@eherve/angular-material-datatable 19.25.0 → 19.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/README.md +2 -0
  2. package/fesm2022/eherve-angular-material-datatable.mjs +3023 -1
  3. package/fesm2022/eherve-angular-material-datatable.mjs.map +1 -1
  4. package/lib/datatable.component.d.ts +10 -0
  5. package/lib/directives/datatable-row-viewport.directive.d.ts +22 -0
  6. package/lib/pipes/safe-html.pipe.d.ts +2 -1
  7. package/lib/types/datatable-column.type.d.ts +2 -1
  8. package/package.json +1 -1
  9. package/fesm2022/eherve-angular-material-datatable-cell-checkbox-value.component-E5dQ-SJb.mjs +0 -26
  10. package/fesm2022/eherve-angular-material-datatable-cell-checkbox-value.component-E5dQ-SJb.mjs.map +0 -1
  11. package/fesm2022/eherve-angular-material-datatable-cell-date-value.component-CXh9rWrt.mjs +0 -103
  12. package/fesm2022/eherve-angular-material-datatable-cell-date-value.component-CXh9rWrt.mjs.map +0 -1
  13. package/fesm2022/eherve-angular-material-datatable-cell-duration-value.component-Br8ga1qE.mjs +0 -35
  14. package/fesm2022/eherve-angular-material-datatable-cell-duration-value.component-Br8ga1qE.mjs.map +0 -1
  15. package/fesm2022/eherve-angular-material-datatable-cell-number-value.component-BGmWTDbF.mjs +0 -26
  16. package/fesm2022/eherve-angular-material-datatable-cell-number-value.component-BGmWTDbF.mjs.map +0 -1
  17. package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-_CDm5Nid.mjs +0 -45
  18. package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-_CDm5Nid.mjs.map +0 -1
  19. package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-oKhIjmQe.mjs +0 -2650
  20. package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-oKhIjmQe.mjs.map +0 -1
  21. package/fesm2022/eherve-angular-material-datatable-get.pipe-OPM3WlAY.mjs +0 -19
  22. package/fesm2022/eherve-angular-material-datatable-get.pipe-OPM3WlAY.mjs.map +0 -1
  23. package/fesm2022/eherve-angular-material-datatable-suffix-function.pipe-CQO-ghpR.mjs +0 -20
  24. package/fesm2022/eherve-angular-material-datatable-suffix-function.pipe-CQO-ghpR.mjs.map +0 -1
  25. package/fesm2022/eherve-angular-material-datatable-transform.pipe-BOmcXXZU.mjs +0 -21
  26. package/fesm2022/eherve-angular-material-datatable-transform.pipe-BOmcXXZU.mjs.map +0 -1
