ngx-eiffage-material 0.0.28 → 0.0.30
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.
- package/fesm2022/ngx-eiffage-material.mjs +1006 -375
- package/fesm2022/ngx-eiffage-material.mjs.map +1 -1
- package/index.d.ts +286 -132
- package/package.json +1 -1
|
@@ -1,51 +1,47 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, Component,
|
|
2
|
+
import { input, Component, inject, ChangeDetectorRef, signal, viewChild, afterRenderEffect, effect, untracked, forwardRef, output, computed, ViewEncapsulation, ViewContainerRef, Directive, Injectable, Pipe, InjectionToken, HostListener, Optional } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/material/button';
|
|
4
4
|
import { MatButtonModule } from '@angular/material/button';
|
|
5
|
-
import * as
|
|
5
|
+
import * as i1$1 from '@angular/material/icon';
|
|
6
6
|
import { MatIconModule } from '@angular/material/icon';
|
|
7
7
|
import * as i2 from '@angular/material/progress-spinner';
|
|
8
8
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
9
|
-
import * as
|
|
10
|
-
import { MatCardModule } from '@angular/material/card';
|
|
11
|
-
import * as i3 from '@angular/material/sort';
|
|
12
|
-
import { MatSortModule } from '@angular/material/sort';
|
|
13
|
-
import * as i2$1 from '@angular/material/table';
|
|
14
|
-
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
15
|
-
import * as i5 from '@angular/material/tooltip';
|
|
16
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
17
|
-
import * as i7 from '@angular/material/paginator';
|
|
18
|
-
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
19
|
-
import * as i8 from 'ngx-skeleton-loader';
|
|
20
|
-
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
|
|
21
|
-
import * as i13 from '@angular/common';
|
|
22
|
-
import { SlicePipe, TitleCasePipe, LowerCasePipe, UpperCasePipe, DecimalPipe, PercentPipe, CurrencyPipe, DatePipe, CommonModule } from '@angular/common';
|
|
23
|
-
import * as i3$1 from '@angular/forms';
|
|
9
|
+
import * as i3 from '@angular/forms';
|
|
24
10
|
import { FormControl, ReactiveFormsModule, NG_VALUE_ACCESSOR, Validators, FormArray, FormGroup, FormBuilder } from '@angular/forms';
|
|
25
|
-
import * as
|
|
11
|
+
import * as i3$2 from '@angular/common';
|
|
12
|
+
import { CommonModule, DatePipe, LowerCasePipe } from '@angular/common';
|
|
13
|
+
import * as i7 from '@angular/material/chips';
|
|
26
14
|
import { MatChipsModule } from '@angular/material/chips';
|
|
27
|
-
import * as i2$
|
|
15
|
+
import * as i2$1 from '@angular/material/form-field';
|
|
28
16
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
29
|
-
import * as
|
|
17
|
+
import * as i7$1 from '@angular/material/progress-bar';
|
|
30
18
|
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
31
|
-
import * as
|
|
19
|
+
import * as i7$2 from '@angular/material/tooltip';
|
|
20
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
21
|
+
import * as i4 from '@angular/material/input';
|
|
32
22
|
import { MatInputModule } from '@angular/material/input';
|
|
33
|
-
import * as i3$
|
|
23
|
+
import * as i3$1 from '@angular/material/select';
|
|
34
24
|
import { MatSelectModule } from '@angular/material/select';
|
|
35
25
|
import { MatBottomSheetRef, MAT_BOTTOM_SHEET_DATA, MatBottomSheet, MatBottomSheetModule } from '@angular/material/bottom-sheet';
|
|
36
26
|
import { Subject, debounceTime, distinctUntilChanged, takeUntil, fromEvent, startWith, map } from 'rxjs';
|
|
37
27
|
import { toSignal, toObservable, rxResource } from '@angular/core/rxjs-interop';
|
|
38
|
-
import * as i2$
|
|
28
|
+
import * as i2$2 from '@angular/material/divider';
|
|
39
29
|
import { MatDividerModule } from '@angular/material/divider';
|
|
40
30
|
import * as i9 from '@angular/material/list';
|
|
41
31
|
import { MatListModule } from '@angular/material/list';
|
|
42
32
|
import { MatDialogRef, MAT_DIALOG_DATA, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialogClose, MatDialog } from '@angular/material/dialog';
|
|
43
|
-
import * as
|
|
33
|
+
import * as i15 from '@angular/material/checkbox';
|
|
44
34
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
45
|
-
import * as
|
|
35
|
+
import * as i11 from '@angular/material/datepicker';
|
|
46
36
|
import { DateRange, MatDatepickerModule } from '@angular/material/datepicker';
|
|
47
|
-
import * as
|
|
37
|
+
import * as i13 from '@angular/material/menu';
|
|
48
38
|
import { MatMenuModule } from '@angular/material/menu';
|
|
39
|
+
import * as i4$2 from '@angular/material/paginator';
|
|
40
|
+
import { MatPaginatorModule, MatPaginator } from '@angular/material/paginator';
|
|
41
|
+
import * as i3$4 from '@angular/material/sort';
|
|
42
|
+
import { MatSortModule } from '@angular/material/sort';
|
|
43
|
+
import * as i2$3 from '@angular/material/table';
|
|
44
|
+
import { MatTableModule, MatTableDataSource } from '@angular/material/table';
|
|
49
45
|
import { Overlay, OverlayContainer } from '@angular/cdk/overlay';
|
|
50
46
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
51
47
|
import jsPDF from 'jspdf';
|
|
@@ -56,7 +52,7 @@ import { moveItemInArray, CdkDropList, CdkDrag } from '@angular/cdk/drag-drop';
|
|
|
56
52
|
import moment from 'moment';
|
|
57
53
|
import * as i3$3 from '@angular/material/slide-toggle';
|
|
58
54
|
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
59
|
-
import * as i4 from '@angular/material/button-toggle';
|
|
55
|
+
import * as i4$1 from '@angular/material/button-toggle';
|
|
60
56
|
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
61
57
|
|
|
62
58
|
class NgxLoadingButton {
|
|
@@ -81,258 +77,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
81
77
|
], template: "<button\r\n class=\"loadingButton\"\r\n [matButton]=\"matButton()\"\r\n [type]=\"type()\"\r\n [disabled]=\"disabled() || isLoading()\"\r\n [class.isLoading]=\"isLoading()\"\r\n [class]=\"color() ?? ''\"\r\n>\r\n {{ label() }}\r\n</button>\r\n\r\n@if (isLoading()) {\r\n <mat-spinner\r\n class=\"spinnerLoadingButton\"\r\n [diameter]=\"spinnerDiameter()\"\r\n [strokeWidth]=\"spinnerStrokeWidth()\"\r\n />\r\n}\r\n", styles: [":host{display:inline-flex;position:relative}.loadingButton{width:100%}.spinnerLoadingButton{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.isLoading{--mat-button-filled-disabled-label-text-color: transparent;--mat-button-outlined-disabled-label-text-color: transparent;--mat-button-protected-disabled-label-text-color: transparent;--mat-button-text-disabled-label-text-color: transparent;--mat-button-tonal-disabled-label-text-color: transparent}.secondary{--mat-button-filled-container-color: var(--mat-sys-secondary);--mat-button-filled-label-text-color: var(--mat-sys-on-secondary);--mat-button-outlined-label-text-color: var(--mat-sys-secondary);--mat-button-outlined-state-layer-color: var(--mat-sys-secondary);--mat-button-outlined-ripple-color: var(--mat-sys-secondary-container);--mat-button-protected-label-text-color: var(--mat-sys-secondary);--mat-button-protected-state-layer-color: var(--mat-sys-secondary);--mat-button-protected-ripple-color: var(--mat-sys-secondary-container);--mat-button-text-label-text-color: var(--mat-sys-secondary);--mat-button-text-state-layer-color: var(--mat-sys-secondary);--mat-button-text-ripple-color: var(--mat-sys-secondary-container)}.secondarySpinner{--mat-progress-spinner-active-indicator-color: var(--mat-sys-secondary)}.tertiary{--mat-button-filled-container-color: var(--mat-sys-tertiary);--mat-button-filled-label-text-color: var(--mat-sys-on-tertiary);--mat-button-outlined-label-text-color: var(--mat-sys-tertiary);--mat-button-outlined-state-layer-color: var(--mat-sys-tertiary);--mat-button-outlined-ripple-color: var(--mat-sys-tertiary-container);--mat-button-protected-label-text-color: var(--mat-sys-tertiary);--mat-button-protected-state-layer-color: var(--mat-sys-tertiary);--mat-button-protected-ripple-color: var(--mat-sys-tertiary-container);--mat-button-text-label-text-color: var(--mat-sys-tertiary);--mat-button-text-state-layer-color: var(--mat-sys-tertiary);--mat-button-text-ripple-color: var(--mat-sys-tertiary-container)}.tertiarySpinner{--mat-progress-spinner-active-indicator-color: var(--mat-sys-tertiary)}\n"] }]
|
|
82
78
|
}], propDecorators: { isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], matButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "matButton", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], spinnerDiameter: [{ type: i0.Input, args: [{ isSignal: true, alias: "spinnerDiameter", required: false }] }], spinnerStrokeWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "spinnerStrokeWidth", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }] } });
|
|
83
79
|
|
|
84
|
-
class CommonTableService {
|
|
85
|
-
/**
|
|
86
|
-
* Métodos para botones customizables
|
|
87
|
-
*
|
|
88
|
-
*/
|
|
89
|
-
isButtonVisible(column, row) {
|
|
90
|
-
if (!column.buttonConfig)
|
|
91
|
-
return false;
|
|
92
|
-
const visible = column.buttonConfig.visible;
|
|
93
|
-
if (typeof visible === 'function') {
|
|
94
|
-
return visible(row);
|
|
95
|
-
}
|
|
96
|
-
return visible !== false; // Por defecto visible si no se especifica
|
|
97
|
-
}
|
|
98
|
-
isButtonDisabled(column, row) {
|
|
99
|
-
if (!column.buttonConfig)
|
|
100
|
-
return false;
|
|
101
|
-
const disabled = column.buttonConfig.disabled;
|
|
102
|
-
if (typeof disabled === 'function') {
|
|
103
|
-
return disabled(row);
|
|
104
|
-
}
|
|
105
|
-
return !!disabled;
|
|
106
|
-
}
|
|
107
|
-
onCustomButtonClick(column, row) {
|
|
108
|
-
if (column.buttonConfig?.onClick) {
|
|
109
|
-
column.buttonConfig.onClick(row);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Métodos para enlaces
|
|
114
|
-
*
|
|
115
|
-
*/
|
|
116
|
-
isLinkVisible(column, row) {
|
|
117
|
-
if (!column.linkConfig)
|
|
118
|
-
return false;
|
|
119
|
-
const visible = column.linkConfig.visible;
|
|
120
|
-
if (typeof visible === 'function') {
|
|
121
|
-
return visible(row);
|
|
122
|
-
}
|
|
123
|
-
return visible !== false;
|
|
124
|
-
}
|
|
125
|
-
getLinkHref(column, row) {
|
|
126
|
-
if (!column.linkConfig?.href)
|
|
127
|
-
return null;
|
|
128
|
-
if (typeof column.linkConfig.href === 'function') {
|
|
129
|
-
return column.linkConfig.href(row);
|
|
130
|
-
}
|
|
131
|
-
return column.linkConfig.href;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Método para obtener el valor de la celda con pipes
|
|
135
|
-
*/
|
|
136
|
-
getCellValue(column, row) {
|
|
137
|
-
const splittedKey = column.key.split('.');
|
|
138
|
-
let value = row;
|
|
139
|
-
if (splittedKey.length > 1) {
|
|
140
|
-
value = this.getNestedKey(row, splittedKey);
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
value = row[column.key];
|
|
144
|
-
}
|
|
145
|
-
if (value === undefined || value === null || value === '') {
|
|
146
|
-
return '-';
|
|
147
|
-
}
|
|
148
|
-
if (column.pipeConfig) {
|
|
149
|
-
return this.applyPipe(value, column.pipeConfig);
|
|
150
|
-
}
|
|
151
|
-
return value;
|
|
152
|
-
}
|
|
153
|
-
getNestedKey(row, splittedKey) {
|
|
154
|
-
let value = row;
|
|
155
|
-
for (let i = 0; i < splittedKey.length; i++) {
|
|
156
|
-
if (value == null)
|
|
157
|
-
return undefined;
|
|
158
|
-
value = value[splittedKey[i]];
|
|
159
|
-
}
|
|
160
|
-
return value;
|
|
161
|
-
}
|
|
162
|
-
applyPipe(value, pipeConfig) {
|
|
163
|
-
try {
|
|
164
|
-
const args = pipeConfig.args || [];
|
|
165
|
-
switch (pipeConfig.name) {
|
|
166
|
-
case 'date':
|
|
167
|
-
const datePipe = new DatePipe('en-US');
|
|
168
|
-
return datePipe.transform(value, args[0] || 'medium', args[1], args[2]);
|
|
169
|
-
case 'currency':
|
|
170
|
-
const currencyPipe = new CurrencyPipe('en-US');
|
|
171
|
-
return currencyPipe.transform(value, args[0] || 'USD', args[1] || 'symbol', args[2] || '1.2-2', args[3]);
|
|
172
|
-
case 'percent':
|
|
173
|
-
const percentPipe = new PercentPipe('en-US');
|
|
174
|
-
return percentPipe.transform(value, args[0] || '1.2-2', args[1]);
|
|
175
|
-
case 'decimal':
|
|
176
|
-
const decimalPipe = new DecimalPipe('en-US');
|
|
177
|
-
return decimalPipe.transform(value, args[0] || '1.2-2');
|
|
178
|
-
case 'uppercase':
|
|
179
|
-
const upperCasePipe = new UpperCasePipe();
|
|
180
|
-
return upperCasePipe.transform(value);
|
|
181
|
-
case 'lowercase':
|
|
182
|
-
const lowerCasePipe = new LowerCasePipe();
|
|
183
|
-
return lowerCasePipe.transform(value);
|
|
184
|
-
case 'titlecase':
|
|
185
|
-
const titleCasePipe = new TitleCasePipe();
|
|
186
|
-
return titleCasePipe.transform(value);
|
|
187
|
-
case 'slice':
|
|
188
|
-
const slicePipe = new SlicePipe();
|
|
189
|
-
return slicePipe.transform(value, args[0] || 0, args[1] || 50);
|
|
190
|
-
case 'json':
|
|
191
|
-
return JSON.stringify(value, null, args[0] || 2);
|
|
192
|
-
case 'custom':
|
|
193
|
-
if (pipeConfig.customPipe) {
|
|
194
|
-
const customPipeInstance = pipeConfig.customPipe();
|
|
195
|
-
return customPipeInstance.transform(value, args);
|
|
196
|
-
}
|
|
197
|
-
return value;
|
|
198
|
-
default:
|
|
199
|
-
console.warn(`Unknown pipe ${pipeConfig.name}`);
|
|
200
|
-
return value;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
catch (error) {
|
|
204
|
-
console.error(`Error aplying pipe ${pipeConfig.name} to value ${value}`, error);
|
|
205
|
-
return value;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CommonTableService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
209
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CommonTableService, providedIn: 'root' });
|
|
210
|
-
}
|
|
211
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CommonTableService, decorators: [{
|
|
212
|
-
type: Injectable,
|
|
213
|
-
args: [{
|
|
214
|
-
providedIn: 'root',
|
|
215
|
-
}]
|
|
216
|
-
}] });
|
|
217
|
-
|
|
218
|
-
class CommonTableComponent {
|
|
219
|
-
//dependencies injection
|
|
220
|
-
_commonTableService = inject((CommonTableService));
|
|
221
|
-
//inputs
|
|
222
|
-
tableConfig = input.required(...(ngDevMode ? [{ debugName: "tableConfig" }] : [])); // Table configuration
|
|
223
|
-
tableData = input.required(...(ngDevMode ? [{ debugName: "tableData" }] : [])); // Table data
|
|
224
|
-
isLoading = input.required(...(ngDevMode ? [{ debugName: "isLoading" }] : [])); // Table loading state
|
|
225
|
-
//outputs
|
|
226
|
-
create = output();
|
|
227
|
-
view = output();
|
|
228
|
-
download = output();
|
|
229
|
-
update = output();
|
|
230
|
-
delete = output();
|
|
231
|
-
//computed
|
|
232
|
-
displayedColumns = computed(() => this.tableConfig().tableColumns.map(column => column.key), ...(ngDevMode ? [{ debugName: "displayedColumns" }] : []));
|
|
233
|
-
datasource = computed(() => new MatTableDataSource(), ...(ngDevMode ? [{ debugName: "datasource" }] : []));
|
|
234
|
-
paginator = viewChild(MatPaginator, ...(ngDevMode ? [{ debugName: "paginator" }] : []));
|
|
235
|
-
constructor() {
|
|
236
|
-
effect(() => {
|
|
237
|
-
this.datasource().data = this.tableData();
|
|
238
|
-
const paginatorInstance = this.paginator();
|
|
239
|
-
if (paginatorInstance && !this.isLoading()) {
|
|
240
|
-
this.datasource().paginator = paginatorInstance;
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
getAllColumns() {
|
|
245
|
-
const columns = [...this.displayedColumns()];
|
|
246
|
-
if (this.hasActions()) {
|
|
247
|
-
columns.push('actions');
|
|
248
|
-
}
|
|
249
|
-
return columns;
|
|
250
|
-
}
|
|
251
|
-
hasActions() {
|
|
252
|
-
return ((this.tableConfig().actions?.canView ||
|
|
253
|
-
this.tableConfig().actions?.canUpdate ||
|
|
254
|
-
this.tableConfig().actions?.canDelete) || false);
|
|
255
|
-
}
|
|
256
|
-
// Check if the action is a function or a boolean value to determine if it can be executed
|
|
257
|
-
canDoAction(action, row) {
|
|
258
|
-
const fnOrValue = this.tableConfig().actions?.[action];
|
|
259
|
-
if (typeof fnOrValue === 'function') {
|
|
260
|
-
return row !== undefined ? fnOrValue(row) : false;
|
|
261
|
-
}
|
|
262
|
-
return !!fnOrValue;
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Actions methods
|
|
266
|
-
*/
|
|
267
|
-
onCreateClick() {
|
|
268
|
-
this.create.emit();
|
|
269
|
-
}
|
|
270
|
-
onViewClick(row) {
|
|
271
|
-
this.view.emit(row);
|
|
272
|
-
}
|
|
273
|
-
onDownloadClick(row) {
|
|
274
|
-
this.download.emit(row);
|
|
275
|
-
}
|
|
276
|
-
onUpdateClick(row) {
|
|
277
|
-
this.update.emit(row);
|
|
278
|
-
}
|
|
279
|
-
onDeleteClick(row) {
|
|
280
|
-
this.delete.emit(row);
|
|
281
|
-
}
|
|
282
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CommonTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
283
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: CommonTableComponent, isStandalone: true, selector: "common-table", inputs: { tableConfig: { classPropertyName: "tableConfig", publicName: "tableConfig", isSignal: true, isRequired: true, transformFunction: null }, tableData: { classPropertyName: "tableData", publicName: "tableData", isSignal: true, isRequired: true, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { create: "create", view: "view", download: "download", update: "update", delete: "delete" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, isSignal: true }], ngImport: i0, template: "<mat-card>\r\n <div class=\"tableContainer\">\r\n <div class=\"tableHeader\">\r\n <div class=\"tableHeader__title\">\r\n <span>{{ tableConfig().title }}</span>\r\n </div>\r\n <div class=\"tableHeader__buttons\">\r\n @if(canDoAction('canCreate')) {\r\n <button matMiniFab type=\"button\" (click)=\"onCreateClick()\">\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n @if(isLoading()) {\r\n <ngx-skeleton-loader [count]=\"tableConfig().skeletonConfig?.count || 5\" />\r\n } @else { \r\n <div class=\"overflowTable\">\r\n <table mat-table class=\"mat-elevation-z8\" [dataSource]=\"datasource()\" class=\"customTable\" matSort>\r\n @for(column of tableConfig().tableColumns; track column.key) {\r\n <!-- Dynamically generate columns -->\r\n <ng-container [matColumnDef]=\"column.key\">\r\n <!-- Header cell definition -->\r\n <th mat-header-cell *matHeaderCellDef>{{ column.displayName }}</th>\r\n \r\n <!-- Data cell definition -->\r\n <td mat-cell *matCellDef=\"let row\">\r\n @switch (column.type) {\r\n @case ('button') {\r\n @if(_commonTableService.isButtonVisible(column, row)) {\r\n <button\r\n [matButton]=\"column.buttonConfig?.variant || 'filled'\"\r\n [class]=\"column.buttonConfig?.color\"\r\n [disabled]=\"_commonTableService.isButtonDisabled(column, row)\"\r\n [matTooltip]=\"column.buttonConfig?.tooltip || ''\"\r\n (click)=\"_commonTableService.onCustomButtonClick(column, row)\"\r\n >\r\n @if(column.buttonConfig?.icon) {\r\n <mat-icon>{{ column.buttonConfig?.icon }}</mat-icon>\r\n }\r\n @if(column.buttonConfig?.text) {\r\n {{ column.buttonConfig?.text }}\r\n }\r\n </button>\r\n }\r\n }\r\n @case ('icon-button') {\r\n @if(_commonTableService.isButtonVisible(column, row)) {\r\n <button \r\n matIconButton\r\n [class]=\"column.buttonConfig?.color\"\r\n [disabled]=\"_commonTableService.isButtonDisabled(column, row)\"\r\n [matTooltip]=\"column.buttonConfig?.tooltip || ''\"\r\n (click)=\"_commonTableService.onCustomButtonClick(column, row)\"\r\n >\r\n @if(column.buttonConfig?.icon) {\r\n <mat-icon>{{ column.buttonConfig?.icon }}</mat-icon>\r\n }\r\n </button>\r\n }\r\n }\r\n @case ('link') {\r\n @if(_commonTableService.isLinkVisible(column, row)) {\r\n <!-- External link -->\r\n @if(_commonTableService.getLinkHref(column, row)) {\r\n <a\r\n [style]=\"{ display: 'flex', alignItems: 'center', gap: '2px' }\"\r\n [href]=\"_commonTableService.getLinkHref(column, row)\"\r\n [target]=\"column.linkConfig?.target || '_blank'\"\r\n [matTooltip]=\"column.linkConfig?.tooltip || ''\"\r\n [style.color]=\"column.linkConfig?.color || 'primary'\"\r\n [style.text-decoration]=\"column.linkConfig?.underline ? 'underline' : 'none'\"\r\n >\r\n @if(column.linkConfig?.icon) {\r\n <mat-icon>{{ column.linkConfig?.icon }}</mat-icon>\r\n }\r\n @if(column.linkConfig?.text) {\r\n {{ column.linkConfig?.text }}\r\n }\r\n </a>\r\n }\r\n }\r\n }\r\n <!-- Text is by default -->\r\n @default {\r\n {{ _commonTableService.getCellValue(column, row) }}\r\n }\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n \r\n <!-- Actions Column -->\r\n @if(hasActions()) {\r\n <ng-container matColumnDef=\"actions\">\r\n <th mat-header-cell *matHeaderCellDef></th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n @if(canDoAction('canView', row)) {\r\n <button matIconButton (click)=\"onViewClick(row)\">\r\n <mat-icon>visibility</mat-icon>\r\n </button>\r\n }\r\n @if(canDoAction('canDownload', row)) {\r\n <button matIconButton (click)=\"onDownloadClick(row)\">\r\n <mat-icon>download</mat-icon>\r\n </button>\r\n }\r\n @if(canDoAction('canUpdate', row)) {\r\n <button matIconButton (click)=\"onUpdateClick(row)\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n }\r\n @if(canDoAction('canDelete', row)) {\r\n <button matIconButton (click)=\"onDeleteClick(row)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n \r\n <tr mat-header-row *matHeaderRowDef=\"getAllColumns()\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: getAllColumns();\"></tr>\r\n <tr *matNoDataRow>No data available</tr>\r\n </table>\r\n <mat-paginator\r\n #paginator\r\n [length]=\"datasource().data.length\"\r\n [pageSize]=\"tableConfig().paginatorConfig?.pageSize || 5\"\r\n [pageSizeOptions]=\"tableConfig().paginatorConfig?.pageSizeOptions || [5, 10, 25, 100]\"\r\n [showFirstLastButtons]=\"tableConfig().paginatorConfig?.showFirstLastButtons || false\"\r\n />\r\n </div>\r\n }\r\n\r\n </div>\r\n</mat-card>", styles: [".tableContainer{display:flex;flex-direction:column;padding:16px 8px;gap:12px}.tableContainer .tableHeader{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:0 0 0 8px}.tableContainer .tableHeader__title{font-size:16px;font-weight:500}.tableContainer .tableHeader__buttons{display:flex;flex-direction:row;align-items:center;gap:8px}.tableContainer .tableHeader__buttons button{padding:0 16px;height:28px;box-shadow:0 1px 2px #0000001a,0 1px 3px 2px #0000000d;border-radius:4px}.overflowTable{overflow-x:auto;width:100%}.secondary{--mat-button-filled-container-color: var(--mat-sys-secondary);--mat-button-filled-label-text-color: var(--mat-sys-on-secondary);--mat-button-outlined-label-text-color: var(--mat-sys-secondary);--mat-button-outlined-state-layer-color: var(--mat-sys-secondary);--mat-button-outlined-ripple-color: var(--mat-sys-secondary-container);--mat-button-protected-label-text-color: var(--mat-sys-secondary);--mat-button-protected-state-layer-color: var(--mat-sys-secondary);--mat-button-protected-ripple-color: var(--mat-sys-secondary-container);--mat-button-text-label-text-color: var(--mat-sys-secondary);--mat-button-text-state-layer-color: var(--mat-sys-secondary);--mat-button-text-ripple-color: var(--mat-sys-secondary-container)}.tertiary{--mat-button-filled-container-color: var(--mat-sys-tertiary);--mat-button-filled-label-text-color: var(--mat-sys-on-tertiary);--mat-button-outlined-label-text-color: var(--mat-sys-tertiary);--mat-button-outlined-state-layer-color: var(--mat-sys-tertiary);--mat-button-outlined-ripple-color: var(--mat-sys-tertiary-container);--mat-button-protected-label-text-color: var(--mat-sys-tertiary);--mat-button-protected-state-layer-color: var(--mat-sys-tertiary);--mat-button-protected-ripple-color: var(--mat-sys-tertiary-container);--mat-button-text-label-text-color: var(--mat-sys-tertiary);--mat-button-text-state-layer-color: var(--mat-sys-tertiary);--mat-button-text-ripple-color: var(--mat-sys-tertiary-container)}\n"], dependencies: [{ kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i1$1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i2$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i2$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i2$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i2$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i2$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i2$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i2$1.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i3.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1.MatMiniFabButton, selector: "button[mat-mini-fab], a[mat-mini-fab], button[matMiniFab], a[matMiniFab]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i7.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: NgxSkeletonLoaderModule }, { kind: "component", type: i8.NgxSkeletonLoaderComponent, selector: "ngx-skeleton-loader", inputs: ["count", "loadingText", "appearance", "animation", "ariaLabel", "theme", "size", "measureUnit"] }] });
|
|
284
|
-
}
|
|
285
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CommonTableComponent, decorators: [{
|
|
286
|
-
type: Component,
|
|
287
|
-
args: [{ selector: 'common-table', imports: [
|
|
288
|
-
MatCardModule,
|
|
289
|
-
MatTableModule,
|
|
290
|
-
MatSortModule,
|
|
291
|
-
MatButtonModule,
|
|
292
|
-
MatTooltipModule,
|
|
293
|
-
MatIconModule,
|
|
294
|
-
MatPaginatorModule,
|
|
295
|
-
NgxSkeletonLoaderModule
|
|
296
|
-
], template: "<mat-card>\r\n <div class=\"tableContainer\">\r\n <div class=\"tableHeader\">\r\n <div class=\"tableHeader__title\">\r\n <span>{{ tableConfig().title }}</span>\r\n </div>\r\n <div class=\"tableHeader__buttons\">\r\n @if(canDoAction('canCreate')) {\r\n <button matMiniFab type=\"button\" (click)=\"onCreateClick()\">\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n @if(isLoading()) {\r\n <ngx-skeleton-loader [count]=\"tableConfig().skeletonConfig?.count || 5\" />\r\n } @else { \r\n <div class=\"overflowTable\">\r\n <table mat-table class=\"mat-elevation-z8\" [dataSource]=\"datasource()\" class=\"customTable\" matSort>\r\n @for(column of tableConfig().tableColumns; track column.key) {\r\n <!-- Dynamically generate columns -->\r\n <ng-container [matColumnDef]=\"column.key\">\r\n <!-- Header cell definition -->\r\n <th mat-header-cell *matHeaderCellDef>{{ column.displayName }}</th>\r\n \r\n <!-- Data cell definition -->\r\n <td mat-cell *matCellDef=\"let row\">\r\n @switch (column.type) {\r\n @case ('button') {\r\n @if(_commonTableService.isButtonVisible(column, row)) {\r\n <button\r\n [matButton]=\"column.buttonConfig?.variant || 'filled'\"\r\n [class]=\"column.buttonConfig?.color\"\r\n [disabled]=\"_commonTableService.isButtonDisabled(column, row)\"\r\n [matTooltip]=\"column.buttonConfig?.tooltip || ''\"\r\n (click)=\"_commonTableService.onCustomButtonClick(column, row)\"\r\n >\r\n @if(column.buttonConfig?.icon) {\r\n <mat-icon>{{ column.buttonConfig?.icon }}</mat-icon>\r\n }\r\n @if(column.buttonConfig?.text) {\r\n {{ column.buttonConfig?.text }}\r\n }\r\n </button>\r\n }\r\n }\r\n @case ('icon-button') {\r\n @if(_commonTableService.isButtonVisible(column, row)) {\r\n <button \r\n matIconButton\r\n [class]=\"column.buttonConfig?.color\"\r\n [disabled]=\"_commonTableService.isButtonDisabled(column, row)\"\r\n [matTooltip]=\"column.buttonConfig?.tooltip || ''\"\r\n (click)=\"_commonTableService.onCustomButtonClick(column, row)\"\r\n >\r\n @if(column.buttonConfig?.icon) {\r\n <mat-icon>{{ column.buttonConfig?.icon }}</mat-icon>\r\n }\r\n </button>\r\n }\r\n }\r\n @case ('link') {\r\n @if(_commonTableService.isLinkVisible(column, row)) {\r\n <!-- External link -->\r\n @if(_commonTableService.getLinkHref(column, row)) {\r\n <a\r\n [style]=\"{ display: 'flex', alignItems: 'center', gap: '2px' }\"\r\n [href]=\"_commonTableService.getLinkHref(column, row)\"\r\n [target]=\"column.linkConfig?.target || '_blank'\"\r\n [matTooltip]=\"column.linkConfig?.tooltip || ''\"\r\n [style.color]=\"column.linkConfig?.color || 'primary'\"\r\n [style.text-decoration]=\"column.linkConfig?.underline ? 'underline' : 'none'\"\r\n >\r\n @if(column.linkConfig?.icon) {\r\n <mat-icon>{{ column.linkConfig?.icon }}</mat-icon>\r\n }\r\n @if(column.linkConfig?.text) {\r\n {{ column.linkConfig?.text }}\r\n }\r\n </a>\r\n }\r\n }\r\n }\r\n <!-- Text is by default -->\r\n @default {\r\n {{ _commonTableService.getCellValue(column, row) }}\r\n }\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n \r\n <!-- Actions Column -->\r\n @if(hasActions()) {\r\n <ng-container matColumnDef=\"actions\">\r\n <th mat-header-cell *matHeaderCellDef></th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n @if(canDoAction('canView', row)) {\r\n <button matIconButton (click)=\"onViewClick(row)\">\r\n <mat-icon>visibility</mat-icon>\r\n </button>\r\n }\r\n @if(canDoAction('canDownload', row)) {\r\n <button matIconButton (click)=\"onDownloadClick(row)\">\r\n <mat-icon>download</mat-icon>\r\n </button>\r\n }\r\n @if(canDoAction('canUpdate', row)) {\r\n <button matIconButton (click)=\"onUpdateClick(row)\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n }\r\n @if(canDoAction('canDelete', row)) {\r\n <button matIconButton (click)=\"onDeleteClick(row)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n \r\n <tr mat-header-row *matHeaderRowDef=\"getAllColumns()\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: getAllColumns();\"></tr>\r\n <tr *matNoDataRow>No data available</tr>\r\n </table>\r\n <mat-paginator\r\n #paginator\r\n [length]=\"datasource().data.length\"\r\n [pageSize]=\"tableConfig().paginatorConfig?.pageSize || 5\"\r\n [pageSizeOptions]=\"tableConfig().paginatorConfig?.pageSizeOptions || [5, 10, 25, 100]\"\r\n [showFirstLastButtons]=\"tableConfig().paginatorConfig?.showFirstLastButtons || false\"\r\n />\r\n </div>\r\n }\r\n\r\n </div>\r\n</mat-card>", styles: [".tableContainer{display:flex;flex-direction:column;padding:16px 8px;gap:12px}.tableContainer .tableHeader{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:0 0 0 8px}.tableContainer .tableHeader__title{font-size:16px;font-weight:500}.tableContainer .tableHeader__buttons{display:flex;flex-direction:row;align-items:center;gap:8px}.tableContainer .tableHeader__buttons button{padding:0 16px;height:28px;box-shadow:0 1px 2px #0000001a,0 1px 3px 2px #0000000d;border-radius:4px}.overflowTable{overflow-x:auto;width:100%}.secondary{--mat-button-filled-container-color: var(--mat-sys-secondary);--mat-button-filled-label-text-color: var(--mat-sys-on-secondary);--mat-button-outlined-label-text-color: var(--mat-sys-secondary);--mat-button-outlined-state-layer-color: var(--mat-sys-secondary);--mat-button-outlined-ripple-color: var(--mat-sys-secondary-container);--mat-button-protected-label-text-color: var(--mat-sys-secondary);--mat-button-protected-state-layer-color: var(--mat-sys-secondary);--mat-button-protected-ripple-color: var(--mat-sys-secondary-container);--mat-button-text-label-text-color: var(--mat-sys-secondary);--mat-button-text-state-layer-color: var(--mat-sys-secondary);--mat-button-text-ripple-color: var(--mat-sys-secondary-container)}.tertiary{--mat-button-filled-container-color: var(--mat-sys-tertiary);--mat-button-filled-label-text-color: var(--mat-sys-on-tertiary);--mat-button-outlined-label-text-color: var(--mat-sys-tertiary);--mat-button-outlined-state-layer-color: var(--mat-sys-tertiary);--mat-button-outlined-ripple-color: var(--mat-sys-tertiary-container);--mat-button-protected-label-text-color: var(--mat-sys-tertiary);--mat-button-protected-state-layer-color: var(--mat-sys-tertiary);--mat-button-protected-ripple-color: var(--mat-sys-tertiary-container);--mat-button-text-label-text-color: var(--mat-sys-tertiary);--mat-button-text-state-layer-color: var(--mat-sys-tertiary);--mat-button-text-ripple-color: var(--mat-sys-tertiary-container)}\n"] }]
|
|
297
|
-
}], ctorParameters: () => [], propDecorators: { tableConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableConfig", required: true }] }], tableData: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableData", required: true }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: true }] }], create: [{ type: i0.Output, args: ["create"] }], view: [{ type: i0.Output, args: ["view"] }], download: [{ type: i0.Output, args: ["download"] }], update: [{ type: i0.Output, args: ["update"] }], delete: [{ type: i0.Output, args: ["delete"] }], paginator: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatPaginator), { isSignal: true }] }] } });
|
|
298
|
-
|
|
299
|
-
class NgxBasicTable {
|
|
300
|
-
//inputs
|
|
301
|
-
tableConfig = input.required(...(ngDevMode ? [{ debugName: "tableConfig" }] : []));
|
|
302
|
-
tableData = input.required(...(ngDevMode ? [{ debugName: "tableData" }] : []));
|
|
303
|
-
isLoading = input.required(...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
304
|
-
//outputs
|
|
305
|
-
create = output();
|
|
306
|
-
view = output();
|
|
307
|
-
download = output();
|
|
308
|
-
update = output();
|
|
309
|
-
delete = output();
|
|
310
|
-
/**
|
|
311
|
-
* Actions methods
|
|
312
|
-
*/
|
|
313
|
-
onCreateClick() {
|
|
314
|
-
this.create.emit();
|
|
315
|
-
}
|
|
316
|
-
onViewClick(row) {
|
|
317
|
-
this.view.emit(row);
|
|
318
|
-
}
|
|
319
|
-
onDownloadClick(row) {
|
|
320
|
-
this.download.emit(row);
|
|
321
|
-
}
|
|
322
|
-
onUpdateClick(row) {
|
|
323
|
-
this.update.emit(row);
|
|
324
|
-
}
|
|
325
|
-
onDeleteClick(row) {
|
|
326
|
-
this.delete.emit(row);
|
|
327
|
-
}
|
|
328
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: NgxBasicTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
329
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.15", type: NgxBasicTable, isStandalone: true, selector: "ngx-basic-table", inputs: { tableConfig: { classPropertyName: "tableConfig", publicName: "tableConfig", isSignal: true, isRequired: true, transformFunction: null }, tableData: { classPropertyName: "tableData", publicName: "tableData", isSignal: true, isRequired: true, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { create: "create", view: "view", download: "download", update: "update", delete: "delete" }, ngImport: i0, template: "<common-table\r\n [tableConfig]=\"tableConfig()\"\r\n [tableData]=\"tableData()\"\r\n [isLoading]=\"isLoading()\"\r\n (create)=\"onCreateClick()\"\r\n (view)=\"onViewClick($event)\"\r\n (download)=\"onDownloadClick($event)\"\r\n (update)=\"onUpdateClick($event)\"\r\n (delete)=\"onDeleteClick($event)\"\r\n/>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatCardModule }, { kind: "component", type: CommonTableComponent, selector: "common-table", inputs: ["tableConfig", "tableData", "isLoading"], outputs: ["create", "view", "download", "update", "delete"] }] });
|
|
330
|
-
}
|
|
331
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: NgxBasicTable, decorators: [{
|
|
332
|
-
type: Component,
|
|
333
|
-
args: [{ selector: 'ngx-basic-table', imports: [MatCardModule, CommonTableComponent], template: "<common-table\r\n [tableConfig]=\"tableConfig()\"\r\n [tableData]=\"tableData()\"\r\n [isLoading]=\"isLoading()\"\r\n (create)=\"onCreateClick()\"\r\n (view)=\"onViewClick($event)\"\r\n (download)=\"onDownloadClick($event)\"\r\n (update)=\"onUpdateClick($event)\"\r\n (delete)=\"onDeleteClick($event)\"\r\n/>\r\n" }]
|
|
334
|
-
}], propDecorators: { tableConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableConfig", required: true }] }], tableData: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableData", required: true }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: true }] }], create: [{ type: i0.Output, args: ["create"] }], view: [{ type: i0.Output, args: ["view"] }], download: [{ type: i0.Output, args: ["download"] }], update: [{ type: i0.Output, args: ["update"] }], delete: [{ type: i0.Output, args: ["delete"] }] } });
|
|
335
|
-
|
|
336
80
|
class NgxInputFile {
|
|
337
81
|
// dependencies injection
|
|
338
82
|
_cdr = inject(ChangeDetectorRef);
|
|
@@ -475,7 +219,7 @@ class NgxInputFile {
|
|
|
475
219
|
useExisting: forwardRef(() => NgxInputFile),
|
|
476
220
|
multi: true,
|
|
477
221
|
},
|
|
478
|
-
], viewQueries: [{ propertyName: "inputFileRef", first: true, predicate: ["inputFileRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n (click)=\"onContainerClick()\"\r\n (dragover)=\"onDragOver($event)\"\r\n (dragleave)=\"onDragLeave($event)\"\r\n (drop)=\"onDrop($event)\"\r\n [class.dragover]=\"isDropping()\"\r\n>\r\n <mat-label>{{ label() }}</mat-label>\r\n <mat-chip-grid \r\n #chipGrid \r\n [formControl]=\"internalControl\"\r\n class=\"chips-grid\"\r\n >\r\n @for(file of value(); track file.name + $index) {\r\n <mat-chip-row\r\n (removed)=\"onDeleteFileClick(file)\"\r\n class=\"chip-item\"\r\n [title]=\"file.name\"\r\n >\r\n <div class=\"chip-content\">\r\n <span class=\"chip-label\">\r\n ({{ bytesToMegaBytes(file.size) }} MB) {{ file.name }}\r\n </span>\r\n </div>\r\n <button matChipRemove [attr.aria-label]=\"'Eliminar ' + file.name\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n }\r\n </mat-chip-grid>\r\n <input \r\n #inputFileRef\r\n type=\"file\"\r\n [accept]=\"getAccept()\" \r\n [multiple]=\"multiple()\" \r\n (change)=\"onInputchange($event)\"\r\n [matChipInputFor]=\"chipGrid\"\r\n style=\"display: none\"\r\n /> \r\n <mat-hint>{{ isDropping() ? 'Arrastrar archivos aqu\u00ED' : hint() }}</mat-hint>\r\n <mat-error>{{ error() }}</mat-error>\r\n</mat-form-field>", styles: [":host{display:block;width:100%}mat-form-field{width:100%;cursor:pointer;--mat-form-field-outlined-focus-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-hover-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-focus-label-text-color: var(--mat-sys-on-surface)}.chips-grid{display:flex;flex-wrap:wrap;gap:8px;width:100%}.chip-item{max-width:100%!important;box-sizing:border-box!important}.chip-item ::ng-deep .mdc-evolution-chip__cell{display:flex!important;align-items:center!important}.chip-item ::ng-deep .mdc-evolution-chip__cell--primary{overflow:hidden!important;max-width:100%!important;display:flex!important;align-items:center!important}.chip-item ::ng-deep .mdc-evolution-chip__action--primary{overflow:hidden!important;max-width:100%!important;display:flex!important;align-items:center!important}.chip-item ::ng-deep .mdc-evolution-chip__text-label{overflow:hidden!important;max-width:100%!important;display:flex!important;align-items:center!important}.chip-item ::ng-deep .mdc-evolution-chip__cell--trailing{display:flex!important;align-items:center!important}.chip-content{overflow:hidden!important;max-width:100%!important;display:flex!important;align-items:center!important}.chip-label{display:block!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;max-width:100%!important;line-height:1.5!important}[matChipRemove]{flex-shrink:0!important;display:flex!important;align-items:center!important;justify-content:center!important}[matChipRemove] mat-icon{font-size:18px;width:18px;height:18px;line-height:18px}.dragover ::ng-deep .mat-mdc-text-field-wrapper{border-color:var(--mat-sys-primary);border-width:2px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type:
|
|
222
|
+
], viewQueries: [{ propertyName: "inputFileRef", first: true, predicate: ["inputFileRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n (click)=\"onContainerClick()\"\r\n (dragover)=\"onDragOver($event)\"\r\n (dragleave)=\"onDragLeave($event)\"\r\n (drop)=\"onDrop($event)\"\r\n [class.dragover]=\"isDropping()\"\r\n>\r\n <mat-label>{{ label() }}</mat-label>\r\n <mat-chip-grid \r\n #chipGrid \r\n [formControl]=\"internalControl\"\r\n class=\"chips-grid\"\r\n >\r\n @for(file of value(); track file.name + $index) {\r\n <mat-chip-row\r\n (removed)=\"onDeleteFileClick(file)\"\r\n class=\"chip-item\"\r\n [title]=\"file.name\"\r\n >\r\n <div class=\"chip-content\">\r\n <span class=\"chip-label\">\r\n ({{ bytesToMegaBytes(file.size) }} MB) {{ file.name }}\r\n </span>\r\n </div>\r\n <button matChipRemove [attr.aria-label]=\"'Eliminar ' + file.name\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n }\r\n </mat-chip-grid>\r\n <input \r\n #inputFileRef\r\n type=\"file\"\r\n [accept]=\"getAccept()\" \r\n [multiple]=\"multiple()\" \r\n (change)=\"onInputchange($event)\"\r\n [matChipInputFor]=\"chipGrid\"\r\n style=\"display: none\"\r\n /> \r\n <mat-hint>{{ isDropping() ? 'Arrastrar archivos aqu\u00ED' : hint() }}</mat-hint>\r\n <mat-error>{{ error() }}</mat-error>\r\n</mat-form-field>", styles: [":host{display:block;width:100%}mat-form-field{width:100%;cursor:pointer;--mat-form-field-outlined-focus-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-hover-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-focus-label-text-color: var(--mat-sys-on-surface)}.chips-grid{display:flex;flex-wrap:wrap;gap:8px;width:100%}.chip-item{max-width:100%!important;box-sizing:border-box!important}.chip-item ::ng-deep .mdc-evolution-chip__cell{display:flex!important;align-items:center!important}.chip-item ::ng-deep .mdc-evolution-chip__cell--primary{overflow:hidden!important;max-width:100%!important;display:flex!important;align-items:center!important}.chip-item ::ng-deep .mdc-evolution-chip__action--primary{overflow:hidden!important;max-width:100%!important;display:flex!important;align-items:center!important}.chip-item ::ng-deep .mdc-evolution-chip__text-label{overflow:hidden!important;max-width:100%!important;display:flex!important;align-items:center!important}.chip-item ::ng-deep .mdc-evolution-chip__cell--trailing{display:flex!important;align-items:center!important}.chip-content{overflow:hidden!important;max-width:100%!important;display:flex!important;align-items:center!important}.chip-label{display:block!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;max-width:100%!important;line-height:1.5!important}[matChipRemove]{flex-shrink:0!important;display:flex!important;align-items:center!important;justify-content:center!important}[matChipRemove] mat-icon{font-size:18px;width:18px;height:18px;line-height:18px}.dragover ::ng-deep .mat-mdc-text-field-wrapper{border-color:var(--mat-sys-primary);border-width:2px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i7.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i7.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled", "readonly", "matChipInputDisabledInteractive"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i7.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i7.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }] });
|
|
479
223
|
}
|
|
480
224
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: NgxInputFile, decorators: [{
|
|
481
225
|
type: Component,
|
|
@@ -588,7 +332,7 @@ class NgxBasicSelect {
|
|
|
588
332
|
}
|
|
589
333
|
}
|
|
590
334
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: NgxBasicSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
591
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: NgxBasicSelect, isStandalone: true, selector: "ngx-basic-select", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, basicSelectConfig: { classPropertyName: "basicSelectConfig", publicName: "basicSelectConfig", isSignal: true, isRequired: true, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectionChange: "selectionChange" }, viewQueries: [{ propertyName: "matSelect", first: true, predicate: ["matSelect"], descendants: true, isSignal: true }, { propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }], ngImport: i0, template: "\n<mat-form-field [appearance]=\"appearance()\" [className]=\"class()\">\n <mat-label>{{ label() }}</mat-label>\n <mat-select \n #matSelect\n [formControl]=\"control()\"\n (selectionChange)=\"onSelectionChange($event)\"\n [multiple]=\"multiple()\"\n [placeholder]=\"placeholder()\"\n (openedChange)=\"onOpenedChange($event)\"\n >\n @if(!isLoading()) {\n <div class=\"searchFilter\">\n <mat-icon class=\"searchIcon\">search</mat-icon>\n <input \n matInput\n #searchInput \n type=\"text\"\n (keydown)=\"$event.stopPropagation()\"\n />\n <button matIconButton (click)=\"onClearInputClick(); searchInput.value = ''\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n @for(option of options(); track option[basicSelectConfig().valueKey]) {\n <mat-option \n [value]=\"option[basicSelectConfig().valueKey]\" \n [disabled]=\"basicSelectConfig().disabled ? basicSelectConfig().disabled?.(option) : false\"\n [style]=\"{ display: includeInFilter(option, searchInput.value) ? 'flex' : 'none' }\"\n > \n {{ basicSelectConfig().displayedLabel(option) }}\n </mat-option>\n }\n }\n </mat-select>\n @if(isLoading()) {\n <mat-icon matSuffix><mat-spinner diameter=\"20\" /></mat-icon>\n } @else if(clearable() && (multiple() ? control().value?.length : control().value)) {\n <mat-icon matSuffix (click)=\"onClearClick(); $event.stopPropagation()\">close</mat-icon>\n }\n <mat-error>{{ error() }}</mat-error>\n</mat-form-field>", styles: [":host{display:block;width:100%}mat-form-field{width:100%}mat-select{width:100%}.searchFilter{display:flex;align-items:center;position:sticky;top:-8px;height:48px;width:100%;background:#fff;z-index:10;border-bottom:1px solid var(--accent-3)}.searchFilter input{height:48px;padding:0 48px;width:calc(100% - 96px);position:absolute;top:0;left:0}.searchFilter .searchIcon{position:absolute;top:0;left:0;height:48px;width:48px;display:flex;align-items:center;justify-content:center}button{position:absolute;right:5px}\n"], dependencies: [{ kind: "ngmodule", type: MatInputModule }, { kind: "directive", type:
|
|
335
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: NgxBasicSelect, isStandalone: true, selector: "ngx-basic-select", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, basicSelectConfig: { classPropertyName: "basicSelectConfig", publicName: "basicSelectConfig", isSignal: true, isRequired: true, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectionChange: "selectionChange" }, viewQueries: [{ propertyName: "matSelect", first: true, predicate: ["matSelect"], descendants: true, isSignal: true }, { propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }], ngImport: i0, template: "\n<mat-form-field [appearance]=\"appearance()\" [className]=\"class()\">\n <mat-label>{{ label() }}</mat-label>\n <mat-select \n #matSelect\n [formControl]=\"control()\"\n (selectionChange)=\"onSelectionChange($event)\"\n [multiple]=\"multiple()\"\n [placeholder]=\"placeholder()\"\n (openedChange)=\"onOpenedChange($event)\"\n >\n @if(!isLoading()) {\n <div class=\"searchFilter\">\n <mat-icon class=\"searchIcon\">search</mat-icon>\n <input \n matInput\n #searchInput \n type=\"text\"\n (keydown)=\"$event.stopPropagation()\"\n />\n <button matIconButton (click)=\"onClearInputClick(); searchInput.value = ''\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n @for(option of options(); track option[basicSelectConfig().valueKey]) {\n <mat-option \n [value]=\"option[basicSelectConfig().valueKey]\" \n [disabled]=\"basicSelectConfig().disabled ? basicSelectConfig().disabled?.(option) : false\"\n [style]=\"{ display: includeInFilter(option, searchInput.value) ? 'flex' : 'none' }\"\n > \n {{ basicSelectConfig().displayedLabel(option) }}\n </mat-option>\n }\n }\n </mat-select>\n @if(isLoading()) {\n <mat-icon matSuffix><mat-spinner diameter=\"20\" /></mat-icon>\n } @else if(clearable() && (multiple() ? control().value?.length : control().value)) {\n <mat-icon matSuffix (click)=\"onClearClick(); $event.stopPropagation()\">close</mat-icon>\n }\n <mat-error>{{ error() }}</mat-error>\n</mat-form-field>", styles: [":host{display:block;width:100%}mat-form-field{width:100%}mat-select{width:100%}.searchFilter{display:flex;align-items:center;position:sticky;top:-8px;height:48px;width:100%;background:#fff;z-index:10;border-bottom:1px solid var(--accent-3)}.searchFilter input{height:48px;padding:0 48px;width:calc(100% - 96px);position:absolute;top:0;left:0}.searchFilter .searchIcon{position:absolute;top:0;left:0;height:48px;width:48px;display:flex;align-items:center;justify-content:center}button{position:absolute;right:5px}\n"], dependencies: [{ kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i3$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i2.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }] });
|
|
592
336
|
}
|
|
593
337
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: NgxBasicSelect, decorators: [{
|
|
594
338
|
type: Component,
|
|
@@ -724,7 +468,7 @@ class PaginatedSelectBottomSheetComponent {
|
|
|
724
468
|
this._bottomSheetRef.dismiss(this.selectedsOptions());
|
|
725
469
|
}
|
|
726
470
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: PaginatedSelectBottomSheetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
727
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: PaginatedSelectBottomSheetComponent, isStandalone: true, selector: "paginated-select-bottom-sheet", viewQueries: [{ propertyName: "selectionList", first: true, predicate: ["selectionList"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"bottomSheetContainer\">\n <div class=\"header\">\n @if(_data.title) {\n <div class=\"title\">\n {{ _data.title }}\n </div>\n }\n @if(!_data.hideFilter) {\n <mat-form-field subscriptSizing=\"dynamic\" appearance=\"outline\">\n <mat-icon matPrefix>search</mat-icon>\n <input matInput #searchInput [placeholder]=\"_data.filterPlaceholder\" [value]=\"queryInput()\" (input)=\"onQueryChange($event, optionsContainer); $event.stopPropagation()\" />\n @if(searchInput.value.length > 0) {\n <button matSuffix mat-icon-button (click)=\"onClearClick(searchInput); $event.stopPropagation()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n \n <mat-chip-listbox [multiple]=\"false\">\n @for(filterKey of _data.config.filtersKeys; track filterKey.key) {\n <mat-chip-option [value]=\"filterKey.key\" [selected]=\"\">{{ filterKey.label() }}</mat-chip-option>\n }\n </mat-chip-listbox>\n }\n\n @if(_data.extraFiltersTemplate) {\n <br />\n <ng-container *ngTemplateOutlet=\"_data.extraFiltersTemplate;\"></ng-container>\n }\n </div>\n <div>\n @if(isLoading()) {\n <mat-progress-bar mode=\"indeterminate\" />\n }\n </div>\n <div #optionsContainer class=\"optionsContainer\" (scroll)=\"onScroll(optionsContainer)\">\n <mat-selection-list #selectionList [multiple]=\"_data.multiple\" (selectionChange)=\"onSelectionChange($event)\">\n @if(options().length === 0 && !isLoading()) {\n <div class=\"no-results\">\n <mat-icon>search_off</mat-icon>\n <p>{{ _data.noResultsMessage }}</p>\n </div>\n }\n @for(option of options(); track option[_data.config.valueKey]; let last = $last) {\n <mat-list-option \n [value]=\"option[_data.config.valueKey]\"\n [selected]=\"isSelected(option[_data.config.valueKey])\"\n [disabled]=\"_data.config.disabled ? _data.config.disabled(option) : false\"\n >\n @if(_data.optionTemplate) {\n <ng-container *ngTemplateOutlet=\"_data.optionTemplate; context: { $implicit: option }\"></ng-container>\n } @else {\n {{_data.config.displayedLabel(option)}}\n }\n </mat-list-option>\n @if(!last) {\n <mat-divider />\n }\n }\n </mat-selection-list>\n </div> \n\n\n <div class=\"footer\">\n @if(_data.multiple) {\n <div class=\"length\">\n {{ selectedsOptions().length }} / {{ total() }} {{ _data.multipleItemsLabel }}\n </div>\n <div class=\"actions\">\n @if(selectedsOptions().length > 0) {\n <button matButton (click)=\"onResetClick()\">{{ _data.resetLabel }}</button>\n }\n <button matButton=\"filled\" color=\"primary\" (click)=\"onConfirmMultiSelectionClick()\">{{ _data.confirmLabel }}</button>\n </div>\n } @else {\n <div class=\"length\">\n {{ total() }} {{ _data.itemsLabel }}\n </div>\n }\n </div>\n</div>", styles: [":host{display:flex;flex-direction:column;min-width:720px}.mat-bottom-sheet-container{padding:0 16px!important}.bottomSheetContainer{display:flex;flex-direction:column;height:100%;max-height:80vh}.bottomSheetContainer .header{width:100%;flex:0 0 auto;margin-top:15px}.bottomSheetContainer .header .title{margin-bottom:10px;font-size:20px;font-weight:500}.bottomSheetContainer .header mat-form-field{width:100%}.bottomSheetContainer .header mat-chip-listbox{width:100%}.bottomSheetContainer .loading{display:flex;align-items:center;width:100%;height:20px}.bottomSheetContainer .optionsContainer{flex:1 1 auto;height:360px;width:100%;overflow-y:auto}.bottomSheetContainer .optionsContainer .no-results{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px 24px;color:#666;text-align:center}.bottomSheetContainer .optionsContainer .no-results mat-icon{font-size:48px;width:48px;height:48px;margin-bottom:16px;opacity:.5}.bottomSheetContainer .optionsContainer .no-results p{margin:0;font-size:16px}.bottomSheetContainer .footer{margin-top:8px;width:100%;flex:0 0 auto;display:flex;justify-content:space-between;height:56px;box-shadow:0 15px 10px -15px #0000001a}mat-form-field{--mat-form-field-outlined-focus-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-hover-outline-color: var(--mat-sys-outline)}:root{--mat-list-list-item-one-line-container-height: auto;--mat-list-list-item-two-line-container-height: auto;--mat-list-list-item-three-line-container-height: auto}@media (max-width: 960px){:host{min-width:auto}}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i2$
|
|
471
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: PaginatedSelectBottomSheetComponent, isStandalone: true, selector: "paginated-select-bottom-sheet", viewQueries: [{ propertyName: "selectionList", first: true, predicate: ["selectionList"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"bottomSheetContainer\">\r\n <div class=\"header\">\r\n @if(_data.title) {\r\n <div class=\"title\">\r\n {{ _data.title }}\r\n </div>\r\n }\r\n @if(!_data.hideFilter) {\r\n <mat-form-field subscriptSizing=\"dynamic\" appearance=\"outline\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input matInput #searchInput [placeholder]=\"_data.filterPlaceholder\" [value]=\"queryInput()\" (input)=\"onQueryChange($event, optionsContainer); $event.stopPropagation()\" />\r\n @if(searchInput.value.length > 0) {\r\n <button matSuffix mat-icon-button (click)=\"onClearClick(searchInput); $event.stopPropagation()\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n }\r\n </mat-form-field>\r\n \r\n <mat-chip-listbox [multiple]=\"false\">\r\n @for(filterKey of _data.config.filtersKeys; track filterKey.key) {\r\n <mat-chip-option [value]=\"filterKey.key\" [selected]=\"\">{{ filterKey.label() }}</mat-chip-option>\r\n }\r\n </mat-chip-listbox>\r\n }\r\n\r\n @if(_data.extraFiltersTemplate) {\r\n <br />\r\n <ng-container *ngTemplateOutlet=\"_data.extraFiltersTemplate;\"></ng-container>\r\n }\r\n </div>\r\n <div>\r\n @if(isLoading()) {\r\n <mat-progress-bar mode=\"indeterminate\" />\r\n }\r\n </div>\r\n <div #optionsContainer class=\"optionsContainer\" (scroll)=\"onScroll(optionsContainer)\">\r\n <mat-selection-list #selectionList [multiple]=\"_data.multiple\" (selectionChange)=\"onSelectionChange($event)\">\r\n @if(options().length === 0 && !isLoading()) {\r\n <div class=\"no-results\">\r\n <mat-icon>search_off</mat-icon>\r\n <p>{{ _data.noResultsMessage }}</p>\r\n </div>\r\n }\r\n @for(option of options(); track option[_data.config.valueKey]; let last = $last) {\r\n <mat-list-option \r\n [value]=\"option[_data.config.valueKey]\"\r\n [selected]=\"isSelected(option[_data.config.valueKey])\"\r\n [disabled]=\"_data.config.disabled ? _data.config.disabled(option) : false\"\r\n >\r\n @if(_data.optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_data.optionTemplate; context: { $implicit: option }\"></ng-container>\r\n } @else {\r\n {{_data.config.displayedLabel(option)}}\r\n }\r\n </mat-list-option>\r\n @if(!last) {\r\n <mat-divider />\r\n }\r\n }\r\n </mat-selection-list>\r\n </div> \r\n\r\n\r\n <div class=\"footer\">\r\n @if(_data.multiple) {\r\n <div class=\"length\">\r\n {{ selectedsOptions().length }} / {{ total() }} {{ _data.multipleItemsLabel }}\r\n </div>\r\n <div class=\"actions\">\r\n @if(selectedsOptions().length > 0) {\r\n <button matButton (click)=\"onResetClick()\">{{ _data.resetLabel }}</button>\r\n }\r\n <button matButton=\"filled\" color=\"primary\" (click)=\"onConfirmMultiSelectionClick()\">{{ _data.confirmLabel }}</button>\r\n </div>\r\n } @else {\r\n <div class=\"length\">\r\n {{ total() }} {{ _data.itemsLabel }}\r\n </div>\r\n }\r\n </div>\r\n</div>", styles: [":host{display:flex;flex-direction:column;min-width:720px}.mat-bottom-sheet-container{padding:0 16px!important}.bottomSheetContainer{display:flex;flex-direction:column;height:100%;max-height:80vh}.bottomSheetContainer .header{width:100%;flex:0 0 auto;margin-top:15px}.bottomSheetContainer .header .title{margin-bottom:10px;font-size:20px;font-weight:500}.bottomSheetContainer .header mat-form-field{width:100%}.bottomSheetContainer .header mat-chip-listbox{width:100%}.bottomSheetContainer .loading{display:flex;align-items:center;width:100%;height:20px}.bottomSheetContainer .optionsContainer{flex:1 1 auto;height:360px;width:100%;overflow-y:auto}.bottomSheetContainer .optionsContainer .no-results{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px 24px;color:#666;text-align:center}.bottomSheetContainer .optionsContainer .no-results mat-icon{font-size:48px;width:48px;height:48px;margin-bottom:16px;opacity:.5}.bottomSheetContainer .optionsContainer .no-results p{margin:0;font-size:16px}.bottomSheetContainer .footer{margin-top:8px;width:100%;flex:0 0 auto;display:flex;justify-content:space-between;height:56px;box-shadow:0 15px 10px -15px #0000001a}mat-form-field{--mat-form-field-outlined-focus-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-hover-outline-color: var(--mat-sys-outline)}:root{--mat-list-list-item-one-line-container-height: auto;--mat-list-list-item-two-line-container-height: auto;--mat-list-list-item-three-line-container-height: auto}@media (max-width: 960px){:host{min-width:auto}}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i2$2.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i7.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i7.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i7$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i9.MatSelectionList, selector: "mat-selection-list", inputs: ["color", "compareWith", "multiple", "hideSingleSelectionIndicator", "disabled"], outputs: ["selectionChange"], exportAs: ["matSelectionList"] }, { kind: "component", type: i9.MatListOption, selector: "mat-list-option", inputs: ["togglePosition", "checkboxPosition", "color", "value", "selected"], outputs: ["selectedChange"], exportAs: ["matListOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }], encapsulation: i0.ViewEncapsulation.None });
|
|
728
472
|
}
|
|
729
473
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: PaginatedSelectBottomSheetComponent, decorators: [{
|
|
730
474
|
type: Component,
|
|
@@ -739,7 +483,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
739
483
|
MatProgressBarModule,
|
|
740
484
|
MatListModule,
|
|
741
485
|
ReactiveFormsModule,
|
|
742
|
-
], encapsulation: ViewEncapsulation.None, template: "<div class=\"bottomSheetContainer\">\n <div class=\"header\">\n @if(_data.title) {\n <div class=\"title\">\n {{ _data.title }}\n </div>\n }\n @if(!_data.hideFilter) {\n <mat-form-field subscriptSizing=\"dynamic\" appearance=\"outline\">\n <mat-icon matPrefix>search</mat-icon>\n <input matInput #searchInput [placeholder]=\"_data.filterPlaceholder\" [value]=\"queryInput()\" (input)=\"onQueryChange($event, optionsContainer); $event.stopPropagation()\" />\n @if(searchInput.value.length > 0) {\n <button matSuffix mat-icon-button (click)=\"onClearClick(searchInput); $event.stopPropagation()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n \n <mat-chip-listbox [multiple]=\"false\">\n @for(filterKey of _data.config.filtersKeys; track filterKey.key) {\n <mat-chip-option [value]=\"filterKey.key\" [selected]=\"\">{{ filterKey.label() }}</mat-chip-option>\n }\n </mat-chip-listbox>\n }\n\n @if(_data.extraFiltersTemplate) {\n <br />\n <ng-container *ngTemplateOutlet=\"_data.extraFiltersTemplate;\"></ng-container>\n }\n </div>\n <div>\n @if(isLoading()) {\n <mat-progress-bar mode=\"indeterminate\" />\n }\n </div>\n <div #optionsContainer class=\"optionsContainer\" (scroll)=\"onScroll(optionsContainer)\">\n <mat-selection-list #selectionList [multiple]=\"_data.multiple\" (selectionChange)=\"onSelectionChange($event)\">\n @if(options().length === 0 && !isLoading()) {\n <div class=\"no-results\">\n <mat-icon>search_off</mat-icon>\n <p>{{ _data.noResultsMessage }}</p>\n </div>\n }\n @for(option of options(); track option[_data.config.valueKey]; let last = $last) {\n <mat-list-option \n [value]=\"option[_data.config.valueKey]\"\n [selected]=\"isSelected(option[_data.config.valueKey])\"\n [disabled]=\"_data.config.disabled ? _data.config.disabled(option) : false\"\n >\n @if(_data.optionTemplate) {\n <ng-container *ngTemplateOutlet=\"_data.optionTemplate; context: { $implicit: option }\"></ng-container>\n } @else {\n {{_data.config.displayedLabel(option)}}\n }\n </mat-list-option>\n @if(!last) {\n <mat-divider />\n }\n }\n </mat-selection-list>\n </div> \n\n\n <div class=\"footer\">\n @if(_data.multiple) {\n <div class=\"length\">\n {{ selectedsOptions().length }} / {{ total() }} {{ _data.multipleItemsLabel }}\n </div>\n <div class=\"actions\">\n @if(selectedsOptions().length > 0) {\n <button matButton (click)=\"onResetClick()\">{{ _data.resetLabel }}</button>\n }\n <button matButton=\"filled\" color=\"primary\" (click)=\"onConfirmMultiSelectionClick()\">{{ _data.confirmLabel }}</button>\n </div>\n } @else {\n <div class=\"length\">\n {{ total() }} {{ _data.itemsLabel }}\n </div>\n }\n </div>\n</div>", styles: [":host{display:flex;flex-direction:column;min-width:720px}.mat-bottom-sheet-container{padding:0 16px!important}.bottomSheetContainer{display:flex;flex-direction:column;height:100%;max-height:80vh}.bottomSheetContainer .header{width:100%;flex:0 0 auto;margin-top:15px}.bottomSheetContainer .header .title{margin-bottom:10px;font-size:20px;font-weight:500}.bottomSheetContainer .header mat-form-field{width:100%}.bottomSheetContainer .header mat-chip-listbox{width:100%}.bottomSheetContainer .loading{display:flex;align-items:center;width:100%;height:20px}.bottomSheetContainer .optionsContainer{flex:1 1 auto;height:360px;width:100%;overflow-y:auto}.bottomSheetContainer .optionsContainer .no-results{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px 24px;color:#666;text-align:center}.bottomSheetContainer .optionsContainer .no-results mat-icon{font-size:48px;width:48px;height:48px;margin-bottom:16px;opacity:.5}.bottomSheetContainer .optionsContainer .no-results p{margin:0;font-size:16px}.bottomSheetContainer .footer{margin-top:8px;width:100%;flex:0 0 auto;display:flex;justify-content:space-between;height:56px;box-shadow:0 15px 10px -15px #0000001a}mat-form-field{--mat-form-field-outlined-focus-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-hover-outline-color: var(--mat-sys-outline)}:root{--mat-list-list-item-one-line-container-height: auto;--mat-list-list-item-two-line-container-height: auto;--mat-list-list-item-three-line-container-height: auto}@media (max-width: 960px){:host{min-width:auto}}\n"] }]
|
|
486
|
+
], encapsulation: ViewEncapsulation.None, template: "<div class=\"bottomSheetContainer\">\r\n <div class=\"header\">\r\n @if(_data.title) {\r\n <div class=\"title\">\r\n {{ _data.title }}\r\n </div>\r\n }\r\n @if(!_data.hideFilter) {\r\n <mat-form-field subscriptSizing=\"dynamic\" appearance=\"outline\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input matInput #searchInput [placeholder]=\"_data.filterPlaceholder\" [value]=\"queryInput()\" (input)=\"onQueryChange($event, optionsContainer); $event.stopPropagation()\" />\r\n @if(searchInput.value.length > 0) {\r\n <button matSuffix mat-icon-button (click)=\"onClearClick(searchInput); $event.stopPropagation()\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n }\r\n </mat-form-field>\r\n \r\n <mat-chip-listbox [multiple]=\"false\">\r\n @for(filterKey of _data.config.filtersKeys; track filterKey.key) {\r\n <mat-chip-option [value]=\"filterKey.key\" [selected]=\"\">{{ filterKey.label() }}</mat-chip-option>\r\n }\r\n </mat-chip-listbox>\r\n }\r\n\r\n @if(_data.extraFiltersTemplate) {\r\n <br />\r\n <ng-container *ngTemplateOutlet=\"_data.extraFiltersTemplate;\"></ng-container>\r\n }\r\n </div>\r\n <div>\r\n @if(isLoading()) {\r\n <mat-progress-bar mode=\"indeterminate\" />\r\n }\r\n </div>\r\n <div #optionsContainer class=\"optionsContainer\" (scroll)=\"onScroll(optionsContainer)\">\r\n <mat-selection-list #selectionList [multiple]=\"_data.multiple\" (selectionChange)=\"onSelectionChange($event)\">\r\n @if(options().length === 0 && !isLoading()) {\r\n <div class=\"no-results\">\r\n <mat-icon>search_off</mat-icon>\r\n <p>{{ _data.noResultsMessage }}</p>\r\n </div>\r\n }\r\n @for(option of options(); track option[_data.config.valueKey]; let last = $last) {\r\n <mat-list-option \r\n [value]=\"option[_data.config.valueKey]\"\r\n [selected]=\"isSelected(option[_data.config.valueKey])\"\r\n [disabled]=\"_data.config.disabled ? _data.config.disabled(option) : false\"\r\n >\r\n @if(_data.optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_data.optionTemplate; context: { $implicit: option }\"></ng-container>\r\n } @else {\r\n {{_data.config.displayedLabel(option)}}\r\n }\r\n </mat-list-option>\r\n @if(!last) {\r\n <mat-divider />\r\n }\r\n }\r\n </mat-selection-list>\r\n </div> \r\n\r\n\r\n <div class=\"footer\">\r\n @if(_data.multiple) {\r\n <div class=\"length\">\r\n {{ selectedsOptions().length }} / {{ total() }} {{ _data.multipleItemsLabel }}\r\n </div>\r\n <div class=\"actions\">\r\n @if(selectedsOptions().length > 0) {\r\n <button matButton (click)=\"onResetClick()\">{{ _data.resetLabel }}</button>\r\n }\r\n <button matButton=\"filled\" color=\"primary\" (click)=\"onConfirmMultiSelectionClick()\">{{ _data.confirmLabel }}</button>\r\n </div>\r\n } @else {\r\n <div class=\"length\">\r\n {{ total() }} {{ _data.itemsLabel }}\r\n </div>\r\n }\r\n </div>\r\n</div>", styles: [":host{display:flex;flex-direction:column;min-width:720px}.mat-bottom-sheet-container{padding:0 16px!important}.bottomSheetContainer{display:flex;flex-direction:column;height:100%;max-height:80vh}.bottomSheetContainer .header{width:100%;flex:0 0 auto;margin-top:15px}.bottomSheetContainer .header .title{margin-bottom:10px;font-size:20px;font-weight:500}.bottomSheetContainer .header mat-form-field{width:100%}.bottomSheetContainer .header mat-chip-listbox{width:100%}.bottomSheetContainer .loading{display:flex;align-items:center;width:100%;height:20px}.bottomSheetContainer .optionsContainer{flex:1 1 auto;height:360px;width:100%;overflow-y:auto}.bottomSheetContainer .optionsContainer .no-results{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px 24px;color:#666;text-align:center}.bottomSheetContainer .optionsContainer .no-results mat-icon{font-size:48px;width:48px;height:48px;margin-bottom:16px;opacity:.5}.bottomSheetContainer .optionsContainer .no-results p{margin:0;font-size:16px}.bottomSheetContainer .footer{margin-top:8px;width:100%;flex:0 0 auto;display:flex;justify-content:space-between;height:56px;box-shadow:0 15px 10px -15px #0000001a}mat-form-field{--mat-form-field-outlined-focus-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-hover-outline-color: var(--mat-sys-outline)}:root{--mat-list-list-item-one-line-container-height: auto;--mat-list-list-item-two-line-container-height: auto;--mat-list-list-item-three-line-container-height: auto}@media (max-width: 960px){:host{min-width:auto}}\n"] }]
|
|
743
487
|
}], ctorParameters: () => [], propDecorators: { selectionList: [{ type: i0.ViewChild, args: ['selectionList', { isSignal: true }] }] } });
|
|
744
488
|
|
|
745
489
|
class NgxPaginatedSelect {
|
|
@@ -800,34 +544,16 @@ class NgxPaginatedSelect {
|
|
|
800
544
|
// effect
|
|
801
545
|
controlEffect = effect(() => {
|
|
802
546
|
const selectedItems = this._selectedItems();
|
|
803
|
-
const currentValue = this.control()?.value;
|
|
804
547
|
if (this.multiple()) {
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
if (!this.arraysEqual(currentValue, newValue)) {
|
|
808
|
-
this.control()?.setValue(newValue, { emitEvent: false });
|
|
809
|
-
this.valueChange.emit(selectedItems);
|
|
810
|
-
}
|
|
548
|
+
this.control()?.setValue(selectedItems.map((item) => item[this.config().valueKey]));
|
|
549
|
+
this.valueChange.emit(selectedItems);
|
|
811
550
|
}
|
|
812
551
|
else {
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
if (currentValue !== newValue) {
|
|
816
|
-
this.control()?.setValue(newValue, { emitEvent: false });
|
|
817
|
-
this.valueChange.emit(selectedItems?.[0]);
|
|
818
|
-
}
|
|
552
|
+
this.control()?.setValue(selectedItems?.[0]?.[this.config().valueKey]);
|
|
553
|
+
this.valueChange.emit(selectedItems?.[0]);
|
|
819
554
|
}
|
|
820
555
|
this._cdr.markForCheck();
|
|
821
556
|
}, ...(ngDevMode ? [{ debugName: "controlEffect" }] : []));
|
|
822
|
-
arraysEqual(a, b) {
|
|
823
|
-
if (!Array.isArray(a) || !Array.isArray(b))
|
|
824
|
-
return false;
|
|
825
|
-
if (a.length !== b.length)
|
|
826
|
-
return false;
|
|
827
|
-
const sortedA = [...a].sort();
|
|
828
|
-
const sortedB = [...b].sort();
|
|
829
|
-
return sortedA.every((val, index) => val === sortedB[index]);
|
|
830
|
-
}
|
|
831
557
|
onOpenBottomSheetClick(event) {
|
|
832
558
|
event.preventDefault();
|
|
833
559
|
event.stopPropagation();
|
|
@@ -888,7 +614,7 @@ class NgxPaginatedSelect {
|
|
|
888
614
|
this._cdr.markForCheck();
|
|
889
615
|
}
|
|
890
616
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: NgxPaginatedSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
891
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: NgxPaginatedSelect, isStandalone: true, selector: "ngx-paginated-select", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, endpoint: { classPropertyName: "endpoint", publicName: "endpoint", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null }, selectedItems: { classPropertyName: "selectedItems", publicName: "selectedItems", isSignal: true, isRequired: false, transformFunction: null }, hideFilter: { classPropertyName: "hideFilter", publicName: "hideFilter", isSignal: true, isRequired: false, transformFunction: null }, filterPlaceholder: { classPropertyName: "filterPlaceholder", publicName: "filterPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, itemsLabel: { classPropertyName: "itemsLabel", publicName: "itemsLabel", isSignal: true, isRequired: false, transformFunction: null }, multipleItemsLabel: { classPropertyName: "multipleItemsLabel", publicName: "multipleItemsLabel", isSignal: true, isRequired: false, transformFunction: null }, resetLabel: { classPropertyName: "resetLabel", publicName: "resetLabel", isSignal: true, isRequired: false, transformFunction: null }, confirmLabel: { classPropertyName: "confirmLabel", publicName: "confirmLabel", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, hideChips: { classPropertyName: "hideChips", publicName: "hideChips", isSignal: true, isRequired: false, transformFunction: null }, optionTemplate: { classPropertyName: "optionTemplate", publicName: "optionTemplate", isSignal: true, isRequired: false, transformFunction: null }, noResultsMessage: { classPropertyName: "noResultsMessage", publicName: "noResultsMessage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { resetFilters: "resetFilters", valueChange: "valueChange" }, viewQueries: [{ propertyName: "extraFiltersTemplate", first: true, predicate: ["extraFiltersTemplate"], descendants: true, isSignal: true }, { propertyName: "matSelect", first: true, predicate: ["matSelect"], descendants: true, isSignal: true }], ngImport: i0, template: "@if(hideChips()) {\n <mat-form-field \n appearance=\"outline\" \n floatLabel=\"always\"\n (click)=\"onOpenBottomSheetClick($event)\"\n >\n <mat-label>{{ label() }}</mat-label>\n <mat-select \n #matSelect\n [formControl]=\"control()\"\n [multiple]=\"multiple()\"\n class=\"clickable-input\"\n (openedChange)=\"preventOpening($event)\"\n >\n @for(item of _selectedItems(); track item[config().valueKey]) {\n <mat-option [value]=\"item[config().valueKey]\">\n {{ config().displayedLabel(item) }}\n </mat-option>\n }\n </mat-select>\n <div matSuffix>\n @if(clearable() && control()?.value) {\n <button matIconButton matSuffix (click)=\"onResetClick($event);\">\n <mat-icon>close</mat-icon>\n </button>\n }\n <mat-icon matSuffix>arrow_drop_down</mat-icon>\n </div>\n <mat-error>{{ error() }}</mat-error>\n </mat-form-field>\n} @else {\n <mat-form-field \n appearance=\"outline\" \n floatLabel=\"always\"\n (click)=\"onOpenBottomSheetClick($event)\"\n >\n <mat-label>{{ label() }}</mat-label>\n <mat-chip-grid \n #chipGrid \n class=\"chips-grid\" \n [formControl]=\"control()\"\n >\n @for(item of _selectedItems(); track item[config().valueKey]) {\n <mat-chip-row\n (removed)=\"onChipRemoved(item)\"\n class=\"chip-item\"\n >\n {{ config().displayedLabel(item) }}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n }\n </mat-chip-grid>\n\n\n <input \n matInput\n [matChipInputFor]=\"chipGrid\"\n style=\"display: none\"\n />\n <mat-icon matSuffix>arrow_drop_down</mat-icon>\n <mat-error>{{ error() }}</mat-error>\n </mat-form-field>\n}\n\n<ng-template #extraFiltersTemplate>\n <ng-content select=\"[extra-filters]\" />\n</ng-template>", styles: [":host{display:block;height:100%}mat-form-field{width:100%;cursor:pointer}:host ::ng-deep mat-select .mat-mdc-select-arrow-wrapper{display:none}.clickable-input{cursor:pointer!important;pointer-events:none}.chips-grid{display:flex;flex-wrap:wrap;gap:8px}.chip-item{width:auto!important;max-width:fit-content}mat-form-field{--mat-form-field-outlined-focus-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-hover-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-focus-label-text-color: var(--mat-sys-on-surface)}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatBottomSheetModule }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$
|
|
617
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: NgxPaginatedSelect, isStandalone: true, selector: "ngx-paginated-select", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, endpoint: { classPropertyName: "endpoint", publicName: "endpoint", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null }, selectedItems: { classPropertyName: "selectedItems", publicName: "selectedItems", isSignal: true, isRequired: false, transformFunction: null }, hideFilter: { classPropertyName: "hideFilter", publicName: "hideFilter", isSignal: true, isRequired: false, transformFunction: null }, filterPlaceholder: { classPropertyName: "filterPlaceholder", publicName: "filterPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, itemsLabel: { classPropertyName: "itemsLabel", publicName: "itemsLabel", isSignal: true, isRequired: false, transformFunction: null }, multipleItemsLabel: { classPropertyName: "multipleItemsLabel", publicName: "multipleItemsLabel", isSignal: true, isRequired: false, transformFunction: null }, resetLabel: { classPropertyName: "resetLabel", publicName: "resetLabel", isSignal: true, isRequired: false, transformFunction: null }, confirmLabel: { classPropertyName: "confirmLabel", publicName: "confirmLabel", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, hideChips: { classPropertyName: "hideChips", publicName: "hideChips", isSignal: true, isRequired: false, transformFunction: null }, optionTemplate: { classPropertyName: "optionTemplate", publicName: "optionTemplate", isSignal: true, isRequired: false, transformFunction: null }, noResultsMessage: { classPropertyName: "noResultsMessage", publicName: "noResultsMessage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { resetFilters: "resetFilters", valueChange: "valueChange" }, viewQueries: [{ propertyName: "extraFiltersTemplate", first: true, predicate: ["extraFiltersTemplate"], descendants: true, isSignal: true }, { propertyName: "matSelect", first: true, predicate: ["matSelect"], descendants: true, isSignal: true }], ngImport: i0, template: "@if(hideChips()) {\r\n <mat-form-field \r\n appearance=\"outline\" \r\n floatLabel=\"always\"\r\n (click)=\"onOpenBottomSheetClick($event)\"\r\n >\r\n <mat-label>{{ label() }}</mat-label>\r\n <mat-select \r\n #matSelect\r\n [formControl]=\"control()\"\r\n [multiple]=\"multiple()\"\r\n class=\"clickable-input\"\r\n (openedChange)=\"preventOpening($event)\"\r\n >\r\n @for(item of _selectedItems(); track item[config().valueKey]) {\r\n <mat-option [value]=\"item[config().valueKey]\">\r\n {{ config().displayedLabel(item) }}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n <div matSuffix>\r\n @if(clearable() && control()?.value) {\r\n <button matIconButton matSuffix (click)=\"onResetClick($event);\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n }\r\n <mat-icon matSuffix>arrow_drop_down</mat-icon>\r\n </div>\r\n <mat-error>{{ error() }}</mat-error>\r\n </mat-form-field>\r\n} @else {\r\n <mat-form-field \r\n appearance=\"outline\" \r\n floatLabel=\"always\"\r\n (click)=\"onOpenBottomSheetClick($event)\"\r\n >\r\n <mat-label>{{ label() }}</mat-label>\r\n <mat-chip-grid \r\n #chipGrid \r\n class=\"chips-grid\" \r\n [formControl]=\"control()\"\r\n >\r\n @for(item of _selectedItems(); track item[config().valueKey]) {\r\n <mat-chip-row\r\n (removed)=\"onChipRemoved(item)\"\r\n class=\"chip-item\"\r\n >\r\n {{ config().displayedLabel(item) }}\r\n <button matChipRemove>\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n }\r\n </mat-chip-grid>\r\n\r\n\r\n <input \r\n matInput\r\n [matChipInputFor]=\"chipGrid\"\r\n style=\"display: none\"\r\n />\r\n <mat-icon matSuffix>arrow_drop_down</mat-icon>\r\n <mat-error>{{ error() }}</mat-error>\r\n </mat-form-field>\r\n}\r\n\r\n<ng-template #extraFiltersTemplate>\r\n <ng-content select=\"[extra-filters]\" />\r\n</ng-template>", styles: [":host{display:block;height:100%}mat-form-field{width:100%;cursor:pointer}:host ::ng-deep mat-select .mat-mdc-select-arrow-wrapper{display:none}.clickable-input{cursor:pointer!important;pointer-events:none}.chips-grid{display:flex;flex-wrap:wrap;gap:8px}.chip-item{width:auto!important;max-width:fit-content}mat-form-field{--mat-form-field-outlined-focus-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-hover-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-focus-label-text-color: var(--mat-sys-on-surface)}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatBottomSheetModule }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i3$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i7.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i7.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled", "readonly", "matChipInputDisabledInteractive"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i7.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i7.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }] });
|
|
892
618
|
}
|
|
893
619
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: NgxPaginatedSelect, decorators: [{
|
|
894
620
|
type: Component,
|
|
@@ -903,7 +629,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
903
629
|
ReactiveFormsModule,
|
|
904
630
|
MatChipsModule,
|
|
905
631
|
MatSelectModule,
|
|
906
|
-
], template: "@if(hideChips()) {\n <mat-form-field \n appearance=\"outline\" \n floatLabel=\"always\"\n (click)=\"onOpenBottomSheetClick($event)\"\n >\n <mat-label>{{ label() }}</mat-label>\n <mat-select \n #matSelect\n [formControl]=\"control()\"\n [multiple]=\"multiple()\"\n class=\"clickable-input\"\n (openedChange)=\"preventOpening($event)\"\n >\n @for(item of _selectedItems(); track item[config().valueKey]) {\n <mat-option [value]=\"item[config().valueKey]\">\n {{ config().displayedLabel(item) }}\n </mat-option>\n }\n </mat-select>\n <div matSuffix>\n @if(clearable() && control()?.value) {\n <button matIconButton matSuffix (click)=\"onResetClick($event);\">\n <mat-icon>close</mat-icon>\n </button>\n }\n <mat-icon matSuffix>arrow_drop_down</mat-icon>\n </div>\n <mat-error>{{ error() }}</mat-error>\n </mat-form-field>\n} @else {\n <mat-form-field \n appearance=\"outline\" \n floatLabel=\"always\"\n (click)=\"onOpenBottomSheetClick($event)\"\n >\n <mat-label>{{ label() }}</mat-label>\n <mat-chip-grid \n #chipGrid \n class=\"chips-grid\" \n [formControl]=\"control()\"\n >\n @for(item of _selectedItems(); track item[config().valueKey]) {\n <mat-chip-row\n (removed)=\"onChipRemoved(item)\"\n class=\"chip-item\"\n >\n {{ config().displayedLabel(item) }}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n }\n </mat-chip-grid>\n\n\n <input \n matInput\n [matChipInputFor]=\"chipGrid\"\n style=\"display: none\"\n />\n <mat-icon matSuffix>arrow_drop_down</mat-icon>\n <mat-error>{{ error() }}</mat-error>\n </mat-form-field>\n}\n\n<ng-template #extraFiltersTemplate>\n <ng-content select=\"[extra-filters]\" />\n</ng-template>", styles: [":host{display:block;height:100%}mat-form-field{width:100%;cursor:pointer}:host ::ng-deep mat-select .mat-mdc-select-arrow-wrapper{display:none}.clickable-input{cursor:pointer!important;pointer-events:none}.chips-grid{display:flex;flex-wrap:wrap;gap:8px}.chip-item{width:auto!important;max-width:fit-content}mat-form-field{--mat-form-field-outlined-focus-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-hover-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-focus-label-text-color: var(--mat-sys-on-surface)}\n"] }]
|
|
632
|
+
], template: "@if(hideChips()) {\r\n <mat-form-field \r\n appearance=\"outline\" \r\n floatLabel=\"always\"\r\n (click)=\"onOpenBottomSheetClick($event)\"\r\n >\r\n <mat-label>{{ label() }}</mat-label>\r\n <mat-select \r\n #matSelect\r\n [formControl]=\"control()\"\r\n [multiple]=\"multiple()\"\r\n class=\"clickable-input\"\r\n (openedChange)=\"preventOpening($event)\"\r\n >\r\n @for(item of _selectedItems(); track item[config().valueKey]) {\r\n <mat-option [value]=\"item[config().valueKey]\">\r\n {{ config().displayedLabel(item) }}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n <div matSuffix>\r\n @if(clearable() && control()?.value) {\r\n <button matIconButton matSuffix (click)=\"onResetClick($event);\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n }\r\n <mat-icon matSuffix>arrow_drop_down</mat-icon>\r\n </div>\r\n <mat-error>{{ error() }}</mat-error>\r\n </mat-form-field>\r\n} @else {\r\n <mat-form-field \r\n appearance=\"outline\" \r\n floatLabel=\"always\"\r\n (click)=\"onOpenBottomSheetClick($event)\"\r\n >\r\n <mat-label>{{ label() }}</mat-label>\r\n <mat-chip-grid \r\n #chipGrid \r\n class=\"chips-grid\" \r\n [formControl]=\"control()\"\r\n >\r\n @for(item of _selectedItems(); track item[config().valueKey]) {\r\n <mat-chip-row\r\n (removed)=\"onChipRemoved(item)\"\r\n class=\"chip-item\"\r\n >\r\n {{ config().displayedLabel(item) }}\r\n <button matChipRemove>\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n }\r\n </mat-chip-grid>\r\n\r\n\r\n <input \r\n matInput\r\n [matChipInputFor]=\"chipGrid\"\r\n style=\"display: none\"\r\n />\r\n <mat-icon matSuffix>arrow_drop_down</mat-icon>\r\n <mat-error>{{ error() }}</mat-error>\r\n </mat-form-field>\r\n}\r\n\r\n<ng-template #extraFiltersTemplate>\r\n <ng-content select=\"[extra-filters]\" />\r\n</ng-template>", styles: [":host{display:block;height:100%}mat-form-field{width:100%;cursor:pointer}:host ::ng-deep mat-select .mat-mdc-select-arrow-wrapper{display:none}.clickable-input{cursor:pointer!important;pointer-events:none}.chips-grid{display:flex;flex-wrap:wrap;gap:8px}.chip-item{width:auto!important;max-width:fit-content}mat-form-field{--mat-form-field-outlined-focus-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-hover-outline-color: var(--mat-sys-outline);--mat-form-field-outlined-focus-label-text-color: var(--mat-sys-on-surface)}\n"] }]
|
|
907
633
|
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], endpoint: [{ type: i0.Input, args: [{ isSignal: true, alias: "endpoint", required: true }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }], control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: false }] }], selectedItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItems", required: false }] }], hideFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideFilter", required: false }] }], filterPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterPlaceholder", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], itemsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsLabel", required: false }] }], multipleItemsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "multipleItemsLabel", required: false }] }], resetLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "resetLabel", required: false }] }], confirmLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmLabel", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], hideChips: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideChips", required: false }] }], optionTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionTemplate", required: false }] }], noResultsMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "noResultsMessage", required: false }] }], resetFilters: [{ type: i0.Output, args: ["resetFilters"] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], extraFiltersTemplate: [{ type: i0.ViewChild, args: ['extraFiltersTemplate', { isSignal: true }] }], matSelect: [{ type: i0.ViewChild, args: ['matSelect', { isSignal: true }] }] } });
|
|
908
634
|
|
|
909
635
|
var DialogBodyType;
|
|
@@ -972,7 +698,7 @@ class NgxDialog {
|
|
|
972
698
|
this._dialogRef.close(true);
|
|
973
699
|
}
|
|
974
700
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: NgxDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
975
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: NgxDialog, isStandalone: true, selector: "ngx-dialog", ngImport: i0, template: "<h2 mat-dialog-title class=\"title\">\r\n {{ title }}\r\n @if(icon) {\r\n <mat-icon \r\n [style.color]=\"iconColor\"\r\n class=\"icon\"\r\n >\r\n {{ icon }}\r\n </mat-icon>\r\n }\r\n</h2>\r\n<mat-dialog-content>\r\n @if(subtitle) {\r\n <p class=\"subtitle\">{{ subtitle }}</p>\r\n <mat-divider />\r\n }\r\n\r\n <div class=\"content\">\r\n @switch (body.type) {\r\n @case (DialogBodyType.TEXT) {\r\n <p>{{ body.content }}</p>\r\n }\r\n @case (DialogBodyType.HTML) {\r\n <div [innerHTML]=\"body.content\"></div>\r\n }\r\n @case (DialogBodyType.COMPONENT) {\r\n <ng-container \r\n ngxDynamicHost \r\n [component]=\"$any(body.content)\"\r\n [data]=\"body.data\"\r\n />\r\n }\r\n @case (DialogBodyType.TEMPLATE) {\r\n <ng-container \r\n [ngTemplateOutlet]=\"$any(body.content)\"\r\n [ngTemplateOutletContext]=\"{ $implicit: body.data }\"\r\n />\r\n }\r\n }\r\n </div>\r\n\r\n</mat-dialog-content>\r\n<mat-dialog-actions align=\"end\" class=\"matDialogActionsCustomGap\">\r\n @if(showCancel) {\r\n <button matButton=\"outlined\" (click)=\"onCancelClick()\">\r\n {{ cancelText }}\r\n </button>\r\n }\r\n @if(showConfirm) {\r\n <button matButton=\"filled\" (click)=\"onConfirmClick()\">\r\n {{ confirmText }}\r\n </button>\r\n }\r\n</mat-dialog-actions>\r\n", styles: [":host{display:block}h2{display:flex;align-items:center;font-weight:600;padding:8px 16px;gap:8px}mat-icon{min-width:28px;min-height:28px;font-size:28px}.subtitle{font-weight:400;font-size:14px;color:#0009;margin-top:-4px}.matDialogActionsCustomGap{gap:.25rem}\n"], dependencies: [{ kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i2$
|
|
701
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: NgxDialog, isStandalone: true, selector: "ngx-dialog", ngImport: i0, template: "<h2 mat-dialog-title class=\"title\">\r\n {{ title }}\r\n @if(icon) {\r\n <mat-icon \r\n [style.color]=\"iconColor\"\r\n class=\"icon\"\r\n >\r\n {{ icon }}\r\n </mat-icon>\r\n }\r\n</h2>\r\n<mat-dialog-content>\r\n @if(subtitle) {\r\n <p class=\"subtitle\">{{ subtitle }}</p>\r\n <mat-divider />\r\n }\r\n\r\n <div class=\"content\">\r\n @switch (body.type) {\r\n @case (DialogBodyType.TEXT) {\r\n <p>{{ body.content }}</p>\r\n }\r\n @case (DialogBodyType.HTML) {\r\n <div [innerHTML]=\"body.content\"></div>\r\n }\r\n @case (DialogBodyType.COMPONENT) {\r\n <ng-container \r\n ngxDynamicHost \r\n [component]=\"$any(body.content)\"\r\n [data]=\"body.data\"\r\n />\r\n }\r\n @case (DialogBodyType.TEMPLATE) {\r\n <ng-container \r\n [ngTemplateOutlet]=\"$any(body.content)\"\r\n [ngTemplateOutletContext]=\"{ $implicit: body.data }\"\r\n />\r\n }\r\n }\r\n </div>\r\n\r\n</mat-dialog-content>\r\n<mat-dialog-actions align=\"end\" class=\"matDialogActionsCustomGap\">\r\n @if(showCancel) {\r\n <button matButton=\"outlined\" (click)=\"onCancelClick()\">\r\n {{ cancelText }}\r\n </button>\r\n }\r\n @if(showConfirm) {\r\n <button matButton=\"filled\" (click)=\"onConfirmClick()\">\r\n {{ confirmText }}\r\n </button>\r\n }\r\n</mat-dialog-actions>\r\n", styles: [":host{display:block}h2{display:flex;align-items:center;font-weight:600;padding:8px 16px;gap:8px}mat-icon{min-width:28px;min-height:28px;font-size:28px}.subtitle{font-weight:400;font-size:14px;color:#0009;margin-top:-4px}.matDialogActionsCustomGap{gap:.25rem}\n"], dependencies: [{ kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i2$2.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: DynamicHostDirective, selector: "[ngxDynamicHost]", inputs: ["component", "data"] }] });
|
|
976
702
|
}
|
|
977
703
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: NgxDialog, decorators: [{
|
|
978
704
|
type: Component,
|
|
@@ -1220,7 +946,7 @@ class NgxConfirmDialogComponent {
|
|
|
1220
946
|
data = inject(MAT_DIALOG_DATA);
|
|
1221
947
|
intl = inject(NgxPaginatedTableIntl);
|
|
1222
948
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: NgxConfirmDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1223
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: NgxConfirmDialogComponent, isStandalone: true, selector: "ngx-confirm-dialog", ngImport: i0, template: "<h2 mat-dialog-title>{{data.title}}</h2>\r\n<mat-dialog-content>\r\n @if(data.body) {\r\n <p>{{data.body}}</p>\r\n }\r\n \r\n @if (data.template) {\r\n <ng-container *ngTemplateOutlet=\"data.template; context: { $implicit: data.row }\"></ng-container>\r\n }\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <button matButton [mat-dialog-close]=\"false\">{{ data.denyButtonLabel ?? intl.cancelButtonLabel }}</button>\r\n <button matButton [mat-dialog-close]=\"true\">{{ data.confirmButtonLabel ?? intl.confirmButtonLabel }}</button>\r\n</mat-dialog-actions>", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type:
|
|
949
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: NgxConfirmDialogComponent, isStandalone: true, selector: "ngx-confirm-dialog", ngImport: i0, template: "<h2 mat-dialog-title>{{data.title}}</h2>\r\n<mat-dialog-content>\r\n @if(data.body) {\r\n <p>{{data.body}}</p>\r\n }\r\n \r\n @if (data.template) {\r\n <ng-container *ngTemplateOutlet=\"data.template; context: { $implicit: data.row }\"></ng-container>\r\n }\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <button matButton [mat-dialog-close]=\"false\">{{ data.denyButtonLabel ?? intl.cancelButtonLabel }}</button>\r\n <button matButton [mat-dialog-close]=\"true\">{{ data.confirmButtonLabel ?? intl.confirmButtonLabel }}</button>\r\n</mat-dialog-actions>", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
1224
950
|
}
|
|
1225
951
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: NgxConfirmDialogComponent, decorators: [{
|
|
1226
952
|
type: Component,
|
|
@@ -1278,6 +1004,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
1278
1004
|
}]
|
|
1279
1005
|
}] });
|
|
1280
1006
|
|
|
1007
|
+
function isFilterOption(obj) {
|
|
1008
|
+
return (typeof obj === 'object' &&
|
|
1009
|
+
obj !== null &&
|
|
1010
|
+
'value' in obj &&
|
|
1011
|
+
'label' in obj &&
|
|
1012
|
+
typeof obj.value === 'string' &&
|
|
1013
|
+
typeof obj.label === 'string');
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1281
1016
|
class AdvancedFilterUtils {
|
|
1282
1017
|
static createAdvancedFilter = (fb, advancedFilter) => {
|
|
1283
1018
|
return fb.group({
|
|
@@ -1470,6 +1205,8 @@ class AdvancedFilterUtils {
|
|
|
1470
1205
|
switch (column.filterType) {
|
|
1471
1206
|
case 'option':
|
|
1472
1207
|
case 'option-multiple':
|
|
1208
|
+
if (isFilterOption(value))
|
|
1209
|
+
return value.label;
|
|
1473
1210
|
const optionSelected = column.filterOptions?.find(option => option.value == value);
|
|
1474
1211
|
return optionSelected?.label ?? '';
|
|
1475
1212
|
case 'date':
|
|
@@ -1504,6 +1241,32 @@ class AdvancedFilterUtils {
|
|
|
1504
1241
|
}
|
|
1505
1242
|
return filters;
|
|
1506
1243
|
}
|
|
1244
|
+
static normalizeAdvancedFilterForBackend(filter) {
|
|
1245
|
+
return {
|
|
1246
|
+
...filter,
|
|
1247
|
+
groups: filter.groups.map(group => this.normalizeGroupForBackend(group))
|
|
1248
|
+
};
|
|
1249
|
+
}
|
|
1250
|
+
static normalizeGroupForBackend(group) {
|
|
1251
|
+
return {
|
|
1252
|
+
...group,
|
|
1253
|
+
filters: group.filters.map(f => {
|
|
1254
|
+
if (this.isFilterGroup(f)) {
|
|
1255
|
+
return this.normalizeGroupForBackend(f);
|
|
1256
|
+
}
|
|
1257
|
+
return this.normalizeRuleForBackend(f);
|
|
1258
|
+
})
|
|
1259
|
+
};
|
|
1260
|
+
}
|
|
1261
|
+
static normalizeRuleForBackend(rule) {
|
|
1262
|
+
if (isFilterOption(rule.value)) {
|
|
1263
|
+
return {
|
|
1264
|
+
...rule,
|
|
1265
|
+
value: rule.value.value
|
|
1266
|
+
};
|
|
1267
|
+
}
|
|
1268
|
+
return rule;
|
|
1269
|
+
}
|
|
1507
1270
|
}
|
|
1508
1271
|
|
|
1509
1272
|
const USER_ID_FACTORY = new InjectionToken('USER_ID_FACTORY');
|
|
@@ -1588,13 +1351,18 @@ class AdvancedFilterService {
|
|
|
1588
1351
|
});
|
|
1589
1352
|
return true;
|
|
1590
1353
|
}
|
|
1591
|
-
getAdvancedFilterById(tableId, advancedFilterId) {
|
|
1354
|
+
getAdvancedFilterById(tableId, advancedFilterId, normalizeForBackend = true) {
|
|
1592
1355
|
const allAdvancedFiltersByTable = this._advancedFilters()[tableId];
|
|
1593
1356
|
if (!allAdvancedFiltersByTable)
|
|
1594
1357
|
return undefined;
|
|
1595
|
-
|
|
1358
|
+
const advancedFilter = allAdvancedFiltersByTable.find(advancedFilter => {
|
|
1596
1359
|
return advancedFilter.groups?.[0].id !== undefined && advancedFilter.groups[0].id == advancedFilterId;
|
|
1597
1360
|
});
|
|
1361
|
+
if (!normalizeForBackend)
|
|
1362
|
+
return advancedFilter;
|
|
1363
|
+
if (!advancedFilter)
|
|
1364
|
+
return undefined;
|
|
1365
|
+
return AdvancedFilterUtils.normalizeAdvancedFilterForBackend(advancedFilter);
|
|
1598
1366
|
}
|
|
1599
1367
|
getDynamicFiltersById(tableId, advancedFilterId) {
|
|
1600
1368
|
const advancedFilter = this.getAdvancedFilterById(tableId, advancedFilterId);
|
|
@@ -1718,12 +1486,16 @@ class ConfigureTableColumnsComponent {
|
|
|
1718
1486
|
animationIndex = signal(undefined, ...(ngDevMode ? [{ debugName: "animationIndex" }] : []));
|
|
1719
1487
|
hasFilterAndDisabled(column) {
|
|
1720
1488
|
const value = this.data.filtersValue[column.key];
|
|
1721
|
-
if (
|
|
1489
|
+
if (Array.isArray(value))
|
|
1490
|
+
return value.length > 0 && !column.show;
|
|
1491
|
+
if (typeof value === 'string')
|
|
1722
1492
|
return value.length > 0 && !column.show;
|
|
1723
1493
|
if (value instanceof DateRange)
|
|
1724
1494
|
return (value.start != null || value.end != null) && !column.show;
|
|
1725
1495
|
if (moment.isMoment(value))
|
|
1726
1496
|
return !column.show;
|
|
1497
|
+
if (isFilterOption(value))
|
|
1498
|
+
return !column.show;
|
|
1727
1499
|
return false;
|
|
1728
1500
|
}
|
|
1729
1501
|
onUpClick(index) {
|
|
@@ -1794,7 +1566,7 @@ class ConfigureTableColumnsComponent {
|
|
|
1794
1566
|
this.dialogRef.close();
|
|
1795
1567
|
}
|
|
1796
1568
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfigureTableColumnsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1797
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ConfigureTableColumnsComponent, isStandalone: true, selector: "lib-configure-table-columns", ngImport: i0, template: "<h2 mat-dialog-title>{{intl.configureColumnsTitle}} {{data.tableName| lowercase}}</h2>\r\n<mat-dialog-content>\r\n\r\n <div class=\"columnsList\" cdkDropList (cdkDropListDropped)=\"onDrop($event)\">\r\n @for (column of columns(); track $index; let first = $first; let last = $last;) {\r\n <div \r\n class=\"columnContainer\" \r\n cdkDrag \r\n [class.pinned]=\"$index == animationIndex()\"\r\n [style]=\"{ transition: `background-color ${animationTime}ms ease` }\">\r\n\r\n <div class=\"labelContainer\">\r\n <mat-icon>drag_indicator</mat-icon>\r\n <p class=\"label\">\r\n {{data.columnsLabels[column.key] ?? ''}}\r\n @if(hasFilterAndDisabled(column)) {\r\n <span> {{intl.hasFiltersAppliedText}}</span>\r\n }\r\n </p>\r\n </div>\r\n\r\n <div class=\"actions\">\r\n <button \r\n matIconButton\r\n [matTooltip]=\"column.isSticky ? intl.unpinColumnTooltip : intl.pinColumnTooltip\"\r\n (click)=\"onPinClick(column, $index)\">\r\n <mat-icon>{{column.isSticky ? 'keep_off' : 'keep'}}</mat-icon>\r\n </button>\r\n\r\n <button [matTooltip]=\"intl.moveUpTooltip\" matIconButton [disabled]=\"$first\" (click)=\"onUpClick($index)\"><mat-icon>keyboard_arrow_up</mat-icon></button>\r\n <button [matTooltip]=\"intl.moveDownTooltip\" matIconButton [disabled]=\"$last\" (click)=\"onDownClick($index)\"><mat-icon>keyboard_arrow_down</mat-icon></button>\r\n <mat-slide-toggle [checked]=\"column.show\" (toggleChange)=\"onToggleChange(column)\"></mat-slide-toggle>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n\r\n <p class=\"note\"><span>{{intl.noteLabel}}</span> {{intl.hideColumnWithFiltersNote}}</p>\r\n \r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <button matButton [mat-dialog-close]=\"undefined\">{{intl.closeButtonLabel}}</button>\r\n <button matButton (click)=\"onResetClick()\">{{intl.resetColumnsButtonLabel}}</button>\r\n <button matButton [disabled]=\"isConfirmDisabled()\" (click)=\"onConfirmClick()\">{{intl.confirmButtonLabel}}</button>\r\n</mat-dialog-actions>", styles: [".columnsList{display:flex;flex-direction:column;cursor:grab}.columnContainer{display:flex;flex-direction:row;align-items:center;justify-content:space-between;background-color:var(--mat-sys-surface);padding:4px 10px}p{margin:0}.label span{font:var(--mat-sys-label-small);color:var(--mat-sys-error);font-weight:400;font-style:italic}.labelContainer,.actions{display:flex;flex-direction:row;align-items:center;gap:10px}.note{margin-top:20px;font-style:italic;font:var(--mat-sys-body-small);font-weight:300;width:100%;text-align:center}.note span{font-weight:500}.cdk-drag-preview{border:none;box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.columnContainer:last-child{border:none}.columnsList.cdk-drop-list-dragging .columnContainer:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.columnContainer.pinned{background-color:#ffeb3b4d;border-radius:4px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type:
|
|
1569
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ConfigureTableColumnsComponent, isStandalone: true, selector: "lib-configure-table-columns", ngImport: i0, template: "<h2 mat-dialog-title>{{intl.configureColumnsTitle}} {{data.tableName| lowercase}}</h2>\r\n<mat-dialog-content>\r\n\r\n <div class=\"columnsList\" cdkDropList (cdkDropListDropped)=\"onDrop($event)\">\r\n @for (column of columns(); track $index; let first = $first; let last = $last;) {\r\n <div \r\n class=\"columnContainer\" \r\n cdkDrag \r\n [class.pinned]=\"$index == animationIndex()\"\r\n [style]=\"{ transition: `background-color ${animationTime}ms ease` }\">\r\n\r\n <div class=\"labelContainer\">\r\n <mat-icon>drag_indicator</mat-icon>\r\n <p class=\"label\">\r\n {{data.columnsLabels[column.key] ?? ''}}\r\n @if(hasFilterAndDisabled(column)) {\r\n <span> {{intl.hasFiltersAppliedText}}</span>\r\n }\r\n </p>\r\n </div>\r\n\r\n <div class=\"actions\">\r\n <button \r\n matIconButton\r\n [matTooltip]=\"column.isSticky ? intl.unpinColumnTooltip : intl.pinColumnTooltip\"\r\n (click)=\"onPinClick(column, $index)\">\r\n <mat-icon>{{column.isSticky ? 'keep_off' : 'keep'}}</mat-icon>\r\n </button>\r\n\r\n <button [matTooltip]=\"intl.moveUpTooltip\" matIconButton [disabled]=\"$first\" (click)=\"onUpClick($index)\"><mat-icon>keyboard_arrow_up</mat-icon></button>\r\n <button [matTooltip]=\"intl.moveDownTooltip\" matIconButton [disabled]=\"$last\" (click)=\"onDownClick($index)\"><mat-icon>keyboard_arrow_down</mat-icon></button>\r\n <mat-slide-toggle [checked]=\"column.show\" (toggleChange)=\"onToggleChange(column)\"></mat-slide-toggle>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n\r\n <p class=\"note\"><span>{{intl.noteLabel}}</span> {{intl.hideColumnWithFiltersNote}}</p>\r\n \r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <button matButton [mat-dialog-close]=\"undefined\">{{intl.closeButtonLabel}}</button>\r\n <button matButton (click)=\"onResetClick()\">{{intl.resetColumnsButtonLabel}}</button>\r\n <button matButton [disabled]=\"isConfirmDisabled()\" (click)=\"onConfirmClick()\">{{intl.confirmButtonLabel}}</button>\r\n</mat-dialog-actions>", styles: [".columnsList{display:flex;flex-direction:column;cursor:grab}.columnContainer{display:flex;flex-direction:row;align-items:center;justify-content:space-between;background-color:var(--mat-sys-surface);padding:4px 10px}p{margin:0}.label span{font:var(--mat-sys-label-small);color:var(--mat-sys-error);font-weight:400;font-style:italic}.labelContainer,.actions{display:flex;flex-direction:row;align-items:center;gap:10px}.note{margin-top:20px;font-style:italic;font:var(--mat-sys-body-small);font-weight:300;width:100%;text-align:center}.note span{font-weight:500}.cdk-drag-preview{border:none;box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.columnContainer:last-child{border:none}.columnsList.cdk-drop-list-dragging .columnContainer:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.columnContainer.pinned{background-color:#ffeb3b4d;border-radius:4px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i3$3.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i7$2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: LowerCasePipe, name: "lowercase" }] });
|
|
1798
1570
|
}
|
|
1799
1571
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfigureTableColumnsComponent, decorators: [{
|
|
1800
1572
|
type: Component,
|
|
@@ -1813,6 +1585,258 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
1813
1585
|
], template: "<h2 mat-dialog-title>{{intl.configureColumnsTitle}} {{data.tableName| lowercase}}</h2>\r\n<mat-dialog-content>\r\n\r\n <div class=\"columnsList\" cdkDropList (cdkDropListDropped)=\"onDrop($event)\">\r\n @for (column of columns(); track $index; let first = $first; let last = $last;) {\r\n <div \r\n class=\"columnContainer\" \r\n cdkDrag \r\n [class.pinned]=\"$index == animationIndex()\"\r\n [style]=\"{ transition: `background-color ${animationTime}ms ease` }\">\r\n\r\n <div class=\"labelContainer\">\r\n <mat-icon>drag_indicator</mat-icon>\r\n <p class=\"label\">\r\n {{data.columnsLabels[column.key] ?? ''}}\r\n @if(hasFilterAndDisabled(column)) {\r\n <span> {{intl.hasFiltersAppliedText}}</span>\r\n }\r\n </p>\r\n </div>\r\n\r\n <div class=\"actions\">\r\n <button \r\n matIconButton\r\n [matTooltip]=\"column.isSticky ? intl.unpinColumnTooltip : intl.pinColumnTooltip\"\r\n (click)=\"onPinClick(column, $index)\">\r\n <mat-icon>{{column.isSticky ? 'keep_off' : 'keep'}}</mat-icon>\r\n </button>\r\n\r\n <button [matTooltip]=\"intl.moveUpTooltip\" matIconButton [disabled]=\"$first\" (click)=\"onUpClick($index)\"><mat-icon>keyboard_arrow_up</mat-icon></button>\r\n <button [matTooltip]=\"intl.moveDownTooltip\" matIconButton [disabled]=\"$last\" (click)=\"onDownClick($index)\"><mat-icon>keyboard_arrow_down</mat-icon></button>\r\n <mat-slide-toggle [checked]=\"column.show\" (toggleChange)=\"onToggleChange(column)\"></mat-slide-toggle>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n\r\n <p class=\"note\"><span>{{intl.noteLabel}}</span> {{intl.hideColumnWithFiltersNote}}</p>\r\n \r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <button matButton [mat-dialog-close]=\"undefined\">{{intl.closeButtonLabel}}</button>\r\n <button matButton (click)=\"onResetClick()\">{{intl.resetColumnsButtonLabel}}</button>\r\n <button matButton [disabled]=\"isConfirmDisabled()\" (click)=\"onConfirmClick()\">{{intl.confirmButtonLabel}}</button>\r\n</mat-dialog-actions>", styles: [".columnsList{display:flex;flex-direction:column;cursor:grab}.columnContainer{display:flex;flex-direction:row;align-items:center;justify-content:space-between;background-color:var(--mat-sys-surface);padding:4px 10px}p{margin:0}.label span{font:var(--mat-sys-label-small);color:var(--mat-sys-error);font-weight:400;font-style:italic}.labelContainer,.actions{display:flex;flex-direction:row;align-items:center;gap:10px}.note{margin-top:20px;font-style:italic;font:var(--mat-sys-body-small);font-weight:300;width:100%;text-align:center}.note span{font-weight:500}.cdk-drag-preview{border:none;box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.columnContainer:last-child{border:none}.columnsList.cdk-drop-list-dragging .columnContainer:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.columnContainer.pinned{background-color:#ffeb3b4d;border-radius:4px}\n"] }]
|
|
1814
1586
|
}] });
|
|
1815
1587
|
|
|
1588
|
+
class PaginatedSearchableSelectComponent {
|
|
1589
|
+
control = input(...(ngDevMode ? [undefined, { debugName: "control" }] : []));
|
|
1590
|
+
endpoint = input.required(...(ngDevMode ? [{ debugName: "endpoint" }] : []));
|
|
1591
|
+
filters = input(signal({
|
|
1592
|
+
pageNumber: 1,
|
|
1593
|
+
pageSize: 20,
|
|
1594
|
+
query: undefined
|
|
1595
|
+
}), ...(ngDevMode ? [{ debugName: "filters" }] : []));
|
|
1596
|
+
optionLabel = input((o) => {
|
|
1597
|
+
if (isFilterOption(o))
|
|
1598
|
+
return o.label;
|
|
1599
|
+
throw new Error("Si el option no es de tipo FilterOption, es necesario especeficar el input optionLabel");
|
|
1600
|
+
}, ...(ngDevMode ? [{ debugName: "optionLabel" }] : []));
|
|
1601
|
+
compareWith = input((o1, o2) => {
|
|
1602
|
+
if (!o2)
|
|
1603
|
+
return false;
|
|
1604
|
+
if (isFilterOption(o1) && isFilterOption(o2))
|
|
1605
|
+
return o1.value == o2.value;
|
|
1606
|
+
throw new Error("Si el option no es de tipo FilterOption, es necesario especeficar el input optionLabel");
|
|
1607
|
+
}, ...(ngDevMode ? [{ debugName: "compareWith" }] : []));
|
|
1608
|
+
multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : []));
|
|
1609
|
+
searchInputPlaceholder = input('Buscar...', ...(ngDevMode ? [{ debugName: "searchInputPlaceholder" }] : []));
|
|
1610
|
+
selectLabel = input(...(ngDevMode ? [undefined, { debugName: "selectLabel" }] : []));
|
|
1611
|
+
selectPlaceholder = input('', ...(ngDevMode ? [{ debugName: "selectPlaceholder" }] : []));
|
|
1612
|
+
clearableOptionLabel = input(...(ngDevMode ? [undefined, { debugName: "clearableOptionLabel" }] : []));
|
|
1613
|
+
subscriptSizing = input('fixed', ...(ngDevMode ? [{ debugName: "subscriptSizing" }] : []));
|
|
1614
|
+
clearable = input(true, ...(ngDevMode ? [{ debugName: "clearable" }] : []));
|
|
1615
|
+
error = input('', ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
1616
|
+
//Estos input/output se utiliza por si no se quiere utilizar el componente select buscable dentro de un formulario
|
|
1617
|
+
selected = input(...(ngDevMode ? [undefined, { debugName: "selected" }] : []));
|
|
1618
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
1619
|
+
optionChange = output();
|
|
1620
|
+
searcher = viewChild('htmlSearcher', ...(ngDevMode ? [{ debugName: "searcher" }] : []));
|
|
1621
|
+
innerControl = signal(new FormControl(undefined), ...(ngDevMode ? [{ debugName: "innerControl" }] : []));
|
|
1622
|
+
queryTimeout = undefined;
|
|
1623
|
+
debounceTime = 300;
|
|
1624
|
+
selectedEffect = effect(() => {
|
|
1625
|
+
const selected = this.selected();
|
|
1626
|
+
const control = this.control();
|
|
1627
|
+
const disabled = this.disabled();
|
|
1628
|
+
const innerControl = control ? control : new FormControl({ value: selected, disabled: disabled });
|
|
1629
|
+
this.innerControl.set(innerControl);
|
|
1630
|
+
}, ...(ngDevMode ? [{ debugName: "selectedEffect" }] : []));
|
|
1631
|
+
dataResource = rxResource({
|
|
1632
|
+
params: () => this.filters()(),
|
|
1633
|
+
stream: ({ params }) => {
|
|
1634
|
+
const endpointPaginated = this.endpoint();
|
|
1635
|
+
return endpointPaginated(params);
|
|
1636
|
+
},
|
|
1637
|
+
defaultValue: { total: 0, items: [] }
|
|
1638
|
+
});
|
|
1639
|
+
options = signal([], ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
1640
|
+
setOptions = effect(() => {
|
|
1641
|
+
const paginatedRecords = this.dataResource.value();
|
|
1642
|
+
const pageNumber = this.filters()().pageNumber;
|
|
1643
|
+
if (!paginatedRecords)
|
|
1644
|
+
return;
|
|
1645
|
+
if (pageNumber > 1)
|
|
1646
|
+
this.options.update((oldValue) => [...oldValue, ...paginatedRecords.items]);
|
|
1647
|
+
else
|
|
1648
|
+
this.options.set(paginatedRecords.items);
|
|
1649
|
+
}, ...(ngDevMode ? [{ debugName: "setOptions" }] : []));
|
|
1650
|
+
/*protected options = computed(() => {
|
|
1651
|
+
if (this.dataResource.error())
|
|
1652
|
+
return [];
|
|
1653
|
+
|
|
1654
|
+
const value = this.dataResource.value();
|
|
1655
|
+
return value.records;
|
|
1656
|
+
});*/
|
|
1657
|
+
total = computed(() => {
|
|
1658
|
+
if (this.dataResource.error())
|
|
1659
|
+
return 0;
|
|
1660
|
+
const value = this.dataResource.value();
|
|
1661
|
+
return value.total;
|
|
1662
|
+
}, ...(ngDevMode ? [{ debugName: "total" }] : []));
|
|
1663
|
+
ngOnDestroy() {
|
|
1664
|
+
//Limpiamos timeout de filtro query
|
|
1665
|
+
if (this.queryTimeout !== undefined)
|
|
1666
|
+
clearTimeout(this.queryTimeout);
|
|
1667
|
+
}
|
|
1668
|
+
openedChange(open) {
|
|
1669
|
+
if (!open)
|
|
1670
|
+
return;
|
|
1671
|
+
const searcher = this.searcher();
|
|
1672
|
+
if (!searcher)
|
|
1673
|
+
return;
|
|
1674
|
+
setTimeout(() => { searcher.nativeElement.focus(); });
|
|
1675
|
+
}
|
|
1676
|
+
cleanQuery() {
|
|
1677
|
+
const searcher = this.searcher();
|
|
1678
|
+
if (!searcher)
|
|
1679
|
+
return;
|
|
1680
|
+
searcher.nativeElement.value = "";
|
|
1681
|
+
this.onQueryChange();
|
|
1682
|
+
setTimeout(() => { searcher.nativeElement.focus(); });
|
|
1683
|
+
}
|
|
1684
|
+
onQueryChange() {
|
|
1685
|
+
const searcher = this.searcher();
|
|
1686
|
+
if (!searcher)
|
|
1687
|
+
return;
|
|
1688
|
+
const query = searcher.nativeElement.value;
|
|
1689
|
+
if (this.queryTimeout !== undefined)
|
|
1690
|
+
clearTimeout(this.queryTimeout);
|
|
1691
|
+
this.queryTimeout = setTimeout(() => {
|
|
1692
|
+
this.filters().update((value) => {
|
|
1693
|
+
return { ...value, query: query, pageNumber: 1 };
|
|
1694
|
+
});
|
|
1695
|
+
}, this.debounceTime);
|
|
1696
|
+
}
|
|
1697
|
+
getClearableOptionName() {
|
|
1698
|
+
const clearableOptionLabel = this.clearableOptionLabel();
|
|
1699
|
+
if (clearableOptionLabel)
|
|
1700
|
+
return clearableOptionLabel.toLowerCase();
|
|
1701
|
+
const selectLabel = this.selectLabel();
|
|
1702
|
+
if (selectLabel)
|
|
1703
|
+
return selectLabel.toLowerCase();
|
|
1704
|
+
const selectPlaceholder = this.selectPlaceholder();
|
|
1705
|
+
return selectPlaceholder.toLowerCase();
|
|
1706
|
+
}
|
|
1707
|
+
onOptionChange(event) {
|
|
1708
|
+
this.optionChange.emit(event.value);
|
|
1709
|
+
}
|
|
1710
|
+
optionsSelectedForView() {
|
|
1711
|
+
const innerControl = this.innerControl();
|
|
1712
|
+
if (!innerControl.value)
|
|
1713
|
+
return [];
|
|
1714
|
+
if (Array.isArray(innerControl.value))
|
|
1715
|
+
return innerControl.value;
|
|
1716
|
+
return [innerControl.value];
|
|
1717
|
+
}
|
|
1718
|
+
;
|
|
1719
|
+
onMoreClick() {
|
|
1720
|
+
this.filters().update((value) => {
|
|
1721
|
+
return {
|
|
1722
|
+
...value,
|
|
1723
|
+
pageNumber: value.pageNumber + 1
|
|
1724
|
+
};
|
|
1725
|
+
});
|
|
1726
|
+
}
|
|
1727
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: PaginatedSearchableSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1728
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: PaginatedSearchableSelectComponent, isStandalone: true, selector: "ngx-paginated-searchable-select", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null }, endpoint: { classPropertyName: "endpoint", publicName: "endpoint", isSignal: true, isRequired: true, transformFunction: null }, filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, searchInputPlaceholder: { classPropertyName: "searchInputPlaceholder", publicName: "searchInputPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, selectLabel: { classPropertyName: "selectLabel", publicName: "selectLabel", isSignal: true, isRequired: false, transformFunction: null }, selectPlaceholder: { classPropertyName: "selectPlaceholder", publicName: "selectPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, clearableOptionLabel: { classPropertyName: "clearableOptionLabel", publicName: "clearableOptionLabel", isSignal: true, isRequired: false, transformFunction: null }, subscriptSizing: { classPropertyName: "subscriptSizing", publicName: "subscriptSizing", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { optionChange: "optionChange" }, viewQueries: [{ propertyName: "searcher", first: true, predicate: ["htmlSearcher"], descendants: true, isSignal: true }], ngImport: i0, template: "<mat-form-field [subscriptSizing]=\"subscriptSizing()\">\r\n @if (selectLabel()) {\r\n <mat-label>{{ selectLabel() }}</mat-label>\r\n }\r\n\r\n <mat-select\r\n [formControl]=\"innerControl()\"\r\n [multiple]=\"multiple()\"\r\n (openedChange)=\"openedChange($event)\" \r\n [placeholder]=\"selectPlaceholder()\"\r\n panelClass=\"searchableSelectPanelClass\"\r\n (selectionChange)=\"onOptionChange($event)\"\r\n [compareWith]=\"compareWith()\">\r\n\r\n <div class=\"searcherContainer\">\r\n <mat-icon class=\"searchIcon\">search</mat-icon>\r\n\r\n @if (htmlSearcher.value.length == 0) {\r\n <span>{{ searchInputPlaceholder() }}</span> \r\n }\r\n\r\n <input \r\n #htmlSearcher \r\n type=\"text\" \r\n matInput \r\n (keydown)=\"$event.stopPropagation()\"\r\n [value]=\"filters()().query ?? ''\" \r\n (input)=\"onQueryChange()\">\r\n\r\n @if (htmlSearcher.value.length > 0) {\r\n <button mat-icon-button (click)=\"cleanQuery()\"><mat-icon>close</mat-icon></button>\r\n }\r\n </div>\r\n\r\n <mat-progress-bar mode=\"indeterminate\" [style.visibility]=\"dataResource.isLoading() ? 'visible': 'hidden'\" />\r\n\r\n @if(clearable() && !multiple()) {\r\n <mat-option>-- Quitar {{ getClearableOptionName() }} --</mat-option>\r\n }\r\n \r\n @for (option of options(); track $index) {\r\n <mat-option [value]=\"option\">\r\n {{ optionLabel()(option) }}\r\n </mat-option>\r\n }\r\n\r\n <!-- Es MUY importante que estos vayan los ultimos (al final de todas las opciones). -->\r\n @for (option of optionsSelectedForView(); track $index) {\r\n <mat-option [value]=\"option\" class=\"hideOption\">\r\n {{ optionLabel()(option) }}\r\n </mat-option>\r\n }\r\n\r\n <!-- Si es multiple, como no esta el option de resetear, si filtran y no hay opciones, y luego cierran el select el desplegable no se abre y queda inutilizado, por eso, ponemos esta opcion dummy, que siempre esta oculta, y no hace nada, pero ya hace que haya un item, y el desplegable se abra -->\r\n @if(multiple()) {\r\n <mat-option class=\"hideOption\" dummyOption></mat-option>\r\n }\r\n\r\n @if (total() == 0) {\r\n <p class=\"withoutResults\">No se han encontrado resultados...</p>\r\n }\r\n\r\n @if((filters()().pageNumber * filters()().pageSize) < total() && !dataResource.isLoading()) {\r\n <button matButton=\"text\" class=\"showMore\" (click)=\"onMoreClick()\">\r\n Ver m\u00E1s\r\n </button>\r\n }\r\n </mat-select>\r\n\r\n <mat-error>{{ error() }}</mat-error>\r\n</mat-form-field>", styles: [":host{display:inline-flex}mat-form-field{width:100%}.searcherContainer{height:48px;position:sticky;top:0;left:0;right:0;background:var(--mat-sys-surface-container);z-index:10}mat-progress-bar{position:sticky;top:48px;z-index:10}.searcherContainer input{height:48px;padding:0 48px;width:calc(100% - 96px);position:absolute;top:0;left:0}.searchIcon{position:absolute;top:0;left:0;height:48px;width:48px;display:flex;align-items:center;justify-content:center;color:#888}.searcherContainer span{line-height:48px;position:absolute;left:48px;color:#888}.searcherContainer button{position:absolute;height:48px;width:48px;top:0;right:0;display:flex;align-items:center;justify-content:center}.hideOption{display:none}.withoutResults{color:#888;text-align:center;padding:0 16px;width:calc(100% - 32px)}.showMore{width:calc(100% - 32px);margin:4px 16px 0}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i3$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i7$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }] });
|
|
1729
|
+
}
|
|
1730
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: PaginatedSearchableSelectComponent, decorators: [{
|
|
1731
|
+
type: Component,
|
|
1732
|
+
args: [{ selector: 'ngx-paginated-searchable-select', imports: [
|
|
1733
|
+
MatIconModule,
|
|
1734
|
+
MatFormFieldModule,
|
|
1735
|
+
MatSelectModule,
|
|
1736
|
+
MatInputModule,
|
|
1737
|
+
ReactiveFormsModule,
|
|
1738
|
+
MatButtonModule,
|
|
1739
|
+
CommonModule,
|
|
1740
|
+
MatProgressBarModule
|
|
1741
|
+
], template: "<mat-form-field [subscriptSizing]=\"subscriptSizing()\">\r\n @if (selectLabel()) {\r\n <mat-label>{{ selectLabel() }}</mat-label>\r\n }\r\n\r\n <mat-select\r\n [formControl]=\"innerControl()\"\r\n [multiple]=\"multiple()\"\r\n (openedChange)=\"openedChange($event)\" \r\n [placeholder]=\"selectPlaceholder()\"\r\n panelClass=\"searchableSelectPanelClass\"\r\n (selectionChange)=\"onOptionChange($event)\"\r\n [compareWith]=\"compareWith()\">\r\n\r\n <div class=\"searcherContainer\">\r\n <mat-icon class=\"searchIcon\">search</mat-icon>\r\n\r\n @if (htmlSearcher.value.length == 0) {\r\n <span>{{ searchInputPlaceholder() }}</span> \r\n }\r\n\r\n <input \r\n #htmlSearcher \r\n type=\"text\" \r\n matInput \r\n (keydown)=\"$event.stopPropagation()\"\r\n [value]=\"filters()().query ?? ''\" \r\n (input)=\"onQueryChange()\">\r\n\r\n @if (htmlSearcher.value.length > 0) {\r\n <button mat-icon-button (click)=\"cleanQuery()\"><mat-icon>close</mat-icon></button>\r\n }\r\n </div>\r\n\r\n <mat-progress-bar mode=\"indeterminate\" [style.visibility]=\"dataResource.isLoading() ? 'visible': 'hidden'\" />\r\n\r\n @if(clearable() && !multiple()) {\r\n <mat-option>-- Quitar {{ getClearableOptionName() }} --</mat-option>\r\n }\r\n \r\n @for (option of options(); track $index) {\r\n <mat-option [value]=\"option\">\r\n {{ optionLabel()(option) }}\r\n </mat-option>\r\n }\r\n\r\n <!-- Es MUY importante que estos vayan los ultimos (al final de todas las opciones). -->\r\n @for (option of optionsSelectedForView(); track $index) {\r\n <mat-option [value]=\"option\" class=\"hideOption\">\r\n {{ optionLabel()(option) }}\r\n </mat-option>\r\n }\r\n\r\n <!-- Si es multiple, como no esta el option de resetear, si filtran y no hay opciones, y luego cierran el select el desplegable no se abre y queda inutilizado, por eso, ponemos esta opcion dummy, que siempre esta oculta, y no hace nada, pero ya hace que haya un item, y el desplegable se abra -->\r\n @if(multiple()) {\r\n <mat-option class=\"hideOption\" dummyOption></mat-option>\r\n }\r\n\r\n @if (total() == 0) {\r\n <p class=\"withoutResults\">No se han encontrado resultados...</p>\r\n }\r\n\r\n @if((filters()().pageNumber * filters()().pageSize) < total() && !dataResource.isLoading()) {\r\n <button matButton=\"text\" class=\"showMore\" (click)=\"onMoreClick()\">\r\n Ver m\u00E1s\r\n </button>\r\n }\r\n </mat-select>\r\n\r\n <mat-error>{{ error() }}</mat-error>\r\n</mat-form-field>", styles: [":host{display:inline-flex}mat-form-field{width:100%}.searcherContainer{height:48px;position:sticky;top:0;left:0;right:0;background:var(--mat-sys-surface-container);z-index:10}mat-progress-bar{position:sticky;top:48px;z-index:10}.searcherContainer input{height:48px;padding:0 48px;width:calc(100% - 96px);position:absolute;top:0;left:0}.searchIcon{position:absolute;top:0;left:0;height:48px;width:48px;display:flex;align-items:center;justify-content:center;color:#888}.searcherContainer span{line-height:48px;position:absolute;left:48px;color:#888}.searcherContainer button{position:absolute;height:48px;width:48px;top:0;right:0;display:flex;align-items:center;justify-content:center}.hideOption{display:none}.withoutResults{color:#888;text-align:center;padding:0 16px;width:calc(100% - 32px)}.showMore{width:calc(100% - 32px);margin:4px 16px 0}\n"] }]
|
|
1742
|
+
}], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: false }] }], endpoint: [{ type: i0.Input, args: [{ isSignal: true, alias: "endpoint", required: true }] }], filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], compareWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "compareWith", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], searchInputPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchInputPlaceholder", required: false }] }], selectLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectLabel", required: false }] }], selectPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectPlaceholder", required: false }] }], clearableOptionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearableOptionLabel", required: false }] }], subscriptSizing: [{ type: i0.Input, args: [{ isSignal: true, alias: "subscriptSizing", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], optionChange: [{ type: i0.Output, args: ["optionChange"] }], searcher: [{ type: i0.ViewChild, args: ['htmlSearcher', { isSignal: true }] }] } });
|
|
1743
|
+
|
|
1744
|
+
class SearchableSelectComponent {
|
|
1745
|
+
control = input(...(ngDevMode ? [undefined, { debugName: "control" }] : []));
|
|
1746
|
+
options = input.required(...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
1747
|
+
optionLabel = input((option) => {
|
|
1748
|
+
if (isFilterOption(option))
|
|
1749
|
+
return option.label;
|
|
1750
|
+
throw new Error("Si el option no es de tipo FilterOption, es necesario especeficar el input optionLabel");
|
|
1751
|
+
}, ...(ngDevMode ? [{ debugName: "optionLabel" }] : []));
|
|
1752
|
+
optionValue = input((option) => {
|
|
1753
|
+
if (isFilterOption(option))
|
|
1754
|
+
return option.value;
|
|
1755
|
+
throw new Error("Si el option no es de tipo FilterOption, es necesario especeficar el input optionValue");
|
|
1756
|
+
}, ...(ngDevMode ? [{ debugName: "optionValue" }] : []));
|
|
1757
|
+
multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : []));
|
|
1758
|
+
searchInputPlaceholder = input('Buscar...', ...(ngDevMode ? [{ debugName: "searchInputPlaceholder" }] : []));
|
|
1759
|
+
selectLabel = input(...(ngDevMode ? [undefined, { debugName: "selectLabel" }] : []));
|
|
1760
|
+
selectPlaceholder = input('', ...(ngDevMode ? [{ debugName: "selectPlaceholder" }] : []));
|
|
1761
|
+
clearableOptionLabel = input(...(ngDevMode ? [undefined, { debugName: "clearableOptionLabel" }] : []));
|
|
1762
|
+
subscriptSizing = input('fixed', ...(ngDevMode ? [{ debugName: "subscriptSizing" }] : []));
|
|
1763
|
+
clearable = input(true, ...(ngDevMode ? [{ debugName: "clearable" }] : []));
|
|
1764
|
+
error = input('', ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
1765
|
+
//Estos input/output se utiliza por si no se quiere utilizar el componente select buscable dentro de un formulario
|
|
1766
|
+
selected = input(...(ngDevMode ? [undefined, { debugName: "selected" }] : []));
|
|
1767
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
1768
|
+
optionChange = output();
|
|
1769
|
+
searcher = viewChild('htmlSearcher', ...(ngDevMode ? [{ debugName: "searcher" }] : []));
|
|
1770
|
+
innerControl = signal(new FormControl(undefined), ...(ngDevMode ? [{ debugName: "innerControl" }] : []));
|
|
1771
|
+
selectedEffect = effect(() => {
|
|
1772
|
+
const selected = this.selected();
|
|
1773
|
+
const control = this.control();
|
|
1774
|
+
const disabled = this.disabled();
|
|
1775
|
+
const innerControl = control ? control : new FormControl({ value: selected, disabled: disabled });
|
|
1776
|
+
this.innerControl.set(innerControl);
|
|
1777
|
+
}, ...(ngDevMode ? [{ debugName: "selectedEffect" }] : []));
|
|
1778
|
+
openedChange(open) {
|
|
1779
|
+
/*if (open)
|
|
1780
|
+
this.cleanQuery();*/
|
|
1781
|
+
if (!open)
|
|
1782
|
+
return;
|
|
1783
|
+
const searcher = this.searcher();
|
|
1784
|
+
if (!searcher)
|
|
1785
|
+
return;
|
|
1786
|
+
setTimeout(() => { searcher.nativeElement.focus(); });
|
|
1787
|
+
}
|
|
1788
|
+
cleanQuery() {
|
|
1789
|
+
const searcher = this.searcher();
|
|
1790
|
+
if (!searcher)
|
|
1791
|
+
return;
|
|
1792
|
+
searcher.nativeElement.value = "";
|
|
1793
|
+
setTimeout(() => {
|
|
1794
|
+
searcher.nativeElement.focus();
|
|
1795
|
+
});
|
|
1796
|
+
}
|
|
1797
|
+
getClearableOptionName() {
|
|
1798
|
+
const clearableOptionLabel = this.clearableOptionLabel();
|
|
1799
|
+
if (clearableOptionLabel)
|
|
1800
|
+
return clearableOptionLabel.toLowerCase();
|
|
1801
|
+
const selectLabel = this.selectLabel();
|
|
1802
|
+
if (selectLabel)
|
|
1803
|
+
return selectLabel.toLowerCase();
|
|
1804
|
+
const selectPlaceholder = this.selectPlaceholder();
|
|
1805
|
+
return selectPlaceholder.toLowerCase();
|
|
1806
|
+
}
|
|
1807
|
+
showOption(option) {
|
|
1808
|
+
const query = this.searcher()?.nativeElement?.value ?? '';
|
|
1809
|
+
const label = this.optionLabel()(option);
|
|
1810
|
+
return includeNoSensible(label, query);
|
|
1811
|
+
}
|
|
1812
|
+
onOptionChange(event) {
|
|
1813
|
+
this.optionChange.emit(event.value);
|
|
1814
|
+
}
|
|
1815
|
+
numberOfResults() {
|
|
1816
|
+
const query = this.searcher()?.nativeElement?.value ?? '';
|
|
1817
|
+
const optionLabel = this.optionLabel();
|
|
1818
|
+
const results = this.options().filter((option) => {
|
|
1819
|
+
const label = optionLabel(option);
|
|
1820
|
+
return includeNoSensible(label, query);
|
|
1821
|
+
});
|
|
1822
|
+
return results.length;
|
|
1823
|
+
}
|
|
1824
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SearchableSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1825
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: SearchableSelectComponent, isStandalone: true, selector: "ngx-searchable-select", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, searchInputPlaceholder: { classPropertyName: "searchInputPlaceholder", publicName: "searchInputPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, selectLabel: { classPropertyName: "selectLabel", publicName: "selectLabel", isSignal: true, isRequired: false, transformFunction: null }, selectPlaceholder: { classPropertyName: "selectPlaceholder", publicName: "selectPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, clearableOptionLabel: { classPropertyName: "clearableOptionLabel", publicName: "clearableOptionLabel", isSignal: true, isRequired: false, transformFunction: null }, subscriptSizing: { classPropertyName: "subscriptSizing", publicName: "subscriptSizing", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { optionChange: "optionChange" }, viewQueries: [{ propertyName: "searcher", first: true, predicate: ["htmlSearcher"], descendants: true, isSignal: true }], ngImport: i0, template: "<mat-form-field [subscriptSizing]=\"subscriptSizing()\">\r\n @if (selectLabel()) {\r\n <mat-label>{{selectLabel()}}</mat-label>\r\n }\r\n\r\n <mat-select\r\n [formControl]=\"innerControl()\"\r\n [multiple]=\"multiple()\"\r\n (openedChange)=\"openedChange($event)\" \r\n [placeholder]=\"selectPlaceholder()\"\r\n panelClass=\"searchableSelectPanelClass\"\r\n (selectionChange)=\"onOptionChange($event)\">\r\n\r\n <div class=\"searcherContainer\">\r\n <mat-icon class=\"searchIcon\">search</mat-icon>\r\n\r\n @if (htmlSearcher.value.length == 0) {\r\n <span>{{searchInputPlaceholder()}}</span> \r\n }\r\n\r\n <input \r\n #htmlSearcher \r\n type=\"text\" \r\n matInput \r\n (keydown)=\"$event.stopPropagation()\">\r\n\r\n @if (htmlSearcher.value.length > 0) {\r\n <button mat-icon-button (click)=\"cleanQuery()\"><mat-icon>close</mat-icon></button>\r\n }\r\n </div>\r\n\r\n @if(clearable() && !multiple()) {\r\n <mat-option>-- Quitar {{getClearableOptionName()}} --</mat-option>\r\n }\r\n \r\n @for (option of options(); track $index) {\r\n <mat-option \r\n [value]=\"optionValue()(option)\"\r\n [class.hideOption]=\"!showOption(option)\">\r\n {{optionLabel()(option)}}\r\n </mat-option>\r\n }\r\n\r\n @if (numberOfResults() == 0) {\r\n <p class=\"withoutResults\">No se han encontrado resultados...</p>\r\n }\r\n </mat-select>\r\n\r\n <mat-error>{{error()}}</mat-error>\r\n</mat-form-field>", styles: [":host{display:inline-flex}mat-form-field{width:100%}.searcherContainer{height:48px;position:sticky;top:0;left:0;right:0;background:var(--mat-sys-surface-container);z-index:10}.searcherContainer input{height:48px;padding:0 48px;width:calc(100% - 96px);position:absolute;top:0;left:0}.searchIcon{position:absolute;top:0;left:0;height:48px;width:48px;display:flex;align-items:center;justify-content:center;color:#888}.searcherContainer span{line-height:48px;position:absolute;left:48px;color:#888}.searcherContainer button{position:absolute;height:48px;width:48px;top:0;right:0;display:flex;align-items:center;justify-content:center}.hideOption{display:none}.withoutResults{color:#888;text-align:center;padding:0 16px;width:calc(100% - 32px)}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i3$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: CommonModule }] });
|
|
1826
|
+
}
|
|
1827
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SearchableSelectComponent, decorators: [{
|
|
1828
|
+
type: Component,
|
|
1829
|
+
args: [{ selector: 'ngx-searchable-select', imports: [
|
|
1830
|
+
MatIconModule,
|
|
1831
|
+
MatFormFieldModule,
|
|
1832
|
+
MatSelectModule,
|
|
1833
|
+
MatInputModule,
|
|
1834
|
+
ReactiveFormsModule,
|
|
1835
|
+
MatButtonModule,
|
|
1836
|
+
CommonModule
|
|
1837
|
+
], template: "<mat-form-field [subscriptSizing]=\"subscriptSizing()\">\r\n @if (selectLabel()) {\r\n <mat-label>{{selectLabel()}}</mat-label>\r\n }\r\n\r\n <mat-select\r\n [formControl]=\"innerControl()\"\r\n [multiple]=\"multiple()\"\r\n (openedChange)=\"openedChange($event)\" \r\n [placeholder]=\"selectPlaceholder()\"\r\n panelClass=\"searchableSelectPanelClass\"\r\n (selectionChange)=\"onOptionChange($event)\">\r\n\r\n <div class=\"searcherContainer\">\r\n <mat-icon class=\"searchIcon\">search</mat-icon>\r\n\r\n @if (htmlSearcher.value.length == 0) {\r\n <span>{{searchInputPlaceholder()}}</span> \r\n }\r\n\r\n <input \r\n #htmlSearcher \r\n type=\"text\" \r\n matInput \r\n (keydown)=\"$event.stopPropagation()\">\r\n\r\n @if (htmlSearcher.value.length > 0) {\r\n <button mat-icon-button (click)=\"cleanQuery()\"><mat-icon>close</mat-icon></button>\r\n }\r\n </div>\r\n\r\n @if(clearable() && !multiple()) {\r\n <mat-option>-- Quitar {{getClearableOptionName()}} --</mat-option>\r\n }\r\n \r\n @for (option of options(); track $index) {\r\n <mat-option \r\n [value]=\"optionValue()(option)\"\r\n [class.hideOption]=\"!showOption(option)\">\r\n {{optionLabel()(option)}}\r\n </mat-option>\r\n }\r\n\r\n @if (numberOfResults() == 0) {\r\n <p class=\"withoutResults\">No se han encontrado resultados...</p>\r\n }\r\n </mat-select>\r\n\r\n <mat-error>{{error()}}</mat-error>\r\n</mat-form-field>", styles: [":host{display:inline-flex}mat-form-field{width:100%}.searcherContainer{height:48px;position:sticky;top:0;left:0;right:0;background:var(--mat-sys-surface-container);z-index:10}.searcherContainer input{height:48px;padding:0 48px;width:calc(100% - 96px);position:absolute;top:0;left:0}.searchIcon{position:absolute;top:0;left:0;height:48px;width:48px;display:flex;align-items:center;justify-content:center;color:#888}.searcherContainer span{line-height:48px;position:absolute;left:48px;color:#888}.searcherContainer button{position:absolute;height:48px;width:48px;top:0;right:0;display:flex;align-items:center;justify-content:center}.hideOption{display:none}.withoutResults{color:#888;text-align:center;padding:0 16px;width:calc(100% - 32px)}\n"] }]
|
|
1838
|
+
}], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], searchInputPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchInputPlaceholder", required: false }] }], selectLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectLabel", required: false }] }], selectPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectPlaceholder", required: false }] }], clearableOptionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearableOptionLabel", required: false }] }], subscriptSizing: [{ type: i0.Input, args: [{ isSignal: true, alias: "subscriptSizing", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], optionChange: [{ type: i0.Output, args: ["optionChange"] }], searcher: [{ type: i0.ViewChild, args: ['htmlSearcher', { isSignal: true }] }] } });
|
|
1839
|
+
|
|
1816
1840
|
class AdvancedFilterRuleComponent {
|
|
1817
1841
|
rule = input.required(...(ngDevMode ? [{ debugName: "rule" }] : []));
|
|
1818
1842
|
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
@@ -1829,6 +1853,11 @@ class AdvancedFilterRuleComponent {
|
|
|
1829
1853
|
'<=': this.intl.operatorLessOrEquals,
|
|
1830
1854
|
'LIKE': this.intl.operatorLike
|
|
1831
1855
|
}), ...(ngDevMode ? [{ debugName: "filterOperatorLabel" }] : []));
|
|
1856
|
+
defaultFiltersForPaginatedFilterOptions = signal({
|
|
1857
|
+
pageNumber: 1,
|
|
1858
|
+
pageSize: 20,
|
|
1859
|
+
query: undefined
|
|
1860
|
+
}, ...(ngDevMode ? [{ debugName: "defaultFiltersForPaginatedFilterOptions" }] : []));
|
|
1832
1861
|
getRuleId() {
|
|
1833
1862
|
return this.rule().get('id').value;
|
|
1834
1863
|
}
|
|
@@ -1854,12 +1883,16 @@ class AdvancedFilterRuleComponent {
|
|
|
1854
1883
|
const columnSelected = this.getColumnSelected(value);
|
|
1855
1884
|
return columnSelected?.filterType;
|
|
1856
1885
|
}
|
|
1857
|
-
onKeyChange(
|
|
1886
|
+
onKeyChange(_) {
|
|
1858
1887
|
this.getOperator().setValue(null);
|
|
1859
1888
|
this.getValue().setValue(null);
|
|
1860
1889
|
}
|
|
1890
|
+
keyOptionLabel = (column) => column.label;
|
|
1891
|
+
keyOptionValue = (column) => column.key;
|
|
1892
|
+
operatorOptionLabel = (filterOperator) => this.filterOperatorLabel()[filterOperator];
|
|
1893
|
+
operatorOptionValue = (filterOperator) => filterOperator;
|
|
1861
1894
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AdvancedFilterRuleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1862
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: AdvancedFilterRuleComponent, isStandalone: true, selector: "lib-advanced-filter-rule", inputs: { rule: { classPropertyName: "rule", publicName: "rule", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { deleteFilter: "deleteFilter" }, ngImport: i0, template: "<button \r\n matIconButton \r\n [matTooltip]=\"intl.deleteFilterTooltip\" \r\n (click)=\"deleteFilter.emit(getRuleId())\"\r\n class=\"deleteButton\"\r\n type=\"button\">\r\n <mat-icon>delete</mat-icon>\r\n</button>\r\n\r\n<
|
|
1895
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: AdvancedFilterRuleComponent, isStandalone: true, selector: "lib-advanced-filter-rule", inputs: { rule: { classPropertyName: "rule", publicName: "rule", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { deleteFilter: "deleteFilter" }, ngImport: i0, template: "<button \r\n matIconButton \r\n [matTooltip]=\"intl.deleteFilterTooltip\" \r\n (click)=\"deleteFilter.emit(getRuleId())\"\r\n class=\"deleteButton\"\r\n type=\"button\">\r\n <mat-icon>delete</mat-icon>\r\n</button>\r\n\r\n<ngx-searchable-select\r\n [control]=\"getKey()\"\r\n [options]=\"columns()\"\r\n [optionLabel]=\"keyOptionLabel\"\r\n [optionValue]=\"keyOptionValue\"\r\n (optionChange)=\"onKeyChange($event)\"\r\n [selectLabel]=\"intl.fieldLabel\"\r\n [selectPlaceholder]=\"intl.selectOptionPlaceholder\"\r\n [error]=\"intl.requiredFieldError\"\r\n/>\r\n\r\n<ngx-searchable-select\r\n [control]=\"getOperator()\"\r\n [options]=\"getOperatorsOption(getKey().value)\"\r\n [optionLabel]=\"operatorOptionLabel\"\r\n [optionValue]=\"operatorOptionValue\"\r\n [selectLabel]=\"intl.conditionLabel\"\r\n [selectPlaceholder]=\"intl.selectOptionPlaceholder\"\r\n [error]=\"intl.requiredFieldError\"\r\n/>\r\n\r\n@if (getFilterType(getKey().value) == 'text' || getFilterType(getKey().value) == 'number') {\r\n <mat-form-field>\r\n <mat-label>{{intl.valueLabel}}</mat-label>\r\n <input [formControl]=\"getValue()\" [type]=\"getFilterType(getKey().value) ?? 'text'\" matInput>\r\n <mat-error>{{intl.requiredFieldError}}</mat-error>\r\n </mat-form-field>\r\n}\r\n\r\n@if (getFilterType(getKey().value) == 'option' || getFilterType(getKey().value) == 'option-multiple') {\r\n @if(getColumnSelected(getKey().value)?.endpointForPaginatedFilterOptions) {\r\n <ngx-paginated-searchable-select \r\n [control]=\"getValue()\"\r\n [endpoint]=\"getColumnSelected(getKey().value)!.endpointForPaginatedFilterOptions!\"\r\n [filters]=\"getColumnSelected(getKey().value)!.filtersForEndpointPaginatedFilterOptions ?? defaultFiltersForPaginatedFilterOptions\"\r\n [selectLabel]=\"intl.valueLabel\"\r\n [selectPlaceholder]=\"intl.selectOptionPlaceholder\"\r\n [error]=\"intl.requiredFieldError\"\r\n />\r\n } @else {\r\n <ngx-searchable-select\r\n [control]=\"getValue()\"\r\n [options]=\"getColumnSelected(getKey().value)?.filterOptions ?? []\"\r\n [selectLabel]=\"intl.valueLabel\"\r\n [selectPlaceholder]=\"intl.selectOptionPlaceholder\"\r\n [error]=\"intl.requiredFieldError\"\r\n />\r\n }\r\n}\r\n\r\n@if(getFilterType(getKey().value) == 'date' || getFilterType(getKey().value) == 'date-range') {\r\n <mat-form-field>\r\n <mat-label>{{intl.valueLabel}}</mat-label>\r\n <input\r\n [formControl]=\"getValue()\"\r\n matInput \r\n [matDatepicker]=\"picker\">\r\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-datepicker #picker></mat-datepicker>\r\n <mat-error>{{intl.requiredFieldError}}</mat-error>\r\n </mat-form-field>\r\n}\r\n\r\n\r\n", styles: [":host{display:flex;flex-direction:row;gap:10px;align-items:center;margin-top:14px}.deleteButton{margin-bottom:20px}mat-form-field,ngx-searchable-select,ngx-paginated-searchable-select{flex:1}@media (max-width: 900px){:host{flex-direction:column;align-items:normal}}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i11.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i11.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i11.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i7$2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: SearchableSelectComponent, selector: "ngx-searchable-select", inputs: ["control", "options", "optionLabel", "optionValue", "multiple", "searchInputPlaceholder", "selectLabel", "selectPlaceholder", "clearableOptionLabel", "subscriptSizing", "clearable", "error", "selected", "disabled"], outputs: ["optionChange"] }, { kind: "component", type: PaginatedSearchableSelectComponent, selector: "ngx-paginated-searchable-select", inputs: ["control", "endpoint", "filters", "optionLabel", "compareWith", "multiple", "searchInputPlaceholder", "selectLabel", "selectPlaceholder", "clearableOptionLabel", "subscriptSizing", "clearable", "error", "selected", "disabled"], outputs: ["optionChange"] }] });
|
|
1863
1896
|
}
|
|
1864
1897
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AdvancedFilterRuleComponent, decorators: [{
|
|
1865
1898
|
type: Component,
|
|
@@ -1871,8 +1904,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
1871
1904
|
MatInputModule,
|
|
1872
1905
|
MatSelectModule,
|
|
1873
1906
|
MatDatepickerModule,
|
|
1874
|
-
MatTooltipModule
|
|
1875
|
-
|
|
1907
|
+
MatTooltipModule,
|
|
1908
|
+
SearchableSelectComponent,
|
|
1909
|
+
PaginatedSearchableSelectComponent
|
|
1910
|
+
], template: "<button \r\n matIconButton \r\n [matTooltip]=\"intl.deleteFilterTooltip\" \r\n (click)=\"deleteFilter.emit(getRuleId())\"\r\n class=\"deleteButton\"\r\n type=\"button\">\r\n <mat-icon>delete</mat-icon>\r\n</button>\r\n\r\n<ngx-searchable-select\r\n [control]=\"getKey()\"\r\n [options]=\"columns()\"\r\n [optionLabel]=\"keyOptionLabel\"\r\n [optionValue]=\"keyOptionValue\"\r\n (optionChange)=\"onKeyChange($event)\"\r\n [selectLabel]=\"intl.fieldLabel\"\r\n [selectPlaceholder]=\"intl.selectOptionPlaceholder\"\r\n [error]=\"intl.requiredFieldError\"\r\n/>\r\n\r\n<ngx-searchable-select\r\n [control]=\"getOperator()\"\r\n [options]=\"getOperatorsOption(getKey().value)\"\r\n [optionLabel]=\"operatorOptionLabel\"\r\n [optionValue]=\"operatorOptionValue\"\r\n [selectLabel]=\"intl.conditionLabel\"\r\n [selectPlaceholder]=\"intl.selectOptionPlaceholder\"\r\n [error]=\"intl.requiredFieldError\"\r\n/>\r\n\r\n@if (getFilterType(getKey().value) == 'text' || getFilterType(getKey().value) == 'number') {\r\n <mat-form-field>\r\n <mat-label>{{intl.valueLabel}}</mat-label>\r\n <input [formControl]=\"getValue()\" [type]=\"getFilterType(getKey().value) ?? 'text'\" matInput>\r\n <mat-error>{{intl.requiredFieldError}}</mat-error>\r\n </mat-form-field>\r\n}\r\n\r\n@if (getFilterType(getKey().value) == 'option' || getFilterType(getKey().value) == 'option-multiple') {\r\n @if(getColumnSelected(getKey().value)?.endpointForPaginatedFilterOptions) {\r\n <ngx-paginated-searchable-select \r\n [control]=\"getValue()\"\r\n [endpoint]=\"getColumnSelected(getKey().value)!.endpointForPaginatedFilterOptions!\"\r\n [filters]=\"getColumnSelected(getKey().value)!.filtersForEndpointPaginatedFilterOptions ?? defaultFiltersForPaginatedFilterOptions\"\r\n [selectLabel]=\"intl.valueLabel\"\r\n [selectPlaceholder]=\"intl.selectOptionPlaceholder\"\r\n [error]=\"intl.requiredFieldError\"\r\n />\r\n } @else {\r\n <ngx-searchable-select\r\n [control]=\"getValue()\"\r\n [options]=\"getColumnSelected(getKey().value)?.filterOptions ?? []\"\r\n [selectLabel]=\"intl.valueLabel\"\r\n [selectPlaceholder]=\"intl.selectOptionPlaceholder\"\r\n [error]=\"intl.requiredFieldError\"\r\n />\r\n }\r\n}\r\n\r\n@if(getFilterType(getKey().value) == 'date' || getFilterType(getKey().value) == 'date-range') {\r\n <mat-form-field>\r\n <mat-label>{{intl.valueLabel}}</mat-label>\r\n <input\r\n [formControl]=\"getValue()\"\r\n matInput \r\n [matDatepicker]=\"picker\">\r\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-datepicker #picker></mat-datepicker>\r\n <mat-error>{{intl.requiredFieldError}}</mat-error>\r\n </mat-form-field>\r\n}\r\n\r\n\r\n", styles: [":host{display:flex;flex-direction:row;gap:10px;align-items:center;margin-top:14px}.deleteButton{margin-bottom:20px}mat-form-field,ngx-searchable-select,ngx-paginated-searchable-select{flex:1}@media (max-width: 900px){:host{flex-direction:column;align-items:normal}}\n"] }]
|
|
1876
1911
|
}], propDecorators: { rule: [{ type: i0.Input, args: [{ isSignal: true, alias: "rule", required: true }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], deleteFilter: [{ type: i0.Output, args: ["deleteFilter"] }] } });
|
|
1877
1912
|
|
|
1878
1913
|
class AdvancedFilterGroupComponent {
|
|
@@ -1903,7 +1938,7 @@ class AdvancedFilterGroupComponent {
|
|
|
1903
1938
|
return this.group().get('filters').controls;
|
|
1904
1939
|
}
|
|
1905
1940
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AdvancedFilterGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1906
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: AdvancedFilterGroupComponent, isStandalone: true, selector: "lib-advanced-filter-group", inputs: { isRootNode: { classPropertyName: "isRootNode", publicName: "isRootNode", isSignal: true, isRequired: true, transformFunction: null }, group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { addGroup: "addGroup", addFilter: "addFilter", deleteGroup: "deleteGroup", deleteFilter: "deleteFilter" }, ngImport: i0, template: "<div class=\"grupo\" [formGroup]=\"group()\">\r\n \r\n <mat-button-toggle-group [formControl]=\"getConnector()\">\r\n @for (option of optionsFilterConnector(); track option.value) {\r\n <mat-button-toggle [value]=\"option.value\">{{option.label}}</mat-button-toggle>\r\n }\r\n </mat-button-toggle-group>\r\n\r\n @if (isDesktop()) {\r\n <button \r\n matButton=\"outlined\" \r\n (click)=\"addFilter.emit(getGroupId())\"\r\n class=\"addFilterButton\"\r\n type=\"button\">\r\n <mat-icon>add</mat-icon>\r\n {{intl.addFilterButtonLabel}}\r\n </button>\r\n\r\n <button \r\n matButton=\"outlined\"\r\n (click)=\"addGroup.emit(getGroupId())\"\r\n class=\"addGroupButton\"\r\n type=\"button\">\r\n <mat-icon>data_array</mat-icon>\r\n {{intl.addGroupButtonLabel}}\r\n </button>\r\n } @else {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"intl.addFilterButtonLabel\" \r\n (click)=\"addFilter.emit(getGroupId())\"\r\n class=\"addFilterButton\"\r\n type=\"button\">\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n\r\n <button \r\n matIconButton \r\n [matTooltip]=\"intl.addGroupButtonLabel\" \r\n (click)=\"addGroup.emit(getGroupId())\"\r\n class=\"addGroupButton\"\r\n type=\"button\">\r\n <mat-icon>data_array</mat-icon>\r\n </button>\r\n }\r\n \r\n\r\n @if(!isRootNode()) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"intl.deleteGroupTooltip\" \r\n (click)=\"deleteGroup.emit(getGroupId())\"\r\n class=\"deleteGroupButton\"\r\n type=\"button\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n\r\n @for (group of getFilters(); track $index) {\r\n @if(isFilterGroupForm(group)) {\r\n <lib-advanced-filter-group \r\n [group]=\"group\"\r\n [config]=\"config()\"\r\n [isRootNode]=\"false\"\r\n (addGroup)=\"addGroup.emit($event)\"\r\n (addFilter)=\"addFilter.emit($event)\"\r\n (deleteGroup)=\"deleteGroup.emit($event)\"\r\n (deleteFilter)=\"deleteFilter.emit($event)\"\r\n />\r\n } @else {\r\n <lib-advanced-filter-rule \r\n [rule]=\"group\"\r\n [config]=\"config()\"\r\n (deleteFilter)=\"deleteFilter.emit($event)\"\r\n />\r\n }\r\n }\r\n\r\n</div>", styles: [":host{display:block}.grupo{border-radius:4px;border:1px solid var(--mat-sys-outline);padding:40px 34px 10px 20px;position:relative;min-height:60px;display:flex;flex-direction:column;margin-top:24px;gap:8px}mat-button-toggle-group{position:absolute;top:-20px;left:50%;transform:translate(-50%);background-color:var(--mat-sys-surface)}.addFilterButton{position:absolute;top:-20px;left:10px;background-color:var(--mat-sys-surface)}.addGroupButton{position:absolute;top:-20px;right:10px;background-color:var(--mat-sys-surface)}.deleteGroupButton{position:absolute;top:50%;right:-20px;transform:translateY(-50%);background-color:var(--mat-sys-surface)}\n"], dependencies: [{ kind: "component", type: AdvancedFilterGroupComponent, selector: "lib-advanced-filter-group", inputs: ["isRootNode", "group", "config"], outputs: ["addGroup", "addFilter", "deleteGroup", "deleteFilter"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type:
|
|
1941
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: AdvancedFilterGroupComponent, isStandalone: true, selector: "lib-advanced-filter-group", inputs: { isRootNode: { classPropertyName: "isRootNode", publicName: "isRootNode", isSignal: true, isRequired: true, transformFunction: null }, group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { addGroup: "addGroup", addFilter: "addFilter", deleteGroup: "deleteGroup", deleteFilter: "deleteFilter" }, ngImport: i0, template: "<div class=\"grupo\" [formGroup]=\"group()\">\r\n \r\n <mat-button-toggle-group [formControl]=\"getConnector()\">\r\n @for (option of optionsFilterConnector(); track option.value) {\r\n <mat-button-toggle [value]=\"option.value\">{{option.label}}</mat-button-toggle>\r\n }\r\n </mat-button-toggle-group>\r\n\r\n @if (isDesktop()) {\r\n <button \r\n matButton=\"outlined\" \r\n (click)=\"addFilter.emit(getGroupId())\"\r\n class=\"addFilterButton\"\r\n type=\"button\">\r\n <mat-icon>add</mat-icon>\r\n {{intl.addFilterButtonLabel}}\r\n </button>\r\n\r\n <button \r\n matButton=\"outlined\"\r\n (click)=\"addGroup.emit(getGroupId())\"\r\n class=\"addGroupButton\"\r\n type=\"button\">\r\n <mat-icon>data_array</mat-icon>\r\n {{intl.addGroupButtonLabel}}\r\n </button>\r\n } @else {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"intl.addFilterButtonLabel\" \r\n (click)=\"addFilter.emit(getGroupId())\"\r\n class=\"addFilterButton\"\r\n type=\"button\">\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n\r\n <button \r\n matIconButton \r\n [matTooltip]=\"intl.addGroupButtonLabel\" \r\n (click)=\"addGroup.emit(getGroupId())\"\r\n class=\"addGroupButton\"\r\n type=\"button\">\r\n <mat-icon>data_array</mat-icon>\r\n </button>\r\n }\r\n \r\n\r\n @if(!isRootNode()) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"intl.deleteGroupTooltip\" \r\n (click)=\"deleteGroup.emit(getGroupId())\"\r\n class=\"deleteGroupButton\"\r\n type=\"button\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n\r\n @for (group of getFilters(); track $index) {\r\n @if(isFilterGroupForm(group)) {\r\n <lib-advanced-filter-group \r\n [group]=\"group\"\r\n [config]=\"config()\"\r\n [isRootNode]=\"false\"\r\n (addGroup)=\"addGroup.emit($event)\"\r\n (addFilter)=\"addFilter.emit($event)\"\r\n (deleteGroup)=\"deleteGroup.emit($event)\"\r\n (deleteFilter)=\"deleteFilter.emit($event)\"\r\n />\r\n } @else {\r\n <lib-advanced-filter-rule \r\n [rule]=\"group\"\r\n [config]=\"config()\"\r\n (deleteFilter)=\"deleteFilter.emit($event)\"\r\n />\r\n }\r\n }\r\n\r\n</div>", styles: [":host{display:block}.grupo{border-radius:4px;border:1px solid var(--mat-sys-outline);padding:40px 34px 10px 20px;position:relative;min-height:60px;display:flex;flex-direction:column;margin-top:24px;gap:8px}mat-button-toggle-group{position:absolute;top:-20px;left:50%;transform:translate(-50%);background-color:var(--mat-sys-surface)}.addFilterButton{position:absolute;top:-20px;left:10px;background-color:var(--mat-sys-surface)}.addGroupButton{position:absolute;top:-20px;right:10px;background-color:var(--mat-sys-surface)}.deleteGroupButton{position:absolute;top:50%;right:-20px;transform:translateY(-50%);background-color:var(--mat-sys-surface)}\n"], dependencies: [{ kind: "component", type: AdvancedFilterGroupComponent, selector: "lib-advanced-filter-group", inputs: ["isRootNode", "group", "config"], outputs: ["addGroup", "addFilter", "deleteGroup", "deleteFilter"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatSelectModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: AdvancedFilterRuleComponent, selector: "lib-advanced-filter-rule", inputs: ["rule", "config"], outputs: ["deleteFilter"] }, { kind: "ngmodule", type: MatButtonToggleModule }, { kind: "directive", type: i4$1.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i4$1.MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i7$2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] });
|
|
1907
1942
|
}
|
|
1908
1943
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AdvancedFilterGroupComponent, decorators: [{
|
|
1909
1944
|
type: Component,
|
|
@@ -1977,7 +2012,7 @@ class ConfigureAdvancedFilterComponent {
|
|
|
1977
2012
|
}
|
|
1978
2013
|
}
|
|
1979
2014
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfigureAdvancedFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1980
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: ConfigureAdvancedFilterComponent, isStandalone: true, selector: "lib-configure-advanced-filter", ngImport: i0, template: "<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit('save_and_apply')\">\r\n\r\n <h2 mat-dialog-title>{{intl.advancedFiltersDialogTitle}} {{data.config.title() | lowercase}}</h2>\r\n <mat-dialog-content>\r\n\r\n <p class=\"advancedFilterResult\" [innerHTML]=\"query()\" [style.visibility]=\"query() ? 'visible': 'hidden'\"></p>\r\n\r\n <mat-form-field>\r\n <mat-label>{{intl.templateNameLabel}}</mat-label>\r\n <input matInput formControlName=\"name\" [maxlength]=\"16\">\r\n <mat-hint>{{form.get('name')?.value.length ?? 0}}/16</mat-hint>\r\n <mat-error>{{intl.templateNameRequiredError}}</mat-error>\r\n </mat-form-field>\r\n\r\n <lib-advanced-filter-group \r\n [group]=\"getRootGroup()\"\r\n [config]=\"data.config\"\r\n [isRootNode]=\"true\"\r\n (addGroup)=\"addGroup($event)\"\r\n (addFilter)=\"addFilter($event)\"\r\n (deleteGroup)=\"deleteGroup($event)\"\r\n (deleteFilter)=\"deleteFilter($event)\"\r\n />\r\n\r\n <div class=\"helperContainer\">\r\n <p class=\"helperTitle\"><strong>{{intl.advancedFiltersHelpTitle}}</strong></p>\r\n <p class=\"helper\">\r\n <strong>{{intl.groupLabel}} </strong>{{intl.advancedFiltersGroupHelp}}<br>\r\n <strong>{{intl.filterLabel}} </strong>{{intl.advancedFiltersRuleHelp}}\r\n </p>\r\n </div>\r\n \r\n </mat-dialog-content>\r\n <mat-dialog-actions>\r\n <button matButton [mat-dialog-close]=\"undefined\">{{intl.closeButtonLabel}}</button>\r\n <button matButton [disabled]=\"form.invalid\" type=\"button\" (click)=\"onSubmit('save')\">{{intl.saveButtonLabel}}</button>\r\n <button matButton [disabled]=\"form.invalid\" type=\"button\" (click)=\"onSubmit('save_and_apply')\">{{intl.saveAndApplyButtonLabel}}</button>\r\n </mat-dialog-actions>\r\n\r\n\r\n</form>", styles: [":host{display:block}mat-dialog-content{display:flex;flex-direction:column;gap:12px}.helperContainer{margin-top:30px}.helperTitle,.helper{font:var(--mat-sys-body-small);font-weight:300;margin:0}.helper{margin-top:4px;padding-left:20px}.advancedFilterResult{align-self:center;text-align:center;font:var(--mat-sys-body-large);padding:8px;border-radius:4px;background-color:var(--warning);color:var(--on-warning)}\n"], dependencies: [{ kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3
|
|
2015
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: ConfigureAdvancedFilterComponent, isStandalone: true, selector: "lib-configure-advanced-filter", ngImport: i0, template: "<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit('save_and_apply')\">\r\n\r\n <h2 mat-dialog-title>{{intl.advancedFiltersDialogTitle}} {{data.config.title() | lowercase}}</h2>\r\n <mat-dialog-content>\r\n\r\n <p class=\"advancedFilterResult\" [innerHTML]=\"query()\" [style.visibility]=\"query() ? 'visible': 'hidden'\"></p>\r\n\r\n <mat-form-field>\r\n <mat-label>{{intl.templateNameLabel}}</mat-label>\r\n <input matInput formControlName=\"name\" [maxlength]=\"16\">\r\n <mat-hint>{{form.get('name')?.value.length ?? 0}}/16</mat-hint>\r\n <mat-error>{{intl.templateNameRequiredError}}</mat-error>\r\n </mat-form-field>\r\n\r\n <lib-advanced-filter-group \r\n [group]=\"getRootGroup()\"\r\n [config]=\"data.config\"\r\n [isRootNode]=\"true\"\r\n (addGroup)=\"addGroup($event)\"\r\n (addFilter)=\"addFilter($event)\"\r\n (deleteGroup)=\"deleteGroup($event)\"\r\n (deleteFilter)=\"deleteFilter($event)\"\r\n />\r\n\r\n <div class=\"helperContainer\">\r\n <p class=\"helperTitle\"><strong>{{intl.advancedFiltersHelpTitle}}</strong></p>\r\n <p class=\"helper\">\r\n <strong>{{intl.groupLabel}} </strong>{{intl.advancedFiltersGroupHelp}}<br>\r\n <strong>{{intl.filterLabel}} </strong>{{intl.advancedFiltersRuleHelp}}\r\n </p>\r\n </div>\r\n \r\n </mat-dialog-content>\r\n <mat-dialog-actions>\r\n <button matButton [mat-dialog-close]=\"undefined\">{{intl.closeButtonLabel}}</button>\r\n <button matButton [disabled]=\"form.invalid\" type=\"button\" (click)=\"onSubmit('save')\">{{intl.saveButtonLabel}}</button>\r\n <button matButton [disabled]=\"form.invalid\" type=\"button\" (click)=\"onSubmit('save_and_apply')\">{{intl.saveAndApplyButtonLabel}}</button>\r\n </mat-dialog-actions>\r\n\r\n\r\n</form>", styles: [":host{display:block}mat-dialog-content{display:flex;flex-direction:column;gap:12px}.helperContainer{margin-top:30px}.helperTitle,.helper{font:var(--mat-sys-body-small);font-weight:300;margin:0}.helper{margin-top:4px;padding-left:20px}.advancedFilterResult{align-self:center;text-align:center;font:var(--mat-sys-body-large);padding:8px;border-radius:4px;background-color:var(--warning);color:var(--on-warning)}\n"], dependencies: [{ kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: AdvancedFilterGroupComponent, selector: "lib-advanced-filter-group", inputs: ["isRootNode", "group", "config"], outputs: ["addGroup", "addFilter", "deleteGroup", "deleteFilter"] }, { kind: "pipe", type: LowerCasePipe, name: "lowercase" }] });
|
|
1981
2016
|
}
|
|
1982
2017
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfigureAdvancedFilterComponent, decorators: [{
|
|
1983
2018
|
type: Component,
|
|
@@ -2117,6 +2152,11 @@ class NgxPaginatedTable {
|
|
|
2117
2152
|
tableContentTemplate = viewChild('tableContent', ...(ngDevMode ? [{ debugName: "tableContentTemplate" }] : []));
|
|
2118
2153
|
overlayRef;
|
|
2119
2154
|
portal;
|
|
2155
|
+
defaultFiltersForPaginatedFilterOptions = signal({
|
|
2156
|
+
pageNumber: 1,
|
|
2157
|
+
pageSize: 20,
|
|
2158
|
+
query: undefined
|
|
2159
|
+
}, ...(ngDevMode ? [{ debugName: "defaultFiltersForPaginatedFilterOptions" }] : []));
|
|
2120
2160
|
constructor(intl) {
|
|
2121
2161
|
this.intl = intl ?? new NgxPaginatedTableIntl();
|
|
2122
2162
|
}
|
|
@@ -2228,8 +2268,11 @@ class NgxPaginatedTable {
|
|
|
2228
2268
|
this.onColumnFilterChange(column.key, query);
|
|
2229
2269
|
}, this.debounceTime);
|
|
2230
2270
|
}
|
|
2231
|
-
|
|
2232
|
-
this.onColumnFilterChange(column.key,
|
|
2271
|
+
onPaginatedOptionFilterColumnChange(column, option) {
|
|
2272
|
+
this.onColumnFilterChange(column.key, option);
|
|
2273
|
+
}
|
|
2274
|
+
onOptionFilterColumnChange(column, value) {
|
|
2275
|
+
this.onColumnFilterChange(column.key, value);
|
|
2233
2276
|
}
|
|
2234
2277
|
onDateFilterChange(column, value) {
|
|
2235
2278
|
this.onColumnFilterChange(column.key, value);
|
|
@@ -2251,6 +2294,18 @@ class NgxPaginatedTable {
|
|
|
2251
2294
|
getValueOfColumnFilter(key) {
|
|
2252
2295
|
return this.filters()().columnsFiltersValue?.[key];
|
|
2253
2296
|
}
|
|
2297
|
+
getPaginatedSearchableSelectValueOfColumnFilter(key) {
|
|
2298
|
+
const value = this.getValueOfColumnFilter(key);
|
|
2299
|
+
if (isFilterOption(value) || (Array.isArray(value) && value.every(v => isFilterOption(v))))
|
|
2300
|
+
return value;
|
|
2301
|
+
return undefined;
|
|
2302
|
+
}
|
|
2303
|
+
getSearchableSelectValueOfColumnFilter(key) {
|
|
2304
|
+
const value = this.getValueOfColumnFilter(key);
|
|
2305
|
+
if (typeof value === 'string' || (Array.isArray(value) && value.every(v => typeof v === 'string')))
|
|
2306
|
+
return value;
|
|
2307
|
+
return undefined;
|
|
2308
|
+
}
|
|
2254
2309
|
getDateRangeValueOfColumnFilter(key, type) {
|
|
2255
2310
|
const value = this.getValueOfColumnFilter(key);
|
|
2256
2311
|
if (!value)
|
|
@@ -2312,7 +2367,7 @@ class NgxPaginatedTable {
|
|
|
2312
2367
|
if (!advancedFilterId)
|
|
2313
2368
|
return;
|
|
2314
2369
|
const tableId = this.config()().tableId;
|
|
2315
|
-
const advancedFilter = this.advancedFilterService.getAdvancedFilterById(tableId, advancedFilterId);
|
|
2370
|
+
const advancedFilter = this.advancedFilterService.getAdvancedFilterById(tableId, advancedFilterId, false);
|
|
2316
2371
|
if (!advancedFilter)
|
|
2317
2372
|
return;
|
|
2318
2373
|
this.onAdvancedFilterUpdate(event, advancedFilter);
|
|
@@ -2356,7 +2411,7 @@ class NgxPaginatedTable {
|
|
|
2356
2411
|
if (!advancedFilterId)
|
|
2357
2412
|
return '';
|
|
2358
2413
|
const tableId = this.config()().tableId;
|
|
2359
|
-
const advancedFilter = this.advancedFilterService.getAdvancedFilterById(tableId, advancedFilterId);
|
|
2414
|
+
const advancedFilter = this.advancedFilterService.getAdvancedFilterById(tableId, advancedFilterId, false);
|
|
2360
2415
|
if (!advancedFilter)
|
|
2361
2416
|
return '';
|
|
2362
2417
|
return AdvancedFilterUtils.groupsToReadableHtml(advancedFilter.groups, this.config()().columns, this.intl);
|
|
@@ -2522,7 +2577,7 @@ class NgxPaginatedTable {
|
|
|
2522
2577
|
return topOverlay === this.overlayRef.hostElement;
|
|
2523
2578
|
}
|
|
2524
2579
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: NgxPaginatedTable, deps: [{ token: NgxPaginatedTableIntl, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
2525
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: NgxPaginatedTable, isStandalone: true, selector: "ngx-paginated-table", inputs: { endpoint: { classPropertyName: "endpoint", publicName: "endpoint", isSignal: true, isRequired: true, transformFunction: null }, filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { createClick: "createClick", updateClick: "updateClick", deleteClick: "deleteClick", rowActionClick: "rowActionClick", expandedItemChange: "expandedItemChange", selectionActionEvent: "selectionActionEvent" }, host: { listeners: { "document:keydown.escape": "onEscape()" }, classAttribute: "contenedorDefecto" }, viewQueries: [{ propertyName: "tableContentTemplate", first: true, predicate: ["tableContent"], descendants: true, isSignal: true }], ngImport: i0, template: "@if(!isFullScreen()) {\r\n <ng-container *ngTemplateOutlet=\"tableContentTemplate()\"></ng-container>\r\n}\r\n\r\n<ng-template #tableContent>\r\n <div class=\"tableContainer\" [class.inFullScreenMode]=\"isFullScreen()\">\r\n <div class=\"headerContainer\">\r\n <div class=\"titleAndButtonContainer\">\r\n <p class=\"title\">{{ config()().title() }}</p>\r\n <div class=\"buttonContainer\">\r\n @if(config()().create && (!config()().create?.show || config()().create?.show())) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"config()().create?.tooltip?.() ?? intl.createButtonLabel\" \r\n [disabled]=\"config()().create?.disabled?.()\" \r\n class=\"newButtonIcon\"\r\n (click)=\"onNewClick()\">\r\n <mat-icon>add_circle</mat-icon>\r\n </button>\r\n }\r\n\r\n <button matIconButton [matTooltip]=\"intl.editColumnsTooltip\" class=\"editColumnsButtonIcon\" (click)=\"onEditColumns()\">\r\n <mat-icon>table_edit</mat-icon>\r\n </button>\r\n\r\n @if(config()().showAdvancedFilters) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"intl.advancedFiltersLabel\"\r\n [matMenuTriggerFor]=\"advancedFiltersMenu\" \r\n #advancedFiltersMenuTrigger=\"matMenuTrigger\">\r\n\r\n <mat-icon>filter_alt</mat-icon>\r\n </button>\r\n\r\n <mat-menu #advancedFiltersMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\r\n <button mat-menu-item (click)=\"onNewAdvancedFiltersClick()\">\r\n <mat-icon>filter_alt</mat-icon>\r\n <span>{{ intl.newAdvancedFilterLabel }}</span>\r\n </button>\r\n\r\n @for (advancedFilter of advancedFilters(); track $index; let first = $first) {\r\n @if (first) {\r\n <mat-divider />\r\n }\r\n\r\n <div mat-menu-item (click)=\"onApplyTemplateClick(advancedFilter)\">\r\n <div class=\"templateContainer\"> \r\n <span>{{advancedFilter.name | ngxOnlyUpperFirstCharacter}}</span>\r\n\r\n <div class=\"buttonTemplateContainer\">\r\n <button\r\n matIconButton \r\n [matTooltip]=\"intl.getEditAdvancedFilterTooltip(advancedFilter.name | ngxOnlyUpperFirstCharacter)\"\r\n (click)=\"onAdvancedFilterUpdate($event, advancedFilter, advancedFiltersMenuTrigger)\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n\r\n <button\r\n matIconButton \r\n [matTooltip]=\"intl.getDeleteAdvancedFilterTooltip(advancedFilter.name | ngxOnlyUpperFirstCharacter)\"\r\n (click)=\"onAdvancedFilterDelete($event, advancedFiltersMenuTrigger, advancedFilter)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </mat-menu>\r\n }\r\n\r\n @if(selection().length > 0) {\r\n @if(getRowSelectionAction().length > 0) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"intl.selectionActionsTooltip\"\r\n [matMenuTriggerFor]=\"selectedRecordsMenu\">\r\n <mat-icon>event_list</mat-icon>\r\n </button>\r\n\r\n <mat-menu #selectedRecordsMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\r\n <button mat-menu-item (click)=\"uncheckAllSelection()\">\r\n <mat-icon>deselect</mat-icon>\r\n <span>{{ intl.deselectAllLabel }}</span>\r\n </button>\r\n\r\n @for (action of getRowSelectionAction(); track $index) {\r\n <button mat-menu-item (click)=\"onRowSelectionActionClick(action.id)\">\r\n <mat-icon>{{action.icon}}</mat-icon>\r\n <span>{{action.label(selection(), selection().length)}}</span>\r\n </button>\r\n }\r\n </mat-menu>\r\n } @else {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"intl.deselectAllLabel\"\r\n (click)=\"uncheckAllSelection()\">\r\n <mat-icon>deselect</mat-icon>\r\n </button>\r\n }\r\n }\r\n\r\n <button matIconButton [matTooltip]=\"intl.exportTooltip\" [matMenuTriggerFor]=\"exportMenu\">\r\n <mat-icon>download</mat-icon>\r\n </button>\r\n <mat-menu #exportMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\r\n <button mat-menu-item (click)=\"exportToCsvCurrentPage()\">\r\n <mat-icon>csv</mat-icon>\r\n <span>{{ intl.exportToExcelLabel }}</span>\r\n </button>\r\n\r\n <button mat-menu-item (click)=\"exportToPdfCurrentPage()\">\r\n <mat-icon>picture_as_pdf</mat-icon>\r\n <span>{{ intl.exportToPdfLabel }}</span>\r\n </button>\r\n </mat-menu>\r\n\r\n <button matIconButton [matTooltip]=\"isFullScreen() ? intl.exitFullscreenTooltip : intl.enterFullscreenTooltip\" (click)=\"onToggleFullScreen()\">\r\n <mat-icon>{{isFullScreen() ? 'fullscreen_exit': 'fullscreen'}}</mat-icon>\r\n </button>\r\n\r\n <ng-content select=\"[icon-buttons]\"></ng-content>\r\n </div>\r\n </div>\r\n\r\n <div class=\"filterContainer\">\r\n <div class=\"moreFiltersContainer\">\r\n <ng-content select=\"[more-filters]\"></ng-content>\r\n </div>\r\n\r\n @if(config()().showQueryFilter) {\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input #queryElement matInput [placeholder]=\"config()().queryFilterPlaceholder ?? intl.searchPlaceholder\" [value]=\"filters()().query ?? ''\" (input)=\"onQueryChange(queryElement)\">\r\n <button matIconButton matSuffix (click)=\"onQueryReset(queryElement)\" [style.visibility]=\"queryElement.value ? 'visible': 'hidden'\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n }\r\n </div>\r\n\r\n <ng-content select=\"[extra-header-content]\"></ng-content>\r\n </div>\r\n\r\n @if(filters()().advancedFilterId) {\r\n <div class=\"advancedFiltersApplied\" (click)=\"onSelectedAdvancedFilterUpdate($event)\">\r\n <p [innerHTML]=\"getAdvancedFilterLabel()\"></p>\r\n <button matIconButton [matTooltip]=\"intl.removeAdvancedFilterTooltip\" class=\"\" (click)=\"onQuitAdvancedFilter($event)\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <mat-progress-bar mode=\"indeterminate\" [style.visibility]=\"dataResource.isLoading() ? 'visible': 'hidden'\"/>\r\n\r\n <div class=\"tableOverflow\" [style.max-height]=\"config()().maxHeight && !isFullScreen() ? config()().maxHeight : null\">\r\n <table\r\n mat-table \r\n matSort\r\n [multiTemplateDataRows]=\"config()().expandableDetail\"\r\n [dataSource]=\"data()\" \r\n [matSortActive]=\"filters()().sortBy?.key ?? ''\" \r\n [matSortDirection]=\"filters()().sortBy?.direction ?? ''\"\r\n (matSortChange)=\"onSortChange($event)\">\r\n\r\n @if(config()().enableRowSelection) {\r\n @if(showFiltersRow()) {\r\n <ng-container [matColumnDef]=\"`${filterKeyPrefix}${nameOfRowSelectionColumn}`\" [sticky]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef class=\"celdaSelection\"></th>\r\n </ng-container>\r\n } \r\n\r\n <ng-container [matColumnDef]=\"nameOfRowSelectionColumn\" [sticky]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <mat-checkbox \r\n class=\"headerCheckbox\"\r\n (change)=\"$event ? toggleAllPageRowSelection() : null\"\r\n [checked]=\"selection().length > 0 && isAllPageRowSelected()\"\r\n [indeterminate]=\"selection().length > 0 && !isAllPageRowSelected()\">\r\n </mat-checkbox>\r\n </th>\r\n <td mat-cell *matCellDef=\"let row\" (click)=\"$event.stopPropagation()\" class=\"celdaSelection\">\r\n <mat-checkbox\r\n (change)=\"$event ? toggleRowSelection(row) : null\"\r\n [checked]=\"isRowSelected(row)\">\r\n </mat-checkbox>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n\r\n @if(showTotalGeneralFooter()) {\r\n <ng-container [matColumnDef]=\"`${generalFooterKeyPrefix}${nameOfRowSelectionColumn}`\" [sticky]=\"isDesktop()\">\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @for (column of config()().columns; track $index) {\r\n <ng-container \r\n [matColumnDef]=\"getKeyAsString(column.key)\" \r\n [sticky]=\"stickyColumnKey() == column.key && isDesktop()\">\r\n\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header [disabled]=\"!column.isSortable\" class=\"columnLabel\">\r\n <p class=\"headerTitle\">\r\n @if(stickyColumnKey() == column.key && isDesktop()) {\r\n <mat-icon>keep</mat-icon>\r\n }\r\n {{ column.label }}\r\n </p>\r\n </th>\r\n\r\n <td \r\n mat-cell \r\n *matCellDef=\"let row\" \r\n [class.columnSticky]=\"stickyColumnKey() == column.key && isDesktop()\"\r\n [ngStyle]=\"column.style\"\r\n class=\"celdaDatos\">\r\n\r\n @if(column.component) {\r\n <ng-container \r\n ngxDynamicCellHost\r\n [component]=\"column.component\"\r\n [row]=\"row\"\r\n [key]=\"column.key\" />\r\n } @else if(column.templateRef) {\r\n <ng-container \r\n *ngTemplateOutlet=\"column.templateRef(); \r\n context: { $implicit: row }\" />\r\n } @else if(column.valueGetter) {\r\n {{ column.valueGetter(row) }}\r\n } @else {\r\n {{ applyColumnPipes(row[column.key], column.pipes) ?? '-' }}\r\n }\r\n </td>\r\n \r\n <td mat-footer-cell *matFooterCellDef [ngStyle]=\"column.style\">\r\n @if(column.showTotalPerPage) {\r\n @if(column.pipes) {\r\n {{ applyColumnPipes(getTotalOfColum(column.key), column.pipes) }}\r\n } @else if(column.totalFooterFormatter) {\r\n {{ column.totalFooterFormatter(getTotalOfColum(column.key)) }}\r\n } @else {\r\n {{ getTotalOfColum(column.key) }}\r\n }\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n\r\n @if(showTotalGeneralFooter()) {\r\n @for (column of config()().columns; track $index) {\r\n <ng-container [matColumnDef]=\"`${generalFooterKeyPrefix}${getKeyAsString(column.key)}`\">\r\n <td mat-footer-cell *matFooterCellDef [ngStyle]=\"column.style\">\r\n @if(column.showTotalGeneral && column.getTotalGeneral) {\r\n @if(column.pipes) {\r\n {{ applyColumnPipes(column.getTotalGeneral(), column.pipes) }}\r\n } @else if(column.totalFooterFormatter) {\r\n {{ column.totalFooterFormatter(column.getTotalGeneral()) }}\r\n } @else {\r\n {{ column.getTotalGeneral() }}\r\n }\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @if(showFiltersRow()) {\r\n @for (column of config()().columns; track $index) {\r\n <ng-container \r\n [matColumnDef]=\"`${filterKeyPrefix}${getKeyAsString(column.key)}`\" \r\n [sticky]=\"stickyColumnKey() == column.key && isDesktop()\">\r\n\r\n <th mat-header-cell *matHeaderCellDef>\r\n @if (column.filterType == 'text' || column.filterType == 'number') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"inputQueryColumn\">\r\n <input [type]=\"column.filterType\" matInput [placeholder]=\"column.label\" [value]=\"getValueOfColumnFilter(column.key) ?? ''\" (input)=\"onTextFilterColumnChange(column, $event)\">\r\n <mat-icon matSuffix>{{ column.filterType == 'text' ? 'search' : 'numbers'}}</mat-icon>\r\n </mat-form-field>\r\n }\r\n\r\n @if (column.filterType == 'option' || column.filterType == 'option-multiple') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"selectColumn\">\r\n <mat-select\r\n [placeholder]=\"column.label\" \r\n [multiple]=\"column.filterType == 'option-multiple'\"\r\n [value]=\"getValueOfColumnFilter(column.key)\"\r\n (selectionChange)=\"onOptionFilterColumnChange(column, $event)\">\r\n \r\n @if(column.filterType == 'option') {\r\n <mat-option>{{ intl.removeFilterLabel }}</mat-option>\r\n }\r\n @for (option of column.filterOptions; track $index;) {\r\n <mat-option [value]=\"option.value\">{{option.label}}</mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n }\r\n \r\n @if(column.filterType == 'date') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"dateColumn\">\r\n <input \r\n matInput \r\n [matDatepicker]=\"picker\" \r\n [placeholder]=\"column.label\"\r\n [value]=\"getValueOfColumnFilter(column.key)\"\r\n (dateChange)=\"onDateFilterChange(column, $event.value)\">\r\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-datepicker #picker></mat-datepicker>\r\n </mat-form-field>\r\n }\r\n\r\n @if(column.filterType == 'date-range') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"dateColumn\">\r\n <mat-date-range-input [rangePicker]=\"picker\" #dateRangeInput>\r\n <input \r\n matStartDate \r\n [placeholder]=\"intl.dateRangeStartPlaceholder\"\r\n [value]=\"getDateRangeValueOfColumnFilter(column.key, 'start')\"\r\n (dateChange)=\"onDateRangeFilterChange(column, dateRangeInput.value)\">\r\n <input \r\n matEndDate \r\n [placeholder]=\"intl.dateRangeEndPlaceholder\"\r\n [value]=\"getDateRangeValueOfColumnFilter(column.key, 'end')\"\r\n (dateChange)=\"onDateRangeFilterChange(column, dateRangeInput.value)\">\r\n </mat-date-range-input>\r\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-date-range-picker #picker></mat-date-range-picker>\r\n </mat-form-field>\r\n }\r\n </th>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @if(showActionsColumn()) {\r\n @if(showFiltersRow()) {\r\n <ng-container [matColumnDef]=\"`${filterKeyPrefix}${nameOfActionsColumn}`\" [stickyEnd]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef class=\"celdaAcciones\"></th>\r\n </ng-container>\r\n } \r\n\r\n <ng-container [matColumnDef]=\"nameOfActionsColumn\" [stickyEnd]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef>{{ intl.actionsLabel }}</th>\r\n <td mat-cell *matCellDef=\"let row\" (click)=\"$event.stopPropagation()\" class=\"celdaAcciones\">\r\n <div class=\"contenedorCeldaAcciones\">\r\n @if(config()().expandableDetail) {\r\n <button \r\n matIconButton\r\n (click)=\"expandableToggle(row)\">\r\n <mat-icon>{{ rowIsExpanded(row) ? 'keyboard_arrow_up' : 'keyboard_arrow_down' }}</mat-icon>\r\n </button>\r\n }\r\n\r\n @if(config()().update && !config()().clickOnRowForUpdate && (!config()().update?.show || config()().update?.show(row))) {\r\n <button \r\n matIconButton\r\n [matTooltip]=\"config()().update?.tooltip?.(row) ?? intl.editTooltip\" \r\n [disabled]=\"config()().update?.disabled?.(row)\" \r\n class=\"editButtonIcon\"\r\n (click)=\"onUpdateClick(row, $event)\">\r\n <mat-icon>edit_square</mat-icon>\r\n </button>\r\n }\r\n \r\n @if(config()().delete && (!config()().delete?.show || config()().delete?.show(row))) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"config()().delete?.tooltip?.(row) ?? intl.deleteTooltip\" \r\n [disabled]=\"config()().delete?.disabled?.(row)\" \r\n class=\"deleteButtonIcon\"\r\n (click)=\"onDeleteClick(row, $event)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n\r\n @for (rowAction of config()().rowActions; track $index) {\r\n @if(!rowAction.show || rowAction.show(row)) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"rowAction.tooltip(row)\" \r\n [disabled]=\"rowAction.disabled?.(row)\" \r\n [class]=\"rowAction.iconColor ? `rowActionIconColor${rowAction.iconColor}` : ''\"\r\n (click)=\"onRowActionClick(row, rowAction, $event)\">\r\n <mat-icon>{{rowAction.icon}}</mat-icon>\r\n </button>\r\n } \r\n }\r\n </div>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n\r\n @if(showTotalGeneralFooter()) {\r\n <ng-container [matColumnDef]=\"`${generalFooterKeyPrefix}${nameOfActionsColumn}`\" [stickyEnd]=\"isDesktop()\">\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @if(config()().expandableDetail) {\r\n <ng-container [matColumnDef]=\"expandableColumnDef\">\r\n <td mat-cell *matCellDef=\"let row\" [attr.colspan]=\"keys().length\">\r\n <div \r\n class=\"detailWrapper\"\r\n [class.detailWrapperExpanded]=\"rowIsExpanded(row)\">\r\n <div class=\"columnDetail\">\r\n @if(config()().expandableDetailTemplateRef) {\r\n <ng-container \r\n *ngTemplateOutlet=\"config()().expandableDetailTemplateRef!(); \r\n context: { $implicit: row }\" />\r\n }\r\n </div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n }\r\n \r\n <tr mat-header-row *matHeaderRowDef=\"keys(); sticky: true\" class=\"tableHeader\"></tr>\r\n \r\n @if(showFiltersRow()) {\r\n <tr mat-header-row *matHeaderRowDef=\"keysWithFilter(); sticky: true\" class=\"filtersByColumn\"></tr>\r\n }\r\n \r\n <tr mat-row *matRowDef=\"let row; columns: keys();\" \r\n (click)=\"onRowClick(row)\" \r\n [class.rowClickEnable]=\"isRowEnabled(row)\"\r\n [class.expandableRow]=\"config()().expandableDetail\">\r\n </tr>\r\n \r\n @if(config()().expandableDetail) {\r\n <tr mat-row *matRowDef=\"let row; columns: [expandableColumnDef]\" class=\"rowDetail\"></tr>\r\n }\r\n\r\n <tr mat-footer-row \r\n *matFooterRowDef=\"showTotalPerPageFooter() ? keys() : []\" \r\n class=\"totalPerPageFooter\"\r\n [class.hideFooter]=\"!showTotalPerPageFooter()\">\r\n </tr>\r\n\r\n <tr mat-footer-row \r\n *matFooterRowDef=\"showTotalGeneralFooter() ? keysWithGeneralFooter() : []\" \r\n class=\"totalFooter\"\r\n [class.hideFooter]=\"!showTotalGeneralFooter()\">\r\n </tr>\r\n\r\n <tr class=\"mat-row\" *matNoDataRow>\r\n <td class=\"noData\" [colSpan]=\"keys().length\">{{ dataResource.isLoading() ? intl.loadingMessage : intl.noDataMessage }}</td>\r\n </tr>\r\n </table>\r\n </div>\r\n\r\n <div class=\"paginatorContainer\">\r\n <div class=\"footerLegend\">\r\n @if(showTotalPerPageFooter()) {\r\n <div class=\"legendItem\">\r\n <div class=\"legendSquare\"></div>\r\n <p>{{ intl.totalPerPageLabel }}</p> \r\n </div>\r\n }\r\n\r\n @if(showTotalGeneralFooter()) {\r\n <div class=\"legendItem\">\r\n <div class=\"legendSquare totalGeneral\"></div>\r\n <p>{{ intl.totalGeneralLabel }}</p>\r\n </div>\r\n }\r\n </div>\r\n <mat-paginator [length]=\"total()\" [pageSize]=\"filters()().pageSize\" [pageIndex]=\"filters()().pageNumber - 1\" (page)=\"onPageChange($event)\"/>\r\n </div>\r\n\r\n <ng-content select=\"[end-container]\"></ng-content>\r\n </div>\r\n</ng-template>", styles: [".tableContainer{display:flex;flex-direction:column;padding:14px;gap:10px;--mat-table-background-color: transparent;--mat-table-header-headline-color: var(--mat-sys-on-primary)}.inFullScreenMode{height:calc(100vh - 28px);width:calc(100vw - 28px);max-width:calc(100% - 28px);background:var(--mat-sys-surface)}.title{font:var(--mat-sys-title-large);margin:0;position:relative}.headerContainer{display:flex;justify-content:space-between;gap:10px;flex-direction:column}.titleAndButtonContainer{display:flex;justify-content:space-between;align-items:center;gap:20px}.buttonContainer{display:flex;gap:10px;align-items:center}.filterContainer{display:flex;flex-direction:row;align-items:center;gap:20px;justify-content:space-between}.moreFiltersContainer{display:flex;gap:20px}.editButtonIcon{--mat-icon-button-icon-color: var(--warning)}.deleteButtonIcon{--mat-icon-button-icon-color: var(--mat-sys-error)}.rowActionIconColorYellow{--mat-icon-button-icon-color: rgb(211, 211, 7)}.rowActionIconColorOrange{--mat-icon-button-icon-color: orange}.rowActionIconColorPink{--mat-icon-button-icon-color: pink}.rowActionIconColorPurple{--mat-icon-button-icon-color: purple}.rowActionIconColorGreen{--mat-icon-button-icon-color: var(--success)}.rowActionIconColorBlue{--mat-icon-button-icon-color: var(--information)}.rowActionIconColorBrown{--mat-icon-button-icon-color: brown}.rowActionIconColorSky{--mat-icon-button-icon-color: rgb(0, 247, 255)}.noData{padding:24px}.tableOverflow{overflow:auto;border-radius:10px}.columnLabel{text-wrap:nowrap}.headerTitle{display:flex;align-items:center;gap:4px}.headerTitle mat-icon{font-size:12px;width:12px;height:12px}.tableHeader{background-color:var(--mat-sys-primary)!important}.filtersByColumn{background-color:var(--mat-sys-surface)!important}.filtersByColumn th{padding:0}.celdaDatos{background-color:var(--mat-sys-surface)!important;transition:background-color .1s}.celdaAcciones,.celdaSelection{cursor:default!important;background-color:var(--mat-sys-surface)!important;transition:background-color .1s}.columnSticky{background-color:var(--mat-sys-surface)!important;transition:background-color .1s}.contenedorCeldaAcciones{display:flex;align-items:center;cursor:default!important}.rowClickEnable{cursor:pointer;transition:background-color .1s}.rowClickEnable:hover,.rowClickEnable:hover>.celdaAcciones,.rowClickEnable:hover>.celdaSelection,.rowClickEnable:hover>.celdaDatos,.rowClickEnable:hover>.columnSticky{background-color:var(--mat-sys-surface-container)!important}.inputQueryColumn,.selectColumn,.dateColumn{--mat-form-field-outlined-focus-outline-color: transparent;--mat-form-field-outlined-outline-color: transparent;--mat-form-field-outlined-hover-outline-color: transparent}.templateContainer{display:flex;align-items:center;justify-content:space-between;gap:60px}.buttonTemplateContainer{display:flex;flex-wrap:nowrap}.advancedFiltersApplied{display:flex;flex-direction:row;justify-content:space-between;gap:20px;border-radius:10px;background-color:var(--warning);color:var(--on-warning);align-items:center;margin-top:10px;padding:5px 5px 5px 15px;cursor:pointer;transition:background-color .3s}.advancedFiltersApplied:hover:not(:has(button:hover)){background-color:color-mix(in srgb,var(--warning) 80%,transparent)}.advancedFiltersApplied p{margin:0}.rowDetail{height:0}.expandableRow td{border-bottom-width:0}.detailWrapper{overflow:hidden;display:grid;grid-template-rows:0fr;grid-template-columns:100%;transition:grid-template-rows 225ms cubic-bezier(.4,0,.2,1)}.detailWrapperExpanded{grid-template-rows:1fr}.columnDetail{display:flex;flex-direction:column;min-height:0}.totalPerPageFooter{font-weight:700}.totalFooter{font-weight:700;background-color:var(--mat-sys-surface-container-highest);color:var(--mat-sys-on-surface)}.hideFooter{display:none}.paginatorContainer{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:20px;margin-top:10px}.footerLegend{display:flex;flex-direction:row;gap:30px}.footerLegend p{margin:0;font:var(--mat-sys-label-medium)}.legendItem{display:flex;flex-direction:row;align-items:center;gap:6px}.legendSquare{width:24px;height:14px;border-radius:4px;border:2px solid var(--mat-sys-on-surface)}.totalGeneral{background-color:var(--mat-sys-surface-container-highest)}.headerCheckbox{--mat-checkbox-selected-checkmark-color: var(--mat-sys-primary);--mat-checkbox-selected-focus-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-focus-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-selected-hover-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-hover-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-selected-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-pressed-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-pressed-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-focus-icon-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-focus-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-hover-icon-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-hover-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-icon-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-pressed-state-layer-color: var(--mat-sys-on-primary)}@media (max-width: 1200px){.filterContainer{flex-direction:column;align-items:normal}.moreFiltersContainer{flex-direction:column}}@media (max-width: 900px){.footerLegend{flex-direction:column;gap:6px}}@media (max-width: 700px){.paginatorContainer{flex-direction:column;align-items:flex-end}}@media (max-width: 600px){.titleAndButtonContainer{flex-direction:column;align-items:normal}}\n"], dependencies: [{ kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i2$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i2$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i2$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i2$1.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2$1.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i2$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i2$1.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i2$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i2$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i2$1.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "directive", type: i2$1.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i3.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i7.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i8$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i1$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3$2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i3$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i12.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i12.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i12.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i12.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i12.MatStartDate, selector: "input[matStartDate]", outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i12.MatEndDate, selector: "input[matEndDate]", outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i12.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i13.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i13.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: DynamicCellHostDirective, selector: "[ngxDynamicCellHost]", inputs: ["component", "row", "key"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i14.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i14.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i14.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i2$4.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i16.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "pipe", type: OnlyUpperFirstCharacterPipe, name: "ngxOnlyUpperFirstCharacter" }] });
|
|
2580
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: NgxPaginatedTable, isStandalone: true, selector: "ngx-paginated-table", inputs: { endpoint: { classPropertyName: "endpoint", publicName: "endpoint", isSignal: true, isRequired: true, transformFunction: null }, filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { createClick: "createClick", updateClick: "updateClick", deleteClick: "deleteClick", rowActionClick: "rowActionClick", expandedItemChange: "expandedItemChange", selectionActionEvent: "selectionActionEvent" }, host: { listeners: { "document:keydown.escape": "onEscape()" }, classAttribute: "contenedorDefecto" }, viewQueries: [{ propertyName: "tableContentTemplate", first: true, predicate: ["tableContent"], descendants: true, isSignal: true }], ngImport: i0, template: "@if(!isFullScreen()) {\r\n <ng-container *ngTemplateOutlet=\"tableContentTemplate()\"></ng-container>\r\n}\r\n\r\n<ng-template #tableContent>\r\n <div class=\"tableContainer\" [class.inFullScreenMode]=\"isFullScreen()\">\r\n <div class=\"headerContainer\">\r\n <div class=\"titleAndButtonContainer\">\r\n <p class=\"title\">{{ config()().title() }}</p>\r\n <div class=\"buttonContainer\">\r\n @if(config()().create && (!config()().create?.show || config()().create?.show())) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"config()().create?.tooltip?.() ?? intl.createButtonLabel\" \r\n [disabled]=\"config()().create?.disabled?.()\" \r\n class=\"newButtonIcon\"\r\n (click)=\"onNewClick()\">\r\n <mat-icon>add_circle</mat-icon>\r\n </button>\r\n }\r\n\r\n <button matIconButton [matTooltip]=\"intl.editColumnsTooltip\" class=\"editColumnsButtonIcon\" (click)=\"onEditColumns()\">\r\n <mat-icon>table_edit</mat-icon>\r\n </button>\r\n\r\n @if(config()().showAdvancedFilters) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"intl.advancedFiltersLabel\"\r\n [matMenuTriggerFor]=\"advancedFiltersMenu\" \r\n #advancedFiltersMenuTrigger=\"matMenuTrigger\">\r\n\r\n <mat-icon>filter_alt</mat-icon>\r\n </button>\r\n\r\n <mat-menu #advancedFiltersMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\r\n <button mat-menu-item (click)=\"onNewAdvancedFiltersClick()\">\r\n <mat-icon>filter_alt</mat-icon>\r\n <span>{{ intl.newAdvancedFilterLabel }}</span>\r\n </button>\r\n\r\n @for (advancedFilter of advancedFilters(); track $index; let first = $first) {\r\n @if (first) {\r\n <mat-divider />\r\n }\r\n\r\n <div mat-menu-item (click)=\"onApplyTemplateClick(advancedFilter)\">\r\n <div class=\"templateContainer\"> \r\n <span>{{advancedFilter.name | ngxOnlyUpperFirstCharacter}}</span>\r\n\r\n <div class=\"buttonTemplateContainer\">\r\n <button\r\n matIconButton \r\n [matTooltip]=\"intl.getEditAdvancedFilterTooltip(advancedFilter.name | ngxOnlyUpperFirstCharacter)\"\r\n (click)=\"onAdvancedFilterUpdate($event, advancedFilter, advancedFiltersMenuTrigger)\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n\r\n <button\r\n matIconButton \r\n [matTooltip]=\"intl.getDeleteAdvancedFilterTooltip(advancedFilter.name | ngxOnlyUpperFirstCharacter)\"\r\n (click)=\"onAdvancedFilterDelete($event, advancedFiltersMenuTrigger, advancedFilter)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </mat-menu>\r\n }\r\n\r\n @if(selection().length > 0) {\r\n @if(getRowSelectionAction().length > 0) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"intl.selectionActionsTooltip\"\r\n [matMenuTriggerFor]=\"selectedRecordsMenu\">\r\n <mat-icon>event_list</mat-icon>\r\n </button>\r\n\r\n <mat-menu #selectedRecordsMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\r\n <button mat-menu-item (click)=\"uncheckAllSelection()\">\r\n <mat-icon>deselect</mat-icon>\r\n <span>{{ intl.deselectAllLabel }}</span>\r\n </button>\r\n\r\n @for (action of getRowSelectionAction(); track $index) {\r\n <button mat-menu-item (click)=\"onRowSelectionActionClick(action.id)\">\r\n <mat-icon>{{action.icon}}</mat-icon>\r\n <span>{{action.label(selection(), selection().length)}}</span>\r\n </button>\r\n }\r\n </mat-menu>\r\n } @else {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"intl.deselectAllLabel\"\r\n (click)=\"uncheckAllSelection()\">\r\n <mat-icon>deselect</mat-icon>\r\n </button>\r\n }\r\n }\r\n\r\n <button matIconButton [matTooltip]=\"intl.exportTooltip\" [matMenuTriggerFor]=\"exportMenu\">\r\n <mat-icon>download</mat-icon>\r\n </button>\r\n <mat-menu #exportMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\r\n <button mat-menu-item (click)=\"exportToCsvCurrentPage()\">\r\n <mat-icon>csv</mat-icon>\r\n <span>{{ intl.exportToExcelLabel }}</span>\r\n </button>\r\n\r\n <button mat-menu-item (click)=\"exportToPdfCurrentPage()\">\r\n <mat-icon>picture_as_pdf</mat-icon>\r\n <span>{{ intl.exportToPdfLabel }}</span>\r\n </button>\r\n </mat-menu>\r\n\r\n <button matIconButton [matTooltip]=\"isFullScreen() ? intl.exitFullscreenTooltip : intl.enterFullscreenTooltip\" (click)=\"onToggleFullScreen()\">\r\n <mat-icon>{{isFullScreen() ? 'fullscreen_exit': 'fullscreen'}}</mat-icon>\r\n </button>\r\n\r\n <ng-content select=\"[icon-buttons]\"></ng-content>\r\n </div>\r\n </div>\r\n\r\n <div class=\"filterContainer\">\r\n <div class=\"moreFiltersContainer\">\r\n <ng-content select=\"[more-filters]\"></ng-content>\r\n </div>\r\n\r\n @if(config()().showQueryFilter) {\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input #queryElement matInput [placeholder]=\"config()().queryFilterPlaceholder ?? intl.searchPlaceholder\" [value]=\"filters()().query ?? ''\" (input)=\"onQueryChange(queryElement)\">\r\n <button matIconButton matSuffix (click)=\"onQueryReset(queryElement)\" [style.visibility]=\"queryElement.value ? 'visible': 'hidden'\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n }\r\n </div>\r\n\r\n <ng-content select=\"[extra-header-content]\"></ng-content>\r\n </div>\r\n\r\n @if(filters()().advancedFilterId) {\r\n <div class=\"advancedFiltersApplied\" (click)=\"onSelectedAdvancedFilterUpdate($event)\">\r\n <p [innerHTML]=\"getAdvancedFilterLabel()\"></p>\r\n <button matIconButton [matTooltip]=\"intl.removeAdvancedFilterTooltip\" class=\"\" (click)=\"onQuitAdvancedFilter($event)\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <mat-progress-bar mode=\"indeterminate\" [style.visibility]=\"dataResource.isLoading() ? 'visible': 'hidden'\"/>\r\n\r\n <div class=\"tableOverflow\" [style.max-height]=\"config()().maxHeight && !isFullScreen() ? config()().maxHeight : null\">\r\n <table\r\n mat-table \r\n matSort\r\n [multiTemplateDataRows]=\"config()().expandableDetail\"\r\n [dataSource]=\"data()\" \r\n [matSortActive]=\"filters()().sortBy?.key ?? ''\" \r\n [matSortDirection]=\"filters()().sortBy?.direction ?? ''\"\r\n (matSortChange)=\"onSortChange($event)\">\r\n\r\n @if(config()().enableRowSelection) {\r\n @if(showFiltersRow()) {\r\n <ng-container [matColumnDef]=\"`${filterKeyPrefix}${nameOfRowSelectionColumn}`\" [sticky]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef class=\"celdaSelection\"></th>\r\n </ng-container>\r\n } \r\n\r\n <ng-container [matColumnDef]=\"nameOfRowSelectionColumn\" [sticky]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <mat-checkbox \r\n class=\"headerCheckbox\"\r\n (change)=\"$event ? toggleAllPageRowSelection() : null\"\r\n [checked]=\"selection().length > 0 && isAllPageRowSelected()\"\r\n [indeterminate]=\"selection().length > 0 && !isAllPageRowSelected()\">\r\n </mat-checkbox>\r\n </th>\r\n <td mat-cell *matCellDef=\"let row\" (click)=\"$event.stopPropagation()\" class=\"celdaSelection\">\r\n <mat-checkbox\r\n (change)=\"$event ? toggleRowSelection(row) : null\"\r\n [checked]=\"isRowSelected(row)\">\r\n </mat-checkbox>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n\r\n @if(showTotalGeneralFooter()) {\r\n <ng-container [matColumnDef]=\"`${generalFooterKeyPrefix}${nameOfRowSelectionColumn}`\" [sticky]=\"isDesktop()\">\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @for (column of config()().columns; track $index) {\r\n <ng-container \r\n [matColumnDef]=\"getKeyAsString(column.key)\" \r\n [sticky]=\"stickyColumnKey() == column.key && isDesktop()\">\r\n\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header [disabled]=\"!column.isSortable\" class=\"columnLabel\">\r\n <p class=\"headerTitle\">\r\n @if(stickyColumnKey() == column.key && isDesktop()) {\r\n <mat-icon>keep</mat-icon>\r\n }\r\n {{ column.label }}\r\n </p>\r\n </th>\r\n\r\n <td \r\n mat-cell \r\n *matCellDef=\"let row\" \r\n [class.columnSticky]=\"stickyColumnKey() == column.key && isDesktop()\"\r\n [style]=\"column.style\"\r\n class=\"celdaDatos\">\r\n\r\n @if(column.component) {\r\n <ng-container \r\n ngxDynamicCellHost\r\n [component]=\"column.component\"\r\n [row]=\"row\"\r\n [key]=\"column.key\" />\r\n } @else if(column.templateRef) {\r\n <ng-container \r\n *ngTemplateOutlet=\"column.templateRef(); \r\n context: { $implicit: row }\" />\r\n } @else if(column.valueGetter) {\r\n {{ column.valueGetter(row) }}\r\n } @else {\r\n {{ applyColumnPipes(row[column.key], column.pipes) ?? '-' }}\r\n }\r\n </td>\r\n \r\n <td \r\n mat-footer-cell \r\n *matFooterCellDef \r\n [class.columnSticky]=\"stickyColumnKey() == column.key && isDesktop()\"\r\n [style]=\"column.footerStyle\">\r\n\r\n @if(column.showTotalPerPage) {\r\n @if(column.pipes) {\r\n {{ applyColumnPipes(getTotalOfColum(column.key), column.pipes) }}\r\n } @else if(column.totalFooterFormatter) {\r\n {{ column.totalFooterFormatter(getTotalOfColum(column.key)) }}\r\n } @else {\r\n {{ getTotalOfColum(column.key) }}\r\n }\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n\r\n @if(showTotalGeneralFooter()) {\r\n @for (column of config()().columns; track $index) {\r\n <ng-container \r\n [matColumnDef]=\"`${generalFooterKeyPrefix}${getKeyAsString(column.key)}`\"\r\n [sticky]=\"stickyColumnKey() == column.key && isDesktop()\">\r\n\r\n <td mat-footer-cell *matFooterCellDef [style]=\"column.footerStyle\">\r\n @if(column.showTotalGeneral && column.getTotalGeneral) {\r\n @if(column.pipes) {\r\n {{ applyColumnPipes(column.getTotalGeneral(), column.pipes) }}\r\n } @else if(column.totalFooterFormatter) {\r\n {{ column.totalFooterFormatter(column.getTotalGeneral()) }}\r\n } @else {\r\n {{ column.getTotalGeneral() }}\r\n }\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @if(showFiltersRow()) {\r\n @for (column of config()().columns; track $index) {\r\n <ng-container \r\n [matColumnDef]=\"`${filterKeyPrefix}${getKeyAsString(column.key)}`\" \r\n [sticky]=\"stickyColumnKey() == column.key && isDesktop()\">\r\n\r\n <th mat-header-cell *matHeaderCellDef>\r\n @if (column.filterType == 'text' || column.filterType == 'number') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"inputQueryColumn\">\r\n <input [type]=\"column.filterType\" matInput [placeholder]=\"column.label\" [value]=\"getValueOfColumnFilter(column.key) ?? ''\" (input)=\"onTextFilterColumnChange(column, $event)\">\r\n <mat-icon matSuffix>{{ column.filterType == 'text' ? 'search' : 'numbers'}}</mat-icon>\r\n </mat-form-field>\r\n }\r\n\r\n @if (column.filterType == 'option' || column.filterType == 'option-multiple') {\r\n @if(column.endpointForPaginatedFilterOptions) {\r\n <ngx-paginated-searchable-select\r\n class=\"selectColumn\"\r\n [selected]=\"getPaginatedSearchableSelectValueOfColumnFilter(column.key)\"\r\n [endpoint]=\"column.endpointForPaginatedFilterOptions\"\r\n [filters]=\"column.filtersForEndpointPaginatedFilterOptions ?? defaultFiltersForPaginatedFilterOptions\"\r\n [multiple]=\"column.filterType == 'option-multiple'\"\r\n subscriptSizing=\"dynamic\"\r\n [selectPlaceholder]=\"column.label\"\r\n (optionChange)=\"onPaginatedOptionFilterColumnChange(column, $event)\"\r\n clearableOptionLabel=\"filtro\"\r\n />\r\n } @else {\r\n <ngx-searchable-select\r\n class=\"selectColumn\"\r\n [selected]=\"getSearchableSelectValueOfColumnFilter(column.key)\"\r\n [options]=\"column.filterOptions ?? []\"\r\n [multiple]=\"column.filterType == 'option-multiple'\"\r\n subscriptSizing=\"dynamic\"\r\n [selectPlaceholder]=\"column.label\"\r\n (optionChange)=\"onOptionFilterColumnChange(column, $event)\"\r\n clearableOptionLabel=\"filtro\"\r\n />\r\n }\r\n }\r\n \r\n @if(column.filterType == 'date') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"dateColumn\">\r\n <input \r\n matInput \r\n [matDatepicker]=\"picker\" \r\n [placeholder]=\"column.label\"\r\n [value]=\"getValueOfColumnFilter(column.key)\"\r\n (dateChange)=\"onDateFilterChange(column, $event.value)\">\r\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-datepicker #picker></mat-datepicker>\r\n </mat-form-field>\r\n }\r\n\r\n @if(column.filterType == 'date-range') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"dateColumn\">\r\n <mat-date-range-input [rangePicker]=\"picker\" #dateRangeInput>\r\n <input \r\n matStartDate \r\n [placeholder]=\"intl.dateRangeStartPlaceholder\"\r\n [value]=\"getDateRangeValueOfColumnFilter(column.key, 'start')\"\r\n (dateChange)=\"onDateRangeFilterChange(column, dateRangeInput.value)\">\r\n <input \r\n matEndDate \r\n [placeholder]=\"intl.dateRangeEndPlaceholder\"\r\n [value]=\"getDateRangeValueOfColumnFilter(column.key, 'end')\"\r\n (dateChange)=\"onDateRangeFilterChange(column, dateRangeInput.value)\">\r\n </mat-date-range-input>\r\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-date-range-picker #picker></mat-date-range-picker>\r\n </mat-form-field>\r\n }\r\n </th>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @if(showActionsColumn()) {\r\n @if(showFiltersRow()) {\r\n <ng-container [matColumnDef]=\"`${filterKeyPrefix}${nameOfActionsColumn}`\" [stickyEnd]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef class=\"celdaAcciones\"></th>\r\n </ng-container>\r\n } \r\n\r\n <ng-container [matColumnDef]=\"nameOfActionsColumn\" [stickyEnd]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef>{{ intl.actionsLabel }}</th>\r\n <td mat-cell *matCellDef=\"let row\" (click)=\"$event.stopPropagation()\" class=\"celdaAcciones\">\r\n <div class=\"contenedorCeldaAcciones\">\r\n @if(config()().expandableDetail) {\r\n <button \r\n matIconButton\r\n (click)=\"expandableToggle(row)\">\r\n <mat-icon>{{ rowIsExpanded(row) ? 'keyboard_arrow_up' : 'keyboard_arrow_down' }}</mat-icon>\r\n </button>\r\n }\r\n\r\n @if(config()().update && !config()().clickOnRowForUpdate && (!config()().update?.show || config()().update?.show(row))) {\r\n <button \r\n matIconButton\r\n [matTooltip]=\"config()().update?.tooltip?.(row) ?? intl.editTooltip\" \r\n [disabled]=\"config()().update?.disabled?.(row)\" \r\n class=\"editButtonIcon\"\r\n (click)=\"onUpdateClick(row, $event)\">\r\n <mat-icon>edit_square</mat-icon>\r\n </button>\r\n }\r\n \r\n @if(config()().delete && (!config()().delete?.show || config()().delete?.show(row))) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"config()().delete?.tooltip?.(row) ?? intl.deleteTooltip\" \r\n [disabled]=\"config()().delete?.disabled?.(row)\" \r\n class=\"deleteButtonIcon\"\r\n (click)=\"onDeleteClick(row, $event)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n\r\n @for (rowAction of config()().rowActions; track $index) {\r\n @if(!rowAction.show || rowAction.show(row)) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"rowAction.tooltip(row)\" \r\n [disabled]=\"rowAction.disabled?.(row)\" \r\n [class]=\"rowAction.iconColor ? `rowActionIconColor${rowAction.iconColor}` : ''\"\r\n (click)=\"onRowActionClick(row, rowAction, $event)\">\r\n <mat-icon>{{rowAction.icon}}</mat-icon>\r\n </button>\r\n } \r\n }\r\n </div>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n\r\n @if(showTotalGeneralFooter()) {\r\n <ng-container [matColumnDef]=\"`${generalFooterKeyPrefix}${nameOfActionsColumn}`\" [stickyEnd]=\"isDesktop()\">\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @if(config()().expandableDetail) {\r\n <ng-container [matColumnDef]=\"expandableColumnDef\">\r\n <td mat-cell *matCellDef=\"let row\" [attr.colspan]=\"keys().length\">\r\n <div \r\n class=\"detailWrapper\"\r\n [class.detailWrapperExpanded]=\"rowIsExpanded(row)\">\r\n <div class=\"columnDetail\">\r\n @if(config()().expandableDetailTemplateRef) {\r\n <ng-container \r\n *ngTemplateOutlet=\"config()().expandableDetailTemplateRef!(); \r\n context: { $implicit: row }\" />\r\n }\r\n </div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n }\r\n \r\n <tr mat-header-row *matHeaderRowDef=\"keys(); sticky: true\" class=\"tableHeader\"></tr>\r\n \r\n @if(showFiltersRow()) {\r\n <tr mat-header-row *matHeaderRowDef=\"keysWithFilter(); sticky: true\" class=\"filtersByColumn\"></tr>\r\n }\r\n \r\n <tr mat-row *matRowDef=\"let row; columns: keys();\" \r\n (click)=\"onRowClick(row)\" \r\n [class.rowClickEnable]=\"isRowEnabled(row)\"\r\n [class.expandableRow]=\"config()().expandableDetail\">\r\n </tr>\r\n \r\n @if(config()().expandableDetail) {\r\n <tr mat-row *matRowDef=\"let row; columns: [expandableColumnDef]\" class=\"rowDetail\"></tr>\r\n }\r\n\r\n <tr mat-footer-row \r\n *matFooterRowDef=\"showTotalPerPageFooter() ? keys() : []\" \r\n class=\"totalPerPageFooter\"\r\n [class.hideFooter]=\"!showTotalPerPageFooter()\">\r\n </tr>\r\n\r\n <tr mat-footer-row \r\n *matFooterRowDef=\"showTotalGeneralFooter() ? keysWithGeneralFooter() : []\" \r\n class=\"totalFooter\"\r\n [class.hideFooter]=\"!showTotalGeneralFooter()\">\r\n </tr>\r\n\r\n <tr class=\"mat-row\" *matNoDataRow>\r\n <td class=\"noData\" [colSpan]=\"keys().length\">{{ dataResource.isLoading() ? intl.loadingMessage : intl.noDataMessage }}</td>\r\n </tr>\r\n </table>\r\n </div>\r\n\r\n <div class=\"paginatorContainer\">\r\n <div class=\"footerLegend\">\r\n @if(showTotalPerPageFooter()) {\r\n <div class=\"legendItem\">\r\n <div class=\"legendSquare\"></div>\r\n <p>{{ intl.totalPerPageLabel }}</p> \r\n </div>\r\n }\r\n\r\n @if(showTotalGeneralFooter()) {\r\n <div class=\"legendItem\">\r\n <div class=\"legendSquare totalGeneral\"></div>\r\n <p>{{ intl.totalGeneralLabel }}</p>\r\n </div>\r\n }\r\n </div>\r\n <mat-paginator [length]=\"total()\" [pageSize]=\"filters()().pageSize\" [pageIndex]=\"filters()().pageNumber - 1\" (page)=\"onPageChange($event)\"/>\r\n </div>\r\n\r\n <ng-content select=\"[end-container]\"></ng-content>\r\n </div>\r\n</ng-template>", styles: [".tableContainer{display:flex;flex-direction:column;padding:14px;gap:10px;--mat-table-background-color: transparent;--mat-table-header-headline-color: var(--mat-sys-on-primary)}.inFullScreenMode{height:calc(100vh - 28px);width:calc(100vw - 28px);max-width:calc(100% - 28px);background:var(--mat-sys-surface)}.title{font:var(--mat-sys-title-large);margin:0;position:relative}.headerContainer{display:flex;justify-content:space-between;gap:10px;flex-direction:column}.titleAndButtonContainer{display:flex;justify-content:space-between;align-items:center;gap:20px}.buttonContainer{display:flex;gap:10px;align-items:center}.filterContainer{display:flex;flex-direction:row;align-items:center;gap:20px;justify-content:space-between}.moreFiltersContainer{display:flex;gap:20px}.editButtonIcon{--mat-icon-button-icon-color: var(--warning)}.deleteButtonIcon{--mat-icon-button-icon-color: var(--mat-sys-error)}.rowActionIconColorYellow{--mat-icon-button-icon-color: rgb(211, 211, 7)}.rowActionIconColorOrange{--mat-icon-button-icon-color: orange}.rowActionIconColorPink{--mat-icon-button-icon-color: pink}.rowActionIconColorPurple{--mat-icon-button-icon-color: purple}.rowActionIconColorGreen{--mat-icon-button-icon-color: var(--success)}.rowActionIconColorBlue{--mat-icon-button-icon-color: var(--information)}.rowActionIconColorBrown{--mat-icon-button-icon-color: brown}.rowActionIconColorSky{--mat-icon-button-icon-color: rgb(0, 247, 255)}.noData{padding:24px}.tableOverflow{overflow:auto;border-radius:10px}.columnLabel{text-wrap:nowrap}.headerTitle{display:flex;align-items:center;gap:4px}.headerTitle mat-icon{font-size:12px;width:12px;height:12px}.tableHeader{background-color:var(--mat-sys-primary)!important}.filtersByColumn{background-color:var(--mat-sys-surface)!important}.filtersByColumn th{padding:0}.celdaDatos{background-color:var(--mat-sys-surface)!important;transition:background-color .1s}.celdaAcciones,.celdaSelection{cursor:default!important;background-color:var(--mat-sys-surface)!important;transition:background-color .1s}.columnSticky{background-color:var(--mat-sys-surface)!important;transition:background-color .1s}.contenedorCeldaAcciones{display:flex;align-items:center;cursor:default!important}.rowClickEnable{cursor:pointer;transition:background-color .1s}.rowClickEnable:hover,.rowClickEnable:hover>.celdaAcciones,.rowClickEnable:hover>.celdaSelection,.rowClickEnable:hover>.celdaDatos,.rowClickEnable:hover>.columnSticky{background-color:var(--mat-sys-surface-container)!important}.inputQueryColumn,.selectColumn,.dateColumn{--mat-form-field-outlined-focus-outline-color: transparent;--mat-form-field-outlined-outline-color: transparent;--mat-form-field-outlined-hover-outline-color: transparent}.templateContainer{display:flex;align-items:center;justify-content:space-between;gap:60px}.buttonTemplateContainer{display:flex;flex-wrap:nowrap}.advancedFiltersApplied{display:flex;flex-direction:row;justify-content:space-between;gap:20px;border-radius:10px;background-color:var(--warning);color:var(--on-warning);align-items:center;margin-top:10px;padding:5px 5px 5px 15px;cursor:pointer;transition:background-color .3s}.advancedFiltersApplied:hover:not(:has(button:hover)){background-color:color-mix(in srgb,var(--warning) 80%,transparent)}.advancedFiltersApplied p{margin:0}.rowDetail{height:0}.expandableRow td{border-bottom-width:0}.detailWrapper{overflow:hidden;display:grid;grid-template-rows:0fr;grid-template-columns:100%;transition:grid-template-rows 225ms cubic-bezier(.4,0,.2,1)}.detailWrapperExpanded{grid-template-rows:1fr}.columnDetail{display:flex;flex-direction:column;min-height:0}.totalPerPageFooter{font-weight:700}.totalFooter{font-weight:700;background-color:var(--mat-sys-surface-container-highest);color:var(--mat-sys-on-surface)}.hideFooter{display:none}.paginatorContainer{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:20px;margin-top:10px}.footerLegend{display:flex;flex-direction:row;gap:30px}.footerLegend p{margin:0;font:var(--mat-sys-label-medium)}.legendItem{display:flex;flex-direction:row;align-items:center;gap:6px}.legendSquare{width:24px;height:14px;border-radius:4px;border:2px solid var(--mat-sys-on-surface)}.totalGeneral{background-color:var(--mat-sys-surface-container-highest)}.headerCheckbox{--mat-checkbox-selected-checkmark-color: var(--mat-sys-primary);--mat-checkbox-selected-focus-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-focus-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-selected-hover-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-hover-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-selected-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-pressed-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-pressed-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-focus-icon-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-focus-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-hover-icon-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-hover-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-icon-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-pressed-state-layer-color: var(--mat-sys-on-primary)}@media (max-width: 1200px){.filterContainer{flex-direction:column;align-items:normal}.moreFiltersContainer{flex-direction:column}}@media (max-width: 900px){.footerLegend{flex-direction:column;gap:6px}}@media (max-width: 700px){.paginatorContainer{flex-direction:column;align-items:flex-end}}@media (max-width: 600px){.titleAndButtonContainer{flex-direction:column;align-items:normal}}\n"], dependencies: [{ kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i2$3.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i2$3.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2$3.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i2$3.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2$3.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2$3.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i2$3.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2$3.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i2$3.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2$3.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i2$3.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i2$3.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i2$3.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i2$3.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "directive", type: i2$3.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i3$4.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i3$4.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i4$2.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i7$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i7$2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i11.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i11.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i11.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i11.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i11.MatStartDate, selector: "input[matStartDate]", outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i11.MatEndDate, selector: "input[matEndDate]", outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i11.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: DynamicCellHostDirective, selector: "[ngxDynamicCellHost]", inputs: ["component", "row", "key"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i13.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i13.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i13.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i2$2.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i15.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: PaginatedSearchableSelectComponent, selector: "ngx-paginated-searchable-select", inputs: ["control", "endpoint", "filters", "optionLabel", "compareWith", "multiple", "searchInputPlaceholder", "selectLabel", "selectPlaceholder", "clearableOptionLabel", "subscriptSizing", "clearable", "error", "selected", "disabled"], outputs: ["optionChange"] }, { kind: "component", type: SearchableSelectComponent, selector: "ngx-searchable-select", inputs: ["control", "options", "optionLabel", "optionValue", "multiple", "searchInputPlaceholder", "selectLabel", "selectPlaceholder", "clearableOptionLabel", "subscriptSizing", "clearable", "error", "selected", "disabled"], outputs: ["optionChange"] }, { kind: "pipe", type: OnlyUpperFirstCharacterPipe, name: "ngxOnlyUpperFirstCharacter" }] });
|
|
2526
2581
|
}
|
|
2527
2582
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: NgxPaginatedTable, decorators: [{
|
|
2528
2583
|
type: Component,
|
|
@@ -2543,8 +2598,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
2543
2598
|
MatMenuModule,
|
|
2544
2599
|
MatDividerModule,
|
|
2545
2600
|
OnlyUpperFirstCharacterPipe,
|
|
2546
|
-
MatCheckboxModule
|
|
2547
|
-
], host: { class: 'contenedorDefecto' }, template: "@if(!isFullScreen()) {\r\n <ng-container *ngTemplateOutlet=\"tableContentTemplate()\"></ng-container>\r\n}\r\n\r\n<ng-template #tableContent>\r\n <div class=\"tableContainer\" [class.inFullScreenMode]=\"isFullScreen()\">\r\n <div class=\"headerContainer\">\r\n <div class=\"titleAndButtonContainer\">\r\n <p class=\"title\">{{ config()().title() }}</p>\r\n <div class=\"buttonContainer\">\r\n @if(config()().create && (!config()().create?.show || config()().create?.show())) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"config()().create?.tooltip?.() ?? intl.createButtonLabel\" \r\n [disabled]=\"config()().create?.disabled?.()\" \r\n class=\"newButtonIcon\"\r\n (click)=\"onNewClick()\">\r\n <mat-icon>add_circle</mat-icon>\r\n </button>\r\n }\r\n\r\n <button matIconButton [matTooltip]=\"intl.editColumnsTooltip\" class=\"editColumnsButtonIcon\" (click)=\"onEditColumns()\">\r\n <mat-icon>table_edit</mat-icon>\r\n </button>\r\n\r\n @if(config()().showAdvancedFilters) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"intl.advancedFiltersLabel\"\r\n [matMenuTriggerFor]=\"advancedFiltersMenu\" \r\n #advancedFiltersMenuTrigger=\"matMenuTrigger\">\r\n\r\n <mat-icon>filter_alt</mat-icon>\r\n </button>\r\n\r\n <mat-menu #advancedFiltersMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\r\n <button mat-menu-item (click)=\"onNewAdvancedFiltersClick()\">\r\n <mat-icon>filter_alt</mat-icon>\r\n <span>{{ intl.newAdvancedFilterLabel }}</span>\r\n </button>\r\n\r\n @for (advancedFilter of advancedFilters(); track $index; let first = $first) {\r\n @if (first) {\r\n <mat-divider />\r\n }\r\n\r\n <div mat-menu-item (click)=\"onApplyTemplateClick(advancedFilter)\">\r\n <div class=\"templateContainer\"> \r\n <span>{{advancedFilter.name | ngxOnlyUpperFirstCharacter}}</span>\r\n\r\n <div class=\"buttonTemplateContainer\">\r\n <button\r\n matIconButton \r\n [matTooltip]=\"intl.getEditAdvancedFilterTooltip(advancedFilter.name | ngxOnlyUpperFirstCharacter)\"\r\n (click)=\"onAdvancedFilterUpdate($event, advancedFilter, advancedFiltersMenuTrigger)\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n\r\n <button\r\n matIconButton \r\n [matTooltip]=\"intl.getDeleteAdvancedFilterTooltip(advancedFilter.name | ngxOnlyUpperFirstCharacter)\"\r\n (click)=\"onAdvancedFilterDelete($event, advancedFiltersMenuTrigger, advancedFilter)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </mat-menu>\r\n }\r\n\r\n @if(selection().length > 0) {\r\n @if(getRowSelectionAction().length > 0) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"intl.selectionActionsTooltip\"\r\n [matMenuTriggerFor]=\"selectedRecordsMenu\">\r\n <mat-icon>event_list</mat-icon>\r\n </button>\r\n\r\n <mat-menu #selectedRecordsMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\r\n <button mat-menu-item (click)=\"uncheckAllSelection()\">\r\n <mat-icon>deselect</mat-icon>\r\n <span>{{ intl.deselectAllLabel }}</span>\r\n </button>\r\n\r\n @for (action of getRowSelectionAction(); track $index) {\r\n <button mat-menu-item (click)=\"onRowSelectionActionClick(action.id)\">\r\n <mat-icon>{{action.icon}}</mat-icon>\r\n <span>{{action.label(selection(), selection().length)}}</span>\r\n </button>\r\n }\r\n </mat-menu>\r\n } @else {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"intl.deselectAllLabel\"\r\n (click)=\"uncheckAllSelection()\">\r\n <mat-icon>deselect</mat-icon>\r\n </button>\r\n }\r\n }\r\n\r\n <button matIconButton [matTooltip]=\"intl.exportTooltip\" [matMenuTriggerFor]=\"exportMenu\">\r\n <mat-icon>download</mat-icon>\r\n </button>\r\n <mat-menu #exportMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\r\n <button mat-menu-item (click)=\"exportToCsvCurrentPage()\">\r\n <mat-icon>csv</mat-icon>\r\n <span>{{ intl.exportToExcelLabel }}</span>\r\n </button>\r\n\r\n <button mat-menu-item (click)=\"exportToPdfCurrentPage()\">\r\n <mat-icon>picture_as_pdf</mat-icon>\r\n <span>{{ intl.exportToPdfLabel }}</span>\r\n </button>\r\n </mat-menu>\r\n\r\n <button matIconButton [matTooltip]=\"isFullScreen() ? intl.exitFullscreenTooltip : intl.enterFullscreenTooltip\" (click)=\"onToggleFullScreen()\">\r\n <mat-icon>{{isFullScreen() ? 'fullscreen_exit': 'fullscreen'}}</mat-icon>\r\n </button>\r\n\r\n <ng-content select=\"[icon-buttons]\"></ng-content>\r\n </div>\r\n </div>\r\n\r\n <div class=\"filterContainer\">\r\n <div class=\"moreFiltersContainer\">\r\n <ng-content select=\"[more-filters]\"></ng-content>\r\n </div>\r\n\r\n @if(config()().showQueryFilter) {\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input #queryElement matInput [placeholder]=\"config()().queryFilterPlaceholder ?? intl.searchPlaceholder\" [value]=\"filters()().query ?? ''\" (input)=\"onQueryChange(queryElement)\">\r\n <button matIconButton matSuffix (click)=\"onQueryReset(queryElement)\" [style.visibility]=\"queryElement.value ? 'visible': 'hidden'\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n }\r\n </div>\r\n\r\n <ng-content select=\"[extra-header-content]\"></ng-content>\r\n </div>\r\n\r\n @if(filters()().advancedFilterId) {\r\n <div class=\"advancedFiltersApplied\" (click)=\"onSelectedAdvancedFilterUpdate($event)\">\r\n <p [innerHTML]=\"getAdvancedFilterLabel()\"></p>\r\n <button matIconButton [matTooltip]=\"intl.removeAdvancedFilterTooltip\" class=\"\" (click)=\"onQuitAdvancedFilter($event)\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <mat-progress-bar mode=\"indeterminate\" [style.visibility]=\"dataResource.isLoading() ? 'visible': 'hidden'\"/>\r\n\r\n <div class=\"tableOverflow\" [style.max-height]=\"config()().maxHeight && !isFullScreen() ? config()().maxHeight : null\">\r\n <table\r\n mat-table \r\n matSort\r\n [multiTemplateDataRows]=\"config()().expandableDetail\"\r\n [dataSource]=\"data()\" \r\n [matSortActive]=\"filters()().sortBy?.key ?? ''\" \r\n [matSortDirection]=\"filters()().sortBy?.direction ?? ''\"\r\n (matSortChange)=\"onSortChange($event)\">\r\n\r\n @if(config()().enableRowSelection) {\r\n @if(showFiltersRow()) {\r\n <ng-container [matColumnDef]=\"`${filterKeyPrefix}${nameOfRowSelectionColumn}`\" [sticky]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef class=\"celdaSelection\"></th>\r\n </ng-container>\r\n } \r\n\r\n <ng-container [matColumnDef]=\"nameOfRowSelectionColumn\" [sticky]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <mat-checkbox \r\n class=\"headerCheckbox\"\r\n (change)=\"$event ? toggleAllPageRowSelection() : null\"\r\n [checked]=\"selection().length > 0 && isAllPageRowSelected()\"\r\n [indeterminate]=\"selection().length > 0 && !isAllPageRowSelected()\">\r\n </mat-checkbox>\r\n </th>\r\n <td mat-cell *matCellDef=\"let row\" (click)=\"$event.stopPropagation()\" class=\"celdaSelection\">\r\n <mat-checkbox\r\n (change)=\"$event ? toggleRowSelection(row) : null\"\r\n [checked]=\"isRowSelected(row)\">\r\n </mat-checkbox>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n\r\n @if(showTotalGeneralFooter()) {\r\n <ng-container [matColumnDef]=\"`${generalFooterKeyPrefix}${nameOfRowSelectionColumn}`\" [sticky]=\"isDesktop()\">\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @for (column of config()().columns; track $index) {\r\n <ng-container \r\n [matColumnDef]=\"getKeyAsString(column.key)\" \r\n [sticky]=\"stickyColumnKey() == column.key && isDesktop()\">\r\n\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header [disabled]=\"!column.isSortable\" class=\"columnLabel\">\r\n <p class=\"headerTitle\">\r\n @if(stickyColumnKey() == column.key && isDesktop()) {\r\n <mat-icon>keep</mat-icon>\r\n }\r\n {{ column.label }}\r\n </p>\r\n </th>\r\n\r\n <td \r\n mat-cell \r\n *matCellDef=\"let row\" \r\n [class.columnSticky]=\"stickyColumnKey() == column.key && isDesktop()\"\r\n [ngStyle]=\"column.style\"\r\n class=\"celdaDatos\">\r\n\r\n @if(column.component) {\r\n <ng-container \r\n ngxDynamicCellHost\r\n [component]=\"column.component\"\r\n [row]=\"row\"\r\n [key]=\"column.key\" />\r\n } @else if(column.templateRef) {\r\n <ng-container \r\n *ngTemplateOutlet=\"column.templateRef(); \r\n context: { $implicit: row }\" />\r\n } @else if(column.valueGetter) {\r\n {{ column.valueGetter(row) }}\r\n } @else {\r\n {{ applyColumnPipes(row[column.key], column.pipes) ?? '-' }}\r\n }\r\n </td>\r\n \r\n <td mat-footer-cell *matFooterCellDef [ngStyle]=\"column.style\">\r\n @if(column.showTotalPerPage) {\r\n @if(column.pipes) {\r\n {{ applyColumnPipes(getTotalOfColum(column.key), column.pipes) }}\r\n } @else if(column.totalFooterFormatter) {\r\n {{ column.totalFooterFormatter(getTotalOfColum(column.key)) }}\r\n } @else {\r\n {{ getTotalOfColum(column.key) }}\r\n }\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n\r\n @if(showTotalGeneralFooter()) {\r\n @for (column of config()().columns; track $index) {\r\n <ng-container [matColumnDef]=\"`${generalFooterKeyPrefix}${getKeyAsString(column.key)}`\">\r\n <td mat-footer-cell *matFooterCellDef [ngStyle]=\"column.style\">\r\n @if(column.showTotalGeneral && column.getTotalGeneral) {\r\n @if(column.pipes) {\r\n {{ applyColumnPipes(column.getTotalGeneral(), column.pipes) }}\r\n } @else if(column.totalFooterFormatter) {\r\n {{ column.totalFooterFormatter(column.getTotalGeneral()) }}\r\n } @else {\r\n {{ column.getTotalGeneral() }}\r\n }\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @if(showFiltersRow()) {\r\n @for (column of config()().columns; track $index) {\r\n <ng-container \r\n [matColumnDef]=\"`${filterKeyPrefix}${getKeyAsString(column.key)}`\" \r\n [sticky]=\"stickyColumnKey() == column.key && isDesktop()\">\r\n\r\n <th mat-header-cell *matHeaderCellDef>\r\n @if (column.filterType == 'text' || column.filterType == 'number') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"inputQueryColumn\">\r\n <input [type]=\"column.filterType\" matInput [placeholder]=\"column.label\" [value]=\"getValueOfColumnFilter(column.key) ?? ''\" (input)=\"onTextFilterColumnChange(column, $event)\">\r\n <mat-icon matSuffix>{{ column.filterType == 'text' ? 'search' : 'numbers'}}</mat-icon>\r\n </mat-form-field>\r\n }\r\n\r\n @if (column.filterType == 'option' || column.filterType == 'option-multiple') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"selectColumn\">\r\n <mat-select\r\n [placeholder]=\"column.label\" \r\n [multiple]=\"column.filterType == 'option-multiple'\"\r\n [value]=\"getValueOfColumnFilter(column.key)\"\r\n (selectionChange)=\"onOptionFilterColumnChange(column, $event)\">\r\n \r\n @if(column.filterType == 'option') {\r\n <mat-option>{{ intl.removeFilterLabel }}</mat-option>\r\n }\r\n @for (option of column.filterOptions; track $index;) {\r\n <mat-option [value]=\"option.value\">{{option.label}}</mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n }\r\n \r\n @if(column.filterType == 'date') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"dateColumn\">\r\n <input \r\n matInput \r\n [matDatepicker]=\"picker\" \r\n [placeholder]=\"column.label\"\r\n [value]=\"getValueOfColumnFilter(column.key)\"\r\n (dateChange)=\"onDateFilterChange(column, $event.value)\">\r\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-datepicker #picker></mat-datepicker>\r\n </mat-form-field>\r\n }\r\n\r\n @if(column.filterType == 'date-range') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"dateColumn\">\r\n <mat-date-range-input [rangePicker]=\"picker\" #dateRangeInput>\r\n <input \r\n matStartDate \r\n [placeholder]=\"intl.dateRangeStartPlaceholder\"\r\n [value]=\"getDateRangeValueOfColumnFilter(column.key, 'start')\"\r\n (dateChange)=\"onDateRangeFilterChange(column, dateRangeInput.value)\">\r\n <input \r\n matEndDate \r\n [placeholder]=\"intl.dateRangeEndPlaceholder\"\r\n [value]=\"getDateRangeValueOfColumnFilter(column.key, 'end')\"\r\n (dateChange)=\"onDateRangeFilterChange(column, dateRangeInput.value)\">\r\n </mat-date-range-input>\r\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-date-range-picker #picker></mat-date-range-picker>\r\n </mat-form-field>\r\n }\r\n </th>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @if(showActionsColumn()) {\r\n @if(showFiltersRow()) {\r\n <ng-container [matColumnDef]=\"`${filterKeyPrefix}${nameOfActionsColumn}`\" [stickyEnd]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef class=\"celdaAcciones\"></th>\r\n </ng-container>\r\n } \r\n\r\n <ng-container [matColumnDef]=\"nameOfActionsColumn\" [stickyEnd]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef>{{ intl.actionsLabel }}</th>\r\n <td mat-cell *matCellDef=\"let row\" (click)=\"$event.stopPropagation()\" class=\"celdaAcciones\">\r\n <div class=\"contenedorCeldaAcciones\">\r\n @if(config()().expandableDetail) {\r\n <button \r\n matIconButton\r\n (click)=\"expandableToggle(row)\">\r\n <mat-icon>{{ rowIsExpanded(row) ? 'keyboard_arrow_up' : 'keyboard_arrow_down' }}</mat-icon>\r\n </button>\r\n }\r\n\r\n @if(config()().update && !config()().clickOnRowForUpdate && (!config()().update?.show || config()().update?.show(row))) {\r\n <button \r\n matIconButton\r\n [matTooltip]=\"config()().update?.tooltip?.(row) ?? intl.editTooltip\" \r\n [disabled]=\"config()().update?.disabled?.(row)\" \r\n class=\"editButtonIcon\"\r\n (click)=\"onUpdateClick(row, $event)\">\r\n <mat-icon>edit_square</mat-icon>\r\n </button>\r\n }\r\n \r\n @if(config()().delete && (!config()().delete?.show || config()().delete?.show(row))) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"config()().delete?.tooltip?.(row) ?? intl.deleteTooltip\" \r\n [disabled]=\"config()().delete?.disabled?.(row)\" \r\n class=\"deleteButtonIcon\"\r\n (click)=\"onDeleteClick(row, $event)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n\r\n @for (rowAction of config()().rowActions; track $index) {\r\n @if(!rowAction.show || rowAction.show(row)) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"rowAction.tooltip(row)\" \r\n [disabled]=\"rowAction.disabled?.(row)\" \r\n [class]=\"rowAction.iconColor ? `rowActionIconColor${rowAction.iconColor}` : ''\"\r\n (click)=\"onRowActionClick(row, rowAction, $event)\">\r\n <mat-icon>{{rowAction.icon}}</mat-icon>\r\n </button>\r\n } \r\n }\r\n </div>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n\r\n @if(showTotalGeneralFooter()) {\r\n <ng-container [matColumnDef]=\"`${generalFooterKeyPrefix}${nameOfActionsColumn}`\" [stickyEnd]=\"isDesktop()\">\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @if(config()().expandableDetail) {\r\n <ng-container [matColumnDef]=\"expandableColumnDef\">\r\n <td mat-cell *matCellDef=\"let row\" [attr.colspan]=\"keys().length\">\r\n <div \r\n class=\"detailWrapper\"\r\n [class.detailWrapperExpanded]=\"rowIsExpanded(row)\">\r\n <div class=\"columnDetail\">\r\n @if(config()().expandableDetailTemplateRef) {\r\n <ng-container \r\n *ngTemplateOutlet=\"config()().expandableDetailTemplateRef!(); \r\n context: { $implicit: row }\" />\r\n }\r\n </div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n }\r\n \r\n <tr mat-header-row *matHeaderRowDef=\"keys(); sticky: true\" class=\"tableHeader\"></tr>\r\n \r\n @if(showFiltersRow()) {\r\n <tr mat-header-row *matHeaderRowDef=\"keysWithFilter(); sticky: true\" class=\"filtersByColumn\"></tr>\r\n }\r\n \r\n <tr mat-row *matRowDef=\"let row; columns: keys();\" \r\n (click)=\"onRowClick(row)\" \r\n [class.rowClickEnable]=\"isRowEnabled(row)\"\r\n [class.expandableRow]=\"config()().expandableDetail\">\r\n </tr>\r\n \r\n @if(config()().expandableDetail) {\r\n <tr mat-row *matRowDef=\"let row; columns: [expandableColumnDef]\" class=\"rowDetail\"></tr>\r\n }\r\n\r\n <tr mat-footer-row \r\n *matFooterRowDef=\"showTotalPerPageFooter() ? keys() : []\" \r\n class=\"totalPerPageFooter\"\r\n [class.hideFooter]=\"!showTotalPerPageFooter()\">\r\n </tr>\r\n\r\n <tr mat-footer-row \r\n *matFooterRowDef=\"showTotalGeneralFooter() ? keysWithGeneralFooter() : []\" \r\n class=\"totalFooter\"\r\n [class.hideFooter]=\"!showTotalGeneralFooter()\">\r\n </tr>\r\n\r\n <tr class=\"mat-row\" *matNoDataRow>\r\n <td class=\"noData\" [colSpan]=\"keys().length\">{{ dataResource.isLoading() ? intl.loadingMessage : intl.noDataMessage }}</td>\r\n </tr>\r\n </table>\r\n </div>\r\n\r\n <div class=\"paginatorContainer\">\r\n <div class=\"footerLegend\">\r\n @if(showTotalPerPageFooter()) {\r\n <div class=\"legendItem\">\r\n <div class=\"legendSquare\"></div>\r\n <p>{{ intl.totalPerPageLabel }}</p> \r\n </div>\r\n }\r\n\r\n @if(showTotalGeneralFooter()) {\r\n <div class=\"legendItem\">\r\n <div class=\"legendSquare totalGeneral\"></div>\r\n <p>{{ intl.totalGeneralLabel }}</p>\r\n </div>\r\n }\r\n </div>\r\n <mat-paginator [length]=\"total()\" [pageSize]=\"filters()().pageSize\" [pageIndex]=\"filters()().pageNumber - 1\" (page)=\"onPageChange($event)\"/>\r\n </div>\r\n\r\n <ng-content select=\"[end-container]\"></ng-content>\r\n </div>\r\n</ng-template>", styles: [".tableContainer{display:flex;flex-direction:column;padding:14px;gap:10px;--mat-table-background-color: transparent;--mat-table-header-headline-color: var(--mat-sys-on-primary)}.inFullScreenMode{height:calc(100vh - 28px);width:calc(100vw - 28px);max-width:calc(100% - 28px);background:var(--mat-sys-surface)}.title{font:var(--mat-sys-title-large);margin:0;position:relative}.headerContainer{display:flex;justify-content:space-between;gap:10px;flex-direction:column}.titleAndButtonContainer{display:flex;justify-content:space-between;align-items:center;gap:20px}.buttonContainer{display:flex;gap:10px;align-items:center}.filterContainer{display:flex;flex-direction:row;align-items:center;gap:20px;justify-content:space-between}.moreFiltersContainer{display:flex;gap:20px}.editButtonIcon{--mat-icon-button-icon-color: var(--warning)}.deleteButtonIcon{--mat-icon-button-icon-color: var(--mat-sys-error)}.rowActionIconColorYellow{--mat-icon-button-icon-color: rgb(211, 211, 7)}.rowActionIconColorOrange{--mat-icon-button-icon-color: orange}.rowActionIconColorPink{--mat-icon-button-icon-color: pink}.rowActionIconColorPurple{--mat-icon-button-icon-color: purple}.rowActionIconColorGreen{--mat-icon-button-icon-color: var(--success)}.rowActionIconColorBlue{--mat-icon-button-icon-color: var(--information)}.rowActionIconColorBrown{--mat-icon-button-icon-color: brown}.rowActionIconColorSky{--mat-icon-button-icon-color: rgb(0, 247, 255)}.noData{padding:24px}.tableOverflow{overflow:auto;border-radius:10px}.columnLabel{text-wrap:nowrap}.headerTitle{display:flex;align-items:center;gap:4px}.headerTitle mat-icon{font-size:12px;width:12px;height:12px}.tableHeader{background-color:var(--mat-sys-primary)!important}.filtersByColumn{background-color:var(--mat-sys-surface)!important}.filtersByColumn th{padding:0}.celdaDatos{background-color:var(--mat-sys-surface)!important;transition:background-color .1s}.celdaAcciones,.celdaSelection{cursor:default!important;background-color:var(--mat-sys-surface)!important;transition:background-color .1s}.columnSticky{background-color:var(--mat-sys-surface)!important;transition:background-color .1s}.contenedorCeldaAcciones{display:flex;align-items:center;cursor:default!important}.rowClickEnable{cursor:pointer;transition:background-color .1s}.rowClickEnable:hover,.rowClickEnable:hover>.celdaAcciones,.rowClickEnable:hover>.celdaSelection,.rowClickEnable:hover>.celdaDatos,.rowClickEnable:hover>.columnSticky{background-color:var(--mat-sys-surface-container)!important}.inputQueryColumn,.selectColumn,.dateColumn{--mat-form-field-outlined-focus-outline-color: transparent;--mat-form-field-outlined-outline-color: transparent;--mat-form-field-outlined-hover-outline-color: transparent}.templateContainer{display:flex;align-items:center;justify-content:space-between;gap:60px}.buttonTemplateContainer{display:flex;flex-wrap:nowrap}.advancedFiltersApplied{display:flex;flex-direction:row;justify-content:space-between;gap:20px;border-radius:10px;background-color:var(--warning);color:var(--on-warning);align-items:center;margin-top:10px;padding:5px 5px 5px 15px;cursor:pointer;transition:background-color .3s}.advancedFiltersApplied:hover:not(:has(button:hover)){background-color:color-mix(in srgb,var(--warning) 80%,transparent)}.advancedFiltersApplied p{margin:0}.rowDetail{height:0}.expandableRow td{border-bottom-width:0}.detailWrapper{overflow:hidden;display:grid;grid-template-rows:0fr;grid-template-columns:100%;transition:grid-template-rows 225ms cubic-bezier(.4,0,.2,1)}.detailWrapperExpanded{grid-template-rows:1fr}.columnDetail{display:flex;flex-direction:column;min-height:0}.totalPerPageFooter{font-weight:700}.totalFooter{font-weight:700;background-color:var(--mat-sys-surface-container-highest);color:var(--mat-sys-on-surface)}.hideFooter{display:none}.paginatorContainer{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:20px;margin-top:10px}.footerLegend{display:flex;flex-direction:row;gap:30px}.footerLegend p{margin:0;font:var(--mat-sys-label-medium)}.legendItem{display:flex;flex-direction:row;align-items:center;gap:6px}.legendSquare{width:24px;height:14px;border-radius:4px;border:2px solid var(--mat-sys-on-surface)}.totalGeneral{background-color:var(--mat-sys-surface-container-highest)}.headerCheckbox{--mat-checkbox-selected-checkmark-color: var(--mat-sys-primary);--mat-checkbox-selected-focus-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-focus-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-selected-hover-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-hover-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-selected-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-pressed-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-pressed-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-focus-icon-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-focus-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-hover-icon-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-hover-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-icon-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-pressed-state-layer-color: var(--mat-sys-on-primary)}@media (max-width: 1200px){.filterContainer{flex-direction:column;align-items:normal}.moreFiltersContainer{flex-direction:column}}@media (max-width: 900px){.footerLegend{flex-direction:column;gap:6px}}@media (max-width: 700px){.paginatorContainer{flex-direction:column;align-items:flex-end}}@media (max-width: 600px){.titleAndButtonContainer{flex-direction:column;align-items:normal}}\n"] }]
|
|
2601
|
+
MatCheckboxModule,
|
|
2602
|
+
PaginatedSearchableSelectComponent,
|
|
2603
|
+
SearchableSelectComponent
|
|
2604
|
+
], host: { class: 'contenedorDefecto' }, template: "@if(!isFullScreen()) {\r\n <ng-container *ngTemplateOutlet=\"tableContentTemplate()\"></ng-container>\r\n}\r\n\r\n<ng-template #tableContent>\r\n <div class=\"tableContainer\" [class.inFullScreenMode]=\"isFullScreen()\">\r\n <div class=\"headerContainer\">\r\n <div class=\"titleAndButtonContainer\">\r\n <p class=\"title\">{{ config()().title() }}</p>\r\n <div class=\"buttonContainer\">\r\n @if(config()().create && (!config()().create?.show || config()().create?.show())) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"config()().create?.tooltip?.() ?? intl.createButtonLabel\" \r\n [disabled]=\"config()().create?.disabled?.()\" \r\n class=\"newButtonIcon\"\r\n (click)=\"onNewClick()\">\r\n <mat-icon>add_circle</mat-icon>\r\n </button>\r\n }\r\n\r\n <button matIconButton [matTooltip]=\"intl.editColumnsTooltip\" class=\"editColumnsButtonIcon\" (click)=\"onEditColumns()\">\r\n <mat-icon>table_edit</mat-icon>\r\n </button>\r\n\r\n @if(config()().showAdvancedFilters) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"intl.advancedFiltersLabel\"\r\n [matMenuTriggerFor]=\"advancedFiltersMenu\" \r\n #advancedFiltersMenuTrigger=\"matMenuTrigger\">\r\n\r\n <mat-icon>filter_alt</mat-icon>\r\n </button>\r\n\r\n <mat-menu #advancedFiltersMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\r\n <button mat-menu-item (click)=\"onNewAdvancedFiltersClick()\">\r\n <mat-icon>filter_alt</mat-icon>\r\n <span>{{ intl.newAdvancedFilterLabel }}</span>\r\n </button>\r\n\r\n @for (advancedFilter of advancedFilters(); track $index; let first = $first) {\r\n @if (first) {\r\n <mat-divider />\r\n }\r\n\r\n <div mat-menu-item (click)=\"onApplyTemplateClick(advancedFilter)\">\r\n <div class=\"templateContainer\"> \r\n <span>{{advancedFilter.name | ngxOnlyUpperFirstCharacter}}</span>\r\n\r\n <div class=\"buttonTemplateContainer\">\r\n <button\r\n matIconButton \r\n [matTooltip]=\"intl.getEditAdvancedFilterTooltip(advancedFilter.name | ngxOnlyUpperFirstCharacter)\"\r\n (click)=\"onAdvancedFilterUpdate($event, advancedFilter, advancedFiltersMenuTrigger)\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n\r\n <button\r\n matIconButton \r\n [matTooltip]=\"intl.getDeleteAdvancedFilterTooltip(advancedFilter.name | ngxOnlyUpperFirstCharacter)\"\r\n (click)=\"onAdvancedFilterDelete($event, advancedFiltersMenuTrigger, advancedFilter)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </mat-menu>\r\n }\r\n\r\n @if(selection().length > 0) {\r\n @if(getRowSelectionAction().length > 0) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"intl.selectionActionsTooltip\"\r\n [matMenuTriggerFor]=\"selectedRecordsMenu\">\r\n <mat-icon>event_list</mat-icon>\r\n </button>\r\n\r\n <mat-menu #selectedRecordsMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\r\n <button mat-menu-item (click)=\"uncheckAllSelection()\">\r\n <mat-icon>deselect</mat-icon>\r\n <span>{{ intl.deselectAllLabel }}</span>\r\n </button>\r\n\r\n @for (action of getRowSelectionAction(); track $index) {\r\n <button mat-menu-item (click)=\"onRowSelectionActionClick(action.id)\">\r\n <mat-icon>{{action.icon}}</mat-icon>\r\n <span>{{action.label(selection(), selection().length)}}</span>\r\n </button>\r\n }\r\n </mat-menu>\r\n } @else {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"intl.deselectAllLabel\"\r\n (click)=\"uncheckAllSelection()\">\r\n <mat-icon>deselect</mat-icon>\r\n </button>\r\n }\r\n }\r\n\r\n <button matIconButton [matTooltip]=\"intl.exportTooltip\" [matMenuTriggerFor]=\"exportMenu\">\r\n <mat-icon>download</mat-icon>\r\n </button>\r\n <mat-menu #exportMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\r\n <button mat-menu-item (click)=\"exportToCsvCurrentPage()\">\r\n <mat-icon>csv</mat-icon>\r\n <span>{{ intl.exportToExcelLabel }}</span>\r\n </button>\r\n\r\n <button mat-menu-item (click)=\"exportToPdfCurrentPage()\">\r\n <mat-icon>picture_as_pdf</mat-icon>\r\n <span>{{ intl.exportToPdfLabel }}</span>\r\n </button>\r\n </mat-menu>\r\n\r\n <button matIconButton [matTooltip]=\"isFullScreen() ? intl.exitFullscreenTooltip : intl.enterFullscreenTooltip\" (click)=\"onToggleFullScreen()\">\r\n <mat-icon>{{isFullScreen() ? 'fullscreen_exit': 'fullscreen'}}</mat-icon>\r\n </button>\r\n\r\n <ng-content select=\"[icon-buttons]\"></ng-content>\r\n </div>\r\n </div>\r\n\r\n <div class=\"filterContainer\">\r\n <div class=\"moreFiltersContainer\">\r\n <ng-content select=\"[more-filters]\"></ng-content>\r\n </div>\r\n\r\n @if(config()().showQueryFilter) {\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input #queryElement matInput [placeholder]=\"config()().queryFilterPlaceholder ?? intl.searchPlaceholder\" [value]=\"filters()().query ?? ''\" (input)=\"onQueryChange(queryElement)\">\r\n <button matIconButton matSuffix (click)=\"onQueryReset(queryElement)\" [style.visibility]=\"queryElement.value ? 'visible': 'hidden'\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n }\r\n </div>\r\n\r\n <ng-content select=\"[extra-header-content]\"></ng-content>\r\n </div>\r\n\r\n @if(filters()().advancedFilterId) {\r\n <div class=\"advancedFiltersApplied\" (click)=\"onSelectedAdvancedFilterUpdate($event)\">\r\n <p [innerHTML]=\"getAdvancedFilterLabel()\"></p>\r\n <button matIconButton [matTooltip]=\"intl.removeAdvancedFilterTooltip\" class=\"\" (click)=\"onQuitAdvancedFilter($event)\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <mat-progress-bar mode=\"indeterminate\" [style.visibility]=\"dataResource.isLoading() ? 'visible': 'hidden'\"/>\r\n\r\n <div class=\"tableOverflow\" [style.max-height]=\"config()().maxHeight && !isFullScreen() ? config()().maxHeight : null\">\r\n <table\r\n mat-table \r\n matSort\r\n [multiTemplateDataRows]=\"config()().expandableDetail\"\r\n [dataSource]=\"data()\" \r\n [matSortActive]=\"filters()().sortBy?.key ?? ''\" \r\n [matSortDirection]=\"filters()().sortBy?.direction ?? ''\"\r\n (matSortChange)=\"onSortChange($event)\">\r\n\r\n @if(config()().enableRowSelection) {\r\n @if(showFiltersRow()) {\r\n <ng-container [matColumnDef]=\"`${filterKeyPrefix}${nameOfRowSelectionColumn}`\" [sticky]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef class=\"celdaSelection\"></th>\r\n </ng-container>\r\n } \r\n\r\n <ng-container [matColumnDef]=\"nameOfRowSelectionColumn\" [sticky]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <mat-checkbox \r\n class=\"headerCheckbox\"\r\n (change)=\"$event ? toggleAllPageRowSelection() : null\"\r\n [checked]=\"selection().length > 0 && isAllPageRowSelected()\"\r\n [indeterminate]=\"selection().length > 0 && !isAllPageRowSelected()\">\r\n </mat-checkbox>\r\n </th>\r\n <td mat-cell *matCellDef=\"let row\" (click)=\"$event.stopPropagation()\" class=\"celdaSelection\">\r\n <mat-checkbox\r\n (change)=\"$event ? toggleRowSelection(row) : null\"\r\n [checked]=\"isRowSelected(row)\">\r\n </mat-checkbox>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n\r\n @if(showTotalGeneralFooter()) {\r\n <ng-container [matColumnDef]=\"`${generalFooterKeyPrefix}${nameOfRowSelectionColumn}`\" [sticky]=\"isDesktop()\">\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @for (column of config()().columns; track $index) {\r\n <ng-container \r\n [matColumnDef]=\"getKeyAsString(column.key)\" \r\n [sticky]=\"stickyColumnKey() == column.key && isDesktop()\">\r\n\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header [disabled]=\"!column.isSortable\" class=\"columnLabel\">\r\n <p class=\"headerTitle\">\r\n @if(stickyColumnKey() == column.key && isDesktop()) {\r\n <mat-icon>keep</mat-icon>\r\n }\r\n {{ column.label }}\r\n </p>\r\n </th>\r\n\r\n <td \r\n mat-cell \r\n *matCellDef=\"let row\" \r\n [class.columnSticky]=\"stickyColumnKey() == column.key && isDesktop()\"\r\n [style]=\"column.style\"\r\n class=\"celdaDatos\">\r\n\r\n @if(column.component) {\r\n <ng-container \r\n ngxDynamicCellHost\r\n [component]=\"column.component\"\r\n [row]=\"row\"\r\n [key]=\"column.key\" />\r\n } @else if(column.templateRef) {\r\n <ng-container \r\n *ngTemplateOutlet=\"column.templateRef(); \r\n context: { $implicit: row }\" />\r\n } @else if(column.valueGetter) {\r\n {{ column.valueGetter(row) }}\r\n } @else {\r\n {{ applyColumnPipes(row[column.key], column.pipes) ?? '-' }}\r\n }\r\n </td>\r\n \r\n <td \r\n mat-footer-cell \r\n *matFooterCellDef \r\n [class.columnSticky]=\"stickyColumnKey() == column.key && isDesktop()\"\r\n [style]=\"column.footerStyle\">\r\n\r\n @if(column.showTotalPerPage) {\r\n @if(column.pipes) {\r\n {{ applyColumnPipes(getTotalOfColum(column.key), column.pipes) }}\r\n } @else if(column.totalFooterFormatter) {\r\n {{ column.totalFooterFormatter(getTotalOfColum(column.key)) }}\r\n } @else {\r\n {{ getTotalOfColum(column.key) }}\r\n }\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n\r\n @if(showTotalGeneralFooter()) {\r\n @for (column of config()().columns; track $index) {\r\n <ng-container \r\n [matColumnDef]=\"`${generalFooterKeyPrefix}${getKeyAsString(column.key)}`\"\r\n [sticky]=\"stickyColumnKey() == column.key && isDesktop()\">\r\n\r\n <td mat-footer-cell *matFooterCellDef [style]=\"column.footerStyle\">\r\n @if(column.showTotalGeneral && column.getTotalGeneral) {\r\n @if(column.pipes) {\r\n {{ applyColumnPipes(column.getTotalGeneral(), column.pipes) }}\r\n } @else if(column.totalFooterFormatter) {\r\n {{ column.totalFooterFormatter(column.getTotalGeneral()) }}\r\n } @else {\r\n {{ column.getTotalGeneral() }}\r\n }\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @if(showFiltersRow()) {\r\n @for (column of config()().columns; track $index) {\r\n <ng-container \r\n [matColumnDef]=\"`${filterKeyPrefix}${getKeyAsString(column.key)}`\" \r\n [sticky]=\"stickyColumnKey() == column.key && isDesktop()\">\r\n\r\n <th mat-header-cell *matHeaderCellDef>\r\n @if (column.filterType == 'text' || column.filterType == 'number') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"inputQueryColumn\">\r\n <input [type]=\"column.filterType\" matInput [placeholder]=\"column.label\" [value]=\"getValueOfColumnFilter(column.key) ?? ''\" (input)=\"onTextFilterColumnChange(column, $event)\">\r\n <mat-icon matSuffix>{{ column.filterType == 'text' ? 'search' : 'numbers'}}</mat-icon>\r\n </mat-form-field>\r\n }\r\n\r\n @if (column.filterType == 'option' || column.filterType == 'option-multiple') {\r\n @if(column.endpointForPaginatedFilterOptions) {\r\n <ngx-paginated-searchable-select\r\n class=\"selectColumn\"\r\n [selected]=\"getPaginatedSearchableSelectValueOfColumnFilter(column.key)\"\r\n [endpoint]=\"column.endpointForPaginatedFilterOptions\"\r\n [filters]=\"column.filtersForEndpointPaginatedFilterOptions ?? defaultFiltersForPaginatedFilterOptions\"\r\n [multiple]=\"column.filterType == 'option-multiple'\"\r\n subscriptSizing=\"dynamic\"\r\n [selectPlaceholder]=\"column.label\"\r\n (optionChange)=\"onPaginatedOptionFilterColumnChange(column, $event)\"\r\n clearableOptionLabel=\"filtro\"\r\n />\r\n } @else {\r\n <ngx-searchable-select\r\n class=\"selectColumn\"\r\n [selected]=\"getSearchableSelectValueOfColumnFilter(column.key)\"\r\n [options]=\"column.filterOptions ?? []\"\r\n [multiple]=\"column.filterType == 'option-multiple'\"\r\n subscriptSizing=\"dynamic\"\r\n [selectPlaceholder]=\"column.label\"\r\n (optionChange)=\"onOptionFilterColumnChange(column, $event)\"\r\n clearableOptionLabel=\"filtro\"\r\n />\r\n }\r\n }\r\n \r\n @if(column.filterType == 'date') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"dateColumn\">\r\n <input \r\n matInput \r\n [matDatepicker]=\"picker\" \r\n [placeholder]=\"column.label\"\r\n [value]=\"getValueOfColumnFilter(column.key)\"\r\n (dateChange)=\"onDateFilterChange(column, $event.value)\">\r\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-datepicker #picker></mat-datepicker>\r\n </mat-form-field>\r\n }\r\n\r\n @if(column.filterType == 'date-range') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"dateColumn\">\r\n <mat-date-range-input [rangePicker]=\"picker\" #dateRangeInput>\r\n <input \r\n matStartDate \r\n [placeholder]=\"intl.dateRangeStartPlaceholder\"\r\n [value]=\"getDateRangeValueOfColumnFilter(column.key, 'start')\"\r\n (dateChange)=\"onDateRangeFilterChange(column, dateRangeInput.value)\">\r\n <input \r\n matEndDate \r\n [placeholder]=\"intl.dateRangeEndPlaceholder\"\r\n [value]=\"getDateRangeValueOfColumnFilter(column.key, 'end')\"\r\n (dateChange)=\"onDateRangeFilterChange(column, dateRangeInput.value)\">\r\n </mat-date-range-input>\r\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-date-range-picker #picker></mat-date-range-picker>\r\n </mat-form-field>\r\n }\r\n </th>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @if(showActionsColumn()) {\r\n @if(showFiltersRow()) {\r\n <ng-container [matColumnDef]=\"`${filterKeyPrefix}${nameOfActionsColumn}`\" [stickyEnd]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef class=\"celdaAcciones\"></th>\r\n </ng-container>\r\n } \r\n\r\n <ng-container [matColumnDef]=\"nameOfActionsColumn\" [stickyEnd]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef>{{ intl.actionsLabel }}</th>\r\n <td mat-cell *matCellDef=\"let row\" (click)=\"$event.stopPropagation()\" class=\"celdaAcciones\">\r\n <div class=\"contenedorCeldaAcciones\">\r\n @if(config()().expandableDetail) {\r\n <button \r\n matIconButton\r\n (click)=\"expandableToggle(row)\">\r\n <mat-icon>{{ rowIsExpanded(row) ? 'keyboard_arrow_up' : 'keyboard_arrow_down' }}</mat-icon>\r\n </button>\r\n }\r\n\r\n @if(config()().update && !config()().clickOnRowForUpdate && (!config()().update?.show || config()().update?.show(row))) {\r\n <button \r\n matIconButton\r\n [matTooltip]=\"config()().update?.tooltip?.(row) ?? intl.editTooltip\" \r\n [disabled]=\"config()().update?.disabled?.(row)\" \r\n class=\"editButtonIcon\"\r\n (click)=\"onUpdateClick(row, $event)\">\r\n <mat-icon>edit_square</mat-icon>\r\n </button>\r\n }\r\n \r\n @if(config()().delete && (!config()().delete?.show || config()().delete?.show(row))) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"config()().delete?.tooltip?.(row) ?? intl.deleteTooltip\" \r\n [disabled]=\"config()().delete?.disabled?.(row)\" \r\n class=\"deleteButtonIcon\"\r\n (click)=\"onDeleteClick(row, $event)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n\r\n @for (rowAction of config()().rowActions; track $index) {\r\n @if(!rowAction.show || rowAction.show(row)) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"rowAction.tooltip(row)\" \r\n [disabled]=\"rowAction.disabled?.(row)\" \r\n [class]=\"rowAction.iconColor ? `rowActionIconColor${rowAction.iconColor}` : ''\"\r\n (click)=\"onRowActionClick(row, rowAction, $event)\">\r\n <mat-icon>{{rowAction.icon}}</mat-icon>\r\n </button>\r\n } \r\n }\r\n </div>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n\r\n @if(showTotalGeneralFooter()) {\r\n <ng-container [matColumnDef]=\"`${generalFooterKeyPrefix}${nameOfActionsColumn}`\" [stickyEnd]=\"isDesktop()\">\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @if(config()().expandableDetail) {\r\n <ng-container [matColumnDef]=\"expandableColumnDef\">\r\n <td mat-cell *matCellDef=\"let row\" [attr.colspan]=\"keys().length\">\r\n <div \r\n class=\"detailWrapper\"\r\n [class.detailWrapperExpanded]=\"rowIsExpanded(row)\">\r\n <div class=\"columnDetail\">\r\n @if(config()().expandableDetailTemplateRef) {\r\n <ng-container \r\n *ngTemplateOutlet=\"config()().expandableDetailTemplateRef!(); \r\n context: { $implicit: row }\" />\r\n }\r\n </div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n }\r\n \r\n <tr mat-header-row *matHeaderRowDef=\"keys(); sticky: true\" class=\"tableHeader\"></tr>\r\n \r\n @if(showFiltersRow()) {\r\n <tr mat-header-row *matHeaderRowDef=\"keysWithFilter(); sticky: true\" class=\"filtersByColumn\"></tr>\r\n }\r\n \r\n <tr mat-row *matRowDef=\"let row; columns: keys();\" \r\n (click)=\"onRowClick(row)\" \r\n [class.rowClickEnable]=\"isRowEnabled(row)\"\r\n [class.expandableRow]=\"config()().expandableDetail\">\r\n </tr>\r\n \r\n @if(config()().expandableDetail) {\r\n <tr mat-row *matRowDef=\"let row; columns: [expandableColumnDef]\" class=\"rowDetail\"></tr>\r\n }\r\n\r\n <tr mat-footer-row \r\n *matFooterRowDef=\"showTotalPerPageFooter() ? keys() : []\" \r\n class=\"totalPerPageFooter\"\r\n [class.hideFooter]=\"!showTotalPerPageFooter()\">\r\n </tr>\r\n\r\n <tr mat-footer-row \r\n *matFooterRowDef=\"showTotalGeneralFooter() ? keysWithGeneralFooter() : []\" \r\n class=\"totalFooter\"\r\n [class.hideFooter]=\"!showTotalGeneralFooter()\">\r\n </tr>\r\n\r\n <tr class=\"mat-row\" *matNoDataRow>\r\n <td class=\"noData\" [colSpan]=\"keys().length\">{{ dataResource.isLoading() ? intl.loadingMessage : intl.noDataMessage }}</td>\r\n </tr>\r\n </table>\r\n </div>\r\n\r\n <div class=\"paginatorContainer\">\r\n <div class=\"footerLegend\">\r\n @if(showTotalPerPageFooter()) {\r\n <div class=\"legendItem\">\r\n <div class=\"legendSquare\"></div>\r\n <p>{{ intl.totalPerPageLabel }}</p> \r\n </div>\r\n }\r\n\r\n @if(showTotalGeneralFooter()) {\r\n <div class=\"legendItem\">\r\n <div class=\"legendSquare totalGeneral\"></div>\r\n <p>{{ intl.totalGeneralLabel }}</p>\r\n </div>\r\n }\r\n </div>\r\n <mat-paginator [length]=\"total()\" [pageSize]=\"filters()().pageSize\" [pageIndex]=\"filters()().pageNumber - 1\" (page)=\"onPageChange($event)\"/>\r\n </div>\r\n\r\n <ng-content select=\"[end-container]\"></ng-content>\r\n </div>\r\n</ng-template>", styles: [".tableContainer{display:flex;flex-direction:column;padding:14px;gap:10px;--mat-table-background-color: transparent;--mat-table-header-headline-color: var(--mat-sys-on-primary)}.inFullScreenMode{height:calc(100vh - 28px);width:calc(100vw - 28px);max-width:calc(100% - 28px);background:var(--mat-sys-surface)}.title{font:var(--mat-sys-title-large);margin:0;position:relative}.headerContainer{display:flex;justify-content:space-between;gap:10px;flex-direction:column}.titleAndButtonContainer{display:flex;justify-content:space-between;align-items:center;gap:20px}.buttonContainer{display:flex;gap:10px;align-items:center}.filterContainer{display:flex;flex-direction:row;align-items:center;gap:20px;justify-content:space-between}.moreFiltersContainer{display:flex;gap:20px}.editButtonIcon{--mat-icon-button-icon-color: var(--warning)}.deleteButtonIcon{--mat-icon-button-icon-color: var(--mat-sys-error)}.rowActionIconColorYellow{--mat-icon-button-icon-color: rgb(211, 211, 7)}.rowActionIconColorOrange{--mat-icon-button-icon-color: orange}.rowActionIconColorPink{--mat-icon-button-icon-color: pink}.rowActionIconColorPurple{--mat-icon-button-icon-color: purple}.rowActionIconColorGreen{--mat-icon-button-icon-color: var(--success)}.rowActionIconColorBlue{--mat-icon-button-icon-color: var(--information)}.rowActionIconColorBrown{--mat-icon-button-icon-color: brown}.rowActionIconColorSky{--mat-icon-button-icon-color: rgb(0, 247, 255)}.noData{padding:24px}.tableOverflow{overflow:auto;border-radius:10px}.columnLabel{text-wrap:nowrap}.headerTitle{display:flex;align-items:center;gap:4px}.headerTitle mat-icon{font-size:12px;width:12px;height:12px}.tableHeader{background-color:var(--mat-sys-primary)!important}.filtersByColumn{background-color:var(--mat-sys-surface)!important}.filtersByColumn th{padding:0}.celdaDatos{background-color:var(--mat-sys-surface)!important;transition:background-color .1s}.celdaAcciones,.celdaSelection{cursor:default!important;background-color:var(--mat-sys-surface)!important;transition:background-color .1s}.columnSticky{background-color:var(--mat-sys-surface)!important;transition:background-color .1s}.contenedorCeldaAcciones{display:flex;align-items:center;cursor:default!important}.rowClickEnable{cursor:pointer;transition:background-color .1s}.rowClickEnable:hover,.rowClickEnable:hover>.celdaAcciones,.rowClickEnable:hover>.celdaSelection,.rowClickEnable:hover>.celdaDatos,.rowClickEnable:hover>.columnSticky{background-color:var(--mat-sys-surface-container)!important}.inputQueryColumn,.selectColumn,.dateColumn{--mat-form-field-outlined-focus-outline-color: transparent;--mat-form-field-outlined-outline-color: transparent;--mat-form-field-outlined-hover-outline-color: transparent}.templateContainer{display:flex;align-items:center;justify-content:space-between;gap:60px}.buttonTemplateContainer{display:flex;flex-wrap:nowrap}.advancedFiltersApplied{display:flex;flex-direction:row;justify-content:space-between;gap:20px;border-radius:10px;background-color:var(--warning);color:var(--on-warning);align-items:center;margin-top:10px;padding:5px 5px 5px 15px;cursor:pointer;transition:background-color .3s}.advancedFiltersApplied:hover:not(:has(button:hover)){background-color:color-mix(in srgb,var(--warning) 80%,transparent)}.advancedFiltersApplied p{margin:0}.rowDetail{height:0}.expandableRow td{border-bottom-width:0}.detailWrapper{overflow:hidden;display:grid;grid-template-rows:0fr;grid-template-columns:100%;transition:grid-template-rows 225ms cubic-bezier(.4,0,.2,1)}.detailWrapperExpanded{grid-template-rows:1fr}.columnDetail{display:flex;flex-direction:column;min-height:0}.totalPerPageFooter{font-weight:700}.totalFooter{font-weight:700;background-color:var(--mat-sys-surface-container-highest);color:var(--mat-sys-on-surface)}.hideFooter{display:none}.paginatorContainer{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:20px;margin-top:10px}.footerLegend{display:flex;flex-direction:row;gap:30px}.footerLegend p{margin:0;font:var(--mat-sys-label-medium)}.legendItem{display:flex;flex-direction:row;align-items:center;gap:6px}.legendSquare{width:24px;height:14px;border-radius:4px;border:2px solid var(--mat-sys-on-surface)}.totalGeneral{background-color:var(--mat-sys-surface-container-highest)}.headerCheckbox{--mat-checkbox-selected-checkmark-color: var(--mat-sys-primary);--mat-checkbox-selected-focus-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-focus-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-selected-hover-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-hover-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-selected-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-pressed-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-pressed-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-focus-icon-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-focus-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-hover-icon-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-hover-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-icon-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-pressed-state-layer-color: var(--mat-sys-on-primary)}@media (max-width: 1200px){.filterContainer{flex-direction:column;align-items:normal}.moreFiltersContainer{flex-direction:column}}@media (max-width: 900px){.footerLegend{flex-direction:column;gap:6px}}@media (max-width: 700px){.paginatorContainer{flex-direction:column;align-items:flex-end}}@media (max-width: 600px){.titleAndButtonContainer{flex-direction:column;align-items:normal}}\n"] }]
|
|
2548
2605
|
}], ctorParameters: () => [{ type: NgxPaginatedTableIntl, decorators: [{
|
|
2549
2606
|
type: Optional
|
|
2550
2607
|
}] }], propDecorators: { endpoint: [{ type: i0.Input, args: [{ isSignal: true, alias: "endpoint", required: true }] }], filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], createClick: [{ type: i0.Output, args: ["createClick"] }], updateClick: [{ type: i0.Output, args: ["updateClick"] }], deleteClick: [{ type: i0.Output, args: ["deleteClick"] }], rowActionClick: [{ type: i0.Output, args: ["rowActionClick"] }], expandedItemChange: [{ type: i0.Output, args: ["expandedItemChange"] }], selectionActionEvent: [{ type: i0.Output, args: ["selectionActionEvent"] }], tableContentTemplate: [{ type: i0.ViewChild, args: ['tableContent', { isSignal: true }] }], onEscape: [{
|
|
@@ -2552,52 +2609,628 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
2552
2609
|
args: ['document:keydown.escape']
|
|
2553
2610
|
}] } });
|
|
2554
2611
|
|
|
2555
|
-
class
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2612
|
+
class NgxBasicTableComponent {
|
|
2613
|
+
columnConfigService = inject(ColumnConfigService);
|
|
2614
|
+
dialog = inject(MatDialog);
|
|
2615
|
+
datosPantallaService = inject(DatosPantallaService);
|
|
2616
|
+
isDesktop = computed(() => this.datosPantallaService.pantalla()?.tipo == 'escritorio', ...(ngDevMode ? [{ debugName: "isDesktop" }] : []));
|
|
2617
|
+
filters = input(signal({
|
|
2618
|
+
query: undefined,
|
|
2619
|
+
sortBy: undefined,
|
|
2620
|
+
columnsFiltersValue: undefined
|
|
2621
|
+
}), ...(ngDevMode ? [{ debugName: "filters" }] : []));
|
|
2622
|
+
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
2623
|
+
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
2624
|
+
loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
2625
|
+
queryFilter = input(...(ngDevMode ? [undefined, { debugName: "queryFilter" }] : []));
|
|
2626
|
+
moreFilters = input((data, _) => {
|
|
2627
|
+
return data;
|
|
2628
|
+
}, ...(ngDevMode ? [{ debugName: "moreFilters" }] : []));
|
|
2629
|
+
createClick = output();
|
|
2630
|
+
updateClick = output();
|
|
2631
|
+
deleteClick = output();
|
|
2632
|
+
rowActionClick = output();
|
|
2633
|
+
expandedItemChange = output();
|
|
2634
|
+
selectionActionEvent = output();
|
|
2635
|
+
dataSource = computed(() => {
|
|
2636
|
+
const data = this.data();
|
|
2637
|
+
const paginator = this.paginator();
|
|
2638
|
+
const dataSource = new MatTableDataSource(data);
|
|
2639
|
+
if (paginator)
|
|
2640
|
+
dataSource.paginator = paginator;
|
|
2641
|
+
return dataSource;
|
|
2642
|
+
}, ...(ngDevMode ? [{ debugName: "dataSource" }] : []));
|
|
2643
|
+
filtersEffect = effect(() => {
|
|
2644
|
+
let data = this.data();
|
|
2645
|
+
const filters = this.filters()();
|
|
2646
|
+
const config = this.config()();
|
|
2647
|
+
const queryFilter = this.queryFilter();
|
|
2648
|
+
const moreFilters = this.moreFilters();
|
|
2649
|
+
if (queryFilter)
|
|
2650
|
+
data = queryFilter(filters.query ?? '', data);
|
|
2651
|
+
else if (this.someColumnFilterable(config.columns))
|
|
2652
|
+
data = this.applyInputFilter(config.columns, data, filters.query);
|
|
2653
|
+
data = this.applySort(data, config.columns, filters.sortBy);
|
|
2654
|
+
data = this.applyColumnFilter(data, config.columns, filters.columnsFiltersValue);
|
|
2655
|
+
data = moreFilters(data, filters);
|
|
2656
|
+
this.dataSource().data = data;
|
|
2657
|
+
}, ...(ngDevMode ? [{ debugName: "filtersEffect" }] : []));
|
|
2658
|
+
columnConfig = computed(() => {
|
|
2659
|
+
const columnConfigs = this.columnConfigService.columnConfigs();
|
|
2660
|
+
const configValue = this.config()();
|
|
2661
|
+
const columnConfig = columnConfigs[configValue.tableId];
|
|
2662
|
+
const defaultColumnConfig = configValue.columns.map(column => {
|
|
2663
|
+
return {
|
|
2664
|
+
key: column.key,
|
|
2665
|
+
show: true,
|
|
2666
|
+
isSticky: configValue.defaultStickyColumn == column.key
|
|
2667
|
+
};
|
|
2668
|
+
});
|
|
2669
|
+
if (!columnConfig)
|
|
2670
|
+
return defaultColumnConfig;
|
|
2671
|
+
//Por si acaso se quitan columnas a posteriori, hay que filtrarlas para que no aparezcan
|
|
2672
|
+
const filteredColumns = columnConfig.filter(column => this.includeInColumnConfig(column, defaultColumnConfig));
|
|
2673
|
+
//Por si a posteriori se añaden nuevas columnas
|
|
2674
|
+
const columnsAdded = defaultColumnConfig.filter(defaultColumn => !this.includeInColumnConfig(defaultColumn, columnConfig));
|
|
2675
|
+
return [...filteredColumns, ...columnsAdded];
|
|
2676
|
+
}, ...(ngDevMode ? [{ debugName: "columnConfig" }] : []));
|
|
2677
|
+
filterKeyPrefix = 'filter';
|
|
2678
|
+
nameOfActionsColumn = 'actionsPerRow';
|
|
2679
|
+
generalFooterKeyPrefix = 'footer';
|
|
2680
|
+
nameOfRowSelectionColumn = 'rowSelectionColumn';
|
|
2681
|
+
stickyColumnKey = computed(() => this.columnConfig().find(c => c.isSticky)?.key, ...(ngDevMode ? [{ debugName: "stickyColumnKey" }] : []));
|
|
2682
|
+
keys = computed(() => {
|
|
2683
|
+
const configValue = this.config()();
|
|
2684
|
+
const columnConfig = this.columnConfig();
|
|
2685
|
+
let keys = [...columnConfig]
|
|
2686
|
+
.filter(column => column.show)
|
|
2687
|
+
.map(column => column.key);
|
|
2688
|
+
if ((configValue.update && !configValue.clickOnRowForUpdate)
|
|
2689
|
+
|| configValue.delete
|
|
2690
|
+
|| (configValue.rowActions && configValue.rowActions.length > 0)
|
|
2691
|
+
|| configValue.expandableDetail) {
|
|
2692
|
+
keys = [...keys, this.nameOfActionsColumn];
|
|
2693
|
+
}
|
|
2694
|
+
if (configValue.enableRowSelection)
|
|
2695
|
+
keys = [this.nameOfRowSelectionColumn, ...keys];
|
|
2696
|
+
return keys;
|
|
2697
|
+
}, ...(ngDevMode ? [{ debugName: "keys" }] : []));
|
|
2698
|
+
keysWithFilter = computed(() => this.keys().map(key => `${this.filterKeyPrefix}${this.getKeyAsString(key)}`), ...(ngDevMode ? [{ debugName: "keysWithFilter" }] : []));
|
|
2699
|
+
keysWithGeneralFooter = computed(() => this.keys().map(key => `${this.generalFooterKeyPrefix}${this.getKeyAsString(key)}`), ...(ngDevMode ? [{ debugName: "keysWithGeneralFooter" }] : []));
|
|
2700
|
+
showFiltersRow = computed(() => {
|
|
2701
|
+
const configValue = this.config()();
|
|
2702
|
+
return [...configValue.columns].some(column => column.filterType);
|
|
2703
|
+
}, ...(ngDevMode ? [{ debugName: "showFiltersRow" }] : []));
|
|
2704
|
+
showActionsColumn = computed(() => this.keys().includes(this.nameOfActionsColumn), ...(ngDevMode ? [{ debugName: "showActionsColumn" }] : []));
|
|
2705
|
+
showTotalPerPageFooter = computed(() => {
|
|
2706
|
+
const columns = this.config()().columns;
|
|
2707
|
+
const keys = this.keys();
|
|
2708
|
+
return keys.some(key => columns.find(column => key == column.key)?.showTotalPerPage);
|
|
2709
|
+
}, ...(ngDevMode ? [{ debugName: "showTotalPerPageFooter" }] : []));
|
|
2710
|
+
showTotalGeneralFooter = computed(() => {
|
|
2711
|
+
const columns = this.config()().columns;
|
|
2712
|
+
const keys = this.keys();
|
|
2713
|
+
return keys.some(key => columns.find(column => key == column.key)?.showTotalGeneral);
|
|
2714
|
+
}, ...(ngDevMode ? [{ debugName: "showTotalGeneralFooter" }] : []));
|
|
2715
|
+
showQueryFilter = computed(() => {
|
|
2716
|
+
const queryFilter = this.queryFilter();
|
|
2717
|
+
const config = this.config()();
|
|
2718
|
+
if (queryFilter)
|
|
2719
|
+
return true;
|
|
2720
|
+
return this.someColumnFilterable(config.columns);
|
|
2721
|
+
}, ...(ngDevMode ? [{ debugName: "showQueryFilter" }] : []));
|
|
2722
|
+
tableContentTemplate = viewChild('tableContent', ...(ngDevMode ? [{ debugName: "tableContentTemplate" }] : []));
|
|
2723
|
+
isFullScreen = signal(false, ...(ngDevMode ? [{ debugName: "isFullScreen" }] : []));
|
|
2724
|
+
overlayRef;
|
|
2725
|
+
portal;
|
|
2726
|
+
overlay = inject(Overlay);
|
|
2727
|
+
overlayContainer = inject(OverlayContainer);
|
|
2728
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
2729
|
+
selection = signal([], ...(ngDevMode ? [{ debugName: "selection" }] : []));
|
|
2730
|
+
expandableColumnDef = 'expandedDetail';
|
|
2731
|
+
expandedItem = signal(null, ...(ngDevMode ? [{ debugName: "expandedItem" }] : []));
|
|
2732
|
+
paginator = viewChild(MatPaginator, ...(ngDevMode ? [{ debugName: "paginator" }] : []));
|
|
2733
|
+
defaultFiltersForPaginatedFilterOptions = signal({
|
|
2734
|
+
pageNumber: 1,
|
|
2735
|
+
pageSize: 20,
|
|
2736
|
+
query: undefined
|
|
2737
|
+
}, ...(ngDevMode ? [{ debugName: "defaultFiltersForPaginatedFilterOptions" }] : []));
|
|
2738
|
+
getKeyAsString = (columnKey) => columnKey;
|
|
2739
|
+
includeInColumnConfig(searchedColumn, allColumns) {
|
|
2740
|
+
return allColumns.some(column => searchedColumn.key == column.key);
|
|
2741
|
+
}
|
|
2742
|
+
onEscape() {
|
|
2743
|
+
if (this.overlayRef && this.isMyOverlayOnTop())
|
|
2744
|
+
this.exitFullscreen();
|
|
2745
|
+
}
|
|
2746
|
+
someColumnFilterable(columns) {
|
|
2747
|
+
return columns.some((column) => column.isFilterableByInput === true);
|
|
2748
|
+
}
|
|
2749
|
+
applyInputFilter(columns, data, query) {
|
|
2750
|
+
if (!query)
|
|
2751
|
+
return data;
|
|
2752
|
+
const filterableColumns = columns.filter(c => c.isFilterableByInput);
|
|
2753
|
+
return data.filter(item => filterableColumns.some(column => {
|
|
2754
|
+
const value = item[column.key];
|
|
2755
|
+
return typeof value === 'string' && includeNoSensible(value, query);
|
|
2756
|
+
}));
|
|
2757
|
+
}
|
|
2758
|
+
applySort(data, columns, sortBy) {
|
|
2759
|
+
if (!sortBy)
|
|
2760
|
+
return data;
|
|
2761
|
+
const column = columns.find(c => c.key === sortBy.key);
|
|
2762
|
+
if (!column || column.sortType === undefined)
|
|
2763
|
+
return data;
|
|
2764
|
+
const { key, direction } = sortBy;
|
|
2765
|
+
const factor = direction === 'asc' ? 1 : -1;
|
|
2766
|
+
return [...data].sort((a, b) => {
|
|
2767
|
+
const aValue = a[key];
|
|
2768
|
+
const bValue = b[key];
|
|
2769
|
+
if (aValue == null && bValue == null)
|
|
2770
|
+
return 0;
|
|
2771
|
+
if (aValue == null)
|
|
2772
|
+
return -1 * factor;
|
|
2773
|
+
if (bValue == null)
|
|
2774
|
+
return 1 * factor;
|
|
2775
|
+
switch (column.sortType) {
|
|
2776
|
+
case 'number':
|
|
2777
|
+
return (Number(aValue) - Number(bValue)) * factor;
|
|
2778
|
+
case 'date':
|
|
2779
|
+
return (Date.parse(aValue) - Date.parse(bValue)) * factor;
|
|
2780
|
+
case 'string':
|
|
2781
|
+
default:
|
|
2782
|
+
if (column.sortByKey) {
|
|
2783
|
+
const aObjectString = column.sortByKey(a) ?? '';
|
|
2784
|
+
const bObjectString = column.sortByKey(b) ?? '';
|
|
2785
|
+
return aObjectString.localeCompare(bObjectString) * factor;
|
|
2786
|
+
}
|
|
2787
|
+
return String(aValue).localeCompare(String(bValue)) * factor;
|
|
2788
|
+
}
|
|
2789
|
+
});
|
|
2790
|
+
}
|
|
2791
|
+
applyColumnFilter(data, columns, columnsFiltersValue) {
|
|
2792
|
+
if (!this.showFiltersRow() || !columnsFiltersValue)
|
|
2793
|
+
return data;
|
|
2794
|
+
columns.forEach(column => {
|
|
2795
|
+
const columnFilterValue = columnsFiltersValue[column.key];
|
|
2796
|
+
if (columnFilterValue) {
|
|
2797
|
+
switch (column.filterType) {
|
|
2798
|
+
case 'number':
|
|
2799
|
+
case 'option':
|
|
2800
|
+
const filterValue = isFilterOption(columnFilterValue) ? columnFilterValue.value : columnFilterValue;
|
|
2801
|
+
data = data.filter(d => {
|
|
2802
|
+
const columnValue = column.filterByKey?.(d) ?? d[column.key];
|
|
2803
|
+
return columnValue == filterValue;
|
|
2804
|
+
});
|
|
2805
|
+
break;
|
|
2806
|
+
case 'text':
|
|
2807
|
+
const query = columnFilterValue;
|
|
2808
|
+
data = data.filter(d => {
|
|
2809
|
+
const word = (column.filterByKey?.(d) ?? d[column.key] ?? '');
|
|
2810
|
+
return includeNoSensible(word, query);
|
|
2811
|
+
});
|
|
2812
|
+
break;
|
|
2813
|
+
case 'option-multiple':
|
|
2814
|
+
if (!Array.isArray(columnFilterValue) || columnFilterValue.length <= 0)
|
|
2815
|
+
break;
|
|
2816
|
+
data = data.filter(d => {
|
|
2817
|
+
const columnValue = column.filterByKey?.(d) ?? d[column.key];
|
|
2818
|
+
return columnFilterValue.some(f => {
|
|
2819
|
+
const columnValueString = isFilterOption(f) ? f.value : f;
|
|
2820
|
+
return columnValueString == columnValue;
|
|
2821
|
+
});
|
|
2822
|
+
});
|
|
2823
|
+
break;
|
|
2824
|
+
case 'date':
|
|
2825
|
+
const date = columnFilterValue;
|
|
2826
|
+
data = data.filter(d => {
|
|
2827
|
+
const value = d[column.key];
|
|
2828
|
+
if (typeof value !== 'string')
|
|
2829
|
+
return false;
|
|
2830
|
+
const momentValue = moment.utc(value);
|
|
2831
|
+
return date.isSame(momentValue, 'day');
|
|
2832
|
+
});
|
|
2833
|
+
break;
|
|
2834
|
+
case 'date-range':
|
|
2835
|
+
const dateRange = columnFilterValue;
|
|
2836
|
+
if (dateRange.start != null || dateRange.end != null) {
|
|
2837
|
+
data = data.filter(d => {
|
|
2838
|
+
const value = d[column.key];
|
|
2839
|
+
if (typeof value !== 'string')
|
|
2840
|
+
return false;
|
|
2841
|
+
const momentValue = moment.utc(value);
|
|
2842
|
+
if (dateRange.start && dateRange.end)
|
|
2843
|
+
return momentValue.isBetween(dateRange.start, dateRange.end, 'day', '[]');
|
|
2844
|
+
if (dateRange.start)
|
|
2845
|
+
return momentValue.isSameOrAfter(dateRange.start, 'day');
|
|
2846
|
+
if (dateRange.end)
|
|
2847
|
+
return momentValue.isSameOrBefore(dateRange.end, 'day');
|
|
2848
|
+
return true;
|
|
2849
|
+
});
|
|
2850
|
+
}
|
|
2851
|
+
break;
|
|
2852
|
+
}
|
|
2853
|
+
}
|
|
2854
|
+
});
|
|
2855
|
+
return data;
|
|
2856
|
+
}
|
|
2857
|
+
onToggleFullScreen() {
|
|
2858
|
+
if (this.isFullScreen())
|
|
2859
|
+
this.exitFullscreen();
|
|
2860
|
+
else
|
|
2861
|
+
this.enterFullscreen();
|
|
2862
|
+
}
|
|
2863
|
+
enterFullscreen() {
|
|
2864
|
+
if (this.overlayRef)
|
|
2865
|
+
return;
|
|
2866
|
+
this.overlayRef = this.overlay.create({
|
|
2867
|
+
hasBackdrop: false,
|
|
2868
|
+
scrollStrategy: this.overlay.scrollStrategies.block(),
|
|
2869
|
+
positionStrategy: this.overlay.position().global().top('0').left('0').right('0').bottom('0'),
|
|
2870
|
+
});
|
|
2871
|
+
this.portal = new TemplatePortal(this.tableContentTemplate(), this.viewContainerRef);
|
|
2872
|
+
this.overlayRef.attach(this.portal);
|
|
2873
|
+
this.isFullScreen.set(true);
|
|
2874
|
+
}
|
|
2875
|
+
exitFullscreen() {
|
|
2876
|
+
if (!this.overlayRef)
|
|
2877
|
+
return;
|
|
2878
|
+
this.overlayRef.detach();
|
|
2879
|
+
this.overlayRef.dispose();
|
|
2880
|
+
this.overlayRef = undefined;
|
|
2881
|
+
this.portal = undefined;
|
|
2882
|
+
this.isFullScreen.set(false);
|
|
2883
|
+
}
|
|
2884
|
+
isMyOverlayOnTop() {
|
|
2885
|
+
if (!this.overlayRef)
|
|
2886
|
+
return false;
|
|
2887
|
+
//Contenedor principal de overlays en el DOM
|
|
2888
|
+
const containerElement = this.overlayContainer.getContainerElement();
|
|
2889
|
+
// Los overlays se añaden como hijos dentro de este contenedor
|
|
2890
|
+
const overlays = Array.from(containerElement.children);
|
|
2891
|
+
// El último hijo es el overlay más "arriba"
|
|
2892
|
+
const topOverlay = overlays[overlays.length - 1];
|
|
2893
|
+
return topOverlay === this.overlayRef.hostElement;
|
|
2894
|
+
}
|
|
2895
|
+
onNewClick() {
|
|
2896
|
+
this.createClick.emit();
|
|
2897
|
+
}
|
|
2898
|
+
onUpdateClick(row, event) {
|
|
2899
|
+
this.updateClick.emit(row);
|
|
2900
|
+
event.stopPropagation();
|
|
2901
|
+
}
|
|
2902
|
+
onRowClick(row) {
|
|
2903
|
+
if (this.isRowEnabled(row))
|
|
2904
|
+
this.updateClick.emit(row);
|
|
2905
|
+
}
|
|
2906
|
+
isRowEnabled(row) {
|
|
2907
|
+
return this.config()().update
|
|
2908
|
+
&& this.config()().clickOnRowForUpdate
|
|
2909
|
+
&& (!this.config()().update?.show || this.config()().update?.show?.(row))
|
|
2910
|
+
&& !this.config()().update?.disabled?.(row);
|
|
2911
|
+
}
|
|
2912
|
+
onDeleteClick(row, event) {
|
|
2913
|
+
event.stopPropagation();
|
|
2914
|
+
const title = this.config()().deleteConfirm?.title?.(row) ?? 'Eliminar';
|
|
2915
|
+
const body = this.config()().deleteConfirm?.body?.(row) ?? 'Vas a eliminar el registro seleccionado. ¿Estas seguro?';
|
|
2916
|
+
const template = this.config()().deleteConfirm?.templateRef?.();
|
|
2917
|
+
const data = {
|
|
2918
|
+
title: title,
|
|
2919
|
+
body: !template ? body : undefined,
|
|
2920
|
+
template: template,
|
|
2921
|
+
row: row,
|
|
2922
|
+
confirmButtonLabel: 'Eliminar'
|
|
2923
|
+
};
|
|
2924
|
+
const dialogRef = this.dialog.open(NgxConfirmDialogComponent, { data: data });
|
|
2925
|
+
dialogRef.afterClosed().subscribe((confirm) => {
|
|
2926
|
+
if (confirm)
|
|
2927
|
+
this.deleteClick.emit(row);
|
|
2928
|
+
});
|
|
2929
|
+
}
|
|
2930
|
+
onRowActionClick(row, rowAction, event) {
|
|
2931
|
+
this.rowActionClick.emit({ id: rowAction.id, row: row });
|
|
2932
|
+
event.stopPropagation();
|
|
2933
|
+
}
|
|
2934
|
+
onEditColumns() {
|
|
2935
|
+
const config = this.config()();
|
|
2936
|
+
const filters = this.filters()();
|
|
2937
|
+
const columnConfig = this.columnConfig();
|
|
2938
|
+
const columnsLabel = Object.fromEntries(config.columns.map(column => [column.key, column.label]));
|
|
2939
|
+
const data = {
|
|
2940
|
+
tableId: config.tableId,
|
|
2941
|
+
tableName: config.title(),
|
|
2942
|
+
columns: columnConfig,
|
|
2943
|
+
filtersValue: filters.columnsFiltersValue ?? {},
|
|
2944
|
+
columnsLabels: columnsLabel
|
|
2945
|
+
};
|
|
2946
|
+
this.dialog.open(ConfigureTableColumnsComponent, { data: data });
|
|
2947
|
+
}
|
|
2948
|
+
getRowSelectionAction() {
|
|
2949
|
+
return this.config()().rowSelectionAction ?? [];
|
|
2950
|
+
}
|
|
2951
|
+
uncheckAllSelection() {
|
|
2952
|
+
this.selection.set([]);
|
|
2953
|
+
}
|
|
2954
|
+
onRowSelectionActionClick(actionId) {
|
|
2955
|
+
this.selectionActionEvent.emit({
|
|
2956
|
+
id: actionId,
|
|
2957
|
+
rows: this.selection()
|
|
2958
|
+
});
|
|
2959
|
+
}
|
|
2960
|
+
getDocumentHeaders() {
|
|
2961
|
+
const config = this.config()();
|
|
2962
|
+
return config.columns.map(c => c.label);
|
|
2963
|
+
}
|
|
2964
|
+
getDocumentRows() {
|
|
2965
|
+
const config = this.config()();
|
|
2966
|
+
const columns = config.columns;
|
|
2967
|
+
const data = this.dataSource().data;
|
|
2968
|
+
return data.map(row => {
|
|
2969
|
+
if (config.mapperForExportData) {
|
|
2970
|
+
const mapped = config.mapperForExportData(row);
|
|
2971
|
+
return columns.map(c => mapped[c.key]);
|
|
2972
|
+
}
|
|
2973
|
+
return columns.map(c => row[c.key] ?? '');
|
|
2974
|
+
});
|
|
2975
|
+
}
|
|
2976
|
+
exportToCsv() {
|
|
2977
|
+
const config = this.config()();
|
|
2978
|
+
const title = config.title();
|
|
2979
|
+
const fileName = config.exportFileName?.() ?? title;
|
|
2980
|
+
const headers = this.getDocumentHeaders();
|
|
2981
|
+
const rows = this.getDocumentRows();
|
|
2982
|
+
const aoaData = [headers, ...rows];
|
|
2983
|
+
//const workSheet = utils.json_to_sheet(data);
|
|
2984
|
+
const workSheet = utils.aoa_to_sheet(aoaData);
|
|
2985
|
+
const workBook = utils.book_new();
|
|
2986
|
+
//El nombre de la hoja no puede exceder de 31 caracteres
|
|
2987
|
+
const name = title.substring(0, 31);
|
|
2988
|
+
utils.book_append_sheet(workBook, workSheet, name);
|
|
2989
|
+
writeFileXLSX(workBook, `${fileName}.xlsx`);
|
|
2990
|
+
}
|
|
2991
|
+
exportToPdf() {
|
|
2992
|
+
const config = this.config()();
|
|
2993
|
+
const title = config.title();
|
|
2994
|
+
const fileName = config.exportFileName?.() ?? title;
|
|
2995
|
+
const headers = this.getDocumentHeaders();
|
|
2996
|
+
const rows = this.getDocumentRows();
|
|
2997
|
+
const doc = config.pdfConfig ?? new jsPDF({
|
|
2998
|
+
orientation: 'landscape',
|
|
2999
|
+
unit: 'pt',
|
|
3000
|
+
format: 'A4'
|
|
3001
|
+
});
|
|
3002
|
+
doc.setFontSize(14);
|
|
3003
|
+
doc.text(title, 40, 40);
|
|
3004
|
+
autoTable(doc, {
|
|
3005
|
+
startY: 60,
|
|
3006
|
+
head: [headers],
|
|
3007
|
+
body: rows,
|
|
3008
|
+
styles: { fontSize: 9, cellPadding: 4 },
|
|
3009
|
+
headStyles: { fillColor: [192, 0, 28], textColor: 255 },
|
|
3010
|
+
alternateRowStyles: { fillColor: [245, 245, 245] },
|
|
3011
|
+
tableLineColor: [200, 200, 200],
|
|
3012
|
+
tableLineWidth: 0.1,
|
|
3013
|
+
});
|
|
3014
|
+
doc.save(`${fileName}.pdf`);
|
|
3015
|
+
}
|
|
3016
|
+
onQueryChange(inputElement) {
|
|
3017
|
+
const query = inputElement.value;
|
|
3018
|
+
this.filters().update((value) => {
|
|
3019
|
+
//return { ...value, query: query, pageNumber: 1 };
|
|
3020
|
+
//Hay que ver el tema del paginador si hay que volver a la pagina 1
|
|
3021
|
+
return { ...value, query: query };
|
|
3022
|
+
});
|
|
3023
|
+
}
|
|
3024
|
+
onQueryReset(inputElement) {
|
|
3025
|
+
inputElement.value = '';
|
|
3026
|
+
this.onQueryChange(inputElement);
|
|
3027
|
+
}
|
|
3028
|
+
onSortChange(sort) {
|
|
3029
|
+
this.filters().update(value => {
|
|
3030
|
+
return {
|
|
3031
|
+
...value,
|
|
3032
|
+
//pageNumber: 1,
|
|
3033
|
+
sortBy: sort.direction ? { key: sort.active, direction: sort.direction } : undefined
|
|
3034
|
+
};
|
|
3035
|
+
});
|
|
3036
|
+
}
|
|
3037
|
+
toggleAllPageRowSelection() {
|
|
3038
|
+
const records = this.getDataOfCurrentPage();
|
|
3039
|
+
if (this.isAllPageRowSelected()) {
|
|
3040
|
+
//Deseleccionar todas las filas de la página actual
|
|
3041
|
+
this.selection.update(recordsSelected => {
|
|
3042
|
+
return recordsSelected.filter(record => !records.some(row2 => this.areEqualByKeys(record, row2)));
|
|
3043
|
+
});
|
|
3044
|
+
}
|
|
3045
|
+
else {
|
|
3046
|
+
//Seleccionar todas las filas visibles que aún no estén seleccionadas
|
|
3047
|
+
const notSelected = records.filter(record => !this.isRowSelected(record));
|
|
3048
|
+
this.selection.update(recordsSelected => {
|
|
3049
|
+
// Evitar duplicados por si ya hay seleccionadas
|
|
3050
|
+
const nuevas = notSelected.filter(row => !recordsSelected.some(sel => this.areEqualByKeys(sel, row)));
|
|
3051
|
+
return [...recordsSelected, ...nuevas];
|
|
3052
|
+
});
|
|
3053
|
+
}
|
|
3054
|
+
}
|
|
3055
|
+
isAllPageRowSelected() {
|
|
3056
|
+
const records = this.getDataOfCurrentPage();
|
|
3057
|
+
return records.every(record => this.isRowSelected(record));
|
|
3058
|
+
}
|
|
3059
|
+
areEqualByKeys(record1, record2) {
|
|
3060
|
+
const primaryKey = this.config()().primaryKey;
|
|
3061
|
+
if (Array.isArray(primaryKey))
|
|
3062
|
+
return primaryKey.every(key => record1[key] === record2[key]);
|
|
3063
|
+
else
|
|
3064
|
+
return record1[primaryKey] === record2[primaryKey];
|
|
3065
|
+
}
|
|
3066
|
+
isRowSelected(row) {
|
|
3067
|
+
return this.selection().some(row2 => this.areEqualByKeys(row, row2));
|
|
3068
|
+
}
|
|
3069
|
+
toggleRowSelection(row) {
|
|
3070
|
+
if (this.isRowSelected(row)) {
|
|
3071
|
+
this.selection.update(recordsSelected => {
|
|
3072
|
+
return recordsSelected.filter(record => !this.areEqualByKeys(row, record));
|
|
3073
|
+
});
|
|
3074
|
+
}
|
|
3075
|
+
else {
|
|
3076
|
+
this.selection.update(recordsSelected => [...recordsSelected, row]);
|
|
3077
|
+
}
|
|
3078
|
+
}
|
|
3079
|
+
applyColumnPipes(value, pipes) {
|
|
3080
|
+
if (!pipes)
|
|
3081
|
+
return value;
|
|
3082
|
+
const pipesArray = Array.isArray(pipes) ? pipes : [pipes];
|
|
3083
|
+
return pipesArray.reduce((v, p) => p.pipe.transform(v, ...(p.args || [])), value);
|
|
3084
|
+
}
|
|
3085
|
+
getTotalPerPageOfColum(columnKey) {
|
|
3086
|
+
const dataOfCurrentPage = this.getDataOfCurrentPage();
|
|
3087
|
+
return dataOfCurrentPage.reduce((previous, item) => (previous + Number(item[columnKey])), 0);
|
|
3088
|
+
}
|
|
3089
|
+
getDataOfCurrentPage() {
|
|
3090
|
+
const paginator = this.dataSource().paginator;
|
|
3091
|
+
if (!paginator)
|
|
3092
|
+
return [];
|
|
3093
|
+
const startIndex = paginator.pageIndex * paginator.pageSize;
|
|
3094
|
+
const endIndex = startIndex + paginator.pageSize;
|
|
3095
|
+
return this.dataSource().data.slice(startIndex, endIndex);
|
|
3096
|
+
}
|
|
3097
|
+
getTotalOfColum(columnKey) {
|
|
3098
|
+
return this.dataSource().data.reduce((previous, item) => (previous + Number(item[columnKey])), 0);
|
|
3099
|
+
}
|
|
3100
|
+
getValueOfColumnFilter(key) {
|
|
3101
|
+
return this.filters()().columnsFiltersValue?.[key];
|
|
3102
|
+
}
|
|
3103
|
+
getPaginatedSearchableSelectValueOfColumnFilter(key) {
|
|
3104
|
+
const value = this.getValueOfColumnFilter(key);
|
|
3105
|
+
if (isFilterOption(value) || (Array.isArray(value) && value.every(v => isFilterOption(v))))
|
|
3106
|
+
return value;
|
|
3107
|
+
return undefined;
|
|
3108
|
+
}
|
|
3109
|
+
getSearchableSelectValueOfColumnFilter(key) {
|
|
3110
|
+
const value = this.getValueOfColumnFilter(key);
|
|
3111
|
+
if (typeof value === 'string' || (Array.isArray(value) && value.every(v => typeof v === 'string')))
|
|
3112
|
+
return value;
|
|
3113
|
+
return undefined;
|
|
3114
|
+
}
|
|
3115
|
+
getDateRangeValueOfColumnFilter(key, type) {
|
|
3116
|
+
const value = this.getValueOfColumnFilter(key);
|
|
3117
|
+
if (!value)
|
|
3118
|
+
return null;
|
|
3119
|
+
return type == 'start' ? value.start : value.end;
|
|
3120
|
+
}
|
|
3121
|
+
onTextFilterColumnChange(column, event) {
|
|
3122
|
+
const query = event.target.value;
|
|
3123
|
+
this.onColumnFilterChange(column.key, query);
|
|
3124
|
+
}
|
|
3125
|
+
onPaginatedOptionFilterColumnChange(column, option) {
|
|
3126
|
+
this.onColumnFilterChange(column.key, option);
|
|
3127
|
+
}
|
|
3128
|
+
onOptionFilterColumnChange(column, value) {
|
|
3129
|
+
this.onColumnFilterChange(column.key, value);
|
|
3130
|
+
}
|
|
3131
|
+
onDateFilterChange(column, value) {
|
|
3132
|
+
this.onColumnFilterChange(column.key, value);
|
|
3133
|
+
}
|
|
3134
|
+
onDateRangeFilterChange(column, value) {
|
|
3135
|
+
this.onColumnFilterChange(column.key, value);
|
|
3136
|
+
}
|
|
3137
|
+
onColumnFilterChange(columnKey, value) {
|
|
3138
|
+
this.filters().update(currentValue => {
|
|
3139
|
+
const columnsFiltersValue = currentValue.columnsFiltersValue ?? {};
|
|
3140
|
+
columnsFiltersValue[columnKey] = value;
|
|
3141
|
+
return {
|
|
3142
|
+
...currentValue,
|
|
3143
|
+
pageNumber: 1,
|
|
3144
|
+
columnsFiltersValue: columnsFiltersValue
|
|
3145
|
+
};
|
|
3146
|
+
});
|
|
3147
|
+
}
|
|
3148
|
+
rowIsExpanded(row) {
|
|
3149
|
+
return this.expandedItem() == row;
|
|
3150
|
+
}
|
|
3151
|
+
expandableToggle(row) {
|
|
3152
|
+
this.expandedItem.update(currentValue => {
|
|
3153
|
+
const newValue = currentValue != row ? row : null;
|
|
3154
|
+
this.expandedItemChange.emit(newValue);
|
|
3155
|
+
return newValue;
|
|
3156
|
+
});
|
|
3157
|
+
}
|
|
3158
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: NgxBasicTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3159
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: NgxBasicTableComponent, isStandalone: true, selector: "ngx-basic-table", inputs: { filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, queryFilter: { classPropertyName: "queryFilter", publicName: "queryFilter", isSignal: true, isRequired: false, transformFunction: null }, moreFilters: { classPropertyName: "moreFilters", publicName: "moreFilters", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { createClick: "createClick", updateClick: "updateClick", deleteClick: "deleteClick", rowActionClick: "rowActionClick", expandedItemChange: "expandedItemChange", selectionActionEvent: "selectionActionEvent" }, host: { listeners: { "document:keydown.escape": "onEscape()" }, classAttribute: "contenedorDefecto" }, viewQueries: [{ propertyName: "tableContentTemplate", first: true, predicate: ["tableContent"], descendants: true, isSignal: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, isSignal: true }], ngImport: i0, template: "@if(!isFullScreen()) {\r\n <ng-container *ngTemplateOutlet=\"tableContentTemplate()\"></ng-container>\r\n}\r\n\r\n<ng-template #tableContent>\r\n <div class=\"tableContainer\" [class.inFullScreenMode]=\"isFullScreen()\">\r\n <div class=\"headerContainer\">\r\n <div class=\"titleAndButtonContainer\">\r\n <p class=\"title\">{{ config()().title() }}</p>\r\n <div class=\"buttonContainer\">\r\n @if(config()().create && (!config()().create?.show || config()().create?.show())) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"config()().create?.tooltip?.() ?? 'Nuevo'\" \r\n [disabled]=\"config()().create?.disabled?.()\" \r\n class=\"newButtonIcon\"\r\n (click)=\"onNewClick()\">\r\n <mat-icon>add_circle</mat-icon>\r\n </button>\r\n }\r\n\r\n <button matIconButton matTooltip=\"Visualizar y ordenar columnas\" class=\"editColumnsButtonIcon\" (click)=\"onEditColumns()\">\r\n <mat-icon>table_edit</mat-icon>\r\n </button>\r\n\r\n @if(selection().length > 0) {\r\n @if(getRowSelectionAction().length > 0) {\r\n <button \r\n matIconButton \r\n matTooltip=\"Operaciones sobre los registros seleccionados\"\r\n [matMenuTriggerFor]=\"selectedRecordsMenu\">\r\n <mat-icon>event_list</mat-icon>\r\n </button>\r\n\r\n <mat-menu #selectedRecordsMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\r\n <button mat-menu-item (click)=\"uncheckAllSelection()\">\r\n <mat-icon>deselect</mat-icon>\r\n <span>Desmarcar todos los registros</span>\r\n </button>\r\n\r\n @for (action of getRowSelectionAction(); track $index) {\r\n <button mat-menu-item (click)=\"onRowSelectionActionClick(action.id)\">\r\n <mat-icon>{{action.icon}}</mat-icon>\r\n <span>{{action.label(selection(), selection().length)}}</span>\r\n </button>\r\n }\r\n </mat-menu>\r\n } @else {\r\n <button \r\n matIconButton \r\n matTooltip=\"Desmarcar todos los registros\"\r\n (click)=\"uncheckAllSelection()\">\r\n <mat-icon>deselect</mat-icon>\r\n </button>\r\n }\r\n }\r\n\r\n <button matIconButton matTooltip=\"Exportar datos\" [matMenuTriggerFor]=\"exportMenu\">\r\n <mat-icon>download</mat-icon>\r\n </button>\r\n <mat-menu #exportMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\r\n <button mat-menu-item (click)=\"exportToCsv()\">\r\n <mat-icon>csv</mat-icon>\r\n <span>Exportar a XLSX</span>\r\n </button>\r\n\r\n <button mat-menu-item (click)=\"exportToPdf()\">\r\n <mat-icon>picture_as_pdf</mat-icon>\r\n <span>Exportar a PDF</span>\r\n </button>\r\n </mat-menu>\r\n\r\n <button matIconButton [matTooltip]=\"isFullScreen() ? 'Salir del modo de pantalla completa': 'Pantalla completa'\" (click)=\"onToggleFullScreen()\">\r\n <mat-icon>{{isFullScreen() ? 'fullscreen_exit': 'fullscreen'}}</mat-icon>\r\n </button>\r\n\r\n <ng-content select=\"[icon-buttons]\"></ng-content>\r\n </div>\r\n </div>\r\n\r\n <div class=\"filterContainer\">\r\n <div class=\"moreFiltersContainer\">\r\n <ng-content select=\"[more-filters]\"></ng-content>\r\n </div>\r\n\r\n @if(showQueryFilter()) {\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input #queryElement matInput [placeholder]=\"config()().queryFilterPlaceholder ?? 'Buscar...'\" [value]=\"filters()().query ?? ''\" (input)=\"onQueryChange(queryElement)\">\r\n <button matIconButton matSuffix (click)=\"onQueryReset(queryElement)\" [style.visibility]=\"queryElement.value ? 'visible': 'hidden'\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n }\r\n </div>\r\n\r\n <ng-content select=\"[extra-header-content]\"></ng-content>\r\n </div>\r\n\r\n <mat-progress-bar mode=\"indeterminate\" [style.visibility]=\"loading() ? 'visible': 'hidden'\"/>\r\n\r\n <div class=\"tableOverflow\" [style.max-height]=\"config()().maxHeight && !isFullScreen() ? config()().maxHeight : null\">\r\n <table\r\n mat-table \r\n matSort\r\n [multiTemplateDataRows]=\"config()().expandableDetail\"\r\n [dataSource]=\"dataSource()\" \r\n [matSortActive]=\"filters()().sortBy?.key ?? ''\" \r\n [matSortDirection]=\"filters()().sortBy?.direction ?? ''\"\r\n (matSortChange)=\"onSortChange($event)\">\r\n\r\n @if(config()().enableRowSelection) {\r\n @if(showFiltersRow()) {\r\n <ng-container [matColumnDef]=\"`${filterKeyPrefix}${nameOfRowSelectionColumn}`\" [sticky]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef class=\"celdaSelection\"></th>\r\n </ng-container>\r\n } \r\n\r\n <ng-container [matColumnDef]=\"nameOfRowSelectionColumn\" [sticky]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <mat-checkbox \r\n class=\"headerCheckbox\"\r\n (change)=\"$event ? toggleAllPageRowSelection() : null\"\r\n [checked]=\"selection().length > 0 && isAllPageRowSelected()\"\r\n [indeterminate]=\"selection().length > 0 && !isAllPageRowSelected()\">\r\n </mat-checkbox>\r\n </th>\r\n <td mat-cell *matCellDef=\"let row\" (click)=\"$event.stopPropagation()\" class=\"celdaSelection\">\r\n <mat-checkbox\r\n (change)=\"$event ? toggleRowSelection(row) : null\"\r\n [checked]=\"isRowSelected(row)\">\r\n </mat-checkbox>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef class=\"celdaSelection\"></td>\r\n </ng-container>\r\n\r\n @if(showTotalGeneralFooter()) {\r\n <ng-container [matColumnDef]=\"`${generalFooterKeyPrefix}${nameOfRowSelectionColumn}`\" [sticky]=\"isDesktop()\">\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @for (column of config()().columns; track $index) {\r\n <ng-container \r\n [matColumnDef]=\"getKeyAsString(column.key)\" \r\n [sticky]=\"stickyColumnKey() == column.key && isDesktop()\">\r\n\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header [disabled]=\"column.sortType === undefined\" class=\"columnLabel\">\r\n <p class=\"headerTitle\">\r\n @if(stickyColumnKey() == column.key && isDesktop()) {\r\n <mat-icon>keep</mat-icon>\r\n }\r\n {{ column.label }}\r\n </p>\r\n </th>\r\n\r\n <td \r\n mat-cell \r\n *matCellDef=\"let row\" \r\n [class.columnSticky]=\"stickyColumnKey() == column.key && isDesktop()\"\r\n [style]=\"column.style\"\r\n class=\"celdaDatos\">\r\n\r\n @if(column.component) {\r\n <ng-container \r\n ngxDynamicCellHost\r\n [component]=\"column.component\"\r\n [row]=\"row\"\r\n [key]=\"column.key\" />\r\n } @else if(column.templateRef) {\r\n <ng-container \r\n *ngTemplateOutlet=\"column.templateRef(); \r\n context: { $implicit: row }\" />\r\n } @else if(column.valueGetter) {\r\n {{ column.valueGetter(row) }}\r\n } @else {\r\n {{ applyColumnPipes(row[column.key], column.pipes) ?? '-' }}\r\n }\r\n </td>\r\n \r\n <td\r\n mat-footer-cell \r\n *matFooterCellDef\r\n [class.columnSticky]=\"stickyColumnKey() == column.key && isDesktop()\"\r\n [style]=\"column.footerStyle\">\r\n\r\n @if(column.showTotalPerPage) {\r\n @if(column.pipes) {\r\n {{ applyColumnPipes(getTotalPerPageOfColum(column.key), column.pipes) }}\r\n } @else if(column.totalFooterFormatter) {\r\n {{ column.totalFooterFormatter(getTotalPerPageOfColum(column.key)) }}\r\n } @else {\r\n {{ getTotalPerPageOfColum(column.key) }}\r\n }\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n\r\n @if(showTotalGeneralFooter()) {\r\n @for (column of config()().columns; track $index) {\r\n <ng-container \r\n [matColumnDef]=\"`${generalFooterKeyPrefix}${getKeyAsString(column.key)}`\"\r\n [sticky]=\"stickyColumnKey() == column.key && isDesktop()\">\r\n <td mat-footer-cell *matFooterCellDef [style]=\"column.footerStyle\">\r\n @if(column.showTotalGeneral) {\r\n @if(column.pipes) {\r\n {{ applyColumnPipes(getTotalOfColum(column.key), column.pipes) }}\r\n } @else if(column.totalFooterFormatter) {\r\n {{ column.totalFooterFormatter(getTotalOfColum(column.key)) }}\r\n } @else {\r\n {{ getTotalOfColum(column.key) }}\r\n }\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @if(showFiltersRow()) {\r\n @for (column of config()().columns; track $index) {\r\n <ng-container \r\n [matColumnDef]=\"`${filterKeyPrefix}${getKeyAsString(column.key)}`\" \r\n [sticky]=\"stickyColumnKey() == column.key && isDesktop()\">\r\n\r\n <th mat-header-cell *matHeaderCellDef>\r\n @if (column.filterType == 'text' || column.filterType == 'number') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"inputQueryColumn\">\r\n <input [type]=\"column.filterType\" matInput [placeholder]=\"column.label\" [value]=\"getValueOfColumnFilter(column.key) ?? ''\" (input)=\"onTextFilterColumnChange(column, $event)\">\r\n <mat-icon matSuffix>{{ column.filterType == 'text' ? 'search' : 'numbers'}}</mat-icon>\r\n </mat-form-field>\r\n }\r\n\r\n @if (column.filterType == 'option' || column.filterType == 'option-multiple') {\r\n @if(column.endpointForPaginatedFilterOptions) {\r\n <ngx-paginated-searchable-select\r\n class=\"selectColumn\"\r\n [selected]=\"getPaginatedSearchableSelectValueOfColumnFilter(column.key)\"\r\n [endpoint]=\"column.endpointForPaginatedFilterOptions\"\r\n [filters]=\"column.filtersForEndpointPaginatedFilterOptions ?? defaultFiltersForPaginatedFilterOptions\"\r\n [multiple]=\"column.filterType == 'option-multiple'\"\r\n subscriptSizing=\"dynamic\"\r\n [selectPlaceholder]=\"column.label\"\r\n (optionChange)=\"onPaginatedOptionFilterColumnChange(column, $event)\"\r\n clearableOptionLabel=\"filtro\"\r\n />\r\n } @else {\r\n <ngx-searchable-select\r\n class=\"selectColumn\"\r\n [selected]=\"getSearchableSelectValueOfColumnFilter(column.key)\"\r\n [options]=\"column.filterOptions ?? []\"\r\n [multiple]=\"column.filterType == 'option-multiple'\"\r\n subscriptSizing=\"dynamic\"\r\n [selectPlaceholder]=\"column.label\"\r\n (optionChange)=\"onOptionFilterColumnChange(column, $event)\"\r\n clearableOptionLabel=\"filtro\"\r\n />\r\n } \r\n }\r\n \r\n @if(column.filterType == 'date') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"dateColumn\">\r\n <input \r\n matInput \r\n [matDatepicker]=\"picker\" \r\n [placeholder]=\"column.label\"\r\n [value]=\"getValueOfColumnFilter(column.key)\"\r\n (dateChange)=\"onDateFilterChange(column, $event.value)\">\r\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-datepicker #picker></mat-datepicker>\r\n </mat-form-field>\r\n }\r\n\r\n @if(column.filterType == 'date-range') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"dateColumn\">\r\n <mat-date-range-input [rangePicker]=\"picker\" #dateRangeInput>\r\n <input \r\n matStartDate \r\n placeholder=\"Desde\"\r\n [value]=\"getDateRangeValueOfColumnFilter(column.key, 'start')\"\r\n (dateChange)=\"onDateRangeFilterChange(column, dateRangeInput.value)\">\r\n <input \r\n matEndDate \r\n placeholder=\"Hasta\"\r\n [value]=\"getDateRangeValueOfColumnFilter(column.key, 'end')\"\r\n (dateChange)=\"onDateRangeFilterChange(column, dateRangeInput.value)\">\r\n </mat-date-range-input>\r\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-date-range-picker #picker></mat-date-range-picker>\r\n </mat-form-field>\r\n }\r\n </th>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @if(showActionsColumn()) {\r\n @if(showFiltersRow()) {\r\n <ng-container [matColumnDef]=\"`${filterKeyPrefix}${nameOfActionsColumn}`\" [stickyEnd]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef class=\"celdaAcciones\"></th>\r\n </ng-container>\r\n } \r\n\r\n <ng-container [matColumnDef]=\"nameOfActionsColumn\" [stickyEnd]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef>Acciones</th>\r\n <td mat-cell *matCellDef=\"let row\" (click)=\"$event.stopPropagation()\" class=\"celdaAcciones\">\r\n <div class=\"contenedorCeldaAcciones\">\r\n @if(config()().expandableDetail) {\r\n <button \r\n matIconButton\r\n (click)=\"expandableToggle(row)\">\r\n <mat-icon>{{ rowIsExpanded(row) ? 'keyboard_arrow_up' : 'keyboard_arrow_down' }}</mat-icon>\r\n </button>\r\n }\r\n\r\n @for (rowAction of config()().rowActions; track $index) {\r\n @if(!rowAction.show || rowAction.show(row)) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"rowAction.tooltip(row)\" \r\n [disabled]=\"rowAction.disabled?.(row)\" \r\n [class]=\"rowAction.iconColor ? `rowActionIconColor${rowAction.iconColor}` : ''\"\r\n (click)=\"onRowActionClick(row, rowAction, $event)\">\r\n <mat-icon>{{rowAction.icon}}</mat-icon>\r\n </button>\r\n } \r\n }\r\n\r\n @if(config()().update && !config()().clickOnRowForUpdate && (!config()().update?.show || config()().update?.show(row))) {\r\n <button \r\n matIconButton\r\n [matTooltip]=\"config()().update?.tooltip?.(row) ?? 'Editar'\" \r\n [disabled]=\"config()().update?.disabled?.(row)\" \r\n class=\"editButtonIcon\"\r\n (click)=\"onUpdateClick(row, $event)\">\r\n <mat-icon>edit_square</mat-icon>\r\n </button>\r\n }\r\n \r\n @if(config()().delete && (!config()().delete?.show || config()().delete?.show(row))) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"config()().delete?.tooltip?.(row) ?? 'Elminar'\" \r\n [disabled]=\"config()().delete?.disabled?.(row)\" \r\n class=\"deleteButtonIcon\"\r\n (click)=\"onDeleteClick(row, $event)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n </div>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n\r\n @if(showTotalGeneralFooter()) {\r\n <ng-container [matColumnDef]=\"`${generalFooterKeyPrefix}${nameOfActionsColumn}`\" [stickyEnd]=\"isDesktop()\">\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @if(config()().expandableDetail) {\r\n <ng-container [matColumnDef]=\"expandableColumnDef\">\r\n <td mat-cell *matCellDef=\"let row\" [attr.colspan]=\"keys().length\">\r\n <div \r\n class=\"detailWrapper\"\r\n [class.detailWrapperExpanded]=\"rowIsExpanded(row)\">\r\n <div class=\"columnDetail\">\r\n @if(config()().expandableDetailTemplateRef) {\r\n <ng-container \r\n *ngTemplateOutlet=\"config()().expandableDetailTemplateRef!(); \r\n context: { $implicit: row }\" />\r\n }\r\n </div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n }\r\n \r\n <tr mat-header-row *matHeaderRowDef=\"keys(); sticky: true\" class=\"tableHeader\"></tr>\r\n \r\n @if(showFiltersRow()) {\r\n <tr mat-header-row *matHeaderRowDef=\"keysWithFilter(); sticky: true\" class=\"filtersByColumn\"></tr>\r\n }\r\n \r\n <tr mat-row *matRowDef=\"let row; columns: keys();\" \r\n (click)=\"onRowClick(row)\" \r\n [class.rowClickEnable]=\"isRowEnabled(row)\"\r\n [class.expandableRow]=\"config()().expandableDetail\">\r\n </tr>\r\n \r\n @if(config()().expandableDetail) {\r\n <tr mat-row *matRowDef=\"let row; columns: [expandableColumnDef]\" class=\"rowDetail\"></tr>\r\n }\r\n\r\n <tr mat-footer-row \r\n *matFooterRowDef=\"showTotalPerPageFooter() ? keys() : []\" \r\n class=\"totalPerPageFooter\"\r\n [class.hideFooter]=\"!showTotalPerPageFooter()\">\r\n </tr>\r\n\r\n <tr mat-footer-row \r\n *matFooterRowDef=\"showTotalGeneralFooter() ? keysWithGeneralFooter() : []\" \r\n class=\"totalFooter\"\r\n [class.hideFooter]=\"!showTotalGeneralFooter()\">\r\n </tr>\r\n\r\n <tr class=\"mat-row\" *matNoDataRow>\r\n <td class=\"noData\" [colSpan]=\"keys().length\">{{ loading() ? 'Cargando...' : 'No se han encontrado resultados...' }}</td>\r\n </tr>\r\n </table>\r\n </div>\r\n\r\n <div class=\"paginatorContainer\">\r\n <div class=\"footerLegend\">\r\n @if(showTotalPerPageFooter()) {\r\n <div class=\"legendItem\">\r\n <div class=\"legendSquare\"></div>\r\n <p>Total parcial (por p\u00E1gina)</p> \r\n </div>\r\n }\r\n\r\n @if(showTotalGeneralFooter()) {\r\n <div class=\"legendItem\">\r\n <div class=\"legendSquare totalGeneral\"></div>\r\n <p>Total (todos los registros)</p>\r\n </div>\r\n }\r\n </div>\r\n <mat-paginator />\r\n </div>\r\n\r\n <ng-content select=\"[end-container]\"></ng-content>\r\n </div>\r\n</ng-template>", styles: [".tableContainer{display:flex;flex-direction:column;padding:14px;gap:10px;--mat-table-background-color: transparent;--mat-table-header-headline-color: var(--mat-sys-on-primary)}.inFullScreenMode{height:calc(100vh - 28px);width:calc(100vw - 28px);max-width:calc(100% - 28px);background:var(--mat-sys-surface)}.title{font:var(--mat-sys-title-large);margin:0;position:relative}.headerContainer{display:flex;justify-content:space-between;gap:10px;flex-direction:column}.titleAndButtonContainer{display:flex;justify-content:space-between;align-items:center;gap:20px}.buttonContainer{display:flex;gap:10px;align-items:center}.filterContainer{display:flex;flex-direction:row;align-items:center;gap:20px;justify-content:space-between}.moreFiltersContainer{display:flex;gap:20px}.editButtonIcon{--mat-icon-button-icon-color: var(--warning)}.deleteButtonIcon{--mat-icon-button-icon-color: var(--mat-sys-error)}.rowActionIconColorYellow{--mat-icon-button-icon-color: rgb(211, 211, 7)}.rowActionIconColorOrange{--mat-icon-button-icon-color: orange}.rowActionIconColorPink{--mat-icon-button-icon-color: pink}.rowActionIconColorPurple{--mat-icon-button-icon-color: purple}.rowActionIconColorGreen{--mat-icon-button-icon-color: var(--success)}.rowActionIconColorBlue{--mat-icon-button-icon-color: var(--information)}.rowActionIconColorBrown{--mat-icon-button-icon-color: brown}.rowActionIconColorSky{--mat-icon-button-icon-color: rgb(0, 247, 255)}.noData{padding:24px}.tableOverflow{overflow:auto;border-radius:10px}.columnLabel{text-wrap:nowrap}.headerTitle{display:flex;align-items:center;gap:4px}.headerTitle mat-icon{font-size:12px;width:12px;height:12px}.tableHeader{background-color:var(--mat-sys-primary)!important}.filtersByColumn{background-color:var(--mat-sys-surface)!important}.filtersByColumn th{padding:0}.celdaDatos{background-color:var(--mat-sys-surface)!important;transition:background-color .1s}.celdaAcciones,.celdaSelection{cursor:default!important;background-color:var(--mat-sys-surface)!important;transition:background-color .1s}.columnSticky{background-color:var(--mat-sys-surface)!important;transition:background-color .1s}.contenedorCeldaAcciones{display:flex;align-items:center;cursor:default!important}.rowClickEnable{cursor:pointer;transition:background-color .1s}.rowClickEnable:hover,.rowClickEnable:hover>.celdaAcciones,.rowClickEnable:hover>.celdaSelection,.rowClickEnable:hover>.celdaDatos,.rowClickEnable:hover>.columnSticky{background-color:var(--mat-sys-surface-container)!important}.inputQueryColumn,.selectColumn,.dateColumn{--mat-form-field-outlined-focus-outline-color: transparent;--mat-form-field-outlined-outline-color: transparent;--mat-form-field-outlined-hover-outline-color: transparent}.advancedFiltersApplied{display:flex;flex-direction:row;justify-content:space-between;gap:20px;border-radius:10px;background-color:var(--warning);color:var(--on-warning);align-items:center;margin-top:10px;padding:5px 5px 5px 15px;cursor:pointer;transition:background-color .3s}.advancedFiltersApplied:hover:not(:has(button:hover)){background-color:color-mix(in srgb,var(--warning) 80%,transparent)}.advancedFiltersApplied p{margin:0}.rowDetail{height:0}.expandableRow td{border-bottom-width:0}.detailWrapper{overflow:hidden;display:grid;grid-template-rows:0fr;grid-template-columns:100%;transition:grid-template-rows 225ms cubic-bezier(.4,0,.2,1)}.detailWrapperExpanded{grid-template-rows:1fr}.columnDetail{display:flex;flex-direction:column;min-height:0}.totalPerPageFooter{font-weight:700}.totalFooter{font-weight:700;background-color:var(--mat-sys-surface-container-highest);color:var(--mat-sys-on-surface)}.hideFooter{display:none}.paginatorContainer{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:20px;margin-top:10px}.footerLegend{display:flex;flex-direction:row;gap:30px}.footerLegend p{margin:0;font:var(--mat-sys-label-medium)}.legendItem{display:flex;flex-direction:row;align-items:center;gap:6px}.legendSquare{width:24px;height:14px;border-radius:4px;border:2px solid var(--mat-sys-on-surface)}.totalGeneral{background-color:var(--mat-sys-surface-container-highest)}.headerCheckbox{--mat-checkbox-selected-checkmark-color: var(--mat-sys-primary);--mat-checkbox-selected-focus-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-focus-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-selected-hover-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-hover-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-selected-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-pressed-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-pressed-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-focus-icon-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-focus-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-hover-icon-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-hover-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-icon-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-pressed-state-layer-color: var(--mat-sys-on-primary)}@media (max-width: 1200px){.filterContainer{flex-direction:column;align-items:normal}.moreFiltersContainer{flex-direction:column}}@media (max-width: 900px){.footerLegend{flex-direction:column;gap:6px}}@media (max-width: 700px){.paginatorContainer{flex-direction:column;align-items:flex-end}}@media (max-width: 600px){.titleAndButtonContainer{flex-direction:column;align-items:normal}}\n"], dependencies: [{ kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i2$3.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i2$3.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2$3.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i2$3.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2$3.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2$3.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i2$3.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2$3.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i2$3.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2$3.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i2$3.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i2$3.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i2$3.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i2$3.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "directive", type: i2$3.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i3$4.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i3$4.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i4$2.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i7$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i7$2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i11.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i11.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i11.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i11.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i11.MatStartDate, selector: "input[matStartDate]", outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i11.MatEndDate, selector: "input[matEndDate]", outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i11.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: DynamicCellHostDirective, selector: "[ngxDynamicCellHost]", inputs: ["component", "row", "key"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i13.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i13.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i13.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i15.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: SearchableSelectComponent, selector: "ngx-searchable-select", inputs: ["control", "options", "optionLabel", "optionValue", "multiple", "searchInputPlaceholder", "selectLabel", "selectPlaceholder", "clearableOptionLabel", "subscriptSizing", "clearable", "error", "selected", "disabled"], outputs: ["optionChange"] }, { kind: "component", type: PaginatedSearchableSelectComponent, selector: "ngx-paginated-searchable-select", inputs: ["control", "endpoint", "filters", "optionLabel", "compareWith", "multiple", "searchInputPlaceholder", "selectLabel", "selectPlaceholder", "clearableOptionLabel", "subscriptSizing", "clearable", "error", "selected", "disabled"], outputs: ["optionChange"] }] });
|
|
3160
|
+
}
|
|
3161
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: NgxBasicTableComponent, decorators: [{
|
|
3162
|
+
type: Component,
|
|
3163
|
+
args: [{ selector: 'ngx-basic-table', imports: [
|
|
3164
|
+
MatTableModule,
|
|
3165
|
+
MatSortModule,
|
|
3166
|
+
MatPaginatorModule,
|
|
3167
|
+
MatIconModule,
|
|
3168
|
+
MatButtonModule,
|
|
3169
|
+
MatProgressBarModule,
|
|
3170
|
+
MatTooltipModule,
|
|
3171
|
+
MatFormFieldModule,
|
|
3172
|
+
MatInputModule,
|
|
3173
|
+
MatSelectModule,
|
|
3174
|
+
MatDatepickerModule,
|
|
3175
|
+
CommonModule,
|
|
3176
|
+
DynamicCellHostDirective,
|
|
3177
|
+
MatMenuModule,
|
|
3178
|
+
MatDividerModule,
|
|
3179
|
+
MatCheckboxModule,
|
|
3180
|
+
SearchableSelectComponent,
|
|
3181
|
+
PaginatedSearchableSelectComponent
|
|
3182
|
+
], host: { class: 'contenedorDefecto' }, template: "@if(!isFullScreen()) {\r\n <ng-container *ngTemplateOutlet=\"tableContentTemplate()\"></ng-container>\r\n}\r\n\r\n<ng-template #tableContent>\r\n <div class=\"tableContainer\" [class.inFullScreenMode]=\"isFullScreen()\">\r\n <div class=\"headerContainer\">\r\n <div class=\"titleAndButtonContainer\">\r\n <p class=\"title\">{{ config()().title() }}</p>\r\n <div class=\"buttonContainer\">\r\n @if(config()().create && (!config()().create?.show || config()().create?.show())) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"config()().create?.tooltip?.() ?? 'Nuevo'\" \r\n [disabled]=\"config()().create?.disabled?.()\" \r\n class=\"newButtonIcon\"\r\n (click)=\"onNewClick()\">\r\n <mat-icon>add_circle</mat-icon>\r\n </button>\r\n }\r\n\r\n <button matIconButton matTooltip=\"Visualizar y ordenar columnas\" class=\"editColumnsButtonIcon\" (click)=\"onEditColumns()\">\r\n <mat-icon>table_edit</mat-icon>\r\n </button>\r\n\r\n @if(selection().length > 0) {\r\n @if(getRowSelectionAction().length > 0) {\r\n <button \r\n matIconButton \r\n matTooltip=\"Operaciones sobre los registros seleccionados\"\r\n [matMenuTriggerFor]=\"selectedRecordsMenu\">\r\n <mat-icon>event_list</mat-icon>\r\n </button>\r\n\r\n <mat-menu #selectedRecordsMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\r\n <button mat-menu-item (click)=\"uncheckAllSelection()\">\r\n <mat-icon>deselect</mat-icon>\r\n <span>Desmarcar todos los registros</span>\r\n </button>\r\n\r\n @for (action of getRowSelectionAction(); track $index) {\r\n <button mat-menu-item (click)=\"onRowSelectionActionClick(action.id)\">\r\n <mat-icon>{{action.icon}}</mat-icon>\r\n <span>{{action.label(selection(), selection().length)}}</span>\r\n </button>\r\n }\r\n </mat-menu>\r\n } @else {\r\n <button \r\n matIconButton \r\n matTooltip=\"Desmarcar todos los registros\"\r\n (click)=\"uncheckAllSelection()\">\r\n <mat-icon>deselect</mat-icon>\r\n </button>\r\n }\r\n }\r\n\r\n <button matIconButton matTooltip=\"Exportar datos\" [matMenuTriggerFor]=\"exportMenu\">\r\n <mat-icon>download</mat-icon>\r\n </button>\r\n <mat-menu #exportMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\r\n <button mat-menu-item (click)=\"exportToCsv()\">\r\n <mat-icon>csv</mat-icon>\r\n <span>Exportar a XLSX</span>\r\n </button>\r\n\r\n <button mat-menu-item (click)=\"exportToPdf()\">\r\n <mat-icon>picture_as_pdf</mat-icon>\r\n <span>Exportar a PDF</span>\r\n </button>\r\n </mat-menu>\r\n\r\n <button matIconButton [matTooltip]=\"isFullScreen() ? 'Salir del modo de pantalla completa': 'Pantalla completa'\" (click)=\"onToggleFullScreen()\">\r\n <mat-icon>{{isFullScreen() ? 'fullscreen_exit': 'fullscreen'}}</mat-icon>\r\n </button>\r\n\r\n <ng-content select=\"[icon-buttons]\"></ng-content>\r\n </div>\r\n </div>\r\n\r\n <div class=\"filterContainer\">\r\n <div class=\"moreFiltersContainer\">\r\n <ng-content select=\"[more-filters]\"></ng-content>\r\n </div>\r\n\r\n @if(showQueryFilter()) {\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input #queryElement matInput [placeholder]=\"config()().queryFilterPlaceholder ?? 'Buscar...'\" [value]=\"filters()().query ?? ''\" (input)=\"onQueryChange(queryElement)\">\r\n <button matIconButton matSuffix (click)=\"onQueryReset(queryElement)\" [style.visibility]=\"queryElement.value ? 'visible': 'hidden'\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n }\r\n </div>\r\n\r\n <ng-content select=\"[extra-header-content]\"></ng-content>\r\n </div>\r\n\r\n <mat-progress-bar mode=\"indeterminate\" [style.visibility]=\"loading() ? 'visible': 'hidden'\"/>\r\n\r\n <div class=\"tableOverflow\" [style.max-height]=\"config()().maxHeight && !isFullScreen() ? config()().maxHeight : null\">\r\n <table\r\n mat-table \r\n matSort\r\n [multiTemplateDataRows]=\"config()().expandableDetail\"\r\n [dataSource]=\"dataSource()\" \r\n [matSortActive]=\"filters()().sortBy?.key ?? ''\" \r\n [matSortDirection]=\"filters()().sortBy?.direction ?? ''\"\r\n (matSortChange)=\"onSortChange($event)\">\r\n\r\n @if(config()().enableRowSelection) {\r\n @if(showFiltersRow()) {\r\n <ng-container [matColumnDef]=\"`${filterKeyPrefix}${nameOfRowSelectionColumn}`\" [sticky]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef class=\"celdaSelection\"></th>\r\n </ng-container>\r\n } \r\n\r\n <ng-container [matColumnDef]=\"nameOfRowSelectionColumn\" [sticky]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <mat-checkbox \r\n class=\"headerCheckbox\"\r\n (change)=\"$event ? toggleAllPageRowSelection() : null\"\r\n [checked]=\"selection().length > 0 && isAllPageRowSelected()\"\r\n [indeterminate]=\"selection().length > 0 && !isAllPageRowSelected()\">\r\n </mat-checkbox>\r\n </th>\r\n <td mat-cell *matCellDef=\"let row\" (click)=\"$event.stopPropagation()\" class=\"celdaSelection\">\r\n <mat-checkbox\r\n (change)=\"$event ? toggleRowSelection(row) : null\"\r\n [checked]=\"isRowSelected(row)\">\r\n </mat-checkbox>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef class=\"celdaSelection\"></td>\r\n </ng-container>\r\n\r\n @if(showTotalGeneralFooter()) {\r\n <ng-container [matColumnDef]=\"`${generalFooterKeyPrefix}${nameOfRowSelectionColumn}`\" [sticky]=\"isDesktop()\">\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @for (column of config()().columns; track $index) {\r\n <ng-container \r\n [matColumnDef]=\"getKeyAsString(column.key)\" \r\n [sticky]=\"stickyColumnKey() == column.key && isDesktop()\">\r\n\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header [disabled]=\"column.sortType === undefined\" class=\"columnLabel\">\r\n <p class=\"headerTitle\">\r\n @if(stickyColumnKey() == column.key && isDesktop()) {\r\n <mat-icon>keep</mat-icon>\r\n }\r\n {{ column.label }}\r\n </p>\r\n </th>\r\n\r\n <td \r\n mat-cell \r\n *matCellDef=\"let row\" \r\n [class.columnSticky]=\"stickyColumnKey() == column.key && isDesktop()\"\r\n [style]=\"column.style\"\r\n class=\"celdaDatos\">\r\n\r\n @if(column.component) {\r\n <ng-container \r\n ngxDynamicCellHost\r\n [component]=\"column.component\"\r\n [row]=\"row\"\r\n [key]=\"column.key\" />\r\n } @else if(column.templateRef) {\r\n <ng-container \r\n *ngTemplateOutlet=\"column.templateRef(); \r\n context: { $implicit: row }\" />\r\n } @else if(column.valueGetter) {\r\n {{ column.valueGetter(row) }}\r\n } @else {\r\n {{ applyColumnPipes(row[column.key], column.pipes) ?? '-' }}\r\n }\r\n </td>\r\n \r\n <td\r\n mat-footer-cell \r\n *matFooterCellDef\r\n [class.columnSticky]=\"stickyColumnKey() == column.key && isDesktop()\"\r\n [style]=\"column.footerStyle\">\r\n\r\n @if(column.showTotalPerPage) {\r\n @if(column.pipes) {\r\n {{ applyColumnPipes(getTotalPerPageOfColum(column.key), column.pipes) }}\r\n } @else if(column.totalFooterFormatter) {\r\n {{ column.totalFooterFormatter(getTotalPerPageOfColum(column.key)) }}\r\n } @else {\r\n {{ getTotalPerPageOfColum(column.key) }}\r\n }\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n\r\n @if(showTotalGeneralFooter()) {\r\n @for (column of config()().columns; track $index) {\r\n <ng-container \r\n [matColumnDef]=\"`${generalFooterKeyPrefix}${getKeyAsString(column.key)}`\"\r\n [sticky]=\"stickyColumnKey() == column.key && isDesktop()\">\r\n <td mat-footer-cell *matFooterCellDef [style]=\"column.footerStyle\">\r\n @if(column.showTotalGeneral) {\r\n @if(column.pipes) {\r\n {{ applyColumnPipes(getTotalOfColum(column.key), column.pipes) }}\r\n } @else if(column.totalFooterFormatter) {\r\n {{ column.totalFooterFormatter(getTotalOfColum(column.key)) }}\r\n } @else {\r\n {{ getTotalOfColum(column.key) }}\r\n }\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @if(showFiltersRow()) {\r\n @for (column of config()().columns; track $index) {\r\n <ng-container \r\n [matColumnDef]=\"`${filterKeyPrefix}${getKeyAsString(column.key)}`\" \r\n [sticky]=\"stickyColumnKey() == column.key && isDesktop()\">\r\n\r\n <th mat-header-cell *matHeaderCellDef>\r\n @if (column.filterType == 'text' || column.filterType == 'number') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"inputQueryColumn\">\r\n <input [type]=\"column.filterType\" matInput [placeholder]=\"column.label\" [value]=\"getValueOfColumnFilter(column.key) ?? ''\" (input)=\"onTextFilterColumnChange(column, $event)\">\r\n <mat-icon matSuffix>{{ column.filterType == 'text' ? 'search' : 'numbers'}}</mat-icon>\r\n </mat-form-field>\r\n }\r\n\r\n @if (column.filterType == 'option' || column.filterType == 'option-multiple') {\r\n @if(column.endpointForPaginatedFilterOptions) {\r\n <ngx-paginated-searchable-select\r\n class=\"selectColumn\"\r\n [selected]=\"getPaginatedSearchableSelectValueOfColumnFilter(column.key)\"\r\n [endpoint]=\"column.endpointForPaginatedFilterOptions\"\r\n [filters]=\"column.filtersForEndpointPaginatedFilterOptions ?? defaultFiltersForPaginatedFilterOptions\"\r\n [multiple]=\"column.filterType == 'option-multiple'\"\r\n subscriptSizing=\"dynamic\"\r\n [selectPlaceholder]=\"column.label\"\r\n (optionChange)=\"onPaginatedOptionFilterColumnChange(column, $event)\"\r\n clearableOptionLabel=\"filtro\"\r\n />\r\n } @else {\r\n <ngx-searchable-select\r\n class=\"selectColumn\"\r\n [selected]=\"getSearchableSelectValueOfColumnFilter(column.key)\"\r\n [options]=\"column.filterOptions ?? []\"\r\n [multiple]=\"column.filterType == 'option-multiple'\"\r\n subscriptSizing=\"dynamic\"\r\n [selectPlaceholder]=\"column.label\"\r\n (optionChange)=\"onOptionFilterColumnChange(column, $event)\"\r\n clearableOptionLabel=\"filtro\"\r\n />\r\n } \r\n }\r\n \r\n @if(column.filterType == 'date') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"dateColumn\">\r\n <input \r\n matInput \r\n [matDatepicker]=\"picker\" \r\n [placeholder]=\"column.label\"\r\n [value]=\"getValueOfColumnFilter(column.key)\"\r\n (dateChange)=\"onDateFilterChange(column, $event.value)\">\r\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-datepicker #picker></mat-datepicker>\r\n </mat-form-field>\r\n }\r\n\r\n @if(column.filterType == 'date-range') {\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"dateColumn\">\r\n <mat-date-range-input [rangePicker]=\"picker\" #dateRangeInput>\r\n <input \r\n matStartDate \r\n placeholder=\"Desde\"\r\n [value]=\"getDateRangeValueOfColumnFilter(column.key, 'start')\"\r\n (dateChange)=\"onDateRangeFilterChange(column, dateRangeInput.value)\">\r\n <input \r\n matEndDate \r\n placeholder=\"Hasta\"\r\n [value]=\"getDateRangeValueOfColumnFilter(column.key, 'end')\"\r\n (dateChange)=\"onDateRangeFilterChange(column, dateRangeInput.value)\">\r\n </mat-date-range-input>\r\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-date-range-picker #picker></mat-date-range-picker>\r\n </mat-form-field>\r\n }\r\n </th>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @if(showActionsColumn()) {\r\n @if(showFiltersRow()) {\r\n <ng-container [matColumnDef]=\"`${filterKeyPrefix}${nameOfActionsColumn}`\" [stickyEnd]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef class=\"celdaAcciones\"></th>\r\n </ng-container>\r\n } \r\n\r\n <ng-container [matColumnDef]=\"nameOfActionsColumn\" [stickyEnd]=\"isDesktop()\">\r\n <th mat-header-cell *matHeaderCellDef>Acciones</th>\r\n <td mat-cell *matCellDef=\"let row\" (click)=\"$event.stopPropagation()\" class=\"celdaAcciones\">\r\n <div class=\"contenedorCeldaAcciones\">\r\n @if(config()().expandableDetail) {\r\n <button \r\n matIconButton\r\n (click)=\"expandableToggle(row)\">\r\n <mat-icon>{{ rowIsExpanded(row) ? 'keyboard_arrow_up' : 'keyboard_arrow_down' }}</mat-icon>\r\n </button>\r\n }\r\n\r\n @for (rowAction of config()().rowActions; track $index) {\r\n @if(!rowAction.show || rowAction.show(row)) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"rowAction.tooltip(row)\" \r\n [disabled]=\"rowAction.disabled?.(row)\" \r\n [class]=\"rowAction.iconColor ? `rowActionIconColor${rowAction.iconColor}` : ''\"\r\n (click)=\"onRowActionClick(row, rowAction, $event)\">\r\n <mat-icon>{{rowAction.icon}}</mat-icon>\r\n </button>\r\n } \r\n }\r\n\r\n @if(config()().update && !config()().clickOnRowForUpdate && (!config()().update?.show || config()().update?.show(row))) {\r\n <button \r\n matIconButton\r\n [matTooltip]=\"config()().update?.tooltip?.(row) ?? 'Editar'\" \r\n [disabled]=\"config()().update?.disabled?.(row)\" \r\n class=\"editButtonIcon\"\r\n (click)=\"onUpdateClick(row, $event)\">\r\n <mat-icon>edit_square</mat-icon>\r\n </button>\r\n }\r\n \r\n @if(config()().delete && (!config()().delete?.show || config()().delete?.show(row))) {\r\n <button \r\n matIconButton \r\n [matTooltip]=\"config()().delete?.tooltip?.(row) ?? 'Elminar'\" \r\n [disabled]=\"config()().delete?.disabled?.(row)\" \r\n class=\"deleteButtonIcon\"\r\n (click)=\"onDeleteClick(row, $event)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n </div>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n\r\n @if(showTotalGeneralFooter()) {\r\n <ng-container [matColumnDef]=\"`${generalFooterKeyPrefix}${nameOfActionsColumn}`\" [stickyEnd]=\"isDesktop()\">\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n }\r\n }\r\n\r\n @if(config()().expandableDetail) {\r\n <ng-container [matColumnDef]=\"expandableColumnDef\">\r\n <td mat-cell *matCellDef=\"let row\" [attr.colspan]=\"keys().length\">\r\n <div \r\n class=\"detailWrapper\"\r\n [class.detailWrapperExpanded]=\"rowIsExpanded(row)\">\r\n <div class=\"columnDetail\">\r\n @if(config()().expandableDetailTemplateRef) {\r\n <ng-container \r\n *ngTemplateOutlet=\"config()().expandableDetailTemplateRef!(); \r\n context: { $implicit: row }\" />\r\n }\r\n </div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n }\r\n \r\n <tr mat-header-row *matHeaderRowDef=\"keys(); sticky: true\" class=\"tableHeader\"></tr>\r\n \r\n @if(showFiltersRow()) {\r\n <tr mat-header-row *matHeaderRowDef=\"keysWithFilter(); sticky: true\" class=\"filtersByColumn\"></tr>\r\n }\r\n \r\n <tr mat-row *matRowDef=\"let row; columns: keys();\" \r\n (click)=\"onRowClick(row)\" \r\n [class.rowClickEnable]=\"isRowEnabled(row)\"\r\n [class.expandableRow]=\"config()().expandableDetail\">\r\n </tr>\r\n \r\n @if(config()().expandableDetail) {\r\n <tr mat-row *matRowDef=\"let row; columns: [expandableColumnDef]\" class=\"rowDetail\"></tr>\r\n }\r\n\r\n <tr mat-footer-row \r\n *matFooterRowDef=\"showTotalPerPageFooter() ? keys() : []\" \r\n class=\"totalPerPageFooter\"\r\n [class.hideFooter]=\"!showTotalPerPageFooter()\">\r\n </tr>\r\n\r\n <tr mat-footer-row \r\n *matFooterRowDef=\"showTotalGeneralFooter() ? keysWithGeneralFooter() : []\" \r\n class=\"totalFooter\"\r\n [class.hideFooter]=\"!showTotalGeneralFooter()\">\r\n </tr>\r\n\r\n <tr class=\"mat-row\" *matNoDataRow>\r\n <td class=\"noData\" [colSpan]=\"keys().length\">{{ loading() ? 'Cargando...' : 'No se han encontrado resultados...' }}</td>\r\n </tr>\r\n </table>\r\n </div>\r\n\r\n <div class=\"paginatorContainer\">\r\n <div class=\"footerLegend\">\r\n @if(showTotalPerPageFooter()) {\r\n <div class=\"legendItem\">\r\n <div class=\"legendSquare\"></div>\r\n <p>Total parcial (por p\u00E1gina)</p> \r\n </div>\r\n }\r\n\r\n @if(showTotalGeneralFooter()) {\r\n <div class=\"legendItem\">\r\n <div class=\"legendSquare totalGeneral\"></div>\r\n <p>Total (todos los registros)</p>\r\n </div>\r\n }\r\n </div>\r\n <mat-paginator />\r\n </div>\r\n\r\n <ng-content select=\"[end-container]\"></ng-content>\r\n </div>\r\n</ng-template>", styles: [".tableContainer{display:flex;flex-direction:column;padding:14px;gap:10px;--mat-table-background-color: transparent;--mat-table-header-headline-color: var(--mat-sys-on-primary)}.inFullScreenMode{height:calc(100vh - 28px);width:calc(100vw - 28px);max-width:calc(100% - 28px);background:var(--mat-sys-surface)}.title{font:var(--mat-sys-title-large);margin:0;position:relative}.headerContainer{display:flex;justify-content:space-between;gap:10px;flex-direction:column}.titleAndButtonContainer{display:flex;justify-content:space-between;align-items:center;gap:20px}.buttonContainer{display:flex;gap:10px;align-items:center}.filterContainer{display:flex;flex-direction:row;align-items:center;gap:20px;justify-content:space-between}.moreFiltersContainer{display:flex;gap:20px}.editButtonIcon{--mat-icon-button-icon-color: var(--warning)}.deleteButtonIcon{--mat-icon-button-icon-color: var(--mat-sys-error)}.rowActionIconColorYellow{--mat-icon-button-icon-color: rgb(211, 211, 7)}.rowActionIconColorOrange{--mat-icon-button-icon-color: orange}.rowActionIconColorPink{--mat-icon-button-icon-color: pink}.rowActionIconColorPurple{--mat-icon-button-icon-color: purple}.rowActionIconColorGreen{--mat-icon-button-icon-color: var(--success)}.rowActionIconColorBlue{--mat-icon-button-icon-color: var(--information)}.rowActionIconColorBrown{--mat-icon-button-icon-color: brown}.rowActionIconColorSky{--mat-icon-button-icon-color: rgb(0, 247, 255)}.noData{padding:24px}.tableOverflow{overflow:auto;border-radius:10px}.columnLabel{text-wrap:nowrap}.headerTitle{display:flex;align-items:center;gap:4px}.headerTitle mat-icon{font-size:12px;width:12px;height:12px}.tableHeader{background-color:var(--mat-sys-primary)!important}.filtersByColumn{background-color:var(--mat-sys-surface)!important}.filtersByColumn th{padding:0}.celdaDatos{background-color:var(--mat-sys-surface)!important;transition:background-color .1s}.celdaAcciones,.celdaSelection{cursor:default!important;background-color:var(--mat-sys-surface)!important;transition:background-color .1s}.columnSticky{background-color:var(--mat-sys-surface)!important;transition:background-color .1s}.contenedorCeldaAcciones{display:flex;align-items:center;cursor:default!important}.rowClickEnable{cursor:pointer;transition:background-color .1s}.rowClickEnable:hover,.rowClickEnable:hover>.celdaAcciones,.rowClickEnable:hover>.celdaSelection,.rowClickEnable:hover>.celdaDatos,.rowClickEnable:hover>.columnSticky{background-color:var(--mat-sys-surface-container)!important}.inputQueryColumn,.selectColumn,.dateColumn{--mat-form-field-outlined-focus-outline-color: transparent;--mat-form-field-outlined-outline-color: transparent;--mat-form-field-outlined-hover-outline-color: transparent}.advancedFiltersApplied{display:flex;flex-direction:row;justify-content:space-between;gap:20px;border-radius:10px;background-color:var(--warning);color:var(--on-warning);align-items:center;margin-top:10px;padding:5px 5px 5px 15px;cursor:pointer;transition:background-color .3s}.advancedFiltersApplied:hover:not(:has(button:hover)){background-color:color-mix(in srgb,var(--warning) 80%,transparent)}.advancedFiltersApplied p{margin:0}.rowDetail{height:0}.expandableRow td{border-bottom-width:0}.detailWrapper{overflow:hidden;display:grid;grid-template-rows:0fr;grid-template-columns:100%;transition:grid-template-rows 225ms cubic-bezier(.4,0,.2,1)}.detailWrapperExpanded{grid-template-rows:1fr}.columnDetail{display:flex;flex-direction:column;min-height:0}.totalPerPageFooter{font-weight:700}.totalFooter{font-weight:700;background-color:var(--mat-sys-surface-container-highest);color:var(--mat-sys-on-surface)}.hideFooter{display:none}.paginatorContainer{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:20px;margin-top:10px}.footerLegend{display:flex;flex-direction:row;gap:30px}.footerLegend p{margin:0;font:var(--mat-sys-label-medium)}.legendItem{display:flex;flex-direction:row;align-items:center;gap:6px}.legendSquare{width:24px;height:14px;border-radius:4px;border:2px solid var(--mat-sys-on-surface)}.totalGeneral{background-color:var(--mat-sys-surface-container-highest)}.headerCheckbox{--mat-checkbox-selected-checkmark-color: var(--mat-sys-primary);--mat-checkbox-selected-focus-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-focus-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-selected-hover-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-hover-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-selected-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-pressed-icon-color: var(--mat-sys-on-primary);--mat-checkbox-selected-pressed-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-focus-icon-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-focus-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-hover-icon-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-hover-state-layer-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-icon-color: var(--mat-sys-on-primary);--mat-checkbox-unselected-pressed-state-layer-color: var(--mat-sys-on-primary)}@media (max-width: 1200px){.filterContainer{flex-direction:column;align-items:normal}.moreFiltersContainer{flex-direction:column}}@media (max-width: 900px){.footerLegend{flex-direction:column;gap:6px}}@media (max-width: 700px){.paginatorContainer{flex-direction:column;align-items:flex-end}}@media (max-width: 600px){.titleAndButtonContainer{flex-direction:column;align-items:normal}}\n"] }]
|
|
3183
|
+
}], propDecorators: { filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], queryFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryFilter", required: false }] }], moreFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "moreFilters", required: false }] }], createClick: [{ type: i0.Output, args: ["createClick"] }], updateClick: [{ type: i0.Output, args: ["updateClick"] }], deleteClick: [{ type: i0.Output, args: ["deleteClick"] }], rowActionClick: [{ type: i0.Output, args: ["rowActionClick"] }], expandedItemChange: [{ type: i0.Output, args: ["expandedItemChange"] }], selectionActionEvent: [{ type: i0.Output, args: ["selectionActionEvent"] }], tableContentTemplate: [{ type: i0.ViewChild, args: ['tableContent', { isSignal: true }] }], paginator: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatPaginator), { isSignal: true }] }], onEscape: [{
|
|
3184
|
+
type: HostListener,
|
|
3185
|
+
args: ['document:keydown.escape']
|
|
3186
|
+
}] } });
|
|
3187
|
+
|
|
3188
|
+
class NgxDialogService {
|
|
3189
|
+
// dependencies injection
|
|
3190
|
+
_dialog = inject(MatDialog);
|
|
3191
|
+
/**
|
|
3192
|
+
*
|
|
3193
|
+
* @param config
|
|
3194
|
+
* @param dialogConfig
|
|
3195
|
+
* @returns Observable<DialogResult>
|
|
3196
|
+
*
|
|
3197
|
+
* Opens a text dialog with the provided configuration.
|
|
3198
|
+
*/
|
|
3199
|
+
openText(config, dialogConfig) {
|
|
3200
|
+
return this._dialog.open(NgxDialog, {
|
|
3201
|
+
...dialogConfig,
|
|
3202
|
+
data: {
|
|
3203
|
+
...config,
|
|
3204
|
+
body: {
|
|
3205
|
+
type: DialogBodyType.TEXT,
|
|
3206
|
+
content: config.content
|
|
3207
|
+
},
|
|
3208
|
+
},
|
|
3209
|
+
minWidth: dialogConfig?.minWidth ?? '400px',
|
|
3210
|
+
autoFocus: dialogConfig?.autoFocus ?? false
|
|
3211
|
+
}).afterClosed();
|
|
3212
|
+
}
|
|
3213
|
+
/**
|
|
3214
|
+
*
|
|
3215
|
+
* @param title
|
|
3216
|
+
* @param message
|
|
3217
|
+
* @param cancelText
|
|
3218
|
+
* @param confirmText
|
|
3219
|
+
* @param dialogConfig
|
|
3220
|
+
* @returns Observable<DialogResult>
|
|
3221
|
+
*
|
|
3222
|
+
* Opens a confirmation dialog with cancel and confirm buttons.
|
|
3223
|
+
*/
|
|
3224
|
+
confirm(config, dialogConfig) {
|
|
3225
|
+
return this.openText({
|
|
3226
|
+
title: config.title,
|
|
3227
|
+
content: config.message,
|
|
3228
|
+
subtitle: config.subtitle,
|
|
3229
|
+
icon: config.icon,
|
|
3230
|
+
iconColor: config.iconColor,
|
|
3231
|
+
cancelText: config.cancelText ?? 'Cancelar',
|
|
3232
|
+
confirmText: config.confirmText ?? 'Confirmar'
|
|
3233
|
+
}, dialogConfig);
|
|
2601
3234
|
}
|
|
2602
3235
|
/**
|
|
2603
3236
|
*
|
|
@@ -2704,11 +3337,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
2704
3337
|
}]
|
|
2705
3338
|
}] });
|
|
2706
3339
|
|
|
2707
|
-
// export * from './lib/utils/index';
|
|
2708
|
-
|
|
2709
3340
|
/**
|
|
2710
3341
|
* Generated bundle index. Do not edit.
|
|
2711
3342
|
*/
|
|
2712
3343
|
|
|
2713
|
-
export { DynamicHostDirective, NgxBasicSelect,
|
|
3344
|
+
export { DynamicHostDirective, NgxBasicSelect, NgxBasicTableComponent, NgxConfirmDialogComponent, NgxDialog, NgxDialogService, NgxInputFile, NgxLoadingButton, NgxPaginatedSelect, NgxPaginatedTable, NgxPaginatedTableIntl, OPERATOR_BY_FILTER_TYPE, PaginatedSearchableSelectComponent, SearchableSelectComponent, USER_ID_FACTORY, base64ToUtf8, includeNoSensible, isFilterOption };
|
|
2714
3345
|
//# sourceMappingURL=ngx-eiffage-material.mjs.map
|