@@ -1,2 +1,3024 @@
1
- export { e as NGX_MAT_DATATABLE_DEFAULT_OPTIONS, c as NgxMatDatatableComponent, f as NgxMatDatatableContentDirective, h as NgxMatDatatableIntl, N as NgxMatDatatableModule, p as provideNgxMatDatatableDefaultOptions } from './eherve-angular-material-datatable-eherve-angular-material-datatable-oKhIjmQe.mjs';
1
+ import * as i0 from '@angular/core';
2
+ import { Pipe, Component, Input, Injectable, inject, ChangeDetectorRef, SecurityContext, LOCALE_ID, Injector, forwardRef, ViewChild, signal, ChangeDetectionStrategy, HostBinding, InjectionToken, Directive, EventEmitter, ElementRef, Output, ContentChildren, NgModule } from '@angular/core';
3
+ import { trigger, transition, style, animate, state } from '@angular/animations';
4
+ import * as i2$1 from '@angular/cdk/drag-drop';
5
+ import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
6
+ import * as i1 from '@angular/common';
7
+ import { CommonModule } from '@angular/common';
8
+ import * as i2 from '@angular/forms';
9
+ import { FormControl, NgControl, NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule, FormGroup, Validators } from '@angular/forms';
10
+ import * as i5$2 from '@angular/material/badge';
11
+ import { MatBadgeModule } from '@angular/material/badge';
12
+ import * as i3$1 from '@angular/material/button';
13
+ import { MatButtonModule } from '@angular/material/button';
14
+ import * as i15 from '@angular/material/card';
15
+ import { MatCardModule } from '@angular/material/card';
16
+ import * as i13 from '@angular/material/chips';
17
+ import { MatChipsModule } from '@angular/material/chips';
18
+ import * as i4$1 from '@angular/material/form-field';
19
+ import { MatLabel, MatFormFieldModule } from '@angular/material/form-field';
20
+ import * as i5 from '@angular/material/icon';
21
+ import { MatIconModule } from '@angular/material/icon';
22
+ import * as i9 from '@angular/material/menu';
23
+ import { MatMenuModule } from '@angular/material/menu';
24
+ import * as i10$1 from '@angular/material/paginator';
25
+ import { MatPaginatorIntl, MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
26
+ import * as i1$3 from '@angular/material/progress-spinner';
27
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
28
+ import * as i12 from '@angular/material/table';
29
+ import { MatTable, MatTableModule } from '@angular/material/table';
30
+ import * as i14 from '@angular/material/tooltip';
31
+ import { MatTooltipModule } from '@angular/material/tooltip';
32
+ import * as i3$3 from 'ngx-countup';
33
+ import { CountUpModule } from 'ngx-countup';
34
+ import * as i3 from 'ngx-intersection-observer';
35
+ import { IntersectionObserverModule } from 'ngx-intersection-observer';
36
+ import moment from 'moment';
37
+ import * as rxjs from 'rxjs';
38
+ import { interval, share, catchError, of, shareReplay, Subscription, BehaviorSubject, Subject, filter, debounceTime, switchMap, startWith, tap, defer, finalize, map, firstValueFrom } from 'rxjs';
39
+ import humanizeDuration from 'humanize-duration';
40
+ import * as i1$1 from '@angular/platform-browser';
41
+ import * as i4 from '@angular/material/autocomplete';
42
+ import { MatAutocomplete, MatAutocompleteModule } from '@angular/material/autocomplete';
43
+ import * as i6 from '@angular/material/input';
44
+ import { MatInputModule } from '@angular/material/input';
45
+ import * as i10 from '@angular/material/progress-bar';
46
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
47
+ import * as i5$1 from '@angular/material/core';
48
+ import { DateAdapter, MAT_DATE_LOCALE } from '@angular/material/core';
49
+ import * as i3$2 from '@angular/material/checkbox';
50
+ import { MatCheckboxModule } from '@angular/material/checkbox';
51
+ import { provideMomentDateAdapter } from '@angular/material-moment-adapter';
52
+ import * as i4$2 from '@angular/material/datepicker';
53
+ import { MatDatepickerIntl, MatDatepickerModule } from '@angular/material/datepicker';
54
+ import * as i1$2 from '@angular/cdk/overlay';
55
+ import { OverlayModule } from '@angular/cdk/overlay';
56
+ import * as i6$1 from '@angular/material/select';
57
+ import { MatSelectModule } from '@angular/material/select';
58
+ import { DataSource } from '@angular/cdk/collections';
59
+ import * as lodash from 'lodash-es';
60
+
61
+ /** @format */
62
+ function get(obj, path) {
63
+ const chunks = path.split('.');
64
+ let value = obj;
65
+ for (let i = 0; i < chunks.length; ++i) {
66
+ value = value[chunks[i]];
67
+ if (value === undefined || value === null)
68
+ return null;
69
+ }
70
+ return value;
71
+ }
72
+
73
+ /** @format */
74
+ class GetPipe {
75
+ transform(obj, path) {
76
+ return get(obj, path);
77
+ }
78
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: GetPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
79
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: GetPipe, isStandalone: true, name: "get" });
80
+ }
81
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: GetPipe, decorators: [{
82
+ type: Pipe,
83
+ args: [{ name: 'get' }]
84
+ }] });
85
+
86
+ /** @format */
87
+ class TransformPipe {
88
+ transform(value, row, column) {
89
+ if (typeof column.transform === 'function') {
90
+ return column.transform(value, row);
91
+ }
92
+ return value;
93
+ }
94
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: TransformPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
95
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: TransformPipe, isStandalone: true, name: "transform" });
96
+ }
97
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: TransformPipe, decorators: [{
98
+ type: Pipe,
99
+ args: [{ name: 'transform' }]
100
+ }] });
101
+
102
+ /** @format */
103
+ class CellCheckboxValueComponent {
104
+ column;
105
+ row;
106
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellCheckboxValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
107
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: CellCheckboxValueComponent, isStandalone: true, selector: "lib-cell-checkbox-value", inputs: { column: "column", row: "row" }, ngImport: i0, template: "<!-- @format -->\n\n@let value = row | get: column.property | transform: row : column;\n@if (value === false) {\n <mat-icon>check_box_outline_blank</mat-icon>\n} @else if (value === true) {\n <mat-icon>check_box</mat-icon>\n}\n", styles: ["mat-icon{color:currentColor;padding:8px;box-sizing:content-box}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: GetPipe, name: "get" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: TransformPipe, name: "transform" }] });
108
+ }
109
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellCheckboxValueComponent, decorators: [{
110
+ type: Component,
111
+ args: [{ selector: 'lib-cell-checkbox-value', imports: [CommonModule, GetPipe, MatIconModule, TransformPipe], template: "<!-- @format -->\n\n@let value = row | get: column.property | transform: row : column;\n@if (value === false) {\n <mat-icon>check_box_outline_blank</mat-icon>\n} @else if (value === true) {\n <mat-icon>check_box</mat-icon>\n}\n", styles: ["mat-icon{color:currentColor;padding:8px;box-sizing:content-box}\n"] }]
112
+ }], propDecorators: { column: [{
113
+ type: Input
114
+ }], row: [{
115
+ type: Input
116
+ }] } });
117
+
118
+ /** @format */
119
+ class DateRefreshService {
120
+ intervals = new Map();
121
+ forInterval(refreshTime) {
122
+ let ticks = this.intervals.get(refreshTime);
123
+ if (!ticks) {
124
+ ticks = interval(refreshTime).pipe(share());
125
+ this.intervals.set(refreshTime, ticks);
126
+ }
127
+ return ticks;
128
+ }
129
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: DateRefreshService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
130
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: DateRefreshService, providedIn: 'root' });
131
+ }
132
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: DateRefreshService, decorators: [{
133
+ type: Injectable,
134
+ args: [{ providedIn: 'root' }]
135
+ }] });
136
+
137
+ /** @format */
138
+ class MomentFormatPipe {
139
+ transform(data, options) {
140
+ const date = this.getMoment(data);
141
+ if (!date)
142
+ return '';
143
+ const format = options?.format || 'LLL';
144
+ return options?.locale ? date.locale(options.locale).format(format) : date.format(format);
145
+ }
146
+ getMoment(data) {
147
+ if (typeof data === 'string')
148
+ return moment(data);
149
+ if (typeof data === 'number')
150
+ return moment(data);
151
+ if (data instanceof Date)
152
+ return moment(data);
153
+ if (moment.isMoment(data))
154
+ return data.clone();
155
+ if (typeof data?.valueOf === 'function') {
156
+ const value = data.valueOf();
157
+ if (typeof value === 'number')
158
+ return moment(data);
159
+ }
160
+ return null;
161
+ }
162
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: MomentFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
163
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: MomentFormatPipe, isStandalone: true, name: "momentFormat" });
164
+ }
165
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: MomentFormatPipe, decorators: [{
166
+ type: Pipe,
167
+ args: [{ name: 'momentFormat' }]
168
+ }] });
169
+
170
+ /** @format */
171
+ function duration(data, options) {
172
+ const durationOption = { maxDecimalPoints: 0, largest: 1, fallbacks: ['en'] };
173
+ if (options?.locale)
174
+ durationOption.language = options.locale;
175
+ if (options?.largest)
176
+ durationOption.largest = options.largest;
177
+ let value;
178
+ if (typeof data === 'number')
179
+ value = data;
180
+ else if (typeof data === 'string') {
181
+ const date = new Date(data);
182
+ if (isNaN(date.valueOf()))
183
+ return null;
184
+ value = Date.now() - date.valueOf();
185
+ }
186
+ else if (typeof data?.valueOf === 'function')
187
+ value = Date.now() - data.valueOf();
188
+ if (value === undefined || value === null)
189
+ return null;
190
+ return humanizeDuration(value, durationOption);
191
+ }
192
+
193
+ /** @format */
194
+ class CellDateValueComponent {
195
+ changeDetectorRef = inject(ChangeDetectorRef);
196
+ dateRefreshService = inject(DateRefreshService);
197
+ column;
198
+ set setRow(row) {
199
+ this.row = row;
200
+ this.value = get(this.row, this.column.property);
201
+ if (typeof this.column.transform === 'function') {
202
+ this.value = this.column.transform(this.value, this.row);
203
+ }
204
+ this.duration = duration(this.value, this.column);
205
+ }
206
+ row;
207
+ value;
208
+ duration;
209
+ refreshSubscription;
210
+ ngOnInit() {
211
+ if (!this.column.withDuration || !this.column.durationRefreshTime)
212
+ return;
213
+ this.refreshSubscription = this.dateRefreshService.forInterval(this.column.durationRefreshTime).subscribe(() => {
214
+ this.duration = duration(this.value, this.column);
215
+ this.changeDetectorRef.detectChanges();
216
+ });
217
+ }
218
+ ngOnDestroy() {
219
+ this.refreshSubscription?.unsubscribe();
220
+ }
221
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellDateValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
222
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: CellDateValueComponent, isStandalone: true, selector: "lib-cell-date-value", inputs: { column: "column", setRow: ["row", "setRow"] }, ngImport: i0, template: "<!-- @format -->\n\n@if (value) {\n <span class=\"date\"> {{ value | momentFormat: column }} </span>\n @if (column.withDuration) {\n <span class=\"duration\"> ({{ duration }}) </span>\n }\n}\n", styles: [".date,.duration{white-space:nowrap}.duration{margin-left:4px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "pipe", type: MomentFormatPipe, name: "momentFormat" }] });
223
+ }
224
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellDateValueComponent, decorators: [{
225
+ type: Component,
226
+ args: [{ selector: 'lib-cell-date-value', imports: [CommonModule, MatIconModule, MomentFormatPipe], template: "<!-- @format -->\n\n@if (value) {\n <span class=\"date\"> {{ value | momentFormat: column }} </span>\n @if (column.withDuration) {\n <span class=\"duration\"> ({{ duration }}) </span>\n }\n}\n", styles: [".date,.duration{white-space:nowrap}.duration{margin-left:4px}\n"] }]
227
+ }], propDecorators: { column: [{
228
+ type: Input
229
+ }], setRow: [{
230
+ type: Input,
231
+ args: ['row']
232
+ }] } });
233
+
234
+ /** @format */
235
+ class CellDurationValueComponent {
236
+ column;
237
+ set setRow(row) {
238
+ this.row = row;
239
+ this.value = get(this.row, this.column.property);
240
+ if (typeof this.column.transform === 'function') {
241
+ this.value = this.column.transform(this.value, this.row);
242
+ }
243
+ this.duration = duration(this.value, this.column);
244
+ }
245
+ row;
246
+ value;
247
+ duration;
248
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellDurationValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
249
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: CellDurationValueComponent, isStandalone: true, selector: "lib-cell-duration-value", inputs: { column: "column", setRow: ["row", "setRow"] }, ngImport: i0, template: "<!-- @format -->\n\n@if (duration !== null) {\n {{ duration }}\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatIconModule }] });
250
+ }
251
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellDurationValueComponent, decorators: [{
252
+ type: Component,
253
+ args: [{ selector: 'lib-cell-duration-value', imports: [CommonModule, MatIconModule], template: "<!-- @format -->\n\n@if (duration !== null) {\n {{ duration }}\n}\n" }]
254
+ }], propDecorators: { column: [{
255
+ type: Input
256
+ }], setRow: [{
257
+ type: Input,
258
+ args: ['row']
259
+ }] } });
260
+
261
+ /** @format */
262
+ class CellNumberValueComponent {
263
+ column;
264
+ row;
265
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellNumberValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
266
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.4", type: CellNumberValueComponent, isStandalone: true, selector: "lib-cell-number-value", inputs: { column: "column", row: "row" }, ngImport: i0, template: "<!-- @format -->\n\n@let value = row | get: column.property;\n{{ value | transform: row : column | number: column.format : column.locale }}\n", styles: ["mat-icon{padding:8px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: GetPipe, name: "get" }, { kind: "ngmodule", type: MatIconModule }, { kind: "pipe", type: TransformPipe, name: "transform" }] });
267
+ }
268
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellNumberValueComponent, decorators: [{
269
+ type: Component,
270
+ args: [{ selector: 'lib-cell-number-value', imports: [CommonModule, GetPipe, MatIconModule, TransformPipe], template: "<!-- @format -->\n\n@let value = row | get: column.property;\n{{ value | transform: row : column | number: column.format : column.locale }}\n", styles: ["mat-icon{padding:8px}\n"] }]
271
+ }], propDecorators: { column: [{
272
+ type: Input
273
+ }], row: [{
274
+ type: Input
275
+ }] } });
276
+
277
+ /** @format */
278
+ class SafeHtmlPipe {
279
+ sanitizer;
280
+ constructor(sanitizer) {
281
+ this.sanitizer = sanitizer;
282
+ }
283
+ transform(html) {
284
+ const sanitizedHtml = this.sanitizer.sanitize(SecurityContext.HTML, html ?? '') ?? '';
285
+ return this.sanitizer.bypassSecurityTrustHtml(sanitizedHtml);
286
+ }
287
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
288
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: SafeHtmlPipe, isStandalone: true, name: "safeHtml" });
289
+ }
290
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SafeHtmlPipe, decorators: [{
291
+ type: Pipe,
292
+ args: [{
293
+ name: 'safeHtml',
294
+ }]
295
+ }], ctorParameters: () => [{ type: i1$1.DomSanitizer }] });
296
+
297
+ /** @format */
298
+ class SelectOptionPipe {
299
+ transform(value, options) {
300
+ if (!options)
301
+ return null;
302
+ return options.find((option) => option.value === value) || null;
303
+ }
304
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SelectOptionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
305
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: SelectOptionPipe, isStandalone: true, name: "selectOption" });
306
+ }
307
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SelectOptionPipe, decorators: [{
308
+ type: Pipe,
309
+ args: [{ name: 'selectOption' }]
310
+ }] });
311
+
312
+ /** @format */
313
+ class IsArrayPipe {
314
+ transform(obj) {
315
+ return Array.isArray(obj);
316
+ }
317
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: IsArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
318
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: IsArrayPipe, isStandalone: true, name: "isArray" });
319
+ }
320
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: IsArrayPipe, decorators: [{
321
+ type: Pipe,
322
+ args: [{ name: 'isArray' }]
323
+ }] });
324
+
325
+ /** @format */
326
+ class SelectOptionsCacheService {
327
+ cache = new WeakMap();
328
+ resolve(source) {
329
+ const cached = this.cache.get(source);
330
+ if (cached)
331
+ return cached;
332
+ const shared = source.pipe(catchError(() => {
333
+ this.cache.delete(source);
334
+ return of([]);
335
+ }), shareReplay({ bufferSize: 1, refCount: true }));
336
+ this.cache.set(source, shared);
337
+ return shared;
338
+ }
339
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SelectOptionsCacheService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
340
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SelectOptionsCacheService, providedIn: 'root' });
341
+ }
342
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SelectOptionsCacheService, decorators: [{
343
+ type: Injectable,
344
+ args: [{ providedIn: 'root' }]
345
+ }] });
346
+
347
+ /** @format */
348
+ class CellSelectValueComponent {
349
+ column;
350
+ row;
351
+ options = [];
352
+ selectOptionsCache = inject(SelectOptionsCacheService);
353
+ subsink = new Subscription();
354
+ ngOnInit() {
355
+ if (Array.isArray(this.column.options))
356
+ this.options = this.column.options;
357
+ else {
358
+ this.subsink.add(this.selectOptionsCache.resolve(this.column.options).subscribe(options => {
359
+ this.options = options;
360
+ }));
361
+ }
362
+ }
363
+ ngOnDestroy() {
364
+ this.subsink.unsubscribe();
365
+ }
366
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellSelectValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
367
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: CellSelectValueComponent, isStandalone: true, selector: "lib-cell-select-value", inputs: { column: "column", row: "row" }, ngImport: i0, template: "<!-- @format -->\n\n@let value = row | get: column.property | transform: row : column;\n\n@if (column.isArrayValue && value | isArray) {\n <div class=\"options\">\n @for (v of value; track v) {\n <ng-container *ngTemplateOutlet=\"optionTmpl; context: { value: v }\"></ng-container>\n }\n </div>\n} @else {\n <ng-container *ngTemplateOutlet=\"optionTmpl; context: { value }\"></ng-container>\n}\n\n<ng-template #optionTmpl let-value=\"value\">\n @let option = value | selectOption: options;\n @if (option) {\n <div class=\"option\">\n @if (option.icon) {\n @switch (option.iconSrc) {\n @case ('svg') {\n <mat-icon [svgIcon]=\"option.icon\" [style.color]=\"option.iconColor ?? option.color\" [style.margin-right.px]=\"8\"></mat-icon>\n }\n @default {\n <mat-icon [style.color]=\"option.iconColor ?? option.color\" [style.margin-right.px]=\"8\">\n {{ option.icon }}\n </mat-icon>\n }\n }\n }\n <mat-label *ngIf=\"!column.iconOnly\" [style.color]=\"option.color\" [innerHTML]=\"option.name | safeHtml\"></mat-label>\n </div>\n } @else {\n {{ value }}\n }\n</ng-template>\n", styles: [".option{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;padding:4px}mat-icon,mat-label{color:currentColor}:host-context(tr.has-click:hover) mat-icon,:host-context(tr.has-click:hover) mat-label{color:var(--datatable-hover-color, var(--mat-sys-on-primary))!important}.options{display:flex;box-sizing:border-box;place-content:start start;align-items:center;flex-direction:row;flex-wrap:wrap}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: SelectOptionPipe, name: "selectOption" }, { kind: "pipe", type: GetPipe, name: "get" }, { kind: "pipe", type: IsArrayPipe, name: "isArray" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "pipe", type: TransformPipe, name: "transform" }, { kind: "pipe", type: SafeHtmlPipe, name: "safeHtml" }] });
368
+ }
369
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellSelectValueComponent, decorators: [{
370
+ type: Component,
371
+ args: [{ selector: 'lib-cell-select-value', imports: [CommonModule, SelectOptionPipe, GetPipe, IsArrayPipe, MatIconModule, MatLabel, TransformPipe, SafeHtmlPipe], template: "<!-- @format -->\n\n@let value = row | get: column.property | transform: row : column;\n\n@if (column.isArrayValue && value | isArray) {\n <div class=\"options\">\n @for (v of value; track v) {\n <ng-container *ngTemplateOutlet=\"optionTmpl; context: { value: v }\"></ng-container>\n }\n </div>\n} @else {\n <ng-container *ngTemplateOutlet=\"optionTmpl; context: { value }\"></ng-container>\n}\n\n<ng-template #optionTmpl let-value=\"value\">\n @let option = value | selectOption: options;\n @if (option) {\n <div class=\"option\">\n @if (option.icon) {\n @switch (option.iconSrc) {\n @case ('svg') {\n <mat-icon [svgIcon]=\"option.icon\" [style.color]=\"option.iconColor ?? option.color\" [style.margin-right.px]=\"8\"></mat-icon>\n }\n @default {\n <mat-icon [style.color]=\"option.iconColor ?? option.color\" [style.margin-right.px]=\"8\">\n {{ option.icon }}\n </mat-icon>\n }\n }\n }\n <mat-label *ngIf=\"!column.iconOnly\" [style.color]=\"option.color\" [innerHTML]=\"option.name | safeHtml\"></mat-label>\n </div>\n } @else {\n {{ value }}\n }\n</ng-template>\n", styles: [".option{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;padding:4px}mat-icon,mat-label{color:currentColor}:host-context(tr.has-click:hover) mat-icon,:host-context(tr.has-click:hover) mat-label{color:var(--datatable-hover-color, var(--mat-sys-on-primary))!important}.options{display:flex;box-sizing:border-box;place-content:start start;align-items:center;flex-direction:row;flex-wrap:wrap}\n"] }]
372
+ }], propDecorators: { column: [{
373
+ type: Input
374
+ }], row: [{
375
+ type: Input
376
+ }] } });
377
+
378
+ /** @format */
379
+ const DEFAULT_LABELS = {
380
+ noDateLabel: 'No data',
381
+ itemsPerPageLabel: `Items per page:`,
382
+ nextPageLabel: `Next page`,
383
+ lastPageLabel: `Last page`,
384
+ previousPageLabel: `Previous page`,
385
+ firstPageLabel: `First page`,
386
+ onLabel: `on`,
387
+ incrementalLoadingLabel: 'Loading...',
388
+ incrementalLoadMoreLabel: 'Load more',
389
+ columnsActionLabel: 'Configure columns',
390
+ exportActionLabel: 'Export data',
391
+ refreshActionLabel: 'Refresh data',
392
+ showColumnActionLabel: 'Show column',
393
+ hideColumnActionLabel: 'Hide column',
394
+ pinColumnActionLabel: 'Pin column',
395
+ unpinColumnActionLabel: 'Unpin column',
396
+ sortColumnActionLabel: 'Sort column',
397
+ clearFilterLabel: 'Clear filter',
398
+ };
399
+ const LABELS = {
400
+ fr: {
401
+ noDateLabel: 'Aucune donnée',
402
+ itemsPerPageLabel: `Éléments par page :`,
403
+ nextPageLabel: `Page suivante`,
404
+ lastPageLabel: `Dernière page`,
405
+ previousPageLabel: `Page précédente`,
406
+ firstPageLabel: `Première page`,
407
+ onLabel: `sur`,
408
+ incrementalLoadingLabel: 'Chargement...',
409
+ incrementalLoadMoreLabel: 'Charger plus',
410
+ columnsActionLabel: 'Configurer les colonnes',
411
+ exportActionLabel: 'Exporter les données',
412
+ refreshActionLabel: 'Actualiser les données',
413
+ showColumnActionLabel: 'Afficher la colonne',
414
+ hideColumnActionLabel: 'Masquer la colonne',
415
+ pinColumnActionLabel: 'Épingler la colonne',
416
+ unpinColumnActionLabel: 'Désépingler la colonne',
417
+ sortColumnActionLabel: 'Trier la colonne',
418
+ clearFilterLabel: 'Effacer le filtre',
419
+ },
420
+ };
421
+ const DEFAULT_NUMBER_OPTIONS = {
422
+ separator: ',',
423
+ decimal: '.',
424
+ duration: 0.3,
425
+ useEasing: false,
426
+ };
427
+ const NUMBER_OPTIONS = {
428
+ fr: {
429
+ separator: ' ',
430
+ decimal: ',',
431
+ },
432
+ };
433
+ class NgxMatDatatableIntl {
434
+ locale = inject(LOCALE_ID);
435
+ noDateLabel;
436
+ itemsPerPageLabel;
437
+ nextPageLabel;
438
+ lastPageLabel;
439
+ previousPageLabel;
440
+ firstPageLabel;
441
+ onLabel;
442
+ incrementalLoadingLabel;
443
+ incrementalLoadMoreLabel;
444
+ columnsActionLabel;
445
+ exportActionLabel;
446
+ refreshActionLabel;
447
+ showColumnActionLabel;
448
+ hideColumnActionLabel;
449
+ pinColumnActionLabel;
450
+ unpinColumnActionLabel;
451
+ sortColumnActionLabel;
452
+ clearFilterLabel;
453
+ numberOptions;
454
+ getRangeLabel = (page, pageSize, length) => {
455
+ if (length === 0 || pageSize === 0)
456
+ return `0 ${this.onLabel} ${length}`;
457
+ length = Math.max(length, 0);
458
+ const startIndex = page * pageSize;
459
+ const endIndex = startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize;
460
+ return `${startIndex + 1} - ${endIndex} ${this.onLabel} ${length}`;
461
+ };
462
+ constructor() {
463
+ const locale = this.locale.toLowerCase().split(/[-_]/)[0];
464
+ this.setLabels(LABELS[locale] ?? DEFAULT_LABELS);
465
+ this.numberOptions = { ...DEFAULT_NUMBER_OPTIONS, ...(NUMBER_OPTIONS[locale] ?? {}) };
466
+ }
467
+ setLabels(labels) {
468
+ this.noDateLabel = labels.noDateLabel;
469
+ this.itemsPerPageLabel = labels.itemsPerPageLabel;
470
+ this.nextPageLabel = labels.nextPageLabel;
471
+ this.lastPageLabel = labels.lastPageLabel;
472
+ this.previousPageLabel = labels.previousPageLabel;
473
+ this.firstPageLabel = labels.firstPageLabel;
474
+ this.onLabel = labels.onLabel;
475
+ this.incrementalLoadingLabel = labels.incrementalLoadingLabel;
476
+ this.incrementalLoadMoreLabel = labels.incrementalLoadMoreLabel;
477
+ this.columnsActionLabel = labels.columnsActionLabel;
478
+ this.exportActionLabel = labels.exportActionLabel;
479
+ this.refreshActionLabel = labels.refreshActionLabel;
480
+ this.showColumnActionLabel = labels.showColumnActionLabel;
481
+ this.hideColumnActionLabel = labels.hideColumnActionLabel;
482
+ this.pinColumnActionLabel = labels.pinColumnActionLabel;
483
+ this.unpinColumnActionLabel = labels.unpinColumnActionLabel;
484
+ this.sortColumnActionLabel = labels.sortColumnActionLabel;
485
+ this.clearFilterLabel = labels.clearFilterLabel;
486
+ }
487
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
488
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableIntl, providedIn: 'root' });
489
+ }
490
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableIntl, decorators: [{
491
+ type: Injectable,
492
+ args: [{ providedIn: 'root' }]
493
+ }], ctorParameters: () => [] });
494
+
495
+ /** @format */
496
+ const HTML_ENTITIES = {
497
+ amp: '&',
498
+ apos: "'",
499
+ gt: '>',
500
+ lt: '<',
501
+ nbsp: ' ',
502
+ quot: '"',
503
+ };
504
+ function stripHtml(value, tagReplacement = ' ') {
505
+ if (!value)
506
+ return '';
507
+ return decodeHtmlEntities(value.replace(/<[^>]+>/g, tagReplacement))
508
+ .replace(/\s+/g, ' ')
509
+ .trim();
510
+ }
511
+ function decodeHtmlEntities(value) {
512
+ return value.replace(/&(#(?:x[0-9a-f]+|\d+)|[a-z][a-z0-9]+);/gi, (match, entity) => {
513
+ if (!entity.startsWith('#'))
514
+ return HTML_ENTITIES[entity.toLowerCase()] ?? match;
515
+ const radix = entity[1]?.toLowerCase() === 'x' ? 16 : 10;
516
+ const source = radix === 16 ? entity.slice(2) : entity.slice(1);
517
+ const codePoint = Number.parseInt(source, radix);
518
+ if (!Number.isInteger(codePoint) || codePoint < 0 || codePoint > 0x10ffff)
519
+ return match;
520
+ try {
521
+ return String.fromCodePoint(codePoint);
522
+ }
523
+ catch {
524
+ return match;
525
+ }
526
+ });
527
+ }
528
+
529
+ /** @format */
530
+ class HeaderAutocompleteFilterComponent {
531
+ column;
532
+ options = [];
533
+ groups = [];
534
+ hasMore = false;
535
+ searching = false;
536
+ input;
537
+ auto;
538
+ control;
539
+ selectControl = new FormControl();
540
+ onChange = () => { };
541
+ onTouched = () => { };
542
+ filter$ = new BehaviorSubject(undefined);
543
+ nextPage$ = new Subject();
544
+ datatableIntl = inject(NgxMatDatatableIntl);
545
+ injector = inject(Injector);
546
+ changeDetectorRef = inject(ChangeDetectorRef);
547
+ subsink = new Subscription();
548
+ writeValue(value) {
549
+ if (value?.value !== this.selectControl.value) {
550
+ if (value?.name) {
551
+ if (!this.options.find(o => o.value === value.value)) {
552
+ this.options.push({ value: value.value, name: value.name });
553
+ }
554
+ }
555
+ this.selectControl.setValue(value?.value, { emitEvent: false });
556
+ }
557
+ this.changeDetectorRef.markForCheck();
558
+ }
559
+ setDisabledState(isDisabled) {
560
+ if (isDisabled)
561
+ this.selectControl.disable({ emitEvent: false });
562
+ else
563
+ this.selectControl.enable({ emitEvent: false });
564
+ }
565
+ registerOnChange(onChange) {
566
+ this.onChange = onChange;
567
+ }
568
+ registerOnTouched(onTouched) {
569
+ this.onTouched = onTouched;
570
+ }
571
+ async ngAfterViewInit() {
572
+ const ngControl = this.injector.get(NgControl, null);
573
+ if (!ngControl)
574
+ throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
575
+ this.control = ngControl.control;
576
+ this.subsink.add(this.selectControl.valueChanges.subscribe((value) => {
577
+ if (value === undefined) {
578
+ if (this.control.value !== undefined)
579
+ this.onChange(undefined);
580
+ }
581
+ else if (value === null && !this.options.find(o => o.value === null)) {
582
+ if (this.control.value !== undefined)
583
+ this.onChange(undefined);
584
+ }
585
+ else if (this.control.value?.value !== value)
586
+ this.onChange({ value, regex: false });
587
+ }));
588
+ this.buildOptions();
589
+ this.changeDetectorRef.detectChanges();
590
+ }
591
+ ngOnDestroy() {
592
+ this.subsink.unsubscribe();
593
+ }
594
+ loadMore(intersect) {
595
+ if (!intersect)
596
+ return;
597
+ this.nextPage$.next();
598
+ }
599
+ focus() {
600
+ if (this.column.loadOnFocus && this.isEmptyValue(this.selectControl.value)) {
601
+ const search = this.input.nativeElement.value;
602
+ if (!search.length || this.filter$.value !== search)
603
+ this.filter$.next(search);
604
+ }
605
+ }
606
+ filter() {
607
+ const search = this.input.nativeElement.value;
608
+ this.filter$.next(search);
609
+ }
610
+ displayWith = (value) => {
611
+ let val;
612
+ if (!this.options)
613
+ val = value;
614
+ else
615
+ val = this.options.find(o => o.value === value)?.name ?? value;
616
+ return stripHtml(val);
617
+ };
618
+ getGlobalSearchValue() {
619
+ if (!this.control.parent)
620
+ return null;
621
+ let parent = this.control.parent;
622
+ while (parent.parent)
623
+ parent = parent.parent;
624
+ return parent.value;
625
+ }
626
+ buildOptions() {
627
+ this.options = this.column.searchValue !== undefined ? (this.column.searchValueOptions ?? []) : [];
628
+ this.subsink.add(this.filter$
629
+ .pipe(filter(value => typeof value === 'string'), debounceTime(300), switchMap((search) => {
630
+ this.auto.panel;
631
+ this.options = [];
632
+ this.groups = [];
633
+ let skip = 0;
634
+ return this.nextPage$.pipe(startWith(skip), tap(() => (this.searching = true)), switchMap(() => defer(() => this.column.options(this.column.limit || 10, skip, search, this.getGlobalSearchValue())).pipe(catchError(() => {
635
+ this.hasMore = false;
636
+ return of(null);
637
+ }), finalize(() => {
638
+ this.searching = false;
639
+ this.changeDetectorRef.markForCheck();
640
+ }))), filter((data) => Array.isArray(data)), map(data => {
641
+ data.forEach(d => {
642
+ this.options.push(d);
643
+ const name = d.group ?? '';
644
+ const group = this.groups.find(g => g.name === name);
645
+ if (!group)
646
+ this.groups.push({ name, options: [d] });
647
+ else
648
+ group.options.push(d);
649
+ });
650
+ skip += this.column.limit || 10;
651
+ this.hasMore = data.length === (this.column.limit || 10);
652
+ }));
653
+ }))
654
+ .subscribe());
655
+ }
656
+ isEmptyValue(value) {
657
+ return value === null || value === undefined || value === '';
658
+ }
659
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderAutocompleteFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
660
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: HeaderAutocompleteFilterComponent, isStandalone: true, selector: "lib-header-autocomplete-filter", inputs: { column: "column" }, providers: [
661
+ {
662
+ provide: NG_VALUE_ACCESSOR,
663
+ multi: true,
664
+ useExisting: forwardRef(() => HeaderAutocompleteFilterComponent),
665
+ },
666
+ ], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }, { propertyName: "auto", first: true, predicate: MatAutocomplete, descendants: true }], ngImport: i0, template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field appearance=\"fill\">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n <input\n #input\n type=\"text\"\n [placeholder]=\"column.placeholder!\"\n matInput\n [formControl]=\"selectControl\"\n [matAutocomplete]=\"auto\"\n (input)=\"filter()\"\n (focus)=\"focus()\"\n (blur)=\"onTouched()\" />\n <mat-autocomplete #auto=\"matAutocomplete\" requireSelection [displayWith]=\"displayWith\">\n @if (column.hasGroup) {\n @for (group of groups; track group) {\n <mat-optgroup>\n <mat-label [innerHTML]=\"group.name | safeHtml\"></mat-label>\n @for (option of group.options; track option) {\n <mat-option [value]=\"option.value\">\n <ng-container *ngTemplateOutlet=\"autocompleteOption; context: { option }\"></ng-container>\n </mat-option>\n }\n </mat-optgroup>\n }\n } @else {\n @for (option of options; track option.value) {\n <mat-option [value]=\"option.value\">\n <ng-container *ngTemplateOutlet=\"autocompleteOption; context: { option }\"></ng-container>\n </mat-option>\n }\n }\n\n <mat-option id=\"searching-option\" disabled>\n @if (searching) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n }\n </mat-option>\n\n @if (hasMore && !searching) {\n <mat-option id=\"load-more-options\" disabled intersectionObserver (intersection)=\"loadMore($event.intersect)\">\n </mat-option>\n }\n </mat-autocomplete>\n\n <button\n *ngIf=\"selectControl.value !== null && selectControl.value !== undefined && selectControl.value !== ''\"\n mat-icon-button\n matSuffix\n size=\"small\"\n [attr.aria-label]=\"datatableIntl.clearFilterLabel\"\n (click)=\"selectControl.setValue(undefined)\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n}\n\n<ng-template #autocompleteOption let-option=\"option\">\n <div class=\"option\">\n @if (option.icon) {\n @switch (option.iconSrc) {\n @case ('svg') {\n <mat-icon [svgIcon]=\"option.icon\" [style.color]=\"option.iconColor ?? option.color\" [style.margin-right.px]=\"8\"></mat-icon>\n }\n @default {\n <mat-icon [style.color]=\"option.iconColor ?? option.color\" [style.margin-right.px]=\"8\">\n {{ option.icon }}\n </mat-icon>\n }\n }\n }\n <mat-label [style.color]=\"option.color\" [innerHTML]=\"option.name | safeHtml\"></mat-label>\n </div>\n</ng-template>\n", styles: [":host{display:flex;flex:1 1 100%}mat-form-field{min-width:auto;flex:1 1 100%;margin:6px 0;--mdc-filled-text-field-active-indicator-color: #999;--mat-form-field-hover-state-layer-opacity: 0;--mdc-filled-text-field-container-shape: 0;--mdc-filled-text-field-container-color: var(--datatable-background)}mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}.option{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row}#searching-option{min-height:2px;position:relative}#searching-option mat-progress-bar{position:absolute;inset:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: IntersectionObserverModule }, { kind: "directive", type: i3.IntersectionObserverDirective, selector: "[intersectionObserver]", inputs: ["visitClass", "leaveClass", "removeVisitClass", "removeLeaveClass", "useScroll", "threshold", "autoRemove"], outputs: ["intersection"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i4.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i5$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i5$1.MatOptgroup, selector: "mat-optgroup", inputs: ["label", "disabled"], exportAs: ["matOptgroup"] }, { kind: "directive", type: i4.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.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: MatProgressBarModule }, { kind: "component", type: i10.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: SafeHtmlPipe, name: "safeHtml" }] });
667
+ }
668
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderAutocompleteFilterComponent, decorators: [{
669
+ type: Component,
670
+ args: [{ selector: 'lib-header-autocomplete-filter', imports: [
671
+ CommonModule,
672
+ FormsModule,
673
+ IntersectionObserverModule,
674
+ MatAutocompleteModule,
675
+ MatButtonModule,
676
+ MatFormFieldModule,
677
+ MatIconModule,
678
+ MatInputModule,
679
+ MatProgressBarModule,
680
+ ReactiveFormsModule,
681
+ SafeHtmlPipe,
682
+ ], providers: [
683
+ {
684
+ provide: NG_VALUE_ACCESSOR,
685
+ multi: true,
686
+ useExisting: forwardRef(() => HeaderAutocompleteFilterComponent),
687
+ },
688
+ ], template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field appearance=\"fill\">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n <input\n #input\n type=\"text\"\n [placeholder]=\"column.placeholder!\"\n matInput\n [formControl]=\"selectControl\"\n [matAutocomplete]=\"auto\"\n (input)=\"filter()\"\n (focus)=\"focus()\"\n (blur)=\"onTouched()\" />\n <mat-autocomplete #auto=\"matAutocomplete\" requireSelection [displayWith]=\"displayWith\">\n @if (column.hasGroup) {\n @for (group of groups; track group) {\n <mat-optgroup>\n <mat-label [innerHTML]=\"group.name | safeHtml\"></mat-label>\n @for (option of group.options; track option) {\n <mat-option [value]=\"option.value\">\n <ng-container *ngTemplateOutlet=\"autocompleteOption; context: { option }\"></ng-container>\n </mat-option>\n }\n </mat-optgroup>\n }\n } @else {\n @for (option of options; track option.value) {\n <mat-option [value]=\"option.value\">\n <ng-container *ngTemplateOutlet=\"autocompleteOption; context: { option }\"></ng-container>\n </mat-option>\n }\n }\n\n <mat-option id=\"searching-option\" disabled>\n @if (searching) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n }\n </mat-option>\n\n @if (hasMore && !searching) {\n <mat-option id=\"load-more-options\" disabled intersectionObserver (intersection)=\"loadMore($event.intersect)\">\n </mat-option>\n }\n </mat-autocomplete>\n\n <button\n *ngIf=\"selectControl.value !== null && selectControl.value !== undefined && selectControl.value !== ''\"\n mat-icon-button\n matSuffix\n size=\"small\"\n [attr.aria-label]=\"datatableIntl.clearFilterLabel\"\n (click)=\"selectControl.setValue(undefined)\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n}\n\n<ng-template #autocompleteOption let-option=\"option\">\n <div class=\"option\">\n @if (option.icon) {\n @switch (option.iconSrc) {\n @case ('svg') {\n <mat-icon [svgIcon]=\"option.icon\" [style.color]=\"option.iconColor ?? option.color\" [style.margin-right.px]=\"8\"></mat-icon>\n }\n @default {\n <mat-icon [style.color]=\"option.iconColor ?? option.color\" [style.margin-right.px]=\"8\">\n {{ option.icon }}\n </mat-icon>\n }\n }\n }\n <mat-label [style.color]=\"option.color\" [innerHTML]=\"option.name | safeHtml\"></mat-label>\n </div>\n</ng-template>\n", styles: [":host{display:flex;flex:1 1 100%}mat-form-field{min-width:auto;flex:1 1 100%;margin:6px 0;--mdc-filled-text-field-active-indicator-color: #999;--mat-form-field-hover-state-layer-opacity: 0;--mdc-filled-text-field-container-shape: 0;--mdc-filled-text-field-container-color: var(--datatable-background)}mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}.option{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row}#searching-option{min-height:2px;position:relative}#searching-option mat-progress-bar{position:absolute;inset:0}\n"] }]
689
+ }], propDecorators: { column: [{
690
+ type: Input
691
+ }], input: [{
692
+ type: ViewChild,
693
+ args: ['input']
694
+ }], auto: [{
695
+ type: ViewChild,
696
+ args: [MatAutocomplete]
697
+ }] } });
698
+
699
+ /** @format */
700
+ class HeaderCheckboxFilterComponent {
701
+ column;
702
+ control;
703
+ selectControl = new FormControl();
704
+ onChange = () => { };
705
+ onTouched = () => { };
706
+ injector = inject(Injector);
707
+ changeDetectorRef = inject(ChangeDetectorRef);
708
+ previousValue;
709
+ subsink = new Subscription();
710
+ writeValue(value) {
711
+ const nextValue = value?.value;
712
+ this.previousValue = nextValue;
713
+ if (nextValue !== this.selectControl.value)
714
+ this.selectControl.setValue(nextValue, { emitEvent: false });
715
+ this.changeDetectorRef.markForCheck();
716
+ }
717
+ setDisabledState(isDisabled) {
718
+ if (isDisabled)
719
+ this.selectControl.disable({ emitEvent: false });
720
+ else
721
+ this.selectControl.enable({ emitEvent: false });
722
+ }
723
+ registerOnChange(onChange) {
724
+ this.onChange = onChange;
725
+ }
726
+ registerOnTouched(onTouched) {
727
+ this.onTouched = onTouched;
728
+ }
729
+ async ngAfterViewInit() {
730
+ const ngControl = this.injector.get(NgControl, null);
731
+ if (!ngControl)
732
+ throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
733
+ this.control = ngControl.control;
734
+ this.previousValue = this.control.value?.value;
735
+ this.subsink.add(this.selectControl.valueChanges
736
+ .pipe(filter(value => {
737
+ if (value === true && this.previousValue === false) {
738
+ this.selectControl.setValue(undefined, { emitEvent: false });
739
+ this.previousValue = undefined;
740
+ this.onChange(undefined);
741
+ return false;
742
+ }
743
+ return true;
744
+ }), tap(value => (this.previousValue = value)))
745
+ .subscribe((value) => {
746
+ if (value === undefined)
747
+ this.onChange(undefined);
748
+ else
749
+ this.onChange({ value, regex: false });
750
+ }));
751
+ this.changeDetectorRef.detectChanges();
752
+ }
753
+ ngOnDestroy() {
754
+ this.subsink.unsubscribe();
755
+ }
756
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderCheckboxFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
757
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: HeaderCheckboxFilterComponent, isStandalone: true, selector: "lib-header-checkbox-filter", inputs: { column: "column" }, providers: [
758
+ {
759
+ provide: NG_VALUE_ACCESSOR,
760
+ multi: true,
761
+ useExisting: forwardRef(() => HeaderCheckboxFilterComponent),
762
+ },
763
+ ], ngImport: i0, template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-checkbox [formControl]=\"selectControl\" [indeterminate]=\"selectControl.value === undefined\" (blur)=\"onTouched()\">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n </mat-checkbox>\n}\n", styles: [":host{display:flex;flex:1 1 100%}mat-form-field{min-width:auto;flex:1 1 100%;margin:6px 0;--mdc-filled-text-field-active-indicator-color: #999;--mat-form-field-hover-state-layer-opacity: 0;--mdc-filled-text-field-container-shape: 0;--mdc-filled-text-field-container-color: var(--datatable-background)}mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}.option{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i3$2.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: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: SafeHtmlPipe, name: "safeHtml" }] });
764
+ }
765
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderCheckboxFilterComponent, decorators: [{
766
+ type: Component,
767
+ args: [{ selector: 'lib-header-checkbox-filter', imports: [
768
+ CommonModule,
769
+ FormsModule,
770
+ MatButtonModule,
771
+ MatFormFieldModule,
772
+ MatIconModule,
773
+ MatCheckboxModule,
774
+ ReactiveFormsModule,
775
+ SafeHtmlPipe,
776
+ ], providers: [
777
+ {
778
+ provide: NG_VALUE_ACCESSOR,
779
+ multi: true,
780
+ useExisting: forwardRef(() => HeaderCheckboxFilterComponent),
781
+ },
782
+ ], template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-checkbox [formControl]=\"selectControl\" [indeterminate]=\"selectControl.value === undefined\" (blur)=\"onTouched()\">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n </mat-checkbox>\n}\n", styles: [":host{display:flex;flex:1 1 100%}mat-form-field{min-width:auto;flex:1 1 100%;margin:6px 0;--mdc-filled-text-field-active-indicator-color: #999;--mat-form-field-hover-state-layer-opacity: 0;--mdc-filled-text-field-container-shape: 0;--mdc-filled-text-field-container-color: var(--datatable-background)}mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}.option{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row}\n"] }]
783
+ }], propDecorators: { column: [{
784
+ type: Input
785
+ }] } });
786
+
787
+ /** @format */
788
+ const OPERATORS = ['=', '>', '≥', '<', '≤', '<>', '≤≥'];
789
+ class OperatorSelectComponent {
790
+ set setDisableRange(disableRange) {
791
+ this.disableRange = disableRange !== false;
792
+ if (this.disableRange)
793
+ this.operators = OPERATORS.slice(0, 5);
794
+ else
795
+ this.operators = OPERATORS;
796
+ }
797
+ disableRange = false;
798
+ operators = OPERATORS;
799
+ isOpen = false;
800
+ control;
801
+ onChange = () => { };
802
+ onTouched = () => { };
803
+ injector = inject(Injector);
804
+ changeDetectorRef = inject(ChangeDetectorRef);
805
+ writeValue = () => { };
806
+ registerOnChange(onChange) {
807
+ this.onChange = onChange;
808
+ }
809
+ registerOnTouched(onTouched) {
810
+ this.onTouched = onTouched;
811
+ }
812
+ async ngAfterViewInit() {
813
+ const ngControl = this.injector.get(NgControl, null);
814
+ if (!ngControl)
815
+ throw new Error(`${this.constructor.name} missing control`);
816
+ this.control = ngControl.control;
817
+ this.changeDetectorRef.detectChanges();
818
+ }
819
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: OperatorSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
820
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: OperatorSelectComponent, isStandalone: true, selector: "lib-operator-select", inputs: { setDisableRange: ["disableRange", "setDisableRange"] }, providers: [
821
+ {
822
+ provide: NG_VALUE_ACCESSOR,
823
+ multi: true,
824
+ useExisting: forwardRef(() => OperatorSelectComponent),
825
+ },
826
+ ], ngImport: i0, template: "<!-- @format -->\n\n@if (control) {\n <button\n mat-mini-fab\n color=\"primary\"\n class=\"ngx-mat-datatable-operator-button\"\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n (click)=\"$event.stopPropagation(); isOpen = !isOpen\">\n {{ control.value }}\n </button>\n\n <ng-template cdkConnectedOverlay [cdkConnectedOverlayOrigin]=\"trigger\" [cdkConnectedOverlayOpen]=\"isOpen\">\n <div class=\"ngx-mat-datatable-operator-column\" @fade>\n @for (operator of operators; track operator) {\n @if (operator !== control.value) {\n <button\n mat-mini-fab\n color=\"primary\"\n class=\"ngx-mat-datatable-operator-button\"\n (click)=\"control.setValue(operator); isOpen = !isOpen\">\n {{ operator }}\n </button>\n }\n }\n </div>\n </ng-template>\n}\n", styles: [".ngx-mat-datatable-operator-button{--mdc-fab-small-container-elevation-shadow: none;--mdc-fab-small-hover-container-elevation-shadow: none;--mdc-fab-small-focus-container-elevation-shadow: none;--mdc-fab-small-container-shape: 50%;--mdc-fab-small-container-color: var(--mat-sys-primary);--mat-fab-small-foreground-color: var(--mat-sys-on-primary);font-size:16px;width:26px;height:26px;padding:6px}.ngx-mat-datatable-operator-button ::ng-deep .mat-mdc-button-touch-target{height:36px;width:36px}.ngx-mat-datatable-operator-column{display:flex;box-sizing:border-box;flex-direction:column}.ngx-mat-datatable-operator-column .ngx-mat-datatable-operator-button{margin-top:8px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1$2.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1$2.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatMiniFabButton, selector: "button[mat-mini-fab]", exportAs: ["matButton"] }], animations: [
827
+ trigger('fade', [
828
+ transition(':enter', [
829
+ style({ opacity: 0 }), // initial
830
+ animate('0.2s', style({ opacity: 1 })), // final
831
+ ]),
832
+ transition(':leave', [
833
+ style({ opacity: 1 }), // initial
834
+ animate('0.2s', style({ opacity: 0 })), // final
835
+ ]),
836
+ ]),
837
+ ] });
838
+ }
839
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: OperatorSelectComponent, decorators: [{
840
+ type: Component,
841
+ args: [{ selector: 'lib-operator-select', imports: [CommonModule, OverlayModule, MatIconModule, MatButtonModule], animations: [
842
+ trigger('fade', [
843
+ transition(':enter', [
844
+ style({ opacity: 0 }), // initial
845
+ animate('0.2s', style({ opacity: 1 })), // final
846
+ ]),
847
+ transition(':leave', [
848
+ style({ opacity: 1 }), // initial
849
+ animate('0.2s', style({ opacity: 0 })), // final
850
+ ]),
851
+ ]),
852
+ ], providers: [
853
+ {
854
+ provide: NG_VALUE_ACCESSOR,
855
+ multi: true,
856
+ useExisting: forwardRef(() => OperatorSelectComponent),
857
+ },
858
+ ], template: "<!-- @format -->\n\n@if (control) {\n <button\n mat-mini-fab\n color=\"primary\"\n class=\"ngx-mat-datatable-operator-button\"\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n (click)=\"$event.stopPropagation(); isOpen = !isOpen\">\n {{ control.value }}\n </button>\n\n <ng-template cdkConnectedOverlay [cdkConnectedOverlayOrigin]=\"trigger\" [cdkConnectedOverlayOpen]=\"isOpen\">\n <div class=\"ngx-mat-datatable-operator-column\" @fade>\n @for (operator of operators; track operator) {\n @if (operator !== control.value) {\n <button\n mat-mini-fab\n color=\"primary\"\n class=\"ngx-mat-datatable-operator-button\"\n (click)=\"control.setValue(operator); isOpen = !isOpen\">\n {{ operator }}\n </button>\n }\n }\n </div>\n </ng-template>\n}\n", styles: [".ngx-mat-datatable-operator-button{--mdc-fab-small-container-elevation-shadow: none;--mdc-fab-small-hover-container-elevation-shadow: none;--mdc-fab-small-focus-container-elevation-shadow: none;--mdc-fab-small-container-shape: 50%;--mdc-fab-small-container-color: var(--mat-sys-primary);--mat-fab-small-foreground-color: var(--mat-sys-on-primary);font-size:16px;width:26px;height:26px;padding:6px}.ngx-mat-datatable-operator-button ::ng-deep .mat-mdc-button-touch-target{height:36px;width:36px}.ngx-mat-datatable-operator-column{display:flex;box-sizing:border-box;flex-direction:column}.ngx-mat-datatable-operator-column .ngx-mat-datatable-operator-button{margin-top:8px}\n"] }]
859
+ }], propDecorators: { setDisableRange: [{
860
+ type: Input,
861
+ args: ['disableRange']
862
+ }] } });
863
+
864
+ /** @format */
865
+ class HeaderDateFilterComponent {
866
+ column;
867
+ control;
868
+ selectControl = new FormControl(undefined);
869
+ rangeGroup = new FormGroup({
870
+ from: new FormControl(undefined, Validators.required),
871
+ to: new FormControl(undefined, Validators.required),
872
+ });
873
+ operatorControl = new FormControl('=');
874
+ onChange = () => { };
875
+ onTouched = () => { };
876
+ _adapter = inject(DateAdapter);
877
+ _intl = inject(MatDatepickerIntl);
878
+ _locale = signal(inject(MAT_DATE_LOCALE));
879
+ datatableIntl = inject(NgxMatDatatableIntl);
880
+ injector = inject(Injector);
881
+ changeDetectorRef = inject(ChangeDetectorRef);
882
+ subsink = new Subscription();
883
+ writeValue(value) {
884
+ const operator = (value?.operator ?? '=');
885
+ this.operatorControl.setValue(operator, { emitEvent: false });
886
+ if (this.isRangeOperator(operator)) {
887
+ this.selectControl.setValue(undefined, { emitEvent: false });
888
+ this.rangeGroup.setValue({
889
+ from: value?.value?.from ?? undefined,
890
+ to: value?.value?.to ?? undefined,
891
+ }, { emitEvent: false });
892
+ }
893
+ else {
894
+ this.rangeGroup.reset({ from: undefined, to: undefined }, { emitEvent: false });
895
+ this.selectControl.setValue(value?.value ?? undefined, { emitEvent: false });
896
+ }
897
+ this.changeDetectorRef.markForCheck();
898
+ }
899
+ setDisabledState(isDisabled) {
900
+ const controls = [this.selectControl, this.rangeGroup, this.operatorControl];
901
+ controls.forEach(control => {
902
+ if (isDisabled)
903
+ control.disable({ emitEvent: false });
904
+ else
905
+ control.enable({ emitEvent: false });
906
+ });
907
+ }
908
+ registerOnChange(onChange) {
909
+ this.onChange = onChange;
910
+ }
911
+ registerOnTouched(onTouched) {
912
+ this.onTouched = onTouched;
913
+ }
914
+ ngOnInit() {
915
+ if (this.column.locale) {
916
+ this._locale.set(this.column.locale);
917
+ this._adapter.setLocale(this._locale());
918
+ this._intl.changes.next();
919
+ }
920
+ }
921
+ async ngAfterViewInit() {
922
+ const ngControl = this.injector.get(NgControl, null);
923
+ if (!ngControl)
924
+ throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
925
+ this.control = ngControl.control;
926
+ this.subsink.add(this.selectControl.valueChanges.subscribe(value => {
927
+ if (this.control.invalid)
928
+ return;
929
+ else if (this.isEmptyValue(value))
930
+ this.onChange(undefined);
931
+ else
932
+ this.onChange(this.buildValue(this.operatorControl.value, value));
933
+ }));
934
+ this.subsink.add(this.rangeGroup.valueChanges.subscribe(value => {
935
+ if (!this.hasRangeValue(value))
936
+ this.onChange(undefined);
937
+ else if (this.rangeGroup.invalid)
938
+ return;
939
+ else
940
+ this.onChange(this.buildValue(this.operatorControl.value, value));
941
+ }));
942
+ this.subsink.add(this.operatorControl.valueChanges.subscribe((value) => {
943
+ if (this.isRangeOperator(value)) {
944
+ if (!this.hasRangeValue(this.rangeGroup.value))
945
+ this.onChange(undefined);
946
+ else if (!this.rangeGroup.invalid)
947
+ this.onChange(this.buildValue(value, this.rangeGroup.value));
948
+ }
949
+ else {
950
+ if (this.isEmptyValue(this.selectControl.value))
951
+ this.onChange(undefined);
952
+ else
953
+ this.onChange(this.buildValue(value, this.selectControl.value));
954
+ }
955
+ this.changeDetectorRef.markForCheck();
956
+ }));
957
+ this.changeDetectorRef.detectChanges();
958
+ }
959
+ ngOnDestroy() {
960
+ this.subsink.unsubscribe();
961
+ }
962
+ clearRange() {
963
+ this.rangeGroup.reset({ from: undefined, to: undefined }, { emitEvent: false });
964
+ this.onChange(undefined);
965
+ this.onTouched();
966
+ this.changeDetectorRef.markForCheck();
967
+ }
968
+ buildValue(operator, value) {
969
+ switch (operator) {
970
+ case '=':
971
+ return {
972
+ operator: '≤≥',
973
+ value: { from: moment(value).startOf('day'), to: moment(value).endOf('day') },
974
+ };
975
+ case '>':
976
+ return { operator, value: moment(value).endOf('day') };
977
+ case '≥':
978
+ return { operator, value: moment(value).startOf('day') };
979
+ case '<':
980
+ return { operator, value: moment(value).startOf('day') };
981
+ case '≤':
982
+ return { operator, value: moment(value).endOf('day') };
983
+ case '<>':
984
+ return { operator, value: { from: moment(value.from).endOf('day'), to: moment(value.to).startOf('day') } };
985
+ case '≤≥':
986
+ return { operator, value: { from: moment(value.from).startOf('day'), to: moment(value.to).endOf('day') } };
987
+ }
988
+ }
989
+ hasRangeValue(value) {
990
+ return !this.isEmptyValue(value?.from) || !this.isEmptyValue(value?.to);
991
+ }
992
+ isEmptyValue(value) {
993
+ return value === null || value === undefined || value === '';
994
+ }
995
+ isRangeOperator(operator) {
996
+ return operator === '<>' || operator === '≤≥';
997
+ }
998
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderDateFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
999
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: HeaderDateFilterComponent, isStandalone: true, selector: "lib-header-date-filter", inputs: { column: "column" }, providers: [
1000
+ {
1001
+ provide: NG_VALUE_ACCESSOR,
1002
+ multi: true,
1003
+ useExisting: forwardRef(() => HeaderDateFilterComponent),
1004
+ },
1005
+ provideMomentDateAdapter(),
1006
+ ], ngImport: i0, template: "<!-- @format -->\n\n@if (selectControl) {\n @if (['<>', '\u2264\u2265'].includes(operatorControl.value!)) {\n <mat-form-field\n class=\"ngx-datatable-date-filter\"\n appearance=\"fill\"\n [class.has-value]=\"\n (rangeGroup.value.from !== null && rangeGroup.value.from !== undefined) ||\n (rangeGroup.value.to !== null && rangeGroup.value.to !== undefined)\n \">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n\n <lib-operator-select matPrefix [formControl]=\"operatorControl\"></lib-operator-select>\n\n <mat-date-range-input [formGroup]=\"rangeGroup\" [rangePicker]=\"rangePicker\">\n <input matStartDate formControlName=\"from\" [placeholder]=\"column.placeholder!\" (blur)=\"onTouched()\" />\n <input matEndDate formControlName=\"to\" [placeholder]=\"column.placeholder!\" (blur)=\"onTouched()\" />\n </mat-date-range-input>\n <mat-datepicker-toggle matIconSuffix [for]=\"rangePicker\"></mat-datepicker-toggle>\n <mat-date-range-picker #rangePicker></mat-date-range-picker>\n\n <button\n *ngIf=\"\n (rangeGroup.value.from !== null && rangeGroup.value.from !== undefined) ||\n (rangeGroup.value.to !== null && rangeGroup.value.to !== undefined)\n \"\n mat-icon-button\n matSuffix\n size=\"small\"\n [attr.aria-label]=\"datatableIntl.clearFilterLabel\"\n (click)=\"clearRange()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n } @else {\n <mat-form-field\n class=\"ngx-datatable-date-filter\"\n appearance=\"fill\"\n [class.has-value]=\"selectControl.value !== null && selectControl.value !== undefined\">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n\n <lib-operator-select matPrefix [formControl]=\"operatorControl\"></lib-operator-select>\n\n <input\n matInput\n [matDatepicker]=\"datePicker\"\n [formControl]=\"selectControl\"\n [placeholder]=\"column.placeholder!\"\n (blur)=\"onTouched()\" />\n <mat-datepicker-toggle matIconSuffix [for]=\"datePicker\"></mat-datepicker-toggle>\n <mat-datepicker #datePicker></mat-datepicker>\n\n <button\n *ngIf=\"selectControl.value !== null && selectControl.value !== undefined\"\n mat-icon-button\n matSuffix\n size=\"small\"\n [attr.aria-label]=\"datatableIntl.clearFilterLabel\"\n (click)=\"selectControl.setValue(undefined)\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n }\n}\n", styles: [":host{display:flex;flex:1 1 100%}mat-form-field{min-width:auto;flex:1 1 100%;margin:6px 0;--mdc-filled-text-field-active-indicator-color: #999;--mat-form-field-hover-state-layer-opacity: 0;--mdc-filled-text-field-container-shape: 0;--mdc-filled-text-field-container-color: var(--datatable-background)}mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}mat-form-field ::ng-deep .mat-mdc-form-field-icon-suffix{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i4$2.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4$2.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i4$2.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i4$2.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i4$2.MatStartDate, selector: "input[matStartDate]", outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i4$2.MatEndDate, selector: "input[matEndDate]", outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i4$2.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i4$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.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: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: OperatorSelectComponent, selector: "lib-operator-select", inputs: ["disableRange"] }, { kind: "pipe", type: SafeHtmlPipe, name: "safeHtml" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1007
+ }
1008
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderDateFilterComponent, decorators: [{
1009
+ type: Component,
1010
+ args: [{ selector: 'lib-header-date-filter', imports: [
1011
+ CommonModule,
1012
+ FormsModule,
1013
+ MatButtonModule,
1014
+ MatDatepickerModule,
1015
+ MatFormFieldModule,
1016
+ MatIconModule,
1017
+ MatInputModule,
1018
+ ReactiveFormsModule,
1019
+ OperatorSelectComponent,
1020
+ SafeHtmlPipe,
1021
+ ], providers: [
1022
+ {
1023
+ provide: NG_VALUE_ACCESSOR,
1024
+ multi: true,
1025
+ useExisting: forwardRef(() => HeaderDateFilterComponent),
1026
+ },
1027
+ provideMomentDateAdapter(),
1028
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- @format -->\n\n@if (selectControl) {\n @if (['<>', '\u2264\u2265'].includes(operatorControl.value!)) {\n <mat-form-field\n class=\"ngx-datatable-date-filter\"\n appearance=\"fill\"\n [class.has-value]=\"\n (rangeGroup.value.from !== null && rangeGroup.value.from !== undefined) ||\n (rangeGroup.value.to !== null && rangeGroup.value.to !== undefined)\n \">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n\n <lib-operator-select matPrefix [formControl]=\"operatorControl\"></lib-operator-select>\n\n <mat-date-range-input [formGroup]=\"rangeGroup\" [rangePicker]=\"rangePicker\">\n <input matStartDate formControlName=\"from\" [placeholder]=\"column.placeholder!\" (blur)=\"onTouched()\" />\n <input matEndDate formControlName=\"to\" [placeholder]=\"column.placeholder!\" (blur)=\"onTouched()\" />\n </mat-date-range-input>\n <mat-datepicker-toggle matIconSuffix [for]=\"rangePicker\"></mat-datepicker-toggle>\n <mat-date-range-picker #rangePicker></mat-date-range-picker>\n\n <button\n *ngIf=\"\n (rangeGroup.value.from !== null && rangeGroup.value.from !== undefined) ||\n (rangeGroup.value.to !== null && rangeGroup.value.to !== undefined)\n \"\n mat-icon-button\n matSuffix\n size=\"small\"\n [attr.aria-label]=\"datatableIntl.clearFilterLabel\"\n (click)=\"clearRange()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n } @else {\n <mat-form-field\n class=\"ngx-datatable-date-filter\"\n appearance=\"fill\"\n [class.has-value]=\"selectControl.value !== null && selectControl.value !== undefined\">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n\n <lib-operator-select matPrefix [formControl]=\"operatorControl\"></lib-operator-select>\n\n <input\n matInput\n [matDatepicker]=\"datePicker\"\n [formControl]=\"selectControl\"\n [placeholder]=\"column.placeholder!\"\n (blur)=\"onTouched()\" />\n <mat-datepicker-toggle matIconSuffix [for]=\"datePicker\"></mat-datepicker-toggle>\n <mat-datepicker #datePicker></mat-datepicker>\n\n <button\n *ngIf=\"selectControl.value !== null && selectControl.value !== undefined\"\n mat-icon-button\n matSuffix\n size=\"small\"\n [attr.aria-label]=\"datatableIntl.clearFilterLabel\"\n (click)=\"selectControl.setValue(undefined)\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n }\n}\n", styles: [":host{display:flex;flex:1 1 100%}mat-form-field{min-width:auto;flex:1 1 100%;margin:6px 0;--mdc-filled-text-field-active-indicator-color: #999;--mat-form-field-hover-state-layer-opacity: 0;--mdc-filled-text-field-container-shape: 0;--mdc-filled-text-field-container-color: var(--datatable-background)}mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}mat-form-field ::ng-deep .mat-mdc-form-field-icon-suffix{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row}\n"] }]
1029
+ }], propDecorators: { column: [{
1030
+ type: Input
1031
+ }] } });
1032
+
1033
+ /** @format */
1034
+ const TIME_UNITS = ['second', 'minute', 'hour', 'day', 'month', 'year'];
1035
+ const MOMENT_RELATIVE_TIME_KEY = ['ss', 'mm', 'hh', 'dd', 'MM', 'yy'];
1036
+ class TimeUnitSelectComponent {
1037
+ static toMilliseconds(value, unit) {
1038
+ return moment.duration(value, unit).as('milliseconds');
1039
+ }
1040
+ static convert(value, from, to) {
1041
+ if (to === undefined)
1042
+ (to = from), (from = 'millisecond');
1043
+ return moment.duration(value, from).as(to);
1044
+ }
1045
+ set setLocale(locale) {
1046
+ this.locale = locale || moment.locale();
1047
+ this.loadUnitNames();
1048
+ }
1049
+ locale = moment.locale();
1050
+ units = TIME_UNITS;
1051
+ unitNames = {};
1052
+ isOpen = false;
1053
+ control;
1054
+ onChange = () => { };
1055
+ onTouched = () => { };
1056
+ injector = inject(Injector);
1057
+ changeDetectorRef = inject(ChangeDetectorRef);
1058
+ writeValue = () => { };
1059
+ registerOnChange(onChange) {
1060
+ this.onChange = onChange;
1061
+ }
1062
+ registerOnTouched(onTouched) {
1063
+ this.onTouched = onTouched;
1064
+ }
1065
+ ngOnInit() {
1066
+ this.loadUnitNames();
1067
+ }
1068
+ async ngAfterViewInit() {
1069
+ const ngControl = this.injector.get(NgControl, null);
1070
+ if (!ngControl)
1071
+ throw new Error(`${this.constructor.name} missing control`);
1072
+ this.control = ngControl.control;
1073
+ this.changeDetectorRef.detectChanges();
1074
+ }
1075
+ loadUnitNames() {
1076
+ this.unitNames = this.units.reduce((pv, cv, i) => ((pv[cv] = moment
1077
+ .localeData(this.locale)
1078
+ .relativeTime('', true, MOMENT_RELATIVE_TIME_KEY[i], false)
1079
+ .trim()),
1080
+ pv), {});
1081
+ }
1082
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: TimeUnitSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1083
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: TimeUnitSelectComponent, isStandalone: true, selector: "lib-time-unit-select", inputs: { setLocale: ["locale", "setLocale"] }, providers: [
1084
+ {
1085
+ provide: NG_VALUE_ACCESSOR,
1086
+ multi: true,
1087
+ useExisting: forwardRef(() => TimeUnitSelectComponent),
1088
+ },
1089
+ ], ngImport: i0, template: "<!-- @format -->\n\n@if (control) {\n <button\n mat-flat-button\n color=\"primary\"\n class=\"ngx-mat-datatable-time-unit-button\"\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n (click)=\"$event.stopPropagation(); isOpen = !isOpen\">\n <span>\n {{ unitNames[control.value] }}\n </span>\n </button>\n\n <ng-template cdkConnectedOverlay [cdkConnectedOverlayOrigin]=\"trigger\" [cdkConnectedOverlayOpen]=\"isOpen\">\n <div class=\"ngx-mat-datatable-time-unit-column\" @fade>\n @for (unit of units; track unit) {\n @if (unit !== control.value) {\n <button\n mat-flat-button\n color=\"primary\"\n class=\"ngx-mat-datatable-time-unit-button\"\n (click)=\"control.setValue(unit); isOpen = !isOpen\">\n <span>\n {{ unitNames[unit] }}\n </span>\n </button>\n }\n }\n </div>\n </ng-template>\n}\n", styles: [".ngx-mat-datatable-time-unit-button{font-size:12px;height:26px;padding:6px}.ngx-mat-datatable-time-unit-button ::ng-deep .mat-mdc-button-touch-target{height:36px;width:36px}.ngx-mat-datatable-time-unit-column{display:flex;box-sizing:border-box;flex-direction:column}.ngx-mat-datatable-time-unit-column .ngx-mat-datatable-time-unit-button{margin-top:8px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1$2.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1$2.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }], animations: [
1090
+ trigger('fade', [
1091
+ transition(':enter', [
1092
+ style({ opacity: 0 }), // initial
1093
+ animate('0.2s', style({ opacity: 1 })), // final
1094
+ ]),
1095
+ transition(':leave', [
1096
+ style({ opacity: 1 }), // initial
1097
+ animate('0.2s', style({ opacity: 0 })), // final
1098
+ ]),
1099
+ ]),
1100
+ ] });
1101
+ }
1102
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: TimeUnitSelectComponent, decorators: [{
1103
+ type: Component,
1104
+ args: [{ selector: 'lib-time-unit-select', imports: [CommonModule, OverlayModule, MatIconModule, MatButtonModule], animations: [
1105
+ trigger('fade', [
1106
+ transition(':enter', [
1107
+ style({ opacity: 0 }), // initial
1108
+ animate('0.2s', style({ opacity: 1 })), // final
1109
+ ]),
1110
+ transition(':leave', [
1111
+ style({ opacity: 1 }), // initial
1112
+ animate('0.2s', style({ opacity: 0 })), // final
1113
+ ]),
1114
+ ]),
1115
+ ], providers: [
1116
+ {
1117
+ provide: NG_VALUE_ACCESSOR,
1118
+ multi: true,
1119
+ useExisting: forwardRef(() => TimeUnitSelectComponent),
1120
+ },
1121
+ ], template: "<!-- @format -->\n\n@if (control) {\n <button\n mat-flat-button\n color=\"primary\"\n class=\"ngx-mat-datatable-time-unit-button\"\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n (click)=\"$event.stopPropagation(); isOpen = !isOpen\">\n <span>\n {{ unitNames[control.value] }}\n </span>\n </button>\n\n <ng-template cdkConnectedOverlay [cdkConnectedOverlayOrigin]=\"trigger\" [cdkConnectedOverlayOpen]=\"isOpen\">\n <div class=\"ngx-mat-datatable-time-unit-column\" @fade>\n @for (unit of units; track unit) {\n @if (unit !== control.value) {\n <button\n mat-flat-button\n color=\"primary\"\n class=\"ngx-mat-datatable-time-unit-button\"\n (click)=\"control.setValue(unit); isOpen = !isOpen\">\n <span>\n {{ unitNames[unit] }}\n </span>\n </button>\n }\n }\n </div>\n </ng-template>\n}\n", styles: [".ngx-mat-datatable-time-unit-button{font-size:12px;height:26px;padding:6px}.ngx-mat-datatable-time-unit-button ::ng-deep .mat-mdc-button-touch-target{height:36px;width:36px}.ngx-mat-datatable-time-unit-column{display:flex;box-sizing:border-box;flex-direction:column}.ngx-mat-datatable-time-unit-column .ngx-mat-datatable-time-unit-button{margin-top:8px}\n"] }]
1122
+ }], propDecorators: { setLocale: [{
1123
+ type: Input,
1124
+ args: ['locale']
1125
+ }] } });
1126
+
1127
+ /** @format */
1128
+ class HeaderDurationFilterComponent {
1129
+ column;
1130
+ control;
1131
+ selectControl = new FormControl(undefined);
1132
+ rangeGroup = new FormGroup({
1133
+ start: new FormControl(undefined, Validators.required),
1134
+ end: new FormControl(undefined, Validators.required),
1135
+ });
1136
+ operatorControl = new FormControl('=');
1137
+ timeUnitControl = new FormControl('second');
1138
+ onChange = () => { };
1139
+ onTouched = () => { };
1140
+ datatableIntl = inject(NgxMatDatatableIntl);
1141
+ injector = inject(Injector);
1142
+ changeDetectorRef = inject(ChangeDetectorRef);
1143
+ subsink = new Subscription();
1144
+ writeValue(value) {
1145
+ if (value?.unitOfTime)
1146
+ this.timeUnitControl.setValue(value.unitOfTime, { emitEvent: false });
1147
+ if (value?.operator)
1148
+ this.operatorControl.setValue(value.operator, { emitEvent: false });
1149
+ if (value?.value !== null && value?.value !== undefined) {
1150
+ let selectValue = TimeUnitSelectComponent.convert(value.value, this.timeUnitControl.value);
1151
+ if (this.selectControl.value !== selectValue)
1152
+ this.selectControl.setValue(selectValue, { emitEvent: false });
1153
+ }
1154
+ else
1155
+ this.selectControl.setValue(null, { emitEvent: false });
1156
+ this.changeDetectorRef.markForCheck();
1157
+ }
1158
+ setDisabledState(isDisabled) {
1159
+ const controls = [this.selectControl, this.operatorControl, this.timeUnitControl];
1160
+ controls.forEach(control => {
1161
+ if (isDisabled)
1162
+ control.disable({ emitEvent: false });
1163
+ else
1164
+ control.enable({ emitEvent: false });
1165
+ });
1166
+ }
1167
+ registerOnChange(onChange) {
1168
+ this.onChange = onChange;
1169
+ }
1170
+ registerOnTouched(onTouched) {
1171
+ this.onTouched = onTouched;
1172
+ }
1173
+ ngOnInit() { }
1174
+ async ngAfterViewInit() {
1175
+ const ngControl = this.injector.get(NgControl, null);
1176
+ if (!ngControl)
1177
+ throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
1178
+ this.control = ngControl.control;
1179
+ this.subsink.add(this.selectControl.valueChanges.subscribe(value => {
1180
+ if (this.control.invalid)
1181
+ return;
1182
+ else if (this.isEmptyValue(value))
1183
+ this.onChange(undefined);
1184
+ else {
1185
+ const unitOfTimeValue = value;
1186
+ this.onChange({
1187
+ unitOfTimeValue,
1188
+ value: TimeUnitSelectComponent.toMilliseconds(unitOfTimeValue, this.timeUnitControl.value),
1189
+ regex: false,
1190
+ operator: this.operatorControl.value,
1191
+ unitOfTime: this.timeUnitControl.value,
1192
+ });
1193
+ }
1194
+ }));
1195
+ this.subsink.add(this.operatorControl.valueChanges.subscribe((value) => {
1196
+ if (this.isEmptyValue(this.selectControl.value))
1197
+ return;
1198
+ const unitOfTimeValue = this.selectControl.value;
1199
+ this.onChange({
1200
+ unitOfTimeValue,
1201
+ value: TimeUnitSelectComponent.toMilliseconds(unitOfTimeValue, this.timeUnitControl.value),
1202
+ regex: false,
1203
+ operator: value,
1204
+ unitOfTime: this.timeUnitControl.value,
1205
+ });
1206
+ }));
1207
+ this.subsink.add(this.timeUnitControl.valueChanges.subscribe((value) => {
1208
+ if (this.isEmptyValue(this.selectControl.value) || !this.control.value?.unitOfTime)
1209
+ return;
1210
+ const unitOfTimeValue = TimeUnitSelectComponent.convert(this.selectControl.value, this.control.value.unitOfTime, value);
1211
+ this.selectControl.setValue(unitOfTimeValue, { emitEvent: false });
1212
+ this.onChange({
1213
+ unitOfTimeValue,
1214
+ value: TimeUnitSelectComponent.toMilliseconds(unitOfTimeValue, value),
1215
+ regex: false,
1216
+ operator: this.operatorControl.value,
1217
+ unitOfTime: value,
1218
+ });
1219
+ }));
1220
+ this.changeDetectorRef.detectChanges();
1221
+ }
1222
+ ngOnDestroy() {
1223
+ this.subsink.unsubscribe();
1224
+ }
1225
+ isEmptyValue(value) {
1226
+ return value === null || value === undefined || value === '';
1227
+ }
1228
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderDurationFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1229
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: HeaderDurationFilterComponent, isStandalone: true, selector: "lib-header-duration-filter", inputs: { column: "column" }, providers: [
1230
+ {
1231
+ provide: NG_VALUE_ACCESSOR,
1232
+ multi: true,
1233
+ useExisting: forwardRef(() => HeaderDurationFilterComponent),
1234
+ },
1235
+ ], ngImport: i0, template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field\n class=\"ngx-datatable-duration-filter\"\n appearance=\"fill\"\n [class.has-value]=\"selectControl.value !== null && selectControl.value !== undefined\">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n\n <lib-operator-select disableRange matPrefix [formControl]=\"operatorControl\"></lib-operator-select>\n\n <input matInput type=\"number\" [formControl]=\"selectControl\" [placeholder]=\"column.placeholder!\" (blur)=\"onTouched()\" />\n\n <lib-time-unit-select [locale]=\"column.locale\" matSuffix [formControl]=\"timeUnitControl\"></lib-time-unit-select>\n\n <button\n *ngIf=\"selectControl.value !== null && selectControl.value !== undefined\"\n mat-icon-button\n matSuffix\n size=\"small\"\n [attr.aria-label]=\"datatableIntl.clearFilterLabel\"\n (click)=\"selectControl.setValue(undefined)\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n}\n", styles: [":host{display:flex;flex:1 1 100%}mat-form-field{min-width:auto;flex:1 1 100%;margin:6px 0;--mdc-filled-text-field-active-indicator-color: #999;--mat-form-field-hover-state-layer-opacity: 0;--mdc-filled-text-field-container-shape: 0;--mdc-filled-text-field-container-color: var(--datatable-background)}mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}mat-form-field ::ng-deep .mat-mdc-form-field-icon-suffix{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.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: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i4$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.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: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: OperatorSelectComponent, selector: "lib-operator-select", inputs: ["disableRange"] }, { kind: "component", type: TimeUnitSelectComponent, selector: "lib-time-unit-select", inputs: ["locale"] }, { kind: "pipe", type: SafeHtmlPipe, name: "safeHtml" }] });
1236
+ }
1237
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderDurationFilterComponent, decorators: [{
1238
+ type: Component,
1239
+ args: [{ selector: 'lib-header-duration-filter', imports: [
1240
+ CommonModule,
1241
+ FormsModule,
1242
+ MatButtonModule,
1243
+ MatFormFieldModule,
1244
+ MatIconModule,
1245
+ MatInputModule,
1246
+ ReactiveFormsModule,
1247
+ OperatorSelectComponent,
1248
+ TimeUnitSelectComponent,
1249
+ SafeHtmlPipe,
1250
+ ], providers: [
1251
+ {
1252
+ provide: NG_VALUE_ACCESSOR,
1253
+ multi: true,
1254
+ useExisting: forwardRef(() => HeaderDurationFilterComponent),
1255
+ },
1256
+ ], template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field\n class=\"ngx-datatable-duration-filter\"\n appearance=\"fill\"\n [class.has-value]=\"selectControl.value !== null && selectControl.value !== undefined\">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n\n <lib-operator-select disableRange matPrefix [formControl]=\"operatorControl\"></lib-operator-select>\n\n <input matInput type=\"number\" [formControl]=\"selectControl\" [placeholder]=\"column.placeholder!\" (blur)=\"onTouched()\" />\n\n <lib-time-unit-select [locale]=\"column.locale\" matSuffix [formControl]=\"timeUnitControl\"></lib-time-unit-select>\n\n <button\n *ngIf=\"selectControl.value !== null && selectControl.value !== undefined\"\n mat-icon-button\n matSuffix\n size=\"small\"\n [attr.aria-label]=\"datatableIntl.clearFilterLabel\"\n (click)=\"selectControl.setValue(undefined)\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n}\n", styles: [":host{display:flex;flex:1 1 100%}mat-form-field{min-width:auto;flex:1 1 100%;margin:6px 0;--mdc-filled-text-field-active-indicator-color: #999;--mat-form-field-hover-state-layer-opacity: 0;--mdc-filled-text-field-container-shape: 0;--mdc-filled-text-field-container-color: var(--datatable-background)}mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}mat-form-field ::ng-deep .mat-mdc-form-field-icon-suffix{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row}\n"] }]
1257
+ }], propDecorators: { column: [{
1258
+ type: Input
1259
+ }] } });
1260
+
1261
+ /** @format */
1262
+ class HeaderNumberFilterComponent {
1263
+ column;
1264
+ control;
1265
+ selectControl = new FormControl();
1266
+ operatorControl = new FormControl('=');
1267
+ onChange = () => { };
1268
+ onTouched = () => { };
1269
+ datatableIntl = inject(NgxMatDatatableIntl);
1270
+ injector = inject(Injector);
1271
+ changeDetectorRef = inject(ChangeDetectorRef);
1272
+ subsink = new Subscription();
1273
+ writeValue(value) {
1274
+ if (value?.operator && value.operator !== this.operatorControl.value) {
1275
+ this.operatorControl.setValue(value.operator, { emitEvent: false });
1276
+ }
1277
+ if (value?.value !== this.selectControl.value)
1278
+ this.selectControl.setValue(value?.value, { emitEvent: false });
1279
+ this.changeDetectorRef.markForCheck();
1280
+ }
1281
+ setDisabledState(isDisabled) {
1282
+ if (isDisabled) {
1283
+ this.selectControl.disable({ emitEvent: false });
1284
+ this.operatorControl.disable({ emitEvent: false });
1285
+ }
1286
+ else {
1287
+ this.selectControl.enable({ emitEvent: false });
1288
+ this.operatorControl.enable({ emitEvent: false });
1289
+ }
1290
+ }
1291
+ registerOnChange(onChange) {
1292
+ this.onChange = onChange;
1293
+ }
1294
+ registerOnTouched(onTouched) {
1295
+ this.onTouched = onTouched;
1296
+ }
1297
+ async ngAfterViewInit() {
1298
+ const ngControl = this.injector.get(NgControl, null);
1299
+ if (!ngControl)
1300
+ throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
1301
+ this.control = ngControl.control;
1302
+ this.subsink.add(this.selectControl.valueChanges.subscribe((value) => {
1303
+ if (this.control.invalid)
1304
+ return;
1305
+ else if (this.isEmptyValue(value))
1306
+ this.onChange(undefined);
1307
+ else
1308
+ this.onChange({ value, regex: false, operator: this.operatorControl.value });
1309
+ }));
1310
+ this.subsink.add(this.operatorControl.valueChanges.subscribe((value) => {
1311
+ if (this.isEmptyValue(this.selectControl.value))
1312
+ return;
1313
+ this.onChange({ value: this.selectControl.value, regex: false, operator: value });
1314
+ }));
1315
+ this.changeDetectorRef.detectChanges();
1316
+ }
1317
+ ngOnDestroy() {
1318
+ this.subsink.unsubscribe();
1319
+ }
1320
+ isEmptyValue(value) {
1321
+ return value === null || value === undefined || value === '';
1322
+ }
1323
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderNumberFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1324
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: HeaderNumberFilterComponent, isStandalone: true, selector: "lib-header-number-filter", inputs: { column: "column" }, providers: [
1325
+ {
1326
+ provide: NG_VALUE_ACCESSOR,
1327
+ multi: true,
1328
+ useExisting: forwardRef(() => HeaderNumberFilterComponent),
1329
+ },
1330
+ ], ngImport: i0, template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field\n class=\"ngx-datatable-number-filter\"\n appearance=\"fill\"\n [class.has-value]=\"selectControl.value !== null && selectControl.value !== undefined && selectControl.value !== ''\">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n\n <lib-operator-select disableRange matPrefix [formControl]=\"operatorControl\"></lib-operator-select>\n\n <input matInput [formControl]=\"selectControl\" type=\"number\" (blur)=\"onTouched()\" />\n\n <button\n *ngIf=\"selectControl.value !== null && selectControl.value !== undefined && selectControl.value !== ''\"\n mat-icon-button\n matSuffix\n size=\"small\"\n [attr.aria-label]=\"datatableIntl.clearFilterLabel\"\n (click)=\"selectControl.setValue(undefined)\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n}\n", styles: [":host{display:flex;flex:1 1 100%}mat-form-field{min-width:auto;flex:1 1 100%;margin:6px 0;--mdc-filled-text-field-active-indicator-color: #999;--mat-form-field-hover-state-layer-opacity: 0;--mdc-filled-text-field-container-shape: 0;--mdc-filled-text-field-container-color: var(--datatable-background)}mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.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: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i4$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.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: MatMenuModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: OperatorSelectComponent, selector: "lib-operator-select", inputs: ["disableRange"] }, { kind: "pipe", type: SafeHtmlPipe, name: "safeHtml" }] });
1331
+ }
1332
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderNumberFilterComponent, decorators: [{
1333
+ type: Component,
1334
+ args: [{ selector: 'lib-header-number-filter', imports: [
1335
+ CommonModule,
1336
+ FormsModule,
1337
+ MatButtonModule,
1338
+ MatFormFieldModule,
1339
+ MatIconModule,
1340
+ MatInputModule,
1341
+ MatMenuModule,
1342
+ ReactiveFormsModule,
1343
+ OperatorSelectComponent,
1344
+ SafeHtmlPipe,
1345
+ ], providers: [
1346
+ {
1347
+ provide: NG_VALUE_ACCESSOR,
1348
+ multi: true,
1349
+ useExisting: forwardRef(() => HeaderNumberFilterComponent),
1350
+ },
1351
+ ], template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field\n class=\"ngx-datatable-number-filter\"\n appearance=\"fill\"\n [class.has-value]=\"selectControl.value !== null && selectControl.value !== undefined && selectControl.value !== ''\">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n\n <lib-operator-select disableRange matPrefix [formControl]=\"operatorControl\"></lib-operator-select>\n\n <input matInput [formControl]=\"selectControl\" type=\"number\" (blur)=\"onTouched()\" />\n\n <button\n *ngIf=\"selectControl.value !== null && selectControl.value !== undefined && selectControl.value !== ''\"\n mat-icon-button\n matSuffix\n size=\"small\"\n [attr.aria-label]=\"datatableIntl.clearFilterLabel\"\n (click)=\"selectControl.setValue(undefined)\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n}\n", styles: [":host{display:flex;flex:1 1 100%}mat-form-field{min-width:auto;flex:1 1 100%;margin:6px 0;--mdc-filled-text-field-active-indicator-color: #999;--mat-form-field-hover-state-layer-opacity: 0;--mdc-filled-text-field-container-shape: 0;--mdc-filled-text-field-container-color: var(--datatable-background)}mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}\n"] }]
1352
+ }], propDecorators: { column: [{
1353
+ type: Input
1354
+ }] } });
1355
+
1356
+ /** @format */
1357
+ class HeaderSelectFilterComponent {
1358
+ column;
1359
+ options = [];
1360
+ groups = [];
1361
+ control;
1362
+ selectControl = new FormControl();
1363
+ onChange = () => { };
1364
+ onTouched = () => { };
1365
+ datatableIntl = inject(NgxMatDatatableIntl);
1366
+ injector = inject(Injector);
1367
+ changeDetectorRef = inject(ChangeDetectorRef);
1368
+ selectOptionsCache = inject(SelectOptionsCacheService);
1369
+ subsink = new Subscription();
1370
+ writeValue(controlValue) {
1371
+ if (controlValue?.value !== this.selectControl.value) {
1372
+ const value = controlValue?.value;
1373
+ if (!this.isEmptyValue(value) && !Array.isArray(value) && this.column.multiple) {
1374
+ this.selectControl.setValue([value], { emitEvent: false });
1375
+ }
1376
+ else
1377
+ this.selectControl.setValue(value, { emitEvent: false });
1378
+ }
1379
+ this.changeDetectorRef.markForCheck();
1380
+ }
1381
+ setDisabledState(isDisabled) {
1382
+ if (isDisabled)
1383
+ this.selectControl.disable({ emitEvent: false });
1384
+ else
1385
+ this.selectControl.enable({ emitEvent: false });
1386
+ }
1387
+ registerOnChange(onChange) {
1388
+ this.onChange = onChange;
1389
+ }
1390
+ registerOnTouched(onTouched) {
1391
+ this.onTouched = onTouched;
1392
+ }
1393
+ async ngAfterViewInit() {
1394
+ const ngControl = this.injector.get(NgControl, null);
1395
+ if (!ngControl)
1396
+ throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
1397
+ this.control = ngControl.control;
1398
+ this.subsink.add(this.selectControl.valueChanges.subscribe((value) => {
1399
+ if (this.isEmptyValue(value))
1400
+ this.onChange(undefined);
1401
+ else
1402
+ this.onChange({ value, operator: this.column.multiple ? '$in' : undefined, regex: false });
1403
+ }));
1404
+ if (Array.isArray(this.column.options))
1405
+ this.buildOptions(this.column.options);
1406
+ else
1407
+ this.subsink.add(this.selectOptionsCache.resolve(this.column.options).subscribe(data => {
1408
+ this.options = [];
1409
+ this.groups = [];
1410
+ this.buildOptions(data);
1411
+ }));
1412
+ this.changeDetectorRef.detectChanges();
1413
+ }
1414
+ ngOnDestroy() {
1415
+ this.subsink.unsubscribe();
1416
+ }
1417
+ buildOptions(data) {
1418
+ data.forEach(d => {
1419
+ this.options.push(d);
1420
+ const name = d.group ?? '';
1421
+ const group = this.groups.find(g => g.name === name);
1422
+ if (!group)
1423
+ this.groups.push({ name, options: [d] });
1424
+ else
1425
+ group.options.push(d);
1426
+ });
1427
+ }
1428
+ isEmptyValue(value) {
1429
+ return value === null || value === undefined || value === '' || (Array.isArray(value) && !value.length);
1430
+ }
1431
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderSelectFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1432
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: HeaderSelectFilterComponent, isStandalone: true, selector: "lib-header-select-filter", inputs: { column: "column" }, providers: [
1433
+ {
1434
+ provide: NG_VALUE_ACCESSOR,
1435
+ multi: true,
1436
+ useExisting: forwardRef(() => HeaderSelectFilterComponent),
1437
+ },
1438
+ ], ngImport: i0, template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field appearance=\"fill\">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n <mat-select\n [formControl]=\"selectControl\"\n [placeholder]=\"column.placeholder!\"\n [multiple]=\"column.multiple\"\n (closed)=\"onTouched()\">\n <mat-select-trigger>\n @if (column.multiple && selectControl.value | isArray) {\n <div class=\"options\">\n @for (v of selectControl.value; track v) {\n @let option = v | selectOption: options;\n @if (option) {\n <ng-container *ngTemplateOutlet=\"selectOption; context: { option }\"></ng-container>\n } @else {\n <mat-label [innerHTML]=\"v | safeHtml\"></mat-label>\n }\n }\n </div>\n } @else {\n @let option = selectControl.value | selectOption: options;\n @if (option) {\n <ng-container *ngTemplateOutlet=\"selectOption; context: { option }\"></ng-container>\n } @else {\n <mat-label [innerHTML]=\"selectControl.value | safeHtml\"></mat-label>\n }\n }\n </mat-select-trigger>\n @if (column.hasGroup) {\n @for (group of groups; track group) {\n <mat-optgroup>\n <mat-label [innerHTML]=\"group.name | safeHtml\"></mat-label>\n @for (option of group.options; track option) {\n <mat-option [value]=\"option.value\">\n <ng-container *ngTemplateOutlet=\"selectOption; context: { option }\"></ng-container>\n </mat-option>\n }\n </mat-optgroup>\n }\n } @else {\n @for (option of options; track option) {\n <mat-option [value]=\"option.value\">\n <ng-container *ngTemplateOutlet=\"selectOption; context: { option }\"></ng-container>\n </mat-option>\n }\n }\n </mat-select>\n\n <button\n *ngIf=\"selectControl.value !== null && selectControl.value !== undefined && selectControl.value !== ''\"\n mat-icon-button\n matSuffix\n size=\"small\"\n [attr.aria-label]=\"datatableIntl.clearFilterLabel\"\n (click)=\"selectControl.setValue(undefined)\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n}\n\n<ng-template #selectOption let-option=\"option\">\n <div class=\"option\">\n @if (option.icon) {\n @switch (option.iconSrc) {\n @case ('svg') {\n <mat-icon\n [svgIcon]=\"option.icon\"\n [style.color]=\"option.iconColor ?? option.color\"\n [style.margin-right.px]=\"8\"></mat-icon>\n }\n @default {\n <mat-icon [style.color]=\"option.iconColor ?? option.color\" [style.margin-right.px]=\"8\">\n {{ option.icon }}\n </mat-icon>\n }\n }\n }\n <mat-label [style.color]=\"option.color\" [innerHTML]=\"option.name | safeHtml\"></mat-label>\n </div>\n</ng-template>\n", styles: [":host{display:flex;flex:1 1 100%}mat-form-field{min-width:auto;flex:1 1 100%;margin:6px 0;--mdc-filled-text-field-active-indicator-color: #999;--mat-form-field-hover-state-layer-opacity: 0;--mdc-filled-text-field-container-shape: 0;--mdc-filled-text-field-container-color: var(--datatable-background)}mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}.options{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;flex-wrap:wrap}.options .option:not(:last-child){margin-right:8px}.option{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i6$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: "directive", type: i6$1.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i5$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i5$1.MatOptgroup, selector: "mat-optgroup", inputs: ["label", "disabled"], exportAs: ["matOptgroup"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: SelectOptionPipe, name: "selectOption" }, { kind: "pipe", type: SafeHtmlPipe, name: "safeHtml" }, { kind: "pipe", type: IsArrayPipe, name: "isArray" }] });
1439
+ }
1440
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderSelectFilterComponent, decorators: [{
1441
+ type: Component,
1442
+ args: [{ selector: 'lib-header-select-filter', imports: [
1443
+ CommonModule,
1444
+ FormsModule,
1445
+ MatButtonModule,
1446
+ MatFormFieldModule,
1447
+ MatIconModule,
1448
+ MatSelectModule,
1449
+ ReactiveFormsModule,
1450
+ SelectOptionPipe,
1451
+ SafeHtmlPipe,
1452
+ IsArrayPipe,
1453
+ ], providers: [
1454
+ {
1455
+ provide: NG_VALUE_ACCESSOR,
1456
+ multi: true,
1457
+ useExisting: forwardRef(() => HeaderSelectFilterComponent),
1458
+ },
1459
+ ], template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field appearance=\"fill\">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n <mat-select\n [formControl]=\"selectControl\"\n [placeholder]=\"column.placeholder!\"\n [multiple]=\"column.multiple\"\n (closed)=\"onTouched()\">\n <mat-select-trigger>\n @if (column.multiple && selectControl.value | isArray) {\n <div class=\"options\">\n @for (v of selectControl.value; track v) {\n @let option = v | selectOption: options;\n @if (option) {\n <ng-container *ngTemplateOutlet=\"selectOption; context: { option }\"></ng-container>\n } @else {\n <mat-label [innerHTML]=\"v | safeHtml\"></mat-label>\n }\n }\n </div>\n } @else {\n @let option = selectControl.value | selectOption: options;\n @if (option) {\n <ng-container *ngTemplateOutlet=\"selectOption; context: { option }\"></ng-container>\n } @else {\n <mat-label [innerHTML]=\"selectControl.value | safeHtml\"></mat-label>\n }\n }\n </mat-select-trigger>\n @if (column.hasGroup) {\n @for (group of groups; track group) {\n <mat-optgroup>\n <mat-label [innerHTML]=\"group.name | safeHtml\"></mat-label>\n @for (option of group.options; track option) {\n <mat-option [value]=\"option.value\">\n <ng-container *ngTemplateOutlet=\"selectOption; context: { option }\"></ng-container>\n </mat-option>\n }\n </mat-optgroup>\n }\n } @else {\n @for (option of options; track option) {\n <mat-option [value]=\"option.value\">\n <ng-container *ngTemplateOutlet=\"selectOption; context: { option }\"></ng-container>\n </mat-option>\n }\n }\n </mat-select>\n\n <button\n *ngIf=\"selectControl.value !== null && selectControl.value !== undefined && selectControl.value !== ''\"\n mat-icon-button\n matSuffix\n size=\"small\"\n [attr.aria-label]=\"datatableIntl.clearFilterLabel\"\n (click)=\"selectControl.setValue(undefined)\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n}\n\n<ng-template #selectOption let-option=\"option\">\n <div class=\"option\">\n @if (option.icon) {\n @switch (option.iconSrc) {\n @case ('svg') {\n <mat-icon\n [svgIcon]=\"option.icon\"\n [style.color]=\"option.iconColor ?? option.color\"\n [style.margin-right.px]=\"8\"></mat-icon>\n }\n @default {\n <mat-icon [style.color]=\"option.iconColor ?? option.color\" [style.margin-right.px]=\"8\">\n {{ option.icon }}\n </mat-icon>\n }\n }\n }\n <mat-label [style.color]=\"option.color\" [innerHTML]=\"option.name | safeHtml\"></mat-label>\n </div>\n</ng-template>\n", styles: [":host{display:flex;flex:1 1 100%}mat-form-field{min-width:auto;flex:1 1 100%;margin:6px 0;--mdc-filled-text-field-active-indicator-color: #999;--mat-form-field-hover-state-layer-opacity: 0;--mdc-filled-text-field-container-shape: 0;--mdc-filled-text-field-container-color: var(--datatable-background)}mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}.options{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;flex-wrap:wrap}.options .option:not(:last-child){margin-right:8px}.option{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row}\n"] }]
1460
+ }], propDecorators: { column: [{
1461
+ type: Input
1462
+ }] } });
1463
+
1464
+ /** @format */
1465
+ class HeaderTextFilterComponent {
1466
+ column;
1467
+ control;
1468
+ selectControl = new FormControl();
1469
+ onChange = () => { };
1470
+ onTouched = () => { };
1471
+ datatableIntl = inject(NgxMatDatatableIntl);
1472
+ injector = inject(Injector);
1473
+ changeDetectorRef = inject(ChangeDetectorRef);
1474
+ subsink = new Subscription();
1475
+ writeValue(value) {
1476
+ const nextValue = value?.value ?? '';
1477
+ if (nextValue !== this.selectControl.value)
1478
+ this.selectControl.setValue(nextValue, { emitEvent: false });
1479
+ this.changeDetectorRef.markForCheck();
1480
+ }
1481
+ setDisabledState(isDisabled) {
1482
+ if (isDisabled)
1483
+ this.selectControl.disable({ emitEvent: false });
1484
+ else
1485
+ this.selectControl.enable({ emitEvent: false });
1486
+ }
1487
+ registerOnChange(onChange) {
1488
+ this.onChange = onChange;
1489
+ }
1490
+ registerOnTouched(onTouched) {
1491
+ this.onTouched = onTouched;
1492
+ }
1493
+ async ngAfterViewInit() {
1494
+ const ngControl = this.injector.get(NgControl, null);
1495
+ if (!ngControl)
1496
+ throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
1497
+ this.control = ngControl.control;
1498
+ this.subsink.add(this.selectControl.valueChanges.subscribe((value) => {
1499
+ if (this.isEmptyValue(value))
1500
+ this.onChange(undefined);
1501
+ else {
1502
+ if (this.column.regex)
1503
+ this.onChange({ value, regex: true });
1504
+ else
1505
+ this.onChange({ value: this.escapeRegExp(value), regex: true });
1506
+ }
1507
+ }));
1508
+ this.changeDetectorRef.detectChanges();
1509
+ }
1510
+ ngOnDestroy() {
1511
+ this.subsink.unsubscribe();
1512
+ }
1513
+ escapeRegExp(value) {
1514
+ if (!value)
1515
+ return '';
1516
+ return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
1517
+ }
1518
+ isEmptyValue(value) {
1519
+ return value === null || value === undefined || value === '';
1520
+ }
1521
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderTextFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1522
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: HeaderTextFilterComponent, isStandalone: true, selector: "lib-header-text-filter", inputs: { column: "column" }, providers: [
1523
+ {
1524
+ provide: NG_VALUE_ACCESSOR,
1525
+ multi: true,
1526
+ useExisting: forwardRef(() => HeaderTextFilterComponent),
1527
+ },
1528
+ ], ngImport: i0, template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field\n appearance=\"fill\"\n [class.has-value]=\"selectControl.value !== null && selectControl.value !== undefined && selectControl.value !== ''\">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n <input matInput [formControl]=\"selectControl\" (blur)=\"onTouched()\" />\n <button\n *ngIf=\"selectControl.value !== null && selectControl.value !== undefined && selectControl.value !== ''\"\n mat-icon-button\n matSuffix\n size=\"small\"\n [attr.aria-label]=\"datatableIntl.clearFilterLabel\"\n (click)=\"selectControl.setValue(undefined)\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n}\n", styles: [":host{display:flex;flex:1 1 100%}mat-form-field{min-width:auto;flex:1 1 100%;margin:6px 0;--mdc-filled-text-field-active-indicator-color: #999;--mat-form-field-hover-state-layer-opacity: 0;--mdc-filled-text-field-container-shape: 0;--mdc-filled-text-field-container-color: var(--datatable-background)}mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.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: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: SafeHtmlPipe, name: "safeHtml" }] });
1529
+ }
1530
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderTextFilterComponent, decorators: [{
1531
+ type: Component,
1532
+ args: [{ selector: 'lib-header-text-filter', imports: [
1533
+ CommonModule,
1534
+ FormsModule,
1535
+ MatButtonModule,
1536
+ MatFormFieldModule,
1537
+ MatIconModule,
1538
+ MatInputModule,
1539
+ ReactiveFormsModule,
1540
+ SafeHtmlPipe,
1541
+ ], providers: [
1542
+ {
1543
+ provide: NG_VALUE_ACCESSOR,
1544
+ multi: true,
1545
+ useExisting: forwardRef(() => HeaderTextFilterComponent),
1546
+ },
1547
+ ], template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field\n appearance=\"fill\"\n [class.has-value]=\"selectControl.value !== null && selectControl.value !== undefined && selectControl.value !== ''\">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n <input matInput [formControl]=\"selectControl\" (blur)=\"onTouched()\" />\n <button\n *ngIf=\"selectControl.value !== null && selectControl.value !== undefined && selectControl.value !== ''\"\n mat-icon-button\n matSuffix\n size=\"small\"\n [attr.aria-label]=\"datatableIntl.clearFilterLabel\"\n (click)=\"selectControl.setValue(undefined)\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n}\n", styles: [":host{display:flex;flex:1 1 100%}mat-form-field{min-width:auto;flex:1 1 100%;margin:6px 0;--mdc-filled-text-field-active-indicator-color: #999;--mat-form-field-hover-state-layer-opacity: 0;--mdc-filled-text-field-container-shape: 0;--mdc-filled-text-field-container-color: var(--datatable-background)}mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}\n"] }]
1548
+ }], propDecorators: { column: [{
1549
+ type: Input
1550
+ }] } });
1551
+
1552
+ /** @format */
1553
+ class MergePipe {
1554
+ transform(obj, src) {
1555
+ return src ? { ...obj, ...src } : { ...obj };
1556
+ }
1557
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: MergePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1558
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: MergePipe, isStandalone: true, name: "merge" });
1559
+ }
1560
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: MergePipe, decorators: [{
1561
+ type: Pipe,
1562
+ args: [{ name: 'merge' }]
1563
+ }] });
1564
+
1565
+ /** @format */
1566
+ class ProgressSpinnerComponent {
1567
+ datatableIntl = inject(NgxMatDatatableIntl);
1568
+ diameter = 100;
1569
+ set setValue(value) {
1570
+ if (typeof value === 'string')
1571
+ this._value = parseFloat(value);
1572
+ else
1573
+ this._value = value;
1574
+ if (this.animateInView)
1575
+ this.load(this.isInView);
1576
+ }
1577
+ _value = 0;
1578
+ value = 0;
1579
+ color;
1580
+ set setDisplayValue(displayValue) {
1581
+ this.displayValue = displayValue !== false;
1582
+ }
1583
+ displayValue = true;
1584
+ get getColor() {
1585
+ return this.color;
1586
+ }
1587
+ fontSize = `${this.diameter / 5}px`;
1588
+ set setAnimateInView(animateInView) {
1589
+ this.animateInView = animateInView !== false;
1590
+ }
1591
+ animateInView = true;
1592
+ set setDelay(delay) {
1593
+ if (typeof delay === 'string')
1594
+ this.delay = parseInt(delay);
1595
+ else
1596
+ this.delay = delay;
1597
+ }
1598
+ delay;
1599
+ isInView = false;
1600
+ load(intersect) {
1601
+ this.isInView = intersect;
1602
+ if (this.isInView) {
1603
+ if (this.delay)
1604
+ setTimeout(() => (this.value = this._value), this.delay);
1605
+ else
1606
+ this.value = this._value;
1607
+ }
1608
+ }
1609
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: ProgressSpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1610
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.4", type: ProgressSpinnerComponent, isStandalone: true, selector: "lib-progress-spinner", inputs: { diameter: "diameter", setValue: ["value", "setValue"], color: "color", setDisplayValue: ["displayValue", "setDisplayValue"], fontSize: "fontSize", setAnimateInView: ["animateInView", "setAnimateInView"], setDelay: ["delay", "setDelay"] }, host: { properties: { "style.--progress-spinner-color": "this.getColor" } }, ngImport: i0, template: "<!-- @format -->\n\n<div id=\"container\" [style.font-size]=\"fontSize\" [style.width.px]=\"diameter\" [style.height.px]=\"diameter\">\n <mat-progress-spinner id=\"background\" [diameter]=\"diameter\" mode=\"determinate\" [value]=\"100\"> </mat-progress-spinner>\n <mat-progress-spinner\n id=\"foreground\"\n [diameter]=\"diameter\"\n mode=\"determinate\"\n [value]=\"value\"\n intersectionObserver\n (intersection)=\"load($event.intersect)\">\n </mat-progress-spinner>\n <div id=\"inner-block\">\n <mat-label\n [countUp]=\"value\"\n [options]=\"datatableIntl.numberOptions | merge: { suffix: '%', duration: 0.6 }\"\n [reanimateOnClick]=\"false\"></mat-label>\n <ng-content></ng-content>\n </div>\n</div>\n", styles: ["#container{position:relative}#container #foreground{--mdc-circular-progress-active-indicator-color: var(--progress-spinner-color, varvar(--mat-sys-primary))}#container #foreground ::ng-deep .mdc-circular-progress__determinate-circle{stroke-width:var(--progress-spinner-stroke-width, 5%)!important}#container #background{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);--mdc-circular-progress-active-indicator-color: var(--progress-spinner-color, var(--mat-sys-primary))}#container #background ::ng-deep .mdc-circular-progress__determinate-circle{stroke-width:var(--progress-spinner-stroke-width, calc(5% + 2px) )!important;stroke-opacity:var(--progress-spinner-background-opacity, .2)}#container #inner-block{position:absolute;inset:0;box-sizing:content-box;display:flex;flex-direction:column;place-content:center center;align-items:center;overflow:hidden;border-radius:50%;margin:calc(var(--progress-spinner-stroke-width, calc(5% + 2px) ) + 2px);line-height:1em}#container:hover #foreground ::ng-deep .mdc-circular-progress__determinate-circle{stroke-width:var(--progress-spinner-stroke-width, calc(5% + 2px) )!important}#container:hover #background ::ng-deep .mdc-circular-progress__determinate-circle{stroke-opacity:var(--progress-spinner-background-opacity, .33)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i1$3.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: IntersectionObserverModule }, { kind: "directive", type: i3.IntersectionObserverDirective, selector: "[intersectionObserver]", inputs: ["visitClass", "leaveClass", "removeVisitClass", "removeLeaveClass", "useScroll", "threshold", "autoRemove"], outputs: ["intersection"] }, { kind: "ngmodule", type: CountUpModule }, { kind: "directive", type: i3$3.CountUpDirective, selector: "[countUp]", inputs: ["countUp", "options", "reanimateOnClick"], outputs: ["complete"] }, { kind: "pipe", type: MergePipe, name: "merge" }] });
1611
+ }
1612
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: ProgressSpinnerComponent, decorators: [{
1613
+ type: Component,
1614
+ args: [{ selector: 'lib-progress-spinner', imports: [CommonModule, MatProgressSpinnerModule, IntersectionObserverModule, CountUpModule, MergePipe], template: "<!-- @format -->\n\n<div id=\"container\" [style.font-size]=\"fontSize\" [style.width.px]=\"diameter\" [style.height.px]=\"diameter\">\n <mat-progress-spinner id=\"background\" [diameter]=\"diameter\" mode=\"determinate\" [value]=\"100\"> </mat-progress-spinner>\n <mat-progress-spinner\n id=\"foreground\"\n [diameter]=\"diameter\"\n mode=\"determinate\"\n [value]=\"value\"\n intersectionObserver\n (intersection)=\"load($event.intersect)\">\n </mat-progress-spinner>\n <div id=\"inner-block\">\n <mat-label\n [countUp]=\"value\"\n [options]=\"datatableIntl.numberOptions | merge: { suffix: '%', duration: 0.6 }\"\n [reanimateOnClick]=\"false\"></mat-label>\n <ng-content></ng-content>\n </div>\n</div>\n", styles: ["#container{position:relative}#container #foreground{--mdc-circular-progress-active-indicator-color: var(--progress-spinner-color, varvar(--mat-sys-primary))}#container #foreground ::ng-deep .mdc-circular-progress__determinate-circle{stroke-width:var(--progress-spinner-stroke-width, 5%)!important}#container #background{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);--mdc-circular-progress-active-indicator-color: var(--progress-spinner-color, var(--mat-sys-primary))}#container #background ::ng-deep .mdc-circular-progress__determinate-circle{stroke-width:var(--progress-spinner-stroke-width, calc(5% + 2px) )!important;stroke-opacity:var(--progress-spinner-background-opacity, .2)}#container #inner-block{position:absolute;inset:0;box-sizing:content-box;display:flex;flex-direction:column;place-content:center center;align-items:center;overflow:hidden;border-radius:50%;margin:calc(var(--progress-spinner-stroke-width, calc(5% + 2px) ) + 2px);line-height:1em}#container:hover #foreground ::ng-deep .mdc-circular-progress__determinate-circle{stroke-width:var(--progress-spinner-stroke-width, calc(5% + 2px) )!important}#container:hover #background ::ng-deep .mdc-circular-progress__determinate-circle{stroke-opacity:var(--progress-spinner-background-opacity, .33)}\n"] }]
1615
+ }], propDecorators: { diameter: [{
1616
+ type: Input
1617
+ }], setValue: [{
1618
+ type: Input,
1619
+ args: ['value']
1620
+ }], color: [{
1621
+ type: Input
1622
+ }], setDisplayValue: [{
1623
+ type: Input,
1624
+ args: ['displayValue']
1625
+ }], getColor: [{
1626
+ type: HostBinding,
1627
+ args: ['style.--progress-spinner-color']
1628
+ }], fontSize: [{
1629
+ type: Input
1630
+ }], setAnimateInView: [{
1631
+ type: Input,
1632
+ args: ['animateInView']
1633
+ }], setDelay: [{
1634
+ type: Input,
1635
+ args: ['delay']
1636
+ }] } });
1637
+
1638
+ /** @format */
1639
+ class DatagridDataSource extends DataSource {
1640
+ service;
1641
+ loading$ = new BehaviorSubject(true);
1642
+ data = [];
1643
+ recordsFiltered = 0;
1644
+ recordsTotal;
1645
+ facets;
1646
+ rowSize = 0; // average row size in MB
1647
+ options;
1648
+ latestRequestId = 0;
1649
+ disconnected = false;
1650
+ measuredRowSize = 0;
1651
+ measuredRowCount = 0;
1652
+ textEncoder = new TextEncoder();
1653
+ dataStream = new BehaviorSubject([]);
1654
+ constructor(service) {
1655
+ super();
1656
+ this.service = service;
1657
+ }
1658
+ connect() {
1659
+ return this.dataStream;
1660
+ }
1661
+ disconnect() {
1662
+ this.disconnected = true;
1663
+ this.latestRequestId++;
1664
+ this.loading$.complete();
1665
+ this.dataStream.complete();
1666
+ }
1667
+ async loadData(options, append = false) {
1668
+ if (this.disconnected)
1669
+ return;
1670
+ const requestId = ++this.latestRequestId;
1671
+ this.options = options;
1672
+ if (!append)
1673
+ this.loading$.next(true);
1674
+ try {
1675
+ const result = await this.service(options);
1676
+ if (this.disconnected || requestId !== this.latestRequestId || options.draw !== result.draw)
1677
+ return;
1678
+ this.recordsTotal = result.recordsTotal;
1679
+ this.recordsFiltered = result.recordsFiltered;
1680
+ this.facets = result.facets;
1681
+ this.updateRowSize(result.data, append);
1682
+ this.setData(result.data, append);
1683
+ }
1684
+ finally {
1685
+ if (!append && !this.disconnected && requestId === this.latestRequestId)
1686
+ this.loading$.next(false);
1687
+ }
1688
+ }
1689
+ refresh() {
1690
+ if (this.options)
1691
+ void this.loadData(this.options);
1692
+ }
1693
+ redraw(match) {
1694
+ const data = [];
1695
+ this.data.forEach((d) => {
1696
+ if (match) {
1697
+ if (match(d))
1698
+ data.push({ ...d });
1699
+ else
1700
+ data.push(d);
1701
+ }
1702
+ else
1703
+ data.push({ ...d });
1704
+ });
1705
+ this.setData(data, false);
1706
+ }
1707
+ setData(data, append) {
1708
+ this.data = append ? [...this.data, ...data] : data;
1709
+ this.dataStream.next(this.data);
1710
+ }
1711
+ updateRowSize(data, append) {
1712
+ if (!append) {
1713
+ this.measuredRowSize = 0;
1714
+ this.measuredRowCount = 0;
1715
+ }
1716
+ for (const row of data) {
1717
+ try {
1718
+ const serialized = JSON.stringify(row);
1719
+ if (serialized === undefined)
1720
+ continue;
1721
+ this.measuredRowSize += this.textEncoder.encode(serialized).length / 1024 / 1024;
1722
+ this.measuredRowCount++;
1723
+ }
1724
+ catch {
1725
+ // Row size is only an export chunking hint; unserializable rows must not fail data loading.
1726
+ }
1727
+ }
1728
+ this.rowSize = this.measuredRowCount ? this.measuredRowSize / this.measuredRowCount : 0;
1729
+ }
1730
+ }
1731
+
1732
+ /** @format */
1733
+ const NGX_MAT_DATATABLE_DEFAULT_OPTIONS = new InjectionToken('NGX_MAT_DATATABLE_DEFAULT_OPTIONS', {
1734
+ providedIn: 'root',
1735
+ factory: () => ({
1736
+ loadMode: 'pagination',
1737
+ showRecordsCount: true,
1738
+ pageSizeOptions: [20, 50, 100],
1739
+ pageSizeOptionsIndex: 1,
1740
+ incremental: {
1741
+ trigger: 'inView',
1742
+ },
1743
+ }),
1744
+ });
1745
+ function provideNgxMatDatatableDefaultOptions(options) {
1746
+ return {
1747
+ provide: NGX_MAT_DATATABLE_DEFAULT_OPTIONS,
1748
+ useValue: options,
1749
+ };
1750
+ }
1751
+
1752
+ /** @format */
1753
+ class NgxMatDatatableContentDirective {
1754
+ templateRef;
1755
+ id;
1756
+ constructor(templateRef) {
1757
+ this.templateRef = templateRef;
1758
+ }
1759
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableContentDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
1760
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.4", type: NgxMatDatatableContentDirective, isStandalone: true, selector: "[ngxMatDatatableContent]", inputs: { id: ["ngxMatDatatableContent", "id"] }, ngImport: i0 });
1761
+ }
1762
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableContentDirective, decorators: [{
1763
+ type: Directive,
1764
+ args: [{
1765
+ selector: '[ngxMatDatatableContent]',
1766
+ }]
1767
+ }], ctorParameters: () => [{ type: i0.TemplateRef }], propDecorators: { id: [{
1768
+ type: Input,
1769
+ args: ['ngxMatDatatableContent']
1770
+ }] } });
1771
+
1772
+ class DatatableRowViewportObserverService {
1773
+ observer;
1774
+ callbacks = new Map();
1775
+ observe(element, callback) {
1776
+ this.callbacks.set(element, callback);
1777
+ if (typeof IntersectionObserver === 'undefined') {
1778
+ callback();
1779
+ this.callbacks.delete(element);
1780
+ return;
1781
+ }
1782
+ this.getObserver(element).observe(element);
1783
+ }
1784
+ unobserve(element) {
1785
+ this.observer?.unobserve(element);
1786
+ this.callbacks.delete(element);
1787
+ }
1788
+ ngOnDestroy() {
1789
+ this.observer?.disconnect();
1790
+ this.callbacks.clear();
1791
+ }
1792
+ getObserver(element) {
1793
+ if (this.observer)
1794
+ return this.observer;
1795
+ const root = element.closest('#table-container');
1796
+ this.observer = new IntersectionObserver(entries => {
1797
+ entries.forEach(entry => {
1798
+ if (!entry.isIntersecting)
1799
+ return;
1800
+ const callback = this.callbacks.get(entry.target);
1801
+ if (!callback)
1802
+ return;
1803
+ callback();
1804
+ this.unobserve(entry.target);
1805
+ });
1806
+ }, { root, rootMargin: '100px 0px', threshold: 0 });
1807
+ return this.observer;
1808
+ }
1809
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: DatatableRowViewportObserverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1810
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: DatatableRowViewportObserverService });
1811
+ }
1812
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: DatatableRowViewportObserverService, decorators: [{
1813
+ type: Injectable
1814
+ }] });
1815
+ class DatatableRowViewportDirective {
1816
+ datatableRowViewport;
1817
+ datatableRowVisible = new EventEmitter();
1818
+ elementRef = inject(ElementRef);
1819
+ observerService = inject(DatatableRowViewportObserverService);
1820
+ ngOnChanges() {
1821
+ const element = this.elementRef.nativeElement;
1822
+ this.observerService.unobserve(element);
1823
+ this.observerService.observe(element, () => this.datatableRowVisible.emit(this.datatableRowViewport));
1824
+ }
1825
+ ngOnDestroy() {
1826
+ this.observerService.unobserve(this.elementRef.nativeElement);
1827
+ }
1828
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: DatatableRowViewportDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1829
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.4", type: DatatableRowViewportDirective, isStandalone: true, selector: "[datatableRowViewport]", inputs: { datatableRowViewport: "datatableRowViewport" }, outputs: { datatableRowVisible: "datatableRowVisible" }, usesOnChanges: true, ngImport: i0 });
1830
+ }
1831
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: DatatableRowViewportDirective, decorators: [{
1832
+ type: Directive,
1833
+ args: [{
1834
+ selector: '[datatableRowViewport]',
1835
+ standalone: true,
1836
+ }]
1837
+ }], propDecorators: { datatableRowViewport: [{
1838
+ type: Input,
1839
+ args: [{ required: true }]
1840
+ }], datatableRowVisible: [{
1841
+ type: Output
1842
+ }] } });
1843
+
1844
+ /** @format */
1845
+ class BackgroundColorPipe {
1846
+ transform(row, column, options) {
1847
+ if (typeof column.backgroundColor === 'string')
1848
+ return column.backgroundColor;
1849
+ if (typeof column.backgroundColor === 'function')
1850
+ return column.backgroundColor(row);
1851
+ if (typeof options.rowBackgroundColor === 'string')
1852
+ return options.rowBackgroundColor;
1853
+ if (typeof options.rowBackgroundColor === 'function')
1854
+ return options.rowBackgroundColor(column, row);
1855
+ }
1856
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: BackgroundColorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1857
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: BackgroundColorPipe, isStandalone: true, name: "backgroundColor" });
1858
+ }
1859
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: BackgroundColorPipe, decorators: [{
1860
+ type: Pipe,
1861
+ args: [{ name: 'backgroundColor' }]
1862
+ }] });
1863
+
1864
+ /** @format */
1865
+ class CellColorPipe {
1866
+ transform(row, column, options) {
1867
+ if (typeof column.color === 'string')
1868
+ return column.color;
1869
+ if (typeof column.color === 'function')
1870
+ return column.color(row);
1871
+ if (typeof options.rowColor === 'string')
1872
+ return options.rowColor;
1873
+ if (typeof options.rowColor === 'function')
1874
+ return options.rowColor(column, row);
1875
+ }
1876
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellColorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1877
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: CellColorPipe, isStandalone: true, name: "cellColor" });
1878
+ }
1879
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellColorPipe, decorators: [{
1880
+ type: Pipe,
1881
+ args: [{ name: 'cellColor' }]
1882
+ }] });
1883
+
1884
+ /** @format */
1885
+ class CellOpacityPipe {
1886
+ transform(row, column, options) {
1887
+ if (typeof options.rowOpacity === 'number')
1888
+ return options.rowOpacity;
1889
+ if (typeof options.rowOpacity === 'function')
1890
+ return options.rowOpacity(column, row);
1891
+ }
1892
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellOpacityPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1893
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: CellOpacityPipe, isStandalone: true, name: "cellOpacity" });
1894
+ }
1895
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellOpacityPipe, decorators: [{
1896
+ type: Pipe,
1897
+ args: [{ name: 'cellOpacity' }]
1898
+ }] });
1899
+
1900
+ /** @format */
1901
+ class FilterPipe {
1902
+ transform(obj, filter) {
1903
+ return (obj ?? []).filter(o => {
1904
+ for (let key of Object.keys(filter)) {
1905
+ if (o[key] !== filter[key])
1906
+ return false;
1907
+ }
1908
+ return true;
1909
+ });
1910
+ }
1911
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FilterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1912
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: FilterPipe, isStandalone: true, name: "filter" });
1913
+ }
1914
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FilterPipe, decorators: [{
1915
+ type: Pipe,
1916
+ args: [{ name: 'filter' }]
1917
+ }] });
1918
+
1919
+ /** @format */
1920
+ class FindContentPipe {
1921
+ transform(contentRefs, id) {
1922
+ return contentRefs?.find(ref => ref.id === id);
1923
+ }
1924
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FindContentPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1925
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: FindContentPipe, isStandalone: true, name: "findContent" });
1926
+ }
1927
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FindContentPipe, decorators: [{
1928
+ type: Pipe,
1929
+ args: [{ name: 'findContent' }]
1930
+ }] });
1931
+
1932
+ /** @format */
1933
+ class FindPipe {
1934
+ transform(obj, filter) {
1935
+ return (obj ?? []).find(o => {
1936
+ for (let key of Object.keys(filter)) {
1937
+ if (o[key] !== filter[key])
1938
+ return false;
1939
+ }
1940
+ return true;
1941
+ });
1942
+ }
1943
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FindPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1944
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: FindPipe, isStandalone: true, name: "find" });
1945
+ }
1946
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FindPipe, decorators: [{
1947
+ type: Pipe,
1948
+ args: [{ name: 'find' }]
1949
+ }] });
1950
+
1951
+ /** @format */
1952
+ class IncludedInPipe {
1953
+ transform(elmt, obj) {
1954
+ return (obj ?? []).includes(elmt);
1955
+ }
1956
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: IncludedInPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1957
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: IncludedInPipe, isStandalone: true, name: "includedIn" });
1958
+ }
1959
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: IncludedInPipe, decorators: [{
1960
+ type: Pipe,
1961
+ args: [{ name: 'includedIn' }]
1962
+ }] });
1963
+
1964
+ /** @format */
1965
+ class OrderByPipe {
1966
+ transform(data, keys, dirs) {
1967
+ return lodash.orderBy(data, typeof keys === 'string' ? [keys] : keys, typeof dirs === 'string' ? [dirs] : dirs);
1968
+ }
1969
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: OrderByPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1970
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: OrderByPipe, isStandalone: true, name: "orderBy" });
1971
+ }
1972
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: OrderByPipe, decorators: [{
1973
+ type: Pipe,
1974
+ args: [{
1975
+ name: 'orderBy',
1976
+ }]
1977
+ }] });
1978
+
1979
+ /** @format */
1980
+ class SortFacetEntriesPipe {
1981
+ transform(entries, options) {
1982
+ if (!entries || !options)
1983
+ return entries;
1984
+ return [...entries].sort((e1, e2) => {
1985
+ const ie1 = options.findIndex(o => o.value === e1._id);
1986
+ if (ie1 === -1)
1987
+ return 1;
1988
+ const ie2 = options.findIndex(o => o.value === e2._id);
1989
+ if (ie2 === -1)
1990
+ return -1;
1991
+ return ie1 - ie2;
1992
+ });
1993
+ }
1994
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SortFacetEntriesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1995
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: SortFacetEntriesPipe, isStandalone: true, name: "sortFacetEntries" });
1996
+ }
1997
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SortFacetEntriesPipe, decorators: [{
1998
+ type: Pipe,
1999
+ args: [{ name: 'sortFacetEntries' }]
2000
+ }] });
2001
+
2002
+ /** @format */
2003
+ class ValueFunctionPipe {
2004
+ transform(value, valueFunction, row, column) {
2005
+ if (typeof valueFunction === 'function')
2006
+ return valueFunction(value, row, column);
2007
+ return null;
2008
+ }
2009
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: ValueFunctionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2010
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: ValueFunctionPipe, isStandalone: true, name: "valueFunction" });
2011
+ }
2012
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: ValueFunctionPipe, decorators: [{
2013
+ type: Pipe,
2014
+ args: [{ name: 'valueFunction' }]
2015
+ }] });
2016
+
2017
+ /** @format */
2018
+ class SumPipe {
2019
+ transform(obj, by) {
2020
+ if (!obj || !obj.length)
2021
+ return 0;
2022
+ if (by)
2023
+ return obj.reduce((pv, cv) => (pv += cv[by]), 0);
2024
+ return obj.reduce((pv, cv) => (pv += cv), 0);
2025
+ }
2026
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SumPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2027
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: SumPipe, isStandalone: true, name: "sum" });
2028
+ }
2029
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SumPipe, decorators: [{
2030
+ type: Pipe,
2031
+ args: [{ name: 'sum' }]
2032
+ }] });
2033
+
2034
+ /** @format */
2035
+ function buildDatasourceRequestColumns(options, searchValues) {
2036
+ const columns = [];
2037
+ const additionalColumns = [];
2038
+ options.additionalProperties?.forEach(property => addAdditionalColumn(additionalColumns, property));
2039
+ options.columns.forEach(columnOptions => {
2040
+ if (columnOptions.hidden)
2041
+ return;
2042
+ const inferredType = columnOptions.searchable ? inferDatasourceRequestColumnType(columnOptions) : undefined;
2043
+ const searchType = columnOptions.searchType ?? inferredType;
2044
+ const column = {
2045
+ data: columnOptions.property,
2046
+ projection: columnOptions.projection,
2047
+ name: columnOptions.columnDef,
2048
+ searchable: columnOptions.searchable,
2049
+ orderable: columnOptions.sortable,
2050
+ type: columnOptions.searchProperty ? inferredType : searchType,
2051
+ };
2052
+ if (columnOptions.sortProperty && columnOptions.order) {
2053
+ addAdditionalColumn(additionalColumns, columnOptions.sortProperty);
2054
+ }
2055
+ if (columnOptions.searchable) {
2056
+ const search = searchValues[columnOptions.columnDef];
2057
+ if (search) {
2058
+ if (columnOptions.searchProperty) {
2059
+ addAdditionalColumn(additionalColumns, columnOptions.searchProperty, search, searchType);
2060
+ }
2061
+ else
2062
+ column.search = search;
2063
+ }
2064
+ }
2065
+ columnOptions.additionalProperties?.forEach(property => addAdditionalColumn(additionalColumns, property));
2066
+ columns.push(column);
2067
+ });
2068
+ additionalColumns.forEach(additionalColumn => {
2069
+ const column = columns.find(item => item.data === additionalColumn.data);
2070
+ if (!column)
2071
+ columns.push(additionalColumn);
2072
+ else {
2073
+ if (additionalColumn.search && !column.search)
2074
+ column.search = additionalColumn.search;
2075
+ if (additionalColumn.type && !column.type)
2076
+ column.type = additionalColumn.type;
2077
+ }
2078
+ });
2079
+ return columns;
2080
+ }
2081
+ function buildDatasourceRequestOrder(options, columns) {
2082
+ const order = [];
2083
+ options.columns
2084
+ .filter(column => !!column.order && column.sortable !== false)
2085
+ .sort((first, second) => first.order.index - second.order.index)
2086
+ .forEach(columnOptions => {
2087
+ const property = columnOptions.sortProperty || columnOptions.property;
2088
+ const index = columns.findIndex(column => column.data === property);
2089
+ if (index !== -1)
2090
+ order.push({ column: index, dir: columnOptions.order.dir });
2091
+ });
2092
+ return order;
2093
+ }
2094
+ function buildDatasourceRequestOptions(options, searchValues, start, length, draw = Date.now().toString()) {
2095
+ const columns = buildDatasourceRequestColumns(options, searchValues);
2096
+ return {
2097
+ draw,
2098
+ columns,
2099
+ start,
2100
+ length,
2101
+ order: buildDatasourceRequestOrder(options, columns),
2102
+ facets: options.facets,
2103
+ };
2104
+ }
2105
+ function inferDatasourceRequestColumnType(column) {
2106
+ switch (column.type) {
2107
+ case 'text':
2108
+ return 'string';
2109
+ case 'number':
2110
+ case 'duration':
2111
+ return 'number';
2112
+ case 'checkbox':
2113
+ return 'boolean';
2114
+ case 'date':
2115
+ return 'date';
2116
+ default:
2117
+ return;
2118
+ }
2119
+ }
2120
+ function addAdditionalColumn(additionalColumns, data, search, type) {
2121
+ let column = additionalColumns.find(item => item.data === data);
2122
+ if (!column) {
2123
+ column = { data };
2124
+ additionalColumns.push(column);
2125
+ }
2126
+ if (search) {
2127
+ column.search = search;
2128
+ column.searchable = true;
2129
+ }
2130
+ if (type && !column.type)
2131
+ column.type = type;
2132
+ return column;
2133
+ }
2134
+
2135
+ /** @format */
2136
+ const DUPLICATE_HEADER_SEPARATOR = '\u2063ngx-mat-datatable:';
2137
+ async function exportDatatable(context) {
2138
+ const xlsx = await import('xlsx');
2139
+ const data = await loadExportData(context);
2140
+ const rows = await buildExportRows(context.options, data);
2141
+ const workbook = xlsx.utils.book_new();
2142
+ const worksheet = xlsx.utils.json_to_sheet(rows);
2143
+ sanitizeExportHeaders(worksheet, xlsx);
2144
+ xlsx.utils.book_append_sheet(workbook, worksheet, 'export');
2145
+ const filename = typeof context.options.actions?.export === 'string' ? context.options.actions.export : 'export';
2146
+ await xlsx.writeFile(workbook, `${filename}-${Date.now()}.xlsx`);
2147
+ }
2148
+ async function loadExportData(context) {
2149
+ const columns = buildDatasourceRequestColumns(context.options, context.searchValues);
2150
+ const order = buildDatasourceRequestOrder(context.options, columns);
2151
+ const chunkLength = getExportChunkLength(context.recordsFiltered, context.rowSize);
2152
+ const chunks = buildExportChunks(context.recordsFiltered, chunkLength);
2153
+ const data = [];
2154
+ for (const chunk of chunks) {
2155
+ const result = await context.options.service({
2156
+ draw: Date.now().toString(),
2157
+ columns,
2158
+ order,
2159
+ start: chunk.start,
2160
+ length: chunk.length,
2161
+ });
2162
+ data.push(...result.data);
2163
+ }
2164
+ return data;
2165
+ }
2166
+ async function buildExportRows(options, data) {
2167
+ const selectOptionsCache = new Map();
2168
+ const exportKeys = buildExportColumnKeys(options.columns);
2169
+ const rows = [];
2170
+ for (const record of data) {
2171
+ const row = {};
2172
+ for (const column of options.columns) {
2173
+ if (column.hidden || column.disabled)
2174
+ continue;
2175
+ let value = get(record, column.property);
2176
+ if (column.export) {
2177
+ column.export(row, value, record);
2178
+ continue;
2179
+ }
2180
+ value = transformExportValue(column, value, record);
2181
+ const keys = exportKeys.get(column);
2182
+ if (column.type === 'select') {
2183
+ await buildSelectExportValue(column, row, keys.value, value, selectOptionsCache);
2184
+ }
2185
+ else if (column.type === 'duration') {
2186
+ buildDurationExportValue(column, row, keys, value);
2187
+ }
2188
+ else {
2189
+ row[keys.value] = value;
2190
+ }
2191
+ }
2192
+ rows.push(row);
2193
+ }
2194
+ return rows;
2195
+ }
2196
+ function getExportChunkLength(recordsFiltered, rowSize) {
2197
+ if (recordsFiltered <= 0)
2198
+ return 0;
2199
+ if (!Number.isFinite(rowSize) || rowSize <= 0)
2200
+ return recordsFiltered;
2201
+ return Math.max(1, Math.min(Math.floor(5 / rowSize), recordsFiltered));
2202
+ }
2203
+ function buildExportChunks(recordsFiltered, chunkLength) {
2204
+ if (recordsFiltered <= 0 || chunkLength <= 0)
2205
+ return [];
2206
+ const chunks = [];
2207
+ for (let index = 0; index < Math.ceil(recordsFiltered / chunkLength); index++) {
2208
+ chunks.push({ start: index, length: chunkLength });
2209
+ }
2210
+ return chunks;
2211
+ }
2212
+ function sanitizeExportHeaders(worksheet, xlsx) {
2213
+ const ref = worksheet['!ref'];
2214
+ if (!ref)
2215
+ return;
2216
+ const range = xlsx.utils.decode_range(ref);
2217
+ for (let columnIndex = range.s.c; columnIndex <= range.e.c; columnIndex++) {
2218
+ const address = xlsx.utils.encode_cell({ r: range.s.r, c: columnIndex });
2219
+ const cell = worksheet[address];
2220
+ if (!cell || typeof cell.v !== 'string')
2221
+ continue;
2222
+ cell.v = stripHtml(removeDuplicateHeaderSuffix(cell.v), '');
2223
+ delete cell.w;
2224
+ }
2225
+ }
2226
+ function transformExportValue(column, value, record) {
2227
+ if (!('transform' in column) || typeof column.transform !== 'function')
2228
+ return value;
2229
+ return column.transform(value, record);
2230
+ }
2231
+ async function buildSelectExportValue(column, row, exportKey, value, cache) {
2232
+ const options = await resolveSelectOptions(column, cache);
2233
+ const getLabel = (optionValue) => options.find(option => option.value === optionValue)?.name ?? optionValue;
2234
+ row[exportKey] = column.isArrayValue && Array.isArray(value) ? value.map(getLabel).join(', ') : getLabel(value);
2235
+ }
2236
+ async function resolveSelectOptions(column, cache) {
2237
+ if (Array.isArray(column.options))
2238
+ return column.options;
2239
+ const cached = cache.get(column);
2240
+ if (cached)
2241
+ return cached;
2242
+ const options = await firstValueFrom(column.options);
2243
+ cache.set(column, options);
2244
+ return options;
2245
+ }
2246
+ function buildDurationExportValue(column, row, keys, value) {
2247
+ row[keys.raw] = value;
2248
+ row[keys.value] = duration(value, column);
2249
+ }
2250
+ function buildExportColumnKeys(columns) {
2251
+ const usedKeys = new Map();
2252
+ const result = new Map();
2253
+ for (const column of columns) {
2254
+ if (column.hidden || column.disabled || column.export)
2255
+ continue;
2256
+ if (column.type === 'duration') {
2257
+ result.set(column, {
2258
+ raw: createUniqueExportKey(`${column.header} ms`, usedKeys),
2259
+ value: createUniqueExportKey(column.header, usedKeys),
2260
+ });
2261
+ }
2262
+ else {
2263
+ result.set(column, { value: createUniqueExportKey(column.header, usedKeys) });
2264
+ }
2265
+ }
2266
+ return result;
2267
+ }
2268
+ function createUniqueExportKey(header, usedKeys) {
2269
+ const occurrence = usedKeys.get(header) ?? 0;
2270
+ usedKeys.set(header, occurrence + 1);
2271
+ return occurrence === 0 ? header : `${header}${DUPLICATE_HEADER_SEPARATOR}${occurrence}`;
2272
+ }
2273
+ function removeDuplicateHeaderSuffix(value) {
2274
+ const separatorIndex = value.lastIndexOf(DUPLICATE_HEADER_SEPARATOR);
2275
+ return separatorIndex === -1 ? value : value.slice(0, separatorIndex);
2276
+ }
2277
+
2278
+ /** @format */
2279
+ class NgxMatDatatablePaginatorIntl extends MatPaginatorIntl {
2280
+ datatableIntl = inject(NgxMatDatatableIntl);
2281
+ itemsPerPageLabel = this.datatableIntl.itemsPerPageLabel;
2282
+ nextPageLabel = this.datatableIntl.nextPageLabel;
2283
+ lastPageLabel = this.datatableIntl.lastPageLabel;
2284
+ previousPageLabel = this.datatableIntl.previousPageLabel;
2285
+ firstPageLabel = this.datatableIntl.firstPageLabel;
2286
+ onLabel = this.datatableIntl.onLabel;
2287
+ getRangeLabel = (page, pageSize, length) => {
2288
+ return this.datatableIntl.getRangeLabel(page, pageSize, length);
2289
+ };
2290
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatablePaginatorIntl, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
2291
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatablePaginatorIntl });
2292
+ }
2293
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatablePaginatorIntl, decorators: [{
2294
+ type: Injectable
2295
+ }] });
2296
+ class NgxMatDatatableComponent {
2297
+ options;
2298
+ config;
2299
+ rowClicked = new EventEmitter();
2300
+ configUpdated = new EventEmitter();
2301
+ searchUpdated = new EventEmitter();
2302
+ ready = new EventEmitter();
2303
+ paginator;
2304
+ contentRefs;
2305
+ displayedColumns = [];
2306
+ visibleColumnsColspan = 1;
2307
+ disabledRows = [];
2308
+ renderedRows = new Set();
2309
+ dataSource;
2310
+ expandedRow = null;
2311
+ loaded = false;
2312
+ datatableIntl = inject(NgxMatDatatableIntl);
2313
+ loadMode = 'pagination';
2314
+ incrementalTrigger = 'inView';
2315
+ incrementalPageSize = 30;
2316
+ incrementalPageIndex = 0;
2317
+ displayedRecordsCount = 0;
2318
+ totalRecordsCount = 0;
2319
+ hasMoreRecords = false;
2320
+ loadingNextRecords = false;
2321
+ showRecordsCount = true;
2322
+ incrementalLoadingLabel = this.datatableIntl.incrementalLoadingLabel;
2323
+ incrementalLoadMoreLabel = this.datatableIntl.incrementalLoadMoreLabel;
2324
+ incrementalRowColumns = ['_incrementalLoad'];
2325
+ showIncrementalRow = false;
2326
+ showIncrementalInViewTrigger = false;
2327
+ showIncrementalButtonTrigger = false;
2328
+ paginationPageSizeOptions = [];
2329
+ paginationPageSize = 30;
2330
+ paginationPageIndex = 0;
2331
+ searchFormGroup;
2332
+ searchControlNames = {};
2333
+ subscriptions = new rxjs.Subscription();
2334
+ changeDetectorRef = inject(ChangeDetectorRef);
2335
+ defaultOptions = inject(NGX_MAT_DATATABLE_DEFAULT_OPTIONS);
2336
+ incrementalLoadToken = 0;
2337
+ restoredState;
2338
+ rowRenderChangeScheduled = false;
2339
+ destroyed = false;
2340
+ get data() {
2341
+ return this._data;
2342
+ }
2343
+ _data;
2344
+ container;
2345
+ head;
2346
+ tableElement;
2347
+ matTable;
2348
+ observer = new ResizeObserver(entries => {
2349
+ entries.forEach(entry => {
2350
+ const containerHeight = this.container?.nativeElement.clientHeight ?? 0;
2351
+ const containerWidth = this.container?.nativeElement.clientWidth ?? 0;
2352
+ const headerHeight = this.head?.nativeElement.clientHeight ?? 0;
2353
+ const headerWidth = this.head?.nativeElement.clientWidth ?? 0;
2354
+ const contentHeight = entry.contentRect.height;
2355
+ const contentWidth = entry.contentRect.width;
2356
+ this.tableContainerOverflowY = containerHeight - headerHeight - contentHeight < 0 ? 'auto' : 'inherit';
2357
+ this.tableContainerOverflowX = containerWidth - headerWidth - contentWidth < 0 ? 'auto' : 'inherit';
2358
+ this.tableContainerWidth = containerWidth;
2359
+ this.changeDetectorRef.markForCheck();
2360
+ });
2361
+ });
2362
+ tableContainerOverflowY = 'inherit';
2363
+ tableContainerOverflowX = 'inherit';
2364
+ tableContainerWidth = 0;
2365
+ async ngOnInit() {
2366
+ if (!this.options?.service)
2367
+ throw new Error(`missing mongoose datatable component service`);
2368
+ if (!this.options?.columns)
2369
+ throw new Error(`missing mongoose datatable component columns`);
2370
+ this.options = this.resolveOptions(this.options);
2371
+ await this.applyConfig();
2372
+ await this.applyState();
2373
+ this.prepareLoadModeOptions();
2374
+ this.buildDisplayColumns();
2375
+ this.buildSearchFormGroup();
2376
+ this.dataSource = new DatagridDataSource(this.options.service);
2377
+ this.ready.emit(this);
2378
+ this.changeDetectorRef.detectChanges();
2379
+ }
2380
+ ngOnDestroy() {
2381
+ this.destroyed = true;
2382
+ if (this.tableElement)
2383
+ this.observer.unobserve(this.tableElement.nativeElement);
2384
+ this.subscriptions.unsubscribe();
2385
+ }
2386
+ load(intersect) {
2387
+ if (!intersect || this.loaded)
2388
+ return;
2389
+ this.loaded = true;
2390
+ if (this.tableElement)
2391
+ this.observer.observe(this.tableElement.nativeElement);
2392
+ if (this.loadMode === 'pagination') {
2393
+ this.subscriptions.add(this.paginator?.page.subscribe(() => {
2394
+ this.updateConfig();
2395
+ void this.updateState();
2396
+ void this.loadPage();
2397
+ }));
2398
+ }
2399
+ void this.loadPage();
2400
+ }
2401
+ sortColumn(column) {
2402
+ if (column.sortable === false)
2403
+ return;
2404
+ if (!column.order)
2405
+ column.order = {
2406
+ index: this.options.columns.filter(c => !!c.order).length,
2407
+ dir: 'asc',
2408
+ };
2409
+ else if (column.order.dir === 'asc')
2410
+ column.order.dir = 'desc';
2411
+ else {
2412
+ delete column.order;
2413
+ this.consolidateOrderIndex();
2414
+ }
2415
+ this.loadFirstPage();
2416
+ }
2417
+ redraw(match) {
2418
+ this.dataSource.redraw(match);
2419
+ this._data = this.dataSource.data;
2420
+ this.pruneRenderedRows();
2421
+ this.buildDisabledRows();
2422
+ this.changeDetectorRef.detectChanges();
2423
+ }
2424
+ refreshColumns() {
2425
+ this.buildDisplayColumns();
2426
+ }
2427
+ exporting = false;
2428
+ async export() {
2429
+ this.exporting = true;
2430
+ try {
2431
+ await exportDatatable({
2432
+ options: this.options,
2433
+ searchValues: this.getSearchValues(),
2434
+ recordsFiltered: this.dataSource.recordsFiltered,
2435
+ rowSize: this.dataSource.rowSize,
2436
+ });
2437
+ }
2438
+ finally {
2439
+ this.exporting = false;
2440
+ }
2441
+ }
2442
+ async loadPage() {
2443
+ if (!this.dataSource)
2444
+ return;
2445
+ if (this.loadMode === 'incremental') {
2446
+ await this.loadInitialPage();
2447
+ return;
2448
+ }
2449
+ await this.loadPaginationPage();
2450
+ }
2451
+ async loadNextIncrementalPage() {
2452
+ if (this.loadMode !== 'incremental')
2453
+ return;
2454
+ if (!this.dataSource || this.dataSource.loading$.value || this.loadingNextRecords || !this.hasMoreRecords)
2455
+ return;
2456
+ this.loadingNextRecords = true;
2457
+ this.updateIncrementalRowState();
2458
+ const loadToken = this.incrementalLoadToken;
2459
+ try {
2460
+ const nextPageIndex = this.incrementalPageIndex + 1;
2461
+ await this.dataSource.loadData(buildDatasourceRequestOptions(this.options, this.getSearchValues(), nextPageIndex, this.incrementalPageSize), true);
2462
+ if (loadToken !== this.incrementalLoadToken)
2463
+ return;
2464
+ this.incrementalPageIndex = nextPageIndex;
2465
+ this.updateLoadedDataState();
2466
+ }
2467
+ finally {
2468
+ if (loadToken === this.incrementalLoadToken) {
2469
+ this.loadingNextRecords = false;
2470
+ this.updateIncrementalRowState();
2471
+ this.changeDetectorRef.detectChanges();
2472
+ }
2473
+ }
2474
+ }
2475
+ onIncrementalIntersection(intersect) {
2476
+ if (!intersect)
2477
+ return;
2478
+ void this.loadNextIncrementalPage();
2479
+ }
2480
+ async loadPaginationPage() {
2481
+ await this.dataSource.loadData(buildDatasourceRequestOptions(this.options, this.getSearchValues(), this.paginator.pageIndex, this.paginator.pageSize));
2482
+ this.updateLoadedDataState();
2483
+ }
2484
+ async loadInitialPage() {
2485
+ this.resetIncrementalLoading();
2486
+ await this.dataSource.loadData(buildDatasourceRequestOptions(this.options, this.getSearchValues(), 0, this.incrementalPageSize));
2487
+ this.updateLoadedDataState();
2488
+ }
2489
+ loadFirstPage() {
2490
+ if (this.loadMode === 'pagination') {
2491
+ this.paginationPageIndex = 0;
2492
+ if (this.paginator)
2493
+ this.paginator.pageIndex = 0;
2494
+ }
2495
+ void this.updateState();
2496
+ void this.loadPage();
2497
+ }
2498
+ updateLoadedDataState() {
2499
+ this._data = this.dataSource.data;
2500
+ this.pruneRenderedRows();
2501
+ this.buildDisabledRows();
2502
+ this.updateRecordsCountState();
2503
+ this.updateHasMoreRecordsState();
2504
+ }
2505
+ pruneRenderedRows() {
2506
+ this.renderedRows = new Set(this.dataSource.data.filter(row => this.renderedRows.has(row)));
2507
+ }
2508
+ buildDisabledRows() {
2509
+ this.disabledRows = [];
2510
+ if (this.options.rowDisabled) {
2511
+ this.dataSource.data?.forEach(d => {
2512
+ if (typeof this.options.rowDisabled === 'string') {
2513
+ if (get(d, this.options.rowDisabled) === true)
2514
+ this.disabledRows.push(d);
2515
+ }
2516
+ else if (typeof this.options.rowDisabled === 'function') {
2517
+ if (this.options.rowDisabled(d))
2518
+ this.disabledRows.push(d);
2519
+ }
2520
+ });
2521
+ }
2522
+ }
2523
+ updateColumns = [];
2524
+ openUpdateColumnDisplay() {
2525
+ this.updateColumns = this.options.columns.map(column => ({
2526
+ columnDef: column.columnDef,
2527
+ header: column.header,
2528
+ sticky: column.sticky,
2529
+ hidden: column.hidden,
2530
+ }));
2531
+ }
2532
+ reorderColumns(event) {
2533
+ moveItemInArray(this.updateColumns, event.previousIndex, event.currentIndex);
2534
+ }
2535
+ closeUpdateColumnDisplay() {
2536
+ let reload = false;
2537
+ this.updateColumns.forEach((updated, index) => {
2538
+ const columnIndex = this.options.columns.findIndex(c => c.columnDef === updated.columnDef);
2539
+ if (columnIndex == -1)
2540
+ return;
2541
+ if (columnIndex !== index)
2542
+ moveItemInArray(this.options.columns, columnIndex, index);
2543
+ const column = this.options.columns[index];
2544
+ if (updated.sticky !== column.sticky)
2545
+ column.sticky = updated.sticky;
2546
+ if (updated.hidden !== column.hidden) {
2547
+ column.hidden = updated.hidden;
2548
+ reload = true;
2549
+ }
2550
+ });
2551
+ this.buildDisplayColumns();
2552
+ this.updateConfig();
2553
+ if (reload)
2554
+ this.loadFirstPage();
2555
+ }
2556
+ rowClick(row) {
2557
+ if (this.disabledRows.includes(row))
2558
+ return;
2559
+ if (this.options.expandedDetailContentId)
2560
+ this.expandedRow = this.expandedRow === row ? null : row;
2561
+ if (this.options.actions?.rowClick === true) {
2562
+ this.rowClicked.emit(row);
2563
+ }
2564
+ else if (typeof this.options.actions?.rowClick === 'function') {
2565
+ this.options.actions.rowClick(row);
2566
+ this.rowClicked.emit(row);
2567
+ }
2568
+ }
2569
+ rowKeydown(event, row) {
2570
+ if (!this.options.actions?.rowClick && !this.options.expandedDetailContentId)
2571
+ return;
2572
+ if (event.key !== 'Enter' && event.key !== ' ')
2573
+ return;
2574
+ event.preventDefault();
2575
+ this.rowClick(row);
2576
+ }
2577
+ renderRow(row) {
2578
+ if (this.renderedRows.has(row))
2579
+ return;
2580
+ this.renderedRows.add(row);
2581
+ if (this.rowRenderChangeScheduled)
2582
+ return;
2583
+ this.rowRenderChangeScheduled = true;
2584
+ queueMicrotask(() => {
2585
+ this.rowRenderChangeScheduled = false;
2586
+ if (!this.destroyed)
2587
+ this.changeDetectorRef.detectChanges();
2588
+ });
2589
+ }
2590
+ facetClick(column, result, option) {
2591
+ if (!column)
2592
+ return;
2593
+ const controlName = this.searchControlNames[column.columnDef];
2594
+ const control = controlName ? this.searchFormGroup?.controls[controlName] : undefined;
2595
+ if (!control)
2596
+ return;
2597
+ if (option && option.value !== control.value?.value)
2598
+ control.setValue({ value: option.value, name: option.name });
2599
+ else if (result._id !== control.value?.value)
2600
+ control.setValue({ value: result._id });
2601
+ }
2602
+ buildDisplayColumns() {
2603
+ const displayedColumns = [];
2604
+ this.options.columns.forEach(column => {
2605
+ if (column.hidden || column.disabled)
2606
+ return;
2607
+ displayedColumns.push(column.columnDef);
2608
+ if (column.type && ['number', 'date', 'duration'].includes(column.type)) {
2609
+ if (!column.locale)
2610
+ column.locale = this.datatableIntl.locale;
2611
+ }
2612
+ });
2613
+ this.displayedColumns = displayedColumns;
2614
+ this.visibleColumnsColspan = Math.max(displayedColumns.length, 1);
2615
+ }
2616
+ prepareLoadModeOptions() {
2617
+ this.loadMode = this.options.loadMode ?? 'pagination';
2618
+ this.incrementalTrigger = this.options.incremental?.trigger ?? 'inView';
2619
+ this.preparePaginationOptions();
2620
+ this.incrementalPageSize = this.getDefaultIncrementalPageSize();
2621
+ this.showRecordsCount = this.options.showRecordsCount ?? true;
2622
+ this.incrementalLoadingLabel = this.datatableIntl.incrementalLoadingLabel;
2623
+ this.incrementalLoadMoreLabel = this.datatableIntl.incrementalLoadMoreLabel;
2624
+ this.updateRecordsCountState();
2625
+ this.updateHasMoreRecordsState();
2626
+ }
2627
+ preparePaginationOptions() {
2628
+ this.paginationPageSizeOptions = this.options.pageSizeOptions || [20, 50, 100];
2629
+ this.paginationPageSize =
2630
+ this.options.pageSize || this.paginationPageSizeOptions[this.options.pageSizeOptionsIndex ?? 1] || 30;
2631
+ this.paginationPageIndex = this.restoredState?.page?.index ?? 0;
2632
+ }
2633
+ getDefaultIncrementalPageSize() {
2634
+ return this.options.incremental?.pageSize || this.options.pageSize || this.paginationPageSize || 30;
2635
+ }
2636
+ resolveOptions(options) {
2637
+ const actions = this.resolveActions(options);
2638
+ const incremental = this.resolveIncrementalOptions(options);
2639
+ return {
2640
+ ...this.defaultOptions,
2641
+ ...options,
2642
+ service: options.service,
2643
+ columns: options.columns,
2644
+ ...(actions ? { actions } : {}),
2645
+ ...(incremental ? { incremental } : {}),
2646
+ };
2647
+ }
2648
+ resolveActions(options) {
2649
+ if (!this.defaultOptions.actions && !options.actions)
2650
+ return undefined;
2651
+ const columns = this.resolveActionColumns(options);
2652
+ return {
2653
+ ...this.defaultOptions.actions,
2654
+ ...options.actions,
2655
+ ...(columns ? { columns } : {}),
2656
+ };
2657
+ }
2658
+ resolveActionColumns(options) {
2659
+ if (!this.defaultOptions.actions?.columns && !options.actions?.columns)
2660
+ return undefined;
2661
+ return {
2662
+ ...this.defaultOptions.actions?.columns,
2663
+ ...options.actions?.columns,
2664
+ };
2665
+ }
2666
+ resolveIncrementalOptions(options) {
2667
+ if (!this.defaultOptions.incremental && !options.incremental)
2668
+ return undefined;
2669
+ return {
2670
+ ...this.defaultOptions.incremental,
2671
+ ...options.incremental,
2672
+ };
2673
+ }
2674
+ resetIncrementalLoading() {
2675
+ this.incrementalLoadToken++;
2676
+ this.incrementalPageIndex = 0;
2677
+ this.loadingNextRecords = false;
2678
+ this.updateIncrementalRowState();
2679
+ }
2680
+ updateRecordsCountState() {
2681
+ this.displayedRecordsCount = this.dataSource?.data.length ?? 0;
2682
+ this.totalRecordsCount = this.dataSource?.recordsFiltered ?? 0;
2683
+ }
2684
+ updateHasMoreRecordsState() {
2685
+ this.hasMoreRecords = this.loadMode === 'incremental' && this.displayedRecordsCount < this.totalRecordsCount;
2686
+ this.updateIncrementalRowState();
2687
+ }
2688
+ updateIncrementalRowState() {
2689
+ this.showIncrementalRow = this.loadMode === 'incremental' && (this.hasMoreRecords || this.loadingNextRecords);
2690
+ this.showIncrementalInViewTrigger = this.showIncrementalRow && this.incrementalTrigger === 'inView';
2691
+ this.showIncrementalButtonTrigger = this.showIncrementalRow && this.incrementalTrigger === 'button';
2692
+ this.changeDetectorRef.markForCheck();
2693
+ queueMicrotask(() => this.matTable?.renderRows());
2694
+ }
2695
+ buildSearchFormGroup() {
2696
+ this.searchControlNames = {};
2697
+ this.searchFormGroup = new FormGroup(this.options.columns.reduce((controls, column) => {
2698
+ if (column.searchable) {
2699
+ const restoredValue = this.restoredState?.filters[column.columnDef];
2700
+ const initialValue = restoredValue !== undefined
2701
+ ? this.restoreFilterValue(column, restoredValue)
2702
+ : column.searchValue !== undefined
2703
+ ? { value: column.searchValue }
2704
+ : undefined;
2705
+ const control = new FormControl({
2706
+ value: initialValue,
2707
+ disabled: false,
2708
+ });
2709
+ const controlName = this.getSearchControlName(column.columnDef);
2710
+ this.searchControlNames[column.columnDef] = controlName;
2711
+ controls[controlName] = control;
2712
+ if (typeof column.searchUpdated === 'function') {
2713
+ this.subscriptions.add(control.valueChanges.pipe(rxjs.debounceTime(500)).subscribe(value => column.searchUpdated(value)));
2714
+ }
2715
+ }
2716
+ return controls;
2717
+ }, {}));
2718
+ this.subscriptions.add(this.searchFormGroup.valueChanges.pipe(rxjs.debounceTime(500)).subscribe(() => {
2719
+ this.searchUpdated.next(this.getSearchValues());
2720
+ this.loadFirstPage();
2721
+ }));
2722
+ }
2723
+ getSearchValues() {
2724
+ return this.options.columns.reduce((values, column) => {
2725
+ if (!column.searchable)
2726
+ return values;
2727
+ const controlName = this.searchControlNames[column.columnDef];
2728
+ if (controlName)
2729
+ values[column.columnDef] = this.searchFormGroup?.controls[controlName]?.value;
2730
+ return values;
2731
+ }, {});
2732
+ }
2733
+ getSearchControlName(columnDef) {
2734
+ return columnDef.replace(/%/g, '%25').replace(/\./g, '%2E');
2735
+ }
2736
+ consolidateOrderIndex() {
2737
+ let index = 0;
2738
+ this.options.columns
2739
+ .filter(c => !!c.order)
2740
+ .sort((c1, c2) => c1.order.index - c2.order.index)
2741
+ .forEach(c => (c.order.index = index++));
2742
+ }
2743
+ async applyConfig() {
2744
+ if (this.options?.configService?.get) {
2745
+ const config = await this.options.configService.get();
2746
+ this.config = config ?? this.config;
2747
+ }
2748
+ if (this.options?.columns && this.config?.columns) {
2749
+ this.config.columns.forEach((updated, index) => {
2750
+ const columnIndex = this.options.columns.findIndex(c => c.columnDef === updated.columnDef);
2751
+ if (columnIndex == -1)
2752
+ return;
2753
+ if (columnIndex !== index)
2754
+ moveItemInArray(this.options.columns, columnIndex, index);
2755
+ const column = this.options.columns[index];
2756
+ if (column && updated.sticky !== column.sticky)
2757
+ column.sticky = updated.sticky;
2758
+ if (column && updated.hidden !== column.hidden)
2759
+ column.hidden = updated.hidden;
2760
+ });
2761
+ this.buildDisplayColumns();
2762
+ }
2763
+ if (this.options && typeof this.config?.pageSizeOptionsIndex === 'number') {
2764
+ this.options.pageSizeOptionsIndex = this.config.pageSizeOptionsIndex;
2765
+ }
2766
+ }
2767
+ async applyState() {
2768
+ if (!this.options.stateService?.get)
2769
+ return;
2770
+ const state = await this.options.stateService.get();
2771
+ if (!state || state.version !== 1)
2772
+ return;
2773
+ this.restoredState = {
2774
+ version: 1,
2775
+ filters: state.filters ?? {},
2776
+ order: Array.isArray(state.order) ? state.order : [],
2777
+ ...(state.page ? { page: state.page } : {}),
2778
+ };
2779
+ this.applyStateOrder(this.restoredState);
2780
+ if (this.restoredState.page?.size)
2781
+ this.options.pageSize = this.restoredState.page.size;
2782
+ }
2783
+ applyStateOrder(state) {
2784
+ this.options.columns.forEach(column => delete column.order);
2785
+ state.order
2786
+ .slice()
2787
+ .sort((a, b) => a.index - b.index)
2788
+ .forEach(order => {
2789
+ const column = this.options.columns.find(item => item.columnDef === order.columnDef);
2790
+ if (!column || column.sortable === false)
2791
+ return;
2792
+ column.order = { index: order.index, dir: order.dir };
2793
+ });
2794
+ this.consolidateOrderIndex();
2795
+ }
2796
+ restoreFilterValue(column, value) {
2797
+ if (column.type !== 'date' || !value?.value)
2798
+ return value;
2799
+ if (typeof value.value === 'object' && ('from' in value.value || 'to' in value.value)) {
2800
+ return {
2801
+ ...value,
2802
+ value: {
2803
+ from: value.value.from ? moment(value.value.from) : undefined,
2804
+ to: value.value.to ? moment(value.value.to) : undefined,
2805
+ },
2806
+ };
2807
+ }
2808
+ return { ...value, value: moment(value.value) };
2809
+ }
2810
+ async updateState() {
2811
+ if (!this.options.stateService?.set || !this.searchFormGroup)
2812
+ return;
2813
+ await this.options.stateService.set(this.buildState());
2814
+ }
2815
+ buildState() {
2816
+ const order = this.options.columns
2817
+ .filter(column => !!column.order)
2818
+ .map(column => ({
2819
+ columnDef: column.columnDef,
2820
+ index: column.order.index,
2821
+ dir: column.order.dir,
2822
+ }));
2823
+ const page = this.loadMode === 'pagination'
2824
+ ? {
2825
+ index: this.paginator?.pageIndex ?? this.paginationPageIndex,
2826
+ size: this.paginator?.pageSize ?? this.paginationPageSize,
2827
+ }
2828
+ : undefined;
2829
+ return {
2830
+ version: 1,
2831
+ filters: this.getSearchValues(),
2832
+ order,
2833
+ ...(page ? { page } : {}),
2834
+ };
2835
+ }
2836
+ updateConfig() {
2837
+ const pageSizeOptions = this.paginationPageSizeOptions;
2838
+ const fallbackPageSize = this.paginationPageSize;
2839
+ const pageSizeOptionsIndex = pageSizeOptions.indexOf(this.paginator?.pageSize ?? fallbackPageSize);
2840
+ const columns = this.options.columns.map(c => ({
2841
+ columnDef: c.columnDef,
2842
+ sticky: c.sticky,
2843
+ hidden: c.hidden,
2844
+ }));
2845
+ this.config = { columns, pageSizeOptionsIndex };
2846
+ this.configUpdated.next(this.config);
2847
+ if (this.options?.configService?.set)
2848
+ this.options.configService.set(this.config);
2849
+ }
2850
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2851
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: NgxMatDatatableComponent, isStandalone: true, selector: "ngx-mat-datatable", inputs: { options: "options", config: "config" }, outputs: { rowClicked: "rowClicked", configUpdated: "configUpdated", searchUpdated: "searchUpdated", ready: "ready" }, host: { properties: { "style.--datatable-container-overflow-y": "this.tableContainerOverflowY", "style.--datatable-container-overflow-x": "this.tableContainerOverflowX", "style.--datatable-container-width.px": "this.tableContainerWidth" } }, providers: [
2852
+ { provide: MatPaginatorIntl, useClass: NgxMatDatatablePaginatorIntl },
2853
+ SelectOptionsCacheService,
2854
+ DatatableRowViewportObserverService,
2855
+ ], queries: [{ propertyName: "contentRefs", predicate: NgxMatDatatableContentDirective }], viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "container", first: true, predicate: ["container"], descendants: true }, { propertyName: "head", first: true, predicate: ["head"], descendants: true }, { propertyName: "tableElement", first: true, predicate: ["table"], descendants: true, read: ElementRef }, { propertyName: "matTable", first: true, predicate: MatTable, descendants: true }], ngImport: i0, template: "<!-- @format -->\n\n@if (dataSource) {\n <div #container id=\"container\">\n <ng-container *ngTemplateOutlet=\"headTmpl\"></ng-container>\n\n <div id=\"table-container\" intersectionObserver (intersection)=\"load($event.intersect)\">\n <table id=\"table\" #table mat-table [fixedLayout]=\"false\" [dataSource]=\"dataSource\" multiTemplateDataRows>\n @for (column of options.columns; track column.columnDef) {\n <ng-container [matColumnDef]=\"column.columnDef\" [sticky]=\"column.sticky\">\n <th\n mat-header-cell\n *matHeaderCellDef\n [class.searchable]=\"column.searchable\"\n [attr.aria-sort]=\"\n column.sortable\n ? column.order?.dir === 'asc'\n ? 'ascending'\n : column.order?.dir === 'desc'\n ? 'descending'\n : 'none'\n : null\n \"\n [style.min-width.px]=\"column.minWidth || options.columnMinWith\">\n <ng-container *ngTemplateOutlet=\"headerTmpl; context: { column }\"></ng-container>\n </th>\n <td\n mat-cell\n *matCellDef=\"let row\"\n [style.min-width.px]=\"column.minWidth || options.columnMinWith\"\n [style.color]=\"row | cellColor: column : options\"\n [style.opacity]=\"row | cellOpacity: column : options\"\n [style.background-color]=\"row | backgroundColor: column : options\">\n <ng-container *ngTemplateOutlet=\"cellTmpl; context: { column, row }\"></ng-container>\n </td>\n </ng-container>\n }\n\n <ng-container *ngIf=\"options.expandedDetailContentId\" matColumnDef=\"expandedDetail\">\n <td mat-cell *matCellDef=\"let row\" [attr.colspan]=\"visibleColumnsColspan\">\n @let content = contentRefs | findContent: options.expandedDetailContentId;\n <div *ngIf=\"content\" class=\"element-detail\" [@detailExpand]=\"row === expandedRow ? 'expanded' : 'collapsed'\">\n <ng-container *ngTemplateOutlet=\"content.templateRef; context: { row }\"> </ng-container>\n </div>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"_incrementalLoad\">\n <td mat-footer-cell *matFooterCellDef [attr.colspan]=\"visibleColumnsColspan\">\n <div class=\"incremental-load-row\">\n @if (showIncrementalInViewTrigger) {\n <div\n class=\"incremental-sentinel\"\n intersectionObserver\n (intersection)=\"onIncrementalIntersection($event.intersect)\">\n @if (loadingNextRecords) {\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n <span>{{ incrementalLoadingLabel }}</span>\n }\n </div>\n }\n\n @if (showIncrementalButtonTrigger) {\n <button mat-button color=\"primary\" [disabled]=\"loadingNextRecords\" (click)=\"loadNextIncrementalPage()\">\n @if (loadingNextRecords) {\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n <span>{{ incrementalLoadingLabel }}</span>\n } @else {\n <span>{{ incrementalLoadMoreLabel }}</span>\n }\n </button>\n }\n </div>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky: true\"></tr>\n\n <tr\n mat-row\n *matRowDef=\"let row; columns: displayedColumns\"\n [datatableRowViewport]=\"row\"\n (datatableRowVisible)=\"renderRow($event)\"\n [class.has-click]=\"!!options.actions?.rowClick || !!options.expandedDetailContentId\"\n [class.is-disabled]=\"row | includedIn: disabledRows\"\n [attr.aria-disabled]=\"(row | includedIn: disabledRows) ? 'true' : null\"\n [attr.aria-expanded]=\"options.expandedDetailContentId ? row === expandedRow : null\"\n [attr.tabindex]=\"\n (!!options.actions?.rowClick || !!options.expandedDetailContentId) && !(row | includedIn: disabledRows) ? 0 : null\n \"\n (click)=\"rowClick(row)\"\n (keydown)=\"rowKeydown($event, row)\"></tr>\n\n <ng-container *ngIf=\"options.expandedDetailContentId\">\n <tr mat-row *matRowDef=\"let row; columns: ['expandedDetail']\" class=\"detail-row\"></tr>\n </ng-container>\n\n <tr\n mat-footer-row\n *matFooterRowDef=\"incrementalRowColumns\"\n class=\"incremental-row\"\n [class.is-hidden]=\"!showIncrementalRow\"></tr>\n\n <tr class=\"mat-row\" *matNoDataRow>\n <td [attr.colspan]=\"displayedColumns.length\">\n <div id=\"no-data\">\n <span id=\"no-data-label\"> {{ datatableIntl.noDateLabel }}</span>\n </div>\n </td>\n </tr>\n </table>\n </div>\n\n <mat-paginator\n *ngIf=\"loadMode === 'pagination'\"\n id=\"paginator\"\n [length]=\"dataSource.recordsFiltered\"\n [pageSizeOptions]=\"paginationPageSizeOptions\"\n [pageSize]=\"paginationPageSize\"\n [pageIndex]=\"paginationPageIndex\"\n [showFirstLastButtons]=\"true\">\n </mat-paginator>\n </div>\n}\n\n<div id=\"loading\" *ngIf=\"!dataSource || (dataSource.loading$ | async)\" @fade>\n <ng-content select=\"[loader-spinner]\">\n <mat-spinner loader-spinner></mat-spinner>\n </ng-content>\n</div>\n\n<ng-template #headTmpl>\n @let hasColumnDisplay =\n options.actions?.columns?.hideAndShow || options.actions?.columns?.sticky || options.actions?.columns?.reorder;\n @let hasHead =\n !!options.title ||\n !!options.facets?.length ||\n !!options.actions?.user?.length ||\n hasColumnDisplay ||\n options.actions?.export ||\n options.actions?.refresh ||\n showRecordsCount;\n <div *ngIf=\"hasHead\" id=\"head\" #head>\n <div id=\"head-start\">\n <span *ngIf=\"options.title\" id=\"title\" [innerHTML]=\"options.title\"></span>\n\n @for (facetOptions of options.facets | filter: { position: 'start' }; track facetOptions.id) {\n <ng-container *ngTemplateOutlet=\"facetsTmpl; context: { facetOptions }\"></ng-container>\n }\n @for (action of options.actions?.user | filter: { position: 'start' }; track action) {\n <ng-container *ngTemplateOutlet=\"actionTmpl; context: { action }\"></ng-container>\n }\n </div>\n\n <div id=\"head-center\">\n @for (facetOptions of options.facets | filter: { position: 'center' }; track facetOptions.id) {\n <ng-container *ngTemplateOutlet=\"facetsTmpl; context: { facetOptions }\"></ng-container>\n }\n @for (action of options.actions?.user | filter: { position: 'center' }; track action) {\n <ng-container *ngTemplateOutlet=\"actionTmpl; context: { action }\"></ng-container>\n }\n </div>\n\n <div id=\"head-end\">\n @for (facetOptions of options.facets | filter: { position: 'end' }; track facetOptions.id) {\n <ng-container *ngTemplateOutlet=\"facetsTmpl; context: { facetOptions }\"></ng-container>\n }\n @for (action of options.actions?.user | filter: { position: 'end' }; track action) {\n <ng-container *ngTemplateOutlet=\"actionTmpl; context: { action }\"></ng-container>\n }\n\n @if (hasColumnDisplay) {\n <div class=\"action\">\n <button\n mat-icon-button\n color=\"primary\"\n class=\"icon-only action\"\n [matTooltip]=\"options.actions?.columns?.tooltip || datatableIntl.columnsActionLabel\"\n [attr.aria-label]=\"options.actions?.columns?.tooltip || datatableIntl.columnsActionLabel\"\n [matMenuTriggerFor]=\"columnsMenu\"\n (menuOpened)=\"openUpdateColumnDisplay()\"\n (menuClosed)=\"closeUpdateColumnDisplay()\">\n <mat-icon>view_column</mat-icon>\n </button>\n </div>\n }\n\n @if (options.actions?.export) {\n <div class=\"action\">\n <button\n mat-icon-button\n color=\"primary\"\n [attr.aria-label]=\"datatableIntl.exportActionLabel\"\n [disabled]=\"exporting\"\n (click)=\"export()\">\n <mat-icon>download</mat-icon>\n </button>\n <div class=\"action-loader\" *ngIf=\"exporting\" @fade>\n <mat-spinner [diameter]=\"32\"></mat-spinner>\n </div>\n </div>\n }\n\n @if (options.actions?.refresh) {\n <div class=\"action\">\n <button\n mat-icon-button\n color=\"primary\"\n [attr.aria-label]=\"datatableIntl.refreshActionLabel\"\n [disabled]=\"dataSource.loading$ | async\"\n (click)=\"loadPage()\">\n <mat-icon>sync</mat-icon>\n </button>\n <div class=\"action-loader\" *ngIf=\"dataSource.loading$ | async\" @fade>\n <mat-spinner [diameter]=\"32\"></mat-spinner>\n </div>\n </div>\n }\n\n @if (showRecordsCount) {\n <div id=\"records-count\">\n <span\n [countUp]=\"displayedRecordsCount\"\n [options]=\"datatableIntl.numberOptions\"\n [reanimateOnClick]=\"false\"></span>\n / {{ totalRecordsCount }}\n </div>\n }\n </div>\n </div>\n</ng-template>\n\n<mat-menu #columnsMenu=\"matMenu\" class=\"datatable-columns-menu\">\n <div\n id=\"column-options\"\n cdkDropList\n has-handle\n [cdkDropListDisabled]=\"!options.actions?.columns?.reorder\"\n (cdkDropListDropped)=\"reorderColumns($event)\">\n @for (column of updateColumns; track column.columnDef) {\n @if (['_select', '_rownumber'].includes(column.header)) {\n <div mat-list-item cdkDrag></div>\n } @else {\n <div class=\"column-options-item\" mat-list-item cdkDrag (click)=\"$event.stopPropagation()\">\n <button\n *ngIf=\"options.actions?.columns?.hideAndShow\"\n mat-icon-button\n size=\"small\"\n color=\"primary\"\n [class]=\"column.hidden ? 'toggle-off' : 'toggle-on'\"\n [attr.aria-label]=\"column.hidden ? datatableIntl.showColumnActionLabel : datatableIntl.hideColumnActionLabel\"\n (click)=\"column.hidden = !column.hidden\"\n [style.margin-right.px]=\"8\">\n <mat-icon>\n @if (!column.hidden) {\n visibility\n } @else {\n visibility_off\n }\n </mat-icon>\n </button>\n <button\n *ngIf=\"options.actions?.columns?.sticky\"\n mat-icon-button\n size=\"small\"\n color=\"primary\"\n [class]=\"column.sticky ? 'toggle-on' : 'toggle-off'\"\n [attr.aria-label]=\"column.sticky ? datatableIntl.unpinColumnActionLabel : datatableIntl.pinColumnActionLabel\"\n (click)=\"column.sticky = !column.sticky\"\n [style.margin-right.px]=\"8\">\n <mat-icon>push_pin </mat-icon>\n </button>\n <span [style.margin-right.px]=\"8\" [innerHTML]=\"column.header\"></span>\n <mat-icon\n *ngIf=\"options.actions?.columns?.reorder\"\n size=\"small\"\n class=\"handle\"\n cdkDragHandle\n [style.margin]=\"'0 8px 0 auto'\">\n open_with\n </mat-icon>\n </div>\n }\n }\n </div>\n</mat-menu>\n\n<ng-template #headerTmpl let-column=\"column\">\n <div class=\"header-container\" [matTooltip]=\"column.tooltip\">\n <div class=\"header\" [formGroup]=\"searchFormGroup\">\n @if (column.searchable) {\n @switch (column.type) {\n @case ('text') {\n <lib-header-text-filter\n [column]=\"column\"\n [formControlName]=\"searchControlNames[column.columnDef]\"></lib-header-text-filter>\n }\n @case ('number') {\n <lib-header-number-filter\n [column]=\"column\"\n [formControlName]=\"searchControlNames[column.columnDef]\"></lib-header-number-filter>\n }\n @case ('select') {\n <lib-header-select-filter\n [column]=\"column\"\n [formControlName]=\"searchControlNames[column.columnDef]\"></lib-header-select-filter>\n }\n @case ('autocomplete') {\n <lib-header-autocomplete-filter\n [column]=\"column\"\n [formControlName]=\"searchControlNames[column.columnDef]\"></lib-header-autocomplete-filter>\n }\n @case ('checkbox') {\n <lib-header-checkbox-filter\n [column]=\"column\"\n [formControlName]=\"searchControlNames[column.columnDef]\"></lib-header-checkbox-filter>\n }\n @case ('date') {\n <lib-header-date-filter\n [column]=\"column\"\n [formControlName]=\"searchControlNames[column.columnDef]\"></lib-header-date-filter>\n }\n @case ('duration') {\n <lib-header-duration-filter\n [column]=\"column\"\n [formControlName]=\"searchControlNames[column.columnDef]\"></lib-header-duration-filter>\n }\n @default {\n <span [innerHTML]=\"column.header | safeHtml\"></span>\n }\n }\n } @else {\n <span [innerHTML]=\"column.header | safeHtml\"></span>\n }\n <ng-container *ngTemplateOutlet=\"headerActionsTmpl; context: { column }\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #headerActionsTmpl let-column=\"column\">\n <div class=\"header-actions\">\n <ng-container *ngIf=\"column.sortable\">\n <button\n class=\"sort-btn\"\n mat-icon-button\n size=\"small\"\n (click)=\"sortColumn(column)\"\n [attr.aria-label]=\"datatableIntl.sortColumnActionLabel\"\n [matBadgeHidden]=\"!column.order\"\n [matBadge]=\"column.order?.index + 1\">\n @switch (column.order?.dir) {\n @case ('asc') {\n <mat-icon size=\"small\">arrow_upward</mat-icon>\n }\n @case ('desc') {\n <mat-icon size=\"small\">arrow_downward</mat-icon>\n }\n @default {\n <mat-icon size=\"small\">sort</mat-icon>\n }\n }\n </button>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #cellTmpl let-column=\"column\" let-row=\"row\">\n @if (renderedRows.has(row)) {\n <div\n class=\"cell\"\n [@.disabled]=\"!!options.disableRowAnimation\"\n @fade\n [style.place-content]=\"column.align\"\n [style.max-height.px]=\"options.rowMaxHeight\">\n @let value = row | get: column.property;\n @if (column.cellComponent) {\n <ng-container *ngComponentOutlet=\"column.cellComponent; inputs: { column, row, value }\" />\n } @else if (column.cellContentId) {\n @let cell = contentRefs | findContent: column.cellContentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, row, value }\" />\n }\n } @else {\n @if (column.prefixContentId) {\n @let cell = contentRefs | findContent: column.prefixContentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, row, value }\" />\n }\n } @else if (column.prefixComponent) {\n <ng-container *ngComponentOutlet=\"column.prefixComponent; inputs: { column, row, value }\" />\n } @else if (column.prefixFunction) {\n <span [innerHTML]=\"value | valueFunction: column.prefixFunction : row : column | safeHtml\"></span>\n } @else if (column.prefix) {\n <span [innerHTML]=\"column.prefix | safeHtml\"></span>\n }\n\n @switch (column.type) {\n @case ('number') {\n <lib-cell-number-value [column]=\"column\" [row]=\"row\"></lib-cell-number-value>\n }\n @case ('select') {\n <lib-cell-select-value [column]=\"column\" [row]=\"row\"></lib-cell-select-value>\n }\n @case ('checkbox') {\n <lib-cell-checkbox-value [column]=\"column\" [row]=\"row\"></lib-cell-checkbox-value>\n }\n @case ('date') {\n <lib-cell-date-value [column]=\"column\" [row]=\"row\"></lib-cell-date-value>\n }\n @case ('duration') {\n <lib-cell-duration-value [column]=\"column\" [row]=\"row\"></lib-cell-duration-value>\n }\n @default {\n <span [innerHTML]=\"(value | transform: row : column) ?? '' | safeHtml\"></span>\n }\n }\n\n @if (column.suffixContentId) {\n @let cell = contentRefs | findContent: column.suffixContentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, row, value }\" />\n }\n } @else if (column.suffixComponent) {\n <ng-container *ngComponentOutlet=\"column.suffixComponent; inputs: { column, row, value }\" />\n } @else if (column.suffixFunction) {\n <span [innerHTML]=\"value | valueFunction: column.suffixFunction : row : column | safeHtml\"></span>\n } @else if (column.suffix) {\n <span [innerHTML]=\"column.suffix | safeHtml\"></span>\n }\n }\n </div>\n } @else {\n <div class=\"cell\"></div>\n }\n</ng-template>\n\n<ng-template #actionTmpl let-action=\"action\">\n @if (!action.isHidden) {\n @switch (action.kind) {\n @case ('icon') {\n <div class=\"action user-action\" [matTooltip]=\"action.tooltip\">\n <button\n [style.--action-color]=\"action.color\"\n mat-icon-button\n [attr.aria-label]=\"action.ariaLabel || action.tooltip || action.icon\"\n (click)=\"action.onclick(this)\"\n [disabled]=\"!!action.isDisabled\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n </div>\n }\n @case ('template') {\n <div class=\"action user-action\">\n @let content = contentRefs | findContent: action.contentId;\n @if (content) {\n <ng-container *ngTemplateOutlet=\"content.templateRef; context: { datatable: this, action }\" />\n }\n </div>\n }\n }\n }\n</ng-template>\n\n<ng-template #facetsTmpl let-facetOptions=\"facetOptions\">\n @let column = options.columns | find: { columnDef: facetOptions.columnDef };\n @let data = (dataSource.facets ?? {})[facetOptions.id] | sortFacetEntries: facetOptions.options;\n @if (data) {\n @if (facetOptions.contentId) {\n @let cell = contentRefs | findContent: facetOptions.contentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, facetOptions, data }\" />\n }\n } @else {\n @switch (facetOptions.display) {\n @case ('chips') {\n <ng-container *ngTemplateOutlet=\"facetsChipsTmpl; context: { column, data, facetOptions }\"></ng-container>\n }\n @default {\n <ng-container\n *ngTemplateOutlet=\"facetsProgressSpinnersTmpl; context: { column, data, facetOptions }\"></ng-container>\n }\n }\n }\n }\n</ng-template>\n\n<ng-template #facetsChipsTmpl let-column=\"column\" let-data=\"data\" let-facetOptions=\"facetOptions\">\n @let size = facetOptions.size;\n @let fontSize = facetOptions.fontSize ?? '1em';\n <!-- @let total = (data | sum: 'value') || 1; -->\n <mat-chip-set class=\"chips-facet\">\n @for (d of data | orderBy: '_id'; track d._id) {\n @let option = facetOptions?.option ? facetOptions.option(d) : (facetOptions.options | find: { value: d._id });\n @let name = option?.name ?? d._id;\n @let color = option?.color ?? 'var(--mat-sys-primary)';\n @let labelColor = option?.labelColor;\n <!-- @let percent = (d.value / total) * 100; -->\n <mat-chip\n class=\"chip-facet\"\n [class.has-action]=\"column?.searchable === true\"\n [attr.tabindex]=\"column?.searchable === true ? 0 : null\"\n (click)=\"column?.searchable === true && facetClick(column, d, option)\"\n (keydown.enter)=\"column?.searchable === true && facetClick(column, d, option)\"\n (keydown.space)=\"column?.searchable === true && facetClick(column, d, option); $event.preventDefault()\"\n [style.--facet-color]=\"color\"\n [style.--facet-label-color]=\"labelColor ?? 'var(--mat-sys-on-primary)'\"\n [style.--facet-value-color]=\"labelColor ?? color\"\n [style.width.px]=\"size\">\n <div class=\"chip-facet-content\" [style.font-size]=\"fontSize\">\n <div class=\"chip-facet-key\">{{ name }}</div>\n <div class=\"chip-facet-value\">{{ d.value | number: '0.0-2' }}</div>\n </div>\n </mat-chip>\n }\n </mat-chip-set>\n</ng-template>\n\n<ng-template #facetsProgressSpinnersTmpl let-column=\"column\" let-data=\"data\" let-facetOptions=\"facetOptions\">\n @let size = facetOptions.size ?? 80;\n @let fontSize = facetOptions.fontSize ?? '1em';\n @let total = (data | sum: 'value') || 1;\n <mat-card class=\"facet\">\n @if (facetOptions.name) {\n <mat-card-header>\n <mat-card-title>{{ facetOptions.name }}</mat-card-title>\n </mat-card-header>\n }\n <mat-card-content>\n @for (d of data; track d._id) {\n @let option = facetOptions?.option ? facetOptions.option(d) : (facetOptions.options | find: { value: d._id });\n @let name = option?.name ?? d._id;\n @let color = option?.color ?? 'var(--mat-sys-primary)';\n @let percent = (d.value / total) * 100;\n <div\n class=\"facet-indicator\"\n [class.has-action]=\"column?.searchable === true\"\n [attr.role]=\"column?.searchable === true ? 'button' : null\"\n [attr.tabindex]=\"column?.searchable === true ? 0 : null\"\n (click)=\"column?.searchable === true && facetClick(column, d, option)\"\n (keydown.enter)=\"column?.searchable === true && facetClick(column, d, option)\"\n (keydown.space)=\"column?.searchable === true && facetClick(column, d, option); $event.preventDefault()\">\n <lib-progress-spinner [diameter]=\"size\" [color]=\"color\" [fontSize]=\"fontSize\" [value]=\"percent\">\n <mat-label>{{ name }}</mat-label>\n </lib-progress-spinner>\n <mat-label\n class=\"facet-indicator-label\"\n [style.font-size]=\"fontSize\"\n [countUp]=\"d.value\"\n [options]=\"datatableIntl.numberOptions\"\n [reanimateOnClick]=\"false\">\n {{ d.value | number: '0.0-2' }}\n </mat-label>\n </div>\n }\n </mat-card-content>\n </mat-card>\n</ng-template>\n", styles: [":host{display:flex;position:relative;max-height:100%;--datatable-background: var(--ngx-mat-datatable-background, #ffffff);--datatable-color: var(--ngx-mat-datatable-color, var(--mat-sys-primary,));--datatable-border-color: var(--ngx-mat-datatable-border-color, #ccc);--datatable-sticky-top: var(--ngx-mat-datatable-sticky-top, 0);--datatable-sticky-background: var(--ngx-mat-datatable-sticky-background, var(--datatable-background));--datatable-sticky-border: var(--ngx-mat-datatable-sticky-border, 1px dashed #e6a93a)}:host{--mat-table-background-color: var(--datatable-background)}:host{--mat-table-header-headline-color: var(--datatable-color)}:host{--mat-table-row-item-label-text-color: var(--datatable-color)}#container{display:flex;flex:1 1 100%;box-sizing:border-box;flex-direction:column;position:relative;width:100%;background-color:var(--datatable-background)}#head{width:100%;display:flex;box-sizing:border-box;place-content:end space-between;align-items:end;flex-direction:row;border-bottom:1px solid var(--datatable-border-color)}#head #head-start,#head #head-center,#head #head-end{display:flex;box-sizing:border-box;align-items:end;flex-direction:row}#head #head-start{place-content:end start}#head #head-center{place-content:end center}#head #head-end{place-content:end end}#head .action{position:relative}#head .action .action-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}#head .action.user-action .mat-mdc-icon-button{--mdc-icon-button-icon-color: var(--action-color, var(--mat-sys-primary))}#head #records-count{min-width:72px;padding:0 8px;color:var(--datatable-color);font-size:14px;line-height:48px;text-align:right;white-space:nowrap}#column-options .column-options-item{overflow:hidden;display:flex;box-sizing:border-box;align-items:center;flex-direction:row;place-content:center start}#column-options .column-options-item button.toggle-off{--mdc-icon-button-icon-color: var(--mdc-icon-button-disabled-icon-color)}#column-options .column-options-item mat-icon.handle{color:var(--mdc-icon-button-disabled-icon-color)}#table-container{flex:1 1 100%;overflow-y:var(--datatable-container-overflow-y, \"inherit\");overflow-x:var(--datatable-container-overflow-x, \"inherit\");width:100%;scrollbar-width:thin}#table{width:100%;max-height:100%;--mat-table-background-color: var(--datatable-background);--mat-table-row-item-outline-color: var(--datatable-border-color)}#table ::ng-deep .mat-mdc-table-sticky{top:var(--datatable-sticky-top)!important;opacity:1;background:var(--datatable-sticky-background, var(--datatable-background, #ffffff))}#table ::ng-deep .mat-mdc-table-sticky.mat-mdc-table-sticky-border-elem-left{border-right:var(--datatable-sticky-border)}#table ::ng-deep .mat-mdc-header-cell{padding:0 8px}#table ::ng-deep .mat-mdc-header-cell mat-form-field{min-width:auto;flex:1 1 100%}#table ::ng-deep .mat-mdc-header-cell mat-form-field{--mat-form-field-state-layer-color: var(--datatable-background)}#table ::ng-deep .mat-mdc-header-cell mat-form-field{--mdc-filled-text-field-container-color: var(--datatable-background)}#table ::ng-deep .mat-mdc-header-cell mat-form-field{--mdc-filled-text-field-container-shape: 0}#table ::ng-deep .mat-mdc-header-cell mat-form-field{--mat-form-field-hover-state-layer-opacity: 0}#table ::ng-deep .mat-mdc-header-cell mat-form-field{--mdc-filled-text-field-active-indicator-color: #999}#table ::ng-deep .mat-mdc-header-cell mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}#table ::ng-deep .mat-mdc-header-cell mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}#table ::ng-deep .mat-mdc-cell{padding:0 8px}#table ::ng-deep .mat-mdc-footer-row.incremental-row{height:44px}#table ::ng-deep .mat-mdc-footer-row.incremental-row.is-hidden{display:none}#table ::ng-deep .mat-mdc-footer-row.incremental-row .mat-mdc-footer-cell{padding:0;border-bottom-color:var(--mat-table-row-item-outline-color, var(--mat-sys-outline, rgba(0, 0, 0, .12)));border-bottom-width:var(--mat-table-row-item-outline-width, 1px);border-bottom-style:solid}#table ::ng-deep .mat-mdc-row.has-click:not(.is-disabled){cursor:pointer}#table ::ng-deep .mat-mdc-row.has-click:not(.is-disabled):focus-visible{outline:2px solid currentColor;outline-offset:-2px}#table ::ng-deep .mat-mdc-row.has-click:not(.is-disabled):hover .mat-mdc-cell{--datatable-hover-color: var(--ngx-mat-datatable-hover-color, var(--mat-sys-on-primary));--datatable-hover-bgcolor: var(--ngx-mat-datatable-hover-bgcolor, var(--mat-sys-primary));color:var(--datatable-hover-color)!important;background-color:var(--datatable-hover-bgcolor)!important}#table ::ng-deep .mat-mdc-row.is-disabled .mat-mdc-cell{opacity:.2}#table ::ng-deep .mat-mdc-row:last-child .mat-mdc-cell{border-bottom-color:var(--mat-table-row-item-outline-color, var(--mat-sys-outline, rgba(0, 0, 0, .12)));border-bottom-width:var(--mat-table-row-item-outline-width, 1px);border-bottom-style:solid}#table .header-container{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;width:100%;min-height:var(--mat-form-field-container-height, 56px);margin:6px 0}#table .header{width:100%;display:flex;box-sizing:border-box;place-content:center space-between;align-items:center;flex-direction:row}#table .header .header-actions .sort-btn{--mat-badge-container-size: 12px;--mat-badge-line-height: 16px;--mat-badge-text-size: 10px;--mat-badge-legacy-container-size: 18px}#table .cell{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;width:100%}#table .cell>*{display:inline-flex}#table .incremental-load-row{position:sticky;left:0;display:flex;box-sizing:border-box;place-content:center center;align-items:center;flex-direction:row;gap:8px;min-height:44px;width:var(--datatable-container-width, 100%);max-width:var(--datatable-container-width, 100%);color:var(--datatable-color);pointer-events:none}#table .incremental-sentinel,#table .incremental-load-row button{pointer-events:auto}#table .incremental-sentinel{display:inline-flex;box-sizing:border-box;place-content:center center;align-items:center;flex-direction:row;gap:8px;min-height:44px}#table .incremental-load-row button{display:inline-flex;align-items:center;gap:8px}#paginator{--mat-paginator-container-background-color: var(--datatable-background);--mat-form-field-container-height: 24px;--mat-form-field-container-vertical-padding: 4px;--mat-paginator-container-size: 46px;border-top:1px solid var(--datatable-border-color)}#paginator ::ng-deep .mat-mdc-select{display:flex;height:24px}#paginator ::ng-deep .mat-mdc-paginator-touch-target{height:24px}#paginator ::ng-deep .mat-mdc-paginator-range-actions button{--mdc-icon-button-state-layer-size: 36px;padding:6px}#loading{position:absolute;z-index:200;inset:0;background-color:#00000029;display:flex;box-sizing:border-box;place-content:center center;align-items:center;flex-direction:row}::ng-deep .mat-mdc-icon-button[mat-icon-button][size=small]{--mdc-icon-button-state-layer-size: 30px;--mdc-icon-button-icon-size: 18px}::ng-deep .mat-mdc-icon-button[mat-icon-button][size=small] .mat-mdc-button-touch-target{height:36px;width:36px}::ng-deep .mat-mdc-icon-button[mat-icon-button][size=small] mat-icon{height:18px;width:18px;font-size:18px}.row{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row}.detail-row{height:0}.element-detail{background:#f5f5f5;overflow:hidden;display:flex}#no-data{position:sticky;width:fit-content;left:50%}#no-data #no-data-label{position:relative;margin-left:-50%}.facet{margin:8px;--mdc-elevated-card-container-color: transparent}.facet mat-card-content{display:flex;box-sizing:border-box;place-content:center center;align-items:center;flex-direction:row;flex-wrap:wrap;padding:4px}.facet .facet-indicator{display:flex;box-sizing:border-box;flex-direction:column;place-content:center center;align-items:center;position:relative;margin:4px}.facet .facet-indicator.has-action{cursor:pointer}.facet .facet-indicator.has-action:focus-visible{outline:2px solid currentColor;outline-offset:2px}.facet .facet-indicator .facet-indicator-label{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1em;padding:2px}.chips-facet{margin-right:8px}.chips-facet .chip-facet{overflow:hidden}.chips-facet .chip-facet{--mdc-chip-label-text-color: var(--facet-color)}.chips-facet .chip-facet{--mdc-chip-outline-color: var(--facet-color)}.chips-facet .chip-facet{--mdc-chip-elevated-container-color: var(--facet-color)}.chips-facet .chip-facet.has-action{cursor:pointer}.chips-facet .chip-facet.has-action:focus-visible{outline:2px solid currentColor;outline-offset:2px}.chips-facet .chip-facet ::ng-deep .mat-mdc-chip-action,.chips-facet .chip-facet ::ng-deep .mat-mdc-standard-chip{cursor:inherit;padding:0}.chips-facet .chip-facet ::ng-deep .mat-mdc-chip-action-label{height:100%;width:100%}.chips-facet .chip-facet .chip-facet-content{display:flex;box-sizing:border-box;place-content:center space-between;align-items:center;flex-direction:row;height:100%;width:100%}.chips-facet .chip-facet .chip-facet-content .chip-facet-key,.chips-facet .chip-facet .chip-facet-content .chip-facet-value{height:100%;padding-left:8px;padding-right:8px;display:flex;box-sizing:border-box;place-content:center space-between;align-items:center;flex-direction:row}.chips-facet .chip-facet .chip-facet-content .chip-facet-key{background-color:var(--mdc-chip-label-text-color);color:var(--facet-label-color, var(--mdc-chip-elevated-container-color))}.chips-facet .chip-facet .chip-facet-content .chip-facet-value{color:var(--facet-value-color, var(--mdc-chip-label-text-color))}\n"], dependencies: [{ kind: "component", type: CellCheckboxValueComponent, selector: "lib-cell-checkbox-value", inputs: ["column", "row"] }, { kind: "component", type: CellDateValueComponent, selector: "lib-cell-date-value", inputs: ["column", "row"] }, { kind: "component", type: CellDurationValueComponent, selector: "lib-cell-duration-value", inputs: ["column", "row"] }, { kind: "component", type: CellNumberValueComponent, selector: "lib-cell-number-value", inputs: ["column", "row"] }, { kind: "component", type: CellSelectValueComponent, selector: "lib-cell-select-value", inputs: ["column", "row"] }, { kind: "pipe", type: CellColorPipe, name: "cellColor" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: TransformPipe, name: "transform" }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$1.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: "directive", type: i2$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "pipe", type: FindContentPipe, name: "findContent" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "pipe", type: GetPipe, name: "get" }, { kind: "component", type: HeaderAutocompleteFilterComponent, selector: "lib-header-autocomplete-filter", inputs: ["column"] }, { kind: "component", type: HeaderCheckboxFilterComponent, selector: "lib-header-checkbox-filter", inputs: ["column"] }, { kind: "component", type: HeaderDateFilterComponent, selector: "lib-header-date-filter", inputs: ["column"] }, { kind: "component", type: HeaderDurationFilterComponent, selector: "lib-header-duration-filter", inputs: ["column"] }, { kind: "component", type: HeaderNumberFilterComponent, selector: "lib-header-number-filter", inputs: ["column"] }, { kind: "component", type: HeaderSelectFilterComponent, selector: "lib-header-select-filter", inputs: ["column"] }, { kind: "component", type: HeaderTextFilterComponent, selector: "lib-header-text-filter", inputs: ["column"] }, { kind: "ngmodule", type: IntersectionObserverModule }, { kind: "directive", type: i3.IntersectionObserverDirective, selector: "[intersectionObserver]", inputs: ["visitClass", "leaveClass", "removeVisitClass", "removeLeaveClass", "useScroll", "threshold", "autoRemove"], outputs: ["intersection"] }, { kind: "ngmodule", type: MatBadgeModule }, { kind: "directive", type: i5$2.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i9.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i9.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: MatPaginatorModule }, { kind: "component", type: i10$1.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i1$3.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i12.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i12.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i12.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i12.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i12.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i12.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i12.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i12.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i12.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i12.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i12.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i12.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i12.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i12.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "directive", type: i12.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i13.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "component", type: i13.MatChipSet, selector: "mat-chip-set", inputs: ["disabled", "role", "tabIndex"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: SafeHtmlPipe, name: "safeHtml" }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i14.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: BackgroundColorPipe, name: "backgroundColor" }, { kind: "pipe", type: FilterPipe, name: "filter" }, { kind: "pipe", type: SumPipe, name: "sum" }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i15.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i15.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i15.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i15.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "ngmodule", type: CountUpModule }, { kind: "directive", type: i3$3.CountUpDirective, selector: "[countUp]", inputs: ["countUp", "options", "reanimateOnClick"], outputs: ["complete"] }, { kind: "component", type: ProgressSpinnerComponent, selector: "lib-progress-spinner", inputs: ["diameter", "value", "color", "displayValue", "fontSize", "animateInView", "delay"] }, { kind: "pipe", type: FindPipe, name: "find" }, { kind: "pipe", type: OrderByPipe, name: "orderBy" }, { kind: "pipe", type: SortFacetEntriesPipe, name: "sortFacetEntries" }, { kind: "pipe", type: ValueFunctionPipe, name: "valueFunction" }, { kind: "pipe", type: IncludedInPipe, name: "includedIn" }, { kind: "pipe", type: CellOpacityPipe, name: "cellOpacity" }, { kind: "directive", type: DatatableRowViewportDirective, selector: "[datatableRowViewport]", inputs: ["datatableRowViewport"], outputs: ["datatableRowVisible"] }], animations: [
2856
+ trigger('fade', [
2857
+ transition(':enter', [
2858
+ style({ opacity: 0 }), // initial
2859
+ animate('0.2s', style({ opacity: 1 })), // final
2860
+ ]),
2861
+ transition(':leave', [
2862
+ style({ opacity: 1 }), // initial
2863
+ animate('0.2s', style({ opacity: 0 })), // final
2864
+ ]),
2865
+ ]),
2866
+ trigger('detailExpand', [
2867
+ state('collapsed', style({ height: '0px', minHeight: '0' })),
2868
+ state('expanded', style({ height: '*' })),
2869
+ transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
2870
+ ]),
2871
+ ] });
2872
+ }
2873
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableComponent, decorators: [{
2874
+ type: Component,
2875
+ args: [{ imports: [
2876
+ CellCheckboxValueComponent,
2877
+ CellDateValueComponent,
2878
+ CellDurationValueComponent,
2879
+ CellNumberValueComponent,
2880
+ CellSelectValueComponent,
2881
+ CellColorPipe,
2882
+ CommonModule,
2883
+ TransformPipe,
2884
+ DragDropModule,
2885
+ FindContentPipe,
2886
+ FormsModule,
2887
+ GetPipe,
2888
+ HeaderAutocompleteFilterComponent,
2889
+ HeaderCheckboxFilterComponent,
2890
+ HeaderDateFilterComponent,
2891
+ HeaderDurationFilterComponent,
2892
+ HeaderNumberFilterComponent,
2893
+ HeaderSelectFilterComponent,
2894
+ HeaderTextFilterComponent,
2895
+ IntersectionObserverModule,
2896
+ MatBadgeModule,
2897
+ MatButtonModule,
2898
+ MatFormFieldModule,
2899
+ MatIconModule,
2900
+ MatMenuModule,
2901
+ MatPaginatorModule,
2902
+ MatProgressSpinnerModule,
2903
+ MatTableModule,
2904
+ MatChipsModule,
2905
+ ReactiveFormsModule,
2906
+ SafeHtmlPipe,
2907
+ MatTooltipModule,
2908
+ BackgroundColorPipe,
2909
+ FilterPipe,
2910
+ SumPipe,
2911
+ MatCardModule,
2912
+ CountUpModule,
2913
+ ProgressSpinnerComponent,
2914
+ FindPipe,
2915
+ OrderByPipe,
2916
+ SortFacetEntriesPipe,
2917
+ ValueFunctionPipe,
2918
+ IncludedInPipe,
2919
+ CellOpacityPipe,
2920
+ DatatableRowViewportDirective,
2921
+ ], providers: [
2922
+ { provide: MatPaginatorIntl, useClass: NgxMatDatatablePaginatorIntl },
2923
+ SelectOptionsCacheService,
2924
+ DatatableRowViewportObserverService,
2925
+ ], selector: 'ngx-mat-datatable', animations: [
2926
+ trigger('fade', [
2927
+ transition(':enter', [
2928
+ style({ opacity: 0 }), // initial
2929
+ animate('0.2s', style({ opacity: 1 })), // final
2930
+ ]),
2931
+ transition(':leave', [
2932
+ style({ opacity: 1 }), // initial
2933
+ animate('0.2s', style({ opacity: 0 })), // final
2934
+ ]),
2935
+ ]),
2936
+ trigger('detailExpand', [
2937
+ state('collapsed', style({ height: '0px', minHeight: '0' })),
2938
+ state('expanded', style({ height: '*' })),
2939
+ transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
2940
+ ]),
2941
+ ], template: "<!-- @format -->\n\n@if (dataSource) {\n <div #container id=\"container\">\n <ng-container *ngTemplateOutlet=\"headTmpl\"></ng-container>\n\n <div id=\"table-container\" intersectionObserver (intersection)=\"load($event.intersect)\">\n <table id=\"table\" #table mat-table [fixedLayout]=\"false\" [dataSource]=\"dataSource\" multiTemplateDataRows>\n @for (column of options.columns; track column.columnDef) {\n <ng-container [matColumnDef]=\"column.columnDef\" [sticky]=\"column.sticky\">\n <th\n mat-header-cell\n *matHeaderCellDef\n [class.searchable]=\"column.searchable\"\n [attr.aria-sort]=\"\n column.sortable\n ? column.order?.dir === 'asc'\n ? 'ascending'\n : column.order?.dir === 'desc'\n ? 'descending'\n : 'none'\n : null\n \"\n [style.min-width.px]=\"column.minWidth || options.columnMinWith\">\n <ng-container *ngTemplateOutlet=\"headerTmpl; context: { column }\"></ng-container>\n </th>\n <td\n mat-cell\n *matCellDef=\"let row\"\n [style.min-width.px]=\"column.minWidth || options.columnMinWith\"\n [style.color]=\"row | cellColor: column : options\"\n [style.opacity]=\"row | cellOpacity: column : options\"\n [style.background-color]=\"row | backgroundColor: column : options\">\n <ng-container *ngTemplateOutlet=\"cellTmpl; context: { column, row }\"></ng-container>\n </td>\n </ng-container>\n }\n\n <ng-container *ngIf=\"options.expandedDetailContentId\" matColumnDef=\"expandedDetail\">\n <td mat-cell *matCellDef=\"let row\" [attr.colspan]=\"visibleColumnsColspan\">\n @let content = contentRefs | findContent: options.expandedDetailContentId;\n <div *ngIf=\"content\" class=\"element-detail\" [@detailExpand]=\"row === expandedRow ? 'expanded' : 'collapsed'\">\n <ng-container *ngTemplateOutlet=\"content.templateRef; context: { row }\"> </ng-container>\n </div>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"_incrementalLoad\">\n <td mat-footer-cell *matFooterCellDef [attr.colspan]=\"visibleColumnsColspan\">\n <div class=\"incremental-load-row\">\n @if (showIncrementalInViewTrigger) {\n <div\n class=\"incremental-sentinel\"\n intersectionObserver\n (intersection)=\"onIncrementalIntersection($event.intersect)\">\n @if (loadingNextRecords) {\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n <span>{{ incrementalLoadingLabel }}</span>\n }\n </div>\n }\n\n @if (showIncrementalButtonTrigger) {\n <button mat-button color=\"primary\" [disabled]=\"loadingNextRecords\" (click)=\"loadNextIncrementalPage()\">\n @if (loadingNextRecords) {\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n <span>{{ incrementalLoadingLabel }}</span>\n } @else {\n <span>{{ incrementalLoadMoreLabel }}</span>\n }\n </button>\n }\n </div>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky: true\"></tr>\n\n <tr\n mat-row\n *matRowDef=\"let row; columns: displayedColumns\"\n [datatableRowViewport]=\"row\"\n (datatableRowVisible)=\"renderRow($event)\"\n [class.has-click]=\"!!options.actions?.rowClick || !!options.expandedDetailContentId\"\n [class.is-disabled]=\"row | includedIn: disabledRows\"\n [attr.aria-disabled]=\"(row | includedIn: disabledRows) ? 'true' : null\"\n [attr.aria-expanded]=\"options.expandedDetailContentId ? row === expandedRow : null\"\n [attr.tabindex]=\"\n (!!options.actions?.rowClick || !!options.expandedDetailContentId) && !(row | includedIn: disabledRows) ? 0 : null\n \"\n (click)=\"rowClick(row)\"\n (keydown)=\"rowKeydown($event, row)\"></tr>\n\n <ng-container *ngIf=\"options.expandedDetailContentId\">\n <tr mat-row *matRowDef=\"let row; columns: ['expandedDetail']\" class=\"detail-row\"></tr>\n </ng-container>\n\n <tr\n mat-footer-row\n *matFooterRowDef=\"incrementalRowColumns\"\n class=\"incremental-row\"\n [class.is-hidden]=\"!showIncrementalRow\"></tr>\n\n <tr class=\"mat-row\" *matNoDataRow>\n <td [attr.colspan]=\"displayedColumns.length\">\n <div id=\"no-data\">\n <span id=\"no-data-label\"> {{ datatableIntl.noDateLabel }}</span>\n </div>\n </td>\n </tr>\n </table>\n </div>\n\n <mat-paginator\n *ngIf=\"loadMode === 'pagination'\"\n id=\"paginator\"\n [length]=\"dataSource.recordsFiltered\"\n [pageSizeOptions]=\"paginationPageSizeOptions\"\n [pageSize]=\"paginationPageSize\"\n [pageIndex]=\"paginationPageIndex\"\n [showFirstLastButtons]=\"true\">\n </mat-paginator>\n </div>\n}\n\n<div id=\"loading\" *ngIf=\"!dataSource || (dataSource.loading$ | async)\" @fade>\n <ng-content select=\"[loader-spinner]\">\n <mat-spinner loader-spinner></mat-spinner>\n </ng-content>\n</div>\n\n<ng-template #headTmpl>\n @let hasColumnDisplay =\n options.actions?.columns?.hideAndShow || options.actions?.columns?.sticky || options.actions?.columns?.reorder;\n @let hasHead =\n !!options.title ||\n !!options.facets?.length ||\n !!options.actions?.user?.length ||\n hasColumnDisplay ||\n options.actions?.export ||\n options.actions?.refresh ||\n showRecordsCount;\n <div *ngIf=\"hasHead\" id=\"head\" #head>\n <div id=\"head-start\">\n <span *ngIf=\"options.title\" id=\"title\" [innerHTML]=\"options.title\"></span>\n\n @for (facetOptions of options.facets | filter: { position: 'start' }; track facetOptions.id) {\n <ng-container *ngTemplateOutlet=\"facetsTmpl; context: { facetOptions }\"></ng-container>\n }\n @for (action of options.actions?.user | filter: { position: 'start' }; track action) {\n <ng-container *ngTemplateOutlet=\"actionTmpl; context: { action }\"></ng-container>\n }\n </div>\n\n <div id=\"head-center\">\n @for (facetOptions of options.facets | filter: { position: 'center' }; track facetOptions.id) {\n <ng-container *ngTemplateOutlet=\"facetsTmpl; context: { facetOptions }\"></ng-container>\n }\n @for (action of options.actions?.user | filter: { position: 'center' }; track action) {\n <ng-container *ngTemplateOutlet=\"actionTmpl; context: { action }\"></ng-container>\n }\n </div>\n\n <div id=\"head-end\">\n @for (facetOptions of options.facets | filter: { position: 'end' }; track facetOptions.id) {\n <ng-container *ngTemplateOutlet=\"facetsTmpl; context: { facetOptions }\"></ng-container>\n }\n @for (action of options.actions?.user | filter: { position: 'end' }; track action) {\n <ng-container *ngTemplateOutlet=\"actionTmpl; context: { action }\"></ng-container>\n }\n\n @if (hasColumnDisplay) {\n <div class=\"action\">\n <button\n mat-icon-button\n color=\"primary\"\n class=\"icon-only action\"\n [matTooltip]=\"options.actions?.columns?.tooltip || datatableIntl.columnsActionLabel\"\n [attr.aria-label]=\"options.actions?.columns?.tooltip || datatableIntl.columnsActionLabel\"\n [matMenuTriggerFor]=\"columnsMenu\"\n (menuOpened)=\"openUpdateColumnDisplay()\"\n (menuClosed)=\"closeUpdateColumnDisplay()\">\n <mat-icon>view_column</mat-icon>\n </button>\n </div>\n }\n\n @if (options.actions?.export) {\n <div class=\"action\">\n <button\n mat-icon-button\n color=\"primary\"\n [attr.aria-label]=\"datatableIntl.exportActionLabel\"\n [disabled]=\"exporting\"\n (click)=\"export()\">\n <mat-icon>download</mat-icon>\n </button>\n <div class=\"action-loader\" *ngIf=\"exporting\" @fade>\n <mat-spinner [diameter]=\"32\"></mat-spinner>\n </div>\n </div>\n }\n\n @if (options.actions?.refresh) {\n <div class=\"action\">\n <button\n mat-icon-button\n color=\"primary\"\n [attr.aria-label]=\"datatableIntl.refreshActionLabel\"\n [disabled]=\"dataSource.loading$ | async\"\n (click)=\"loadPage()\">\n <mat-icon>sync</mat-icon>\n </button>\n <div class=\"action-loader\" *ngIf=\"dataSource.loading$ | async\" @fade>\n <mat-spinner [diameter]=\"32\"></mat-spinner>\n </div>\n </div>\n }\n\n @if (showRecordsCount) {\n <div id=\"records-count\">\n <span\n [countUp]=\"displayedRecordsCount\"\n [options]=\"datatableIntl.numberOptions\"\n [reanimateOnClick]=\"false\"></span>\n / {{ totalRecordsCount }}\n </div>\n }\n </div>\n </div>\n</ng-template>\n\n<mat-menu #columnsMenu=\"matMenu\" class=\"datatable-columns-menu\">\n <div\n id=\"column-options\"\n cdkDropList\n has-handle\n [cdkDropListDisabled]=\"!options.actions?.columns?.reorder\"\n (cdkDropListDropped)=\"reorderColumns($event)\">\n @for (column of updateColumns; track column.columnDef) {\n @if (['_select', '_rownumber'].includes(column.header)) {\n <div mat-list-item cdkDrag></div>\n } @else {\n <div class=\"column-options-item\" mat-list-item cdkDrag (click)=\"$event.stopPropagation()\">\n <button\n *ngIf=\"options.actions?.columns?.hideAndShow\"\n mat-icon-button\n size=\"small\"\n color=\"primary\"\n [class]=\"column.hidden ? 'toggle-off' : 'toggle-on'\"\n [attr.aria-label]=\"column.hidden ? datatableIntl.showColumnActionLabel : datatableIntl.hideColumnActionLabel\"\n (click)=\"column.hidden = !column.hidden\"\n [style.margin-right.px]=\"8\">\n <mat-icon>\n @if (!column.hidden) {\n visibility\n } @else {\n visibility_off\n }\n </mat-icon>\n </button>\n <button\n *ngIf=\"options.actions?.columns?.sticky\"\n mat-icon-button\n size=\"small\"\n color=\"primary\"\n [class]=\"column.sticky ? 'toggle-on' : 'toggle-off'\"\n [attr.aria-label]=\"column.sticky ? datatableIntl.unpinColumnActionLabel : datatableIntl.pinColumnActionLabel\"\n (click)=\"column.sticky = !column.sticky\"\n [style.margin-right.px]=\"8\">\n <mat-icon>push_pin </mat-icon>\n </button>\n <span [style.margin-right.px]=\"8\" [innerHTML]=\"column.header\"></span>\n <mat-icon\n *ngIf=\"options.actions?.columns?.reorder\"\n size=\"small\"\n class=\"handle\"\n cdkDragHandle\n [style.margin]=\"'0 8px 0 auto'\">\n open_with\n </mat-icon>\n </div>\n }\n }\n </div>\n</mat-menu>\n\n<ng-template #headerTmpl let-column=\"column\">\n <div class=\"header-container\" [matTooltip]=\"column.tooltip\">\n <div class=\"header\" [formGroup]=\"searchFormGroup\">\n @if (column.searchable) {\n @switch (column.type) {\n @case ('text') {\n <lib-header-text-filter\n [column]=\"column\"\n [formControlName]=\"searchControlNames[column.columnDef]\"></lib-header-text-filter>\n }\n @case ('number') {\n <lib-header-number-filter\n [column]=\"column\"\n [formControlName]=\"searchControlNames[column.columnDef]\"></lib-header-number-filter>\n }\n @case ('select') {\n <lib-header-select-filter\n [column]=\"column\"\n [formControlName]=\"searchControlNames[column.columnDef]\"></lib-header-select-filter>\n }\n @case ('autocomplete') {\n <lib-header-autocomplete-filter\n [column]=\"column\"\n [formControlName]=\"searchControlNames[column.columnDef]\"></lib-header-autocomplete-filter>\n }\n @case ('checkbox') {\n <lib-header-checkbox-filter\n [column]=\"column\"\n [formControlName]=\"searchControlNames[column.columnDef]\"></lib-header-checkbox-filter>\n }\n @case ('date') {\n <lib-header-date-filter\n [column]=\"column\"\n [formControlName]=\"searchControlNames[column.columnDef]\"></lib-header-date-filter>\n }\n @case ('duration') {\n <lib-header-duration-filter\n [column]=\"column\"\n [formControlName]=\"searchControlNames[column.columnDef]\"></lib-header-duration-filter>\n }\n @default {\n <span [innerHTML]=\"column.header | safeHtml\"></span>\n }\n }\n } @else {\n <span [innerHTML]=\"column.header | safeHtml\"></span>\n }\n <ng-container *ngTemplateOutlet=\"headerActionsTmpl; context: { column }\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #headerActionsTmpl let-column=\"column\">\n <div class=\"header-actions\">\n <ng-container *ngIf=\"column.sortable\">\n <button\n class=\"sort-btn\"\n mat-icon-button\n size=\"small\"\n (click)=\"sortColumn(column)\"\n [attr.aria-label]=\"datatableIntl.sortColumnActionLabel\"\n [matBadgeHidden]=\"!column.order\"\n [matBadge]=\"column.order?.index + 1\">\n @switch (column.order?.dir) {\n @case ('asc') {\n <mat-icon size=\"small\">arrow_upward</mat-icon>\n }\n @case ('desc') {\n <mat-icon size=\"small\">arrow_downward</mat-icon>\n }\n @default {\n <mat-icon size=\"small\">sort</mat-icon>\n }\n }\n </button>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #cellTmpl let-column=\"column\" let-row=\"row\">\n @if (renderedRows.has(row)) {\n <div\n class=\"cell\"\n [@.disabled]=\"!!options.disableRowAnimation\"\n @fade\n [style.place-content]=\"column.align\"\n [style.max-height.px]=\"options.rowMaxHeight\">\n @let value = row | get: column.property;\n @if (column.cellComponent) {\n <ng-container *ngComponentOutlet=\"column.cellComponent; inputs: { column, row, value }\" />\n } @else if (column.cellContentId) {\n @let cell = contentRefs | findContent: column.cellContentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, row, value }\" />\n }\n } @else {\n @if (column.prefixContentId) {\n @let cell = contentRefs | findContent: column.prefixContentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, row, value }\" />\n }\n } @else if (column.prefixComponent) {\n <ng-container *ngComponentOutlet=\"column.prefixComponent; inputs: { column, row, value }\" />\n } @else if (column.prefixFunction) {\n <span [innerHTML]=\"value | valueFunction: column.prefixFunction : row : column | safeHtml\"></span>\n } @else if (column.prefix) {\n <span [innerHTML]=\"column.prefix | safeHtml\"></span>\n }\n\n @switch (column.type) {\n @case ('number') {\n <lib-cell-number-value [column]=\"column\" [row]=\"row\"></lib-cell-number-value>\n }\n @case ('select') {\n <lib-cell-select-value [column]=\"column\" [row]=\"row\"></lib-cell-select-value>\n }\n @case ('checkbox') {\n <lib-cell-checkbox-value [column]=\"column\" [row]=\"row\"></lib-cell-checkbox-value>\n }\n @case ('date') {\n <lib-cell-date-value [column]=\"column\" [row]=\"row\"></lib-cell-date-value>\n }\n @case ('duration') {\n <lib-cell-duration-value [column]=\"column\" [row]=\"row\"></lib-cell-duration-value>\n }\n @default {\n <span [innerHTML]=\"(value | transform: row : column) ?? '' | safeHtml\"></span>\n }\n }\n\n @if (column.suffixContentId) {\n @let cell = contentRefs | findContent: column.suffixContentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, row, value }\" />\n }\n } @else if (column.suffixComponent) {\n <ng-container *ngComponentOutlet=\"column.suffixComponent; inputs: { column, row, value }\" />\n } @else if (column.suffixFunction) {\n <span [innerHTML]=\"value | valueFunction: column.suffixFunction : row : column | safeHtml\"></span>\n } @else if (column.suffix) {\n <span [innerHTML]=\"column.suffix | safeHtml\"></span>\n }\n }\n </div>\n } @else {\n <div class=\"cell\"></div>\n }\n</ng-template>\n\n<ng-template #actionTmpl let-action=\"action\">\n @if (!action.isHidden) {\n @switch (action.kind) {\n @case ('icon') {\n <div class=\"action user-action\" [matTooltip]=\"action.tooltip\">\n <button\n [style.--action-color]=\"action.color\"\n mat-icon-button\n [attr.aria-label]=\"action.ariaLabel || action.tooltip || action.icon\"\n (click)=\"action.onclick(this)\"\n [disabled]=\"!!action.isDisabled\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n </div>\n }\n @case ('template') {\n <div class=\"action user-action\">\n @let content = contentRefs | findContent: action.contentId;\n @if (content) {\n <ng-container *ngTemplateOutlet=\"content.templateRef; context: { datatable: this, action }\" />\n }\n </div>\n }\n }\n }\n</ng-template>\n\n<ng-template #facetsTmpl let-facetOptions=\"facetOptions\">\n @let column = options.columns | find: { columnDef: facetOptions.columnDef };\n @let data = (dataSource.facets ?? {})[facetOptions.id] | sortFacetEntries: facetOptions.options;\n @if (data) {\n @if (facetOptions.contentId) {\n @let cell = contentRefs | findContent: facetOptions.contentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, facetOptions, data }\" />\n }\n } @else {\n @switch (facetOptions.display) {\n @case ('chips') {\n <ng-container *ngTemplateOutlet=\"facetsChipsTmpl; context: { column, data, facetOptions }\"></ng-container>\n }\n @default {\n <ng-container\n *ngTemplateOutlet=\"facetsProgressSpinnersTmpl; context: { column, data, facetOptions }\"></ng-container>\n }\n }\n }\n }\n</ng-template>\n\n<ng-template #facetsChipsTmpl let-column=\"column\" let-data=\"data\" let-facetOptions=\"facetOptions\">\n @let size = facetOptions.size;\n @let fontSize = facetOptions.fontSize ?? '1em';\n <!-- @let total = (data | sum: 'value') || 1; -->\n <mat-chip-set class=\"chips-facet\">\n @for (d of data | orderBy: '_id'; track d._id) {\n @let option = facetOptions?.option ? facetOptions.option(d) : (facetOptions.options | find: { value: d._id });\n @let name = option?.name ?? d._id;\n @let color = option?.color ?? 'var(--mat-sys-primary)';\n @let labelColor = option?.labelColor;\n <!-- @let percent = (d.value / total) * 100; -->\n <mat-chip\n class=\"chip-facet\"\n [class.has-action]=\"column?.searchable === true\"\n [attr.tabindex]=\"column?.searchable === true ? 0 : null\"\n (click)=\"column?.searchable === true && facetClick(column, d, option)\"\n (keydown.enter)=\"column?.searchable === true && facetClick(column, d, option)\"\n (keydown.space)=\"column?.searchable === true && facetClick(column, d, option); $event.preventDefault()\"\n [style.--facet-color]=\"color\"\n [style.--facet-label-color]=\"labelColor ?? 'var(--mat-sys-on-primary)'\"\n [style.--facet-value-color]=\"labelColor ?? color\"\n [style.width.px]=\"size\">\n <div class=\"chip-facet-content\" [style.font-size]=\"fontSize\">\n <div class=\"chip-facet-key\">{{ name }}</div>\n <div class=\"chip-facet-value\">{{ d.value | number: '0.0-2' }}</div>\n </div>\n </mat-chip>\n }\n </mat-chip-set>\n</ng-template>\n\n<ng-template #facetsProgressSpinnersTmpl let-column=\"column\" let-data=\"data\" let-facetOptions=\"facetOptions\">\n @let size = facetOptions.size ?? 80;\n @let fontSize = facetOptions.fontSize ?? '1em';\n @let total = (data | sum: 'value') || 1;\n <mat-card class=\"facet\">\n @if (facetOptions.name) {\n <mat-card-header>\n <mat-card-title>{{ facetOptions.name }}</mat-card-title>\n </mat-card-header>\n }\n <mat-card-content>\n @for (d of data; track d._id) {\n @let option = facetOptions?.option ? facetOptions.option(d) : (facetOptions.options | find: { value: d._id });\n @let name = option?.name ?? d._id;\n @let color = option?.color ?? 'var(--mat-sys-primary)';\n @let percent = (d.value / total) * 100;\n <div\n class=\"facet-indicator\"\n [class.has-action]=\"column?.searchable === true\"\n [attr.role]=\"column?.searchable === true ? 'button' : null\"\n [attr.tabindex]=\"column?.searchable === true ? 0 : null\"\n (click)=\"column?.searchable === true && facetClick(column, d, option)\"\n (keydown.enter)=\"column?.searchable === true && facetClick(column, d, option)\"\n (keydown.space)=\"column?.searchable === true && facetClick(column, d, option); $event.preventDefault()\">\n <lib-progress-spinner [diameter]=\"size\" [color]=\"color\" [fontSize]=\"fontSize\" [value]=\"percent\">\n <mat-label>{{ name }}</mat-label>\n </lib-progress-spinner>\n <mat-label\n class=\"facet-indicator-label\"\n [style.font-size]=\"fontSize\"\n [countUp]=\"d.value\"\n [options]=\"datatableIntl.numberOptions\"\n [reanimateOnClick]=\"false\">\n {{ d.value | number: '0.0-2' }}\n </mat-label>\n </div>\n }\n </mat-card-content>\n </mat-card>\n</ng-template>\n", styles: [":host{display:flex;position:relative;max-height:100%;--datatable-background: var(--ngx-mat-datatable-background, #ffffff);--datatable-color: var(--ngx-mat-datatable-color, var(--mat-sys-primary,));--datatable-border-color: var(--ngx-mat-datatable-border-color, #ccc);--datatable-sticky-top: var(--ngx-mat-datatable-sticky-top, 0);--datatable-sticky-background: var(--ngx-mat-datatable-sticky-background, var(--datatable-background));--datatable-sticky-border: var(--ngx-mat-datatable-sticky-border, 1px dashed #e6a93a)}:host{--mat-table-background-color: var(--datatable-background)}:host{--mat-table-header-headline-color: var(--datatable-color)}:host{--mat-table-row-item-label-text-color: var(--datatable-color)}#container{display:flex;flex:1 1 100%;box-sizing:border-box;flex-direction:column;position:relative;width:100%;background-color:var(--datatable-background)}#head{width:100%;display:flex;box-sizing:border-box;place-content:end space-between;align-items:end;flex-direction:row;border-bottom:1px solid var(--datatable-border-color)}#head #head-start,#head #head-center,#head #head-end{display:flex;box-sizing:border-box;align-items:end;flex-direction:row}#head #head-start{place-content:end start}#head #head-center{place-content:end center}#head #head-end{place-content:end end}#head .action{position:relative}#head .action .action-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}#head .action.user-action .mat-mdc-icon-button{--mdc-icon-button-icon-color: var(--action-color, var(--mat-sys-primary))}#head #records-count{min-width:72px;padding:0 8px;color:var(--datatable-color);font-size:14px;line-height:48px;text-align:right;white-space:nowrap}#column-options .column-options-item{overflow:hidden;display:flex;box-sizing:border-box;align-items:center;flex-direction:row;place-content:center start}#column-options .column-options-item button.toggle-off{--mdc-icon-button-icon-color: var(--mdc-icon-button-disabled-icon-color)}#column-options .column-options-item mat-icon.handle{color:var(--mdc-icon-button-disabled-icon-color)}#table-container{flex:1 1 100%;overflow-y:var(--datatable-container-overflow-y, \"inherit\");overflow-x:var(--datatable-container-overflow-x, \"inherit\");width:100%;scrollbar-width:thin}#table{width:100%;max-height:100%;--mat-table-background-color: var(--datatable-background);--mat-table-row-item-outline-color: var(--datatable-border-color)}#table ::ng-deep .mat-mdc-table-sticky{top:var(--datatable-sticky-top)!important;opacity:1;background:var(--datatable-sticky-background, var(--datatable-background, #ffffff))}#table ::ng-deep .mat-mdc-table-sticky.mat-mdc-table-sticky-border-elem-left{border-right:var(--datatable-sticky-border)}#table ::ng-deep .mat-mdc-header-cell{padding:0 8px}#table ::ng-deep .mat-mdc-header-cell mat-form-field{min-width:auto;flex:1 1 100%}#table ::ng-deep .mat-mdc-header-cell mat-form-field{--mat-form-field-state-layer-color: var(--datatable-background)}#table ::ng-deep .mat-mdc-header-cell mat-form-field{--mdc-filled-text-field-container-color: var(--datatable-background)}#table ::ng-deep .mat-mdc-header-cell mat-form-field{--mdc-filled-text-field-container-shape: 0}#table ::ng-deep .mat-mdc-header-cell mat-form-field{--mat-form-field-hover-state-layer-opacity: 0}#table ::ng-deep .mat-mdc-header-cell mat-form-field{--mdc-filled-text-field-active-indicator-color: #999}#table ::ng-deep .mat-mdc-header-cell mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}#table ::ng-deep .mat-mdc-header-cell mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}#table ::ng-deep .mat-mdc-cell{padding:0 8px}#table ::ng-deep .mat-mdc-footer-row.incremental-row{height:44px}#table ::ng-deep .mat-mdc-footer-row.incremental-row.is-hidden{display:none}#table ::ng-deep .mat-mdc-footer-row.incremental-row .mat-mdc-footer-cell{padding:0;border-bottom-color:var(--mat-table-row-item-outline-color, var(--mat-sys-outline, rgba(0, 0, 0, .12)));border-bottom-width:var(--mat-table-row-item-outline-width, 1px);border-bottom-style:solid}#table ::ng-deep .mat-mdc-row.has-click:not(.is-disabled){cursor:pointer}#table ::ng-deep .mat-mdc-row.has-click:not(.is-disabled):focus-visible{outline:2px solid currentColor;outline-offset:-2px}#table ::ng-deep .mat-mdc-row.has-click:not(.is-disabled):hover .mat-mdc-cell{--datatable-hover-color: var(--ngx-mat-datatable-hover-color, var(--mat-sys-on-primary));--datatable-hover-bgcolor: var(--ngx-mat-datatable-hover-bgcolor, var(--mat-sys-primary));color:var(--datatable-hover-color)!important;background-color:var(--datatable-hover-bgcolor)!important}#table ::ng-deep .mat-mdc-row.is-disabled .mat-mdc-cell{opacity:.2}#table ::ng-deep .mat-mdc-row:last-child .mat-mdc-cell{border-bottom-color:var(--mat-table-row-item-outline-color, var(--mat-sys-outline, rgba(0, 0, 0, .12)));border-bottom-width:var(--mat-table-row-item-outline-width, 1px);border-bottom-style:solid}#table .header-container{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;width:100%;min-height:var(--mat-form-field-container-height, 56px);margin:6px 0}#table .header{width:100%;display:flex;box-sizing:border-box;place-content:center space-between;align-items:center;flex-direction:row}#table .header .header-actions .sort-btn{--mat-badge-container-size: 12px;--mat-badge-line-height: 16px;--mat-badge-text-size: 10px;--mat-badge-legacy-container-size: 18px}#table .cell{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;width:100%}#table .cell>*{display:inline-flex}#table .incremental-load-row{position:sticky;left:0;display:flex;box-sizing:border-box;place-content:center center;align-items:center;flex-direction:row;gap:8px;min-height:44px;width:var(--datatable-container-width, 100%);max-width:var(--datatable-container-width, 100%);color:var(--datatable-color);pointer-events:none}#table .incremental-sentinel,#table .incremental-load-row button{pointer-events:auto}#table .incremental-sentinel{display:inline-flex;box-sizing:border-box;place-content:center center;align-items:center;flex-direction:row;gap:8px;min-height:44px}#table .incremental-load-row button{display:inline-flex;align-items:center;gap:8px}#paginator{--mat-paginator-container-background-color: var(--datatable-background);--mat-form-field-container-height: 24px;--mat-form-field-container-vertical-padding: 4px;--mat-paginator-container-size: 46px;border-top:1px solid var(--datatable-border-color)}#paginator ::ng-deep .mat-mdc-select{display:flex;height:24px}#paginator ::ng-deep .mat-mdc-paginator-touch-target{height:24px}#paginator ::ng-deep .mat-mdc-paginator-range-actions button{--mdc-icon-button-state-layer-size: 36px;padding:6px}#loading{position:absolute;z-index:200;inset:0;background-color:#00000029;display:flex;box-sizing:border-box;place-content:center center;align-items:center;flex-direction:row}::ng-deep .mat-mdc-icon-button[mat-icon-button][size=small]{--mdc-icon-button-state-layer-size: 30px;--mdc-icon-button-icon-size: 18px}::ng-deep .mat-mdc-icon-button[mat-icon-button][size=small] .mat-mdc-button-touch-target{height:36px;width:36px}::ng-deep .mat-mdc-icon-button[mat-icon-button][size=small] mat-icon{height:18px;width:18px;font-size:18px}.row{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row}.detail-row{height:0}.element-detail{background:#f5f5f5;overflow:hidden;display:flex}#no-data{position:sticky;width:fit-content;left:50%}#no-data #no-data-label{position:relative;margin-left:-50%}.facet{margin:8px;--mdc-elevated-card-container-color: transparent}.facet mat-card-content{display:flex;box-sizing:border-box;place-content:center center;align-items:center;flex-direction:row;flex-wrap:wrap;padding:4px}.facet .facet-indicator{display:flex;box-sizing:border-box;flex-direction:column;place-content:center center;align-items:center;position:relative;margin:4px}.facet .facet-indicator.has-action{cursor:pointer}.facet .facet-indicator.has-action:focus-visible{outline:2px solid currentColor;outline-offset:2px}.facet .facet-indicator .facet-indicator-label{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1em;padding:2px}.chips-facet{margin-right:8px}.chips-facet .chip-facet{overflow:hidden}.chips-facet .chip-facet{--mdc-chip-label-text-color: var(--facet-color)}.chips-facet .chip-facet{--mdc-chip-outline-color: var(--facet-color)}.chips-facet .chip-facet{--mdc-chip-elevated-container-color: var(--facet-color)}.chips-facet .chip-facet.has-action{cursor:pointer}.chips-facet .chip-facet.has-action:focus-visible{outline:2px solid currentColor;outline-offset:2px}.chips-facet .chip-facet ::ng-deep .mat-mdc-chip-action,.chips-facet .chip-facet ::ng-deep .mat-mdc-standard-chip{cursor:inherit;padding:0}.chips-facet .chip-facet ::ng-deep .mat-mdc-chip-action-label{height:100%;width:100%}.chips-facet .chip-facet .chip-facet-content{display:flex;box-sizing:border-box;place-content:center space-between;align-items:center;flex-direction:row;height:100%;width:100%}.chips-facet .chip-facet .chip-facet-content .chip-facet-key,.chips-facet .chip-facet .chip-facet-content .chip-facet-value{height:100%;padding-left:8px;padding-right:8px;display:flex;box-sizing:border-box;place-content:center space-between;align-items:center;flex-direction:row}.chips-facet .chip-facet .chip-facet-content .chip-facet-key{background-color:var(--mdc-chip-label-text-color);color:var(--facet-label-color, var(--mdc-chip-elevated-container-color))}.chips-facet .chip-facet .chip-facet-content .chip-facet-value{color:var(--facet-value-color, var(--mdc-chip-label-text-color))}\n"] }]
2942
+ }], propDecorators: { options: [{
2943
+ type: Input,
2944
+ args: ['options']
2945
+ }], config: [{
2946
+ type: Input
2947
+ }], rowClicked: [{
2948
+ type: Output
2949
+ }], configUpdated: [{
2950
+ type: Output
2951
+ }], searchUpdated: [{
2952
+ type: Output
2953
+ }], ready: [{
2954
+ type: Output
2955
+ }], paginator: [{
2956
+ type: ViewChild,
2957
+ args: [MatPaginator]
2958
+ }], contentRefs: [{
2959
+ type: ContentChildren,
2960
+ args: [NgxMatDatatableContentDirective]
2961
+ }], container: [{
2962
+ type: ViewChild,
2963
+ args: ['container']
2964
+ }], head: [{
2965
+ type: ViewChild,
2966
+ args: ['head']
2967
+ }], tableElement: [{
2968
+ type: ViewChild,
2969
+ args: ['table', { read: ElementRef }]
2970
+ }], matTable: [{
2971
+ type: ViewChild,
2972
+ args: [MatTable]
2973
+ }], tableContainerOverflowY: [{
2974
+ type: HostBinding,
2975
+ args: ['style.--datatable-container-overflow-y']
2976
+ }], tableContainerOverflowX: [{
2977
+ type: HostBinding,
2978
+ args: ['style.--datatable-container-overflow-x']
2979
+ }], tableContainerWidth: [{
2980
+ type: HostBinding,
2981
+ args: ['style.--datatable-container-width.px']
2982
+ }] } });
2983
+
2984
+ /** @format */
2985
+ class NgxMatDatatableModule {
2986
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2987
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableModule, imports: [NgxMatDatatableComponent, NgxMatDatatableContentDirective], exports: [NgxMatDatatableComponent, NgxMatDatatableContentDirective] });
2988
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableModule, providers: [NgxMatDatatableIntl], imports: [NgxMatDatatableComponent] });
2989
+ }
2990
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableModule, decorators: [{
2991
+ type: NgModule,
2992
+ args: [{
2993
+ imports: [NgxMatDatatableComponent, NgxMatDatatableContentDirective],
2994
+ exports: [NgxMatDatatableComponent, NgxMatDatatableContentDirective],
2995
+ providers: [NgxMatDatatableIntl],
2996
+ }]
2997
+ }] });
2998
+
2999
+ /** @format */
3000
+
3001
+ /** @format */
3002
+
3003
+ /** @format */
3004
+
3005
+ /** @format */
3006
+
3007
+ /** @format */
3008
+
3009
+ /** @format */
3010
+
3011
+ /** @format */
3012
+
3013
+ /**
3014
+ * Public API Surface of @eherve/angular-material-datatable
3015
+ *
3016
+ * @format
3017
+ */
3018
+
3019
+ /**
3020
+ * Generated bundle index. Do not edit.
3021
+ */
3022
+
3023
+ export { NGX_MAT_DATATABLE_DEFAULT_OPTIONS, NgxMatDatatableComponent, NgxMatDatatableContentDirective, NgxMatDatatableIntl, NgxMatDatatableModule, provideNgxMatDatatableDefaultOptions };
2
3024
  //# sourceMappingURL=eherve-angular-material-datatable.mjs.map