@eherve/angular-material-datatable 19.24.0 → 19.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +2 -0
  2. package/fesm2022/eherve-angular-material-datatable.mjs +3005 -1
  3. package/fesm2022/eherve-angular-material-datatable.mjs.map +1 -1
  4. package/lib/components/cell-date-value/cell-date-value.component.d.ts +2 -1
  5. package/lib/components/cell-select-value/cell-select-value.component.d.ts +2 -3
  6. package/lib/components/header-autocomplete-filter/header-autocomplete-filter.component.d.ts +2 -0
  7. package/lib/components/header-date-filter/header-date-filter.component.d.ts +2 -0
  8. package/lib/components/header-duration-filter/header-duration-filter.component.d.ts +2 -0
  9. package/lib/components/header-number-filter/header-number-filter.component.d.ts +2 -0
  10. package/lib/components/header-select-filter/header-select-filter.component.d.ts +3 -0
  11. package/lib/components/header-text-filter/header-text-filter.component.d.ts +2 -0
  12. package/lib/datasource.d.ts +4 -1
  13. package/lib/datatable.component.d.ts +6 -0
  14. package/lib/datatable.intl.d.ts +11 -0
  15. package/lib/date-refresh.service.d.ts +8 -0
  16. package/lib/directives/datatable-row-viewport.directive.d.ts +22 -0
  17. package/lib/pipes/safe-html.pipe.d.ts +2 -1
  18. package/lib/select-options-cache.service.d.ts +9 -0
  19. package/lib/types/action.type.d.ts +1 -0
  20. package/lib/types/datatable-column.type.d.ts +2 -1
  21. package/package.json +2 -2
  22. package/public-api.d.ts +1 -0
  23. package/fesm2022/eherve-angular-material-datatable-cell-checkbox-value.component-Dcer6VNu.mjs +0 -26
  24. package/fesm2022/eherve-angular-material-datatable-cell-checkbox-value.component-Dcer6VNu.mjs.map +0 -1
  25. package/fesm2022/eherve-angular-material-datatable-cell-date-value.component-CH38s3de.mjs +0 -83
  26. package/fesm2022/eherve-angular-material-datatable-cell-date-value.component-CH38s3de.mjs.map +0 -1
  27. package/fesm2022/eherve-angular-material-datatable-cell-duration-value.component-C96dDNf9.mjs +0 -35
  28. package/fesm2022/eherve-angular-material-datatable-cell-duration-value.component-C96dDNf9.mjs.map +0 -1
  29. package/fesm2022/eherve-angular-material-datatable-cell-number-value.component-YPEA9XOc.mjs +0 -26
  30. package/fesm2022/eherve-angular-material-datatable-cell-number-value.component-YPEA9XOc.mjs.map +0 -1
  31. package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-DH-Kq9yJ.mjs +0 -44
  32. package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-DH-Kq9yJ.mjs.map +0 -1
  33. package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-yAj8iPwA.mjs +0 -2510
  34. package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-yAj8iPwA.mjs.map +0 -1
  35. package/fesm2022/eherve-angular-material-datatable-get.pipe-kupjbnPY.mjs +0 -19
  36. package/fesm2022/eherve-angular-material-datatable-get.pipe-kupjbnPY.mjs.map +0 -1
  37. package/fesm2022/eherve-angular-material-datatable-suffix-function.pipe-CQO-ghpR.mjs +0 -20
  38. package/fesm2022/eherve-angular-material-datatable-suffix-function.pipe-CQO-ghpR.mjs.map +0 -1
  39. package/fesm2022/eherve-angular-material-datatable-transform.pipe-BOmcXXZU.mjs +0 -21
  40. package/fesm2022/eherve-angular-material-datatable-transform.pipe-BOmcXXZU.mjs.map +0 -1
@@ -1,2510 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { SecurityContext, Pipe, inject, Injector, ChangeDetectorRef, forwardRef, Component, Input, ViewChild, signal, ChangeDetectionStrategy, LOCALE_ID, Injectable, 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$1 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 { MatFormFieldModule } from '@angular/material/form-field';
20
- import * as i5$1 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 { BehaviorSubject, Subject, Subscription, filter, debounceTime, switchMap, startWith, tap, defer, catchError, of, finalize, map, firstValueFrom } from 'rxjs';
39
- import * as i4 from '@angular/material/autocomplete';
40
- import { MatAutocomplete, MatAutocompleteModule } from '@angular/material/autocomplete';
41
- import * as i6 from '@angular/material/input';
42
- import { MatInputModule } from '@angular/material/input';
43
- import * as i10 from '@angular/material/progress-bar';
44
- import { MatProgressBarModule } from '@angular/material/progress-bar';
45
- import * as i1 from '@angular/platform-browser';
46
- import * as i5 from '@angular/material/core';
47
- import { DateAdapter, MAT_DATE_LOCALE } from '@angular/material/core';
48
- import * as i3$2 from '@angular/material/checkbox';
49
- import { MatCheckboxModule } from '@angular/material/checkbox';
50
- import { provideMomentDateAdapter } from '@angular/material-moment-adapter';
51
- import * as i4$2 from '@angular/material/datepicker';
52
- import { MatDatepickerIntl, MatDatepickerModule } from '@angular/material/datepicker';
53
- import * as i1$2 from '@angular/cdk/overlay';
54
- import { OverlayModule } from '@angular/cdk/overlay';
55
- import * as i6$1 from '@angular/material/select';
56
- import { MatSelectModule } from '@angular/material/select';
57
- import { DataSource } from '@angular/cdk/collections';
58
- import * as lodash from 'lodash-es';
59
- import humanizeDuration from 'humanize-duration';
60
-
61
- /** @format */
62
- class SafeHtmlPipe {
63
- sanitizer;
64
- constructor(sanitizer) {
65
- this.sanitizer = sanitizer;
66
- }
67
- transform(html) {
68
- return this.sanitizer.sanitize(SecurityContext.HTML, html ?? '') ?? '';
69
- }
70
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
71
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: SafeHtmlPipe, isStandalone: true, name: "safeHtml" });
72
- }
73
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SafeHtmlPipe, decorators: [{
74
- type: Pipe,
75
- args: [{
76
- name: 'safeHtml',
77
- }]
78
- }], ctorParameters: () => [{ type: i1.DomSanitizer }] });
79
-
80
- var safeHtml_pipe = /*#__PURE__*/Object.freeze({
81
- __proto__: null,
82
- SafeHtmlPipe: SafeHtmlPipe
83
- });
84
-
85
- /** @format */
86
- function stripHtml(value, tagReplacement = ' ') {
87
- if (!value)
88
- return '';
89
- return value
90
- .replace(/<[^>]+>/g, tagReplacement) // remove tags
91
- .replace(/\s+/g, ' ') // collapse spaces
92
- .trim();
93
- }
94
-
95
- /** @format */
96
- class HeaderAutocompleteFilterComponent {
97
- column;
98
- options = [];
99
- groups = [];
100
- hasMore = false;
101
- searching = false;
102
- input;
103
- auto;
104
- control;
105
- selectControl = new FormControl();
106
- onChange = () => { };
107
- onTouched = () => { };
108
- filter$ = new BehaviorSubject(undefined);
109
- nextPage$ = new Subject();
110
- injector = inject(Injector);
111
- changeDetectorRef = inject(ChangeDetectorRef);
112
- subsink = new Subscription();
113
- writeValue(value) {
114
- if (value?.value !== this.selectControl.value) {
115
- if (value?.name) {
116
- if (!this.options.find(o => o.value === value.value)) {
117
- this.options.push({ value: value.value, name: value.name });
118
- }
119
- }
120
- this.selectControl.setValue(value?.value, { emitEvent: false });
121
- }
122
- this.changeDetectorRef.markForCheck();
123
- }
124
- setDisabledState(isDisabled) {
125
- if (isDisabled)
126
- this.selectControl.disable({ emitEvent: false });
127
- else
128
- this.selectControl.enable({ emitEvent: false });
129
- }
130
- registerOnChange(onChange) {
131
- this.onChange = onChange;
132
- }
133
- registerOnTouched(onTouched) {
134
- this.onTouched = onTouched;
135
- }
136
- async ngAfterViewInit() {
137
- const ngControl = this.injector.get(NgControl, null);
138
- if (!ngControl)
139
- throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
140
- this.control = ngControl.control;
141
- this.subsink.add(this.selectControl.valueChanges.subscribe((value) => {
142
- if (value === undefined) {
143
- if (this.control.value !== undefined)
144
- this.onChange(undefined);
145
- }
146
- else if (value === null && !this.options.find(o => o.value === null)) {
147
- if (this.control.value !== undefined)
148
- this.onChange(undefined);
149
- }
150
- else if (this.control.value?.value !== value)
151
- this.onChange({ value, regex: false });
152
- }));
153
- this.buildOptions();
154
- this.changeDetectorRef.detectChanges();
155
- }
156
- ngOnDestroy() {
157
- this.subsink.unsubscribe();
158
- }
159
- loadMore(intersect) {
160
- if (!intersect)
161
- return;
162
- this.nextPage$.next();
163
- }
164
- focus() {
165
- if (this.column.loadOnFocus && this.isEmptyValue(this.selectControl.value)) {
166
- const search = this.input.nativeElement.value;
167
- if (!search.length || this.filter$.value !== search)
168
- this.filter$.next(search);
169
- }
170
- }
171
- filter() {
172
- const search = this.input.nativeElement.value;
173
- this.filter$.next(search);
174
- }
175
- displayWith = (value) => {
176
- let val;
177
- if (!this.options)
178
- val = value;
179
- else
180
- val = this.options.find(o => o.value === value)?.name ?? value;
181
- return stripHtml(val);
182
- };
183
- getGlobalSearchValue() {
184
- if (!this.control.parent)
185
- return null;
186
- let parent = this.control.parent;
187
- while (parent.parent)
188
- parent = parent.parent;
189
- return parent.value;
190
- }
191
- buildOptions() {
192
- this.options = this.column.searchValue !== undefined ? (this.column.searchValueOptions ?? []) : [];
193
- this.subsink.add(this.filter$
194
- .pipe(filter(value => typeof value === 'string'), debounceTime(300), switchMap((search) => {
195
- this.auto.panel;
196
- this.options = [];
197
- this.groups = [];
198
- let skip = 0;
199
- 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(() => {
200
- this.hasMore = false;
201
- return of(null);
202
- }), finalize(() => {
203
- this.searching = false;
204
- this.changeDetectorRef.markForCheck();
205
- }))), filter((data) => Array.isArray(data)), map(data => {
206
- data.forEach(d => {
207
- this.options.push(d);
208
- const name = d.group ?? '';
209
- const group = this.groups.find(g => g.name === name);
210
- if (!group)
211
- this.groups.push({ name, options: [d] });
212
- else
213
- group.options.push(d);
214
- });
215
- skip += this.column.limit || 10;
216
- this.hasMore = data.length === (this.column.limit || 10);
217
- }));
218
- }))
219
- .subscribe());
220
- }
221
- isEmptyValue(value) {
222
- return value === null || value === undefined || value === '';
223
- }
224
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderAutocompleteFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
225
- 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: [
226
- {
227
- provide: NG_VALUE_ACCESSOR,
228
- multi: true,
229
- useExisting: forwardRef(() => HeaderAutocompleteFilterComponent),
230
- },
231
- ], 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 aria-label=\"Number\"\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 (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$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.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.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i5.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$1.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" }] });
232
- }
233
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderAutocompleteFilterComponent, decorators: [{
234
- type: Component,
235
- args: [{ selector: 'lib-header-autocomplete-filter', imports: [
236
- CommonModule,
237
- FormsModule,
238
- IntersectionObserverModule,
239
- MatAutocompleteModule,
240
- MatButtonModule,
241
- MatFormFieldModule,
242
- MatIconModule,
243
- MatInputModule,
244
- MatProgressBarModule,
245
- ReactiveFormsModule,
246
- SafeHtmlPipe,
247
- ], providers: [
248
- {
249
- provide: NG_VALUE_ACCESSOR,
250
- multi: true,
251
- useExisting: forwardRef(() => HeaderAutocompleteFilterComponent),
252
- },
253
- ], 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 aria-label=\"Number\"\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 (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"] }]
254
- }], propDecorators: { column: [{
255
- type: Input
256
- }], input: [{
257
- type: ViewChild,
258
- args: ['input']
259
- }], auto: [{
260
- type: ViewChild,
261
- args: [MatAutocomplete]
262
- }] } });
263
-
264
- /** @format */
265
- class HeaderCheckboxFilterComponent {
266
- column;
267
- control;
268
- selectControl = new FormControl();
269
- onChange = () => { };
270
- onTouched = () => { };
271
- injector = inject(Injector);
272
- changeDetectorRef = inject(ChangeDetectorRef);
273
- previousValue;
274
- subsink = new Subscription();
275
- writeValue(value) {
276
- const nextValue = value?.value;
277
- this.previousValue = nextValue;
278
- if (nextValue !== this.selectControl.value)
279
- this.selectControl.setValue(nextValue, { emitEvent: false });
280
- this.changeDetectorRef.markForCheck();
281
- }
282
- setDisabledState(isDisabled) {
283
- if (isDisabled)
284
- this.selectControl.disable({ emitEvent: false });
285
- else
286
- this.selectControl.enable({ emitEvent: false });
287
- }
288
- registerOnChange(onChange) {
289
- this.onChange = onChange;
290
- }
291
- registerOnTouched(onTouched) {
292
- this.onTouched = onTouched;
293
- }
294
- async ngAfterViewInit() {
295
- const ngControl = this.injector.get(NgControl, null);
296
- if (!ngControl)
297
- throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
298
- this.control = ngControl.control;
299
- this.previousValue = this.control.value?.value;
300
- this.subsink.add(this.selectControl.valueChanges
301
- .pipe(filter(value => {
302
- if (value === true && this.previousValue === false) {
303
- this.selectControl.setValue(undefined, { emitEvent: false });
304
- this.previousValue = undefined;
305
- this.onChange(undefined);
306
- return false;
307
- }
308
- return true;
309
- }), tap(value => (this.previousValue = value)))
310
- .subscribe((value) => {
311
- if (value === undefined)
312
- this.onChange(undefined);
313
- else
314
- this.onChange({ value, regex: false });
315
- }));
316
- this.changeDetectorRef.detectChanges();
317
- }
318
- ngOnDestroy() {
319
- this.subsink.unsubscribe();
320
- }
321
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderCheckboxFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
322
- 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: [
323
- {
324
- provide: NG_VALUE_ACCESSOR,
325
- multi: true,
326
- useExisting: forwardRef(() => HeaderCheckboxFilterComponent),
327
- },
328
- ], 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" }] });
329
- }
330
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderCheckboxFilterComponent, decorators: [{
331
- type: Component,
332
- args: [{ selector: 'lib-header-checkbox-filter', imports: [
333
- CommonModule,
334
- FormsModule,
335
- MatButtonModule,
336
- MatFormFieldModule,
337
- MatIconModule,
338
- MatCheckboxModule,
339
- ReactiveFormsModule,
340
- SafeHtmlPipe,
341
- ], providers: [
342
- {
343
- provide: NG_VALUE_ACCESSOR,
344
- multi: true,
345
- useExisting: forwardRef(() => HeaderCheckboxFilterComponent),
346
- },
347
- ], 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"] }]
348
- }], propDecorators: { column: [{
349
- type: Input
350
- }] } });
351
-
352
- /** @format */
353
- const OPERATORS = ['=', '>', '≥', '<', '≤', '<>', '≤≥'];
354
- class OperatorSelectComponent {
355
- set setDisableRange(disableRange) {
356
- this.disableRange = disableRange !== false;
357
- if (this.disableRange)
358
- this.operators = OPERATORS.slice(0, 5);
359
- else
360
- this.operators = OPERATORS;
361
- }
362
- disableRange = false;
363
- operators = OPERATORS;
364
- isOpen = false;
365
- control;
366
- onChange = () => { };
367
- onTouched = () => { };
368
- injector = inject(Injector);
369
- changeDetectorRef = inject(ChangeDetectorRef);
370
- writeValue = () => { };
371
- registerOnChange(onChange) {
372
- this.onChange = onChange;
373
- }
374
- registerOnTouched(onTouched) {
375
- this.onTouched = onTouched;
376
- }
377
- async ngAfterViewInit() {
378
- const ngControl = this.injector.get(NgControl, null);
379
- if (!ngControl)
380
- throw new Error(`${this.constructor.name} missing control`);
381
- this.control = ngControl.control;
382
- this.changeDetectorRef.detectChanges();
383
- }
384
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: OperatorSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
385
- 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: [
386
- {
387
- provide: NG_VALUE_ACCESSOR,
388
- multi: true,
389
- useExisting: forwardRef(() => OperatorSelectComponent),
390
- },
391
- ], 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: [
392
- trigger('fade', [
393
- transition(':enter', [
394
- style({ opacity: 0 }), // initial
395
- animate('0.2s', style({ opacity: 1 })), // final
396
- ]),
397
- transition(':leave', [
398
- style({ opacity: 1 }), // initial
399
- animate('0.2s', style({ opacity: 0 })), // final
400
- ]),
401
- ]),
402
- ] });
403
- }
404
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: OperatorSelectComponent, decorators: [{
405
- type: Component,
406
- args: [{ selector: 'lib-operator-select', imports: [CommonModule, OverlayModule, MatIconModule, MatButtonModule], animations: [
407
- trigger('fade', [
408
- transition(':enter', [
409
- style({ opacity: 0 }), // initial
410
- animate('0.2s', style({ opacity: 1 })), // final
411
- ]),
412
- transition(':leave', [
413
- style({ opacity: 1 }), // initial
414
- animate('0.2s', style({ opacity: 0 })), // final
415
- ]),
416
- ]),
417
- ], providers: [
418
- {
419
- provide: NG_VALUE_ACCESSOR,
420
- multi: true,
421
- useExisting: forwardRef(() => OperatorSelectComponent),
422
- },
423
- ], 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"] }]
424
- }], propDecorators: { setDisableRange: [{
425
- type: Input,
426
- args: ['disableRange']
427
- }] } });
428
-
429
- /** @format */
430
- class HeaderDateFilterComponent {
431
- column;
432
- control;
433
- selectControl = new FormControl(undefined);
434
- rangeGroup = new FormGroup({
435
- from: new FormControl(undefined, Validators.required),
436
- to: new FormControl(undefined, Validators.required),
437
- });
438
- operatorControl = new FormControl('=');
439
- onChange = () => { };
440
- onTouched = () => { };
441
- _adapter = inject(DateAdapter);
442
- _intl = inject(MatDatepickerIntl);
443
- _locale = signal(inject(MAT_DATE_LOCALE));
444
- injector = inject(Injector);
445
- changeDetectorRef = inject(ChangeDetectorRef);
446
- subsink = new Subscription();
447
- writeValue(value) {
448
- const operator = (value?.operator ?? '=');
449
- this.operatorControl.setValue(operator, { emitEvent: false });
450
- if (this.isRangeOperator(operator)) {
451
- this.selectControl.setValue(undefined, { emitEvent: false });
452
- this.rangeGroup.setValue({
453
- from: value?.value?.from ?? undefined,
454
- to: value?.value?.to ?? undefined,
455
- }, { emitEvent: false });
456
- }
457
- else {
458
- this.rangeGroup.reset({ from: undefined, to: undefined }, { emitEvent: false });
459
- this.selectControl.setValue(value?.value ?? undefined, { emitEvent: false });
460
- }
461
- this.changeDetectorRef.markForCheck();
462
- }
463
- setDisabledState(isDisabled) {
464
- const controls = [this.selectControl, this.rangeGroup, this.operatorControl];
465
- controls.forEach(control => {
466
- if (isDisabled)
467
- control.disable({ emitEvent: false });
468
- else
469
- control.enable({ emitEvent: false });
470
- });
471
- }
472
- registerOnChange(onChange) {
473
- this.onChange = onChange;
474
- }
475
- registerOnTouched(onTouched) {
476
- this.onTouched = onTouched;
477
- }
478
- ngOnInit() {
479
- if (this.column.locale) {
480
- this._locale.set(this.column.locale);
481
- this._adapter.setLocale(this._locale());
482
- this._intl.changes.next();
483
- }
484
- }
485
- async ngAfterViewInit() {
486
- const ngControl = this.injector.get(NgControl, null);
487
- if (!ngControl)
488
- throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
489
- this.control = ngControl.control;
490
- this.subsink.add(this.selectControl.valueChanges.pipe(debounceTime(500)).subscribe(value => {
491
- if (this.control.invalid)
492
- return;
493
- else if (this.isEmptyValue(value))
494
- this.onChange(undefined);
495
- else
496
- this.onChange(this.buildValue(this.operatorControl.value, value));
497
- }));
498
- this.subsink.add(this.rangeGroup.valueChanges.pipe(debounceTime(500)).subscribe(value => {
499
- if (!this.hasRangeValue(value))
500
- this.onChange(undefined);
501
- else if (this.rangeGroup.invalid)
502
- return;
503
- else
504
- this.onChange(this.buildValue(this.operatorControl.value, value));
505
- }));
506
- this.subsink.add(this.operatorControl.valueChanges.subscribe((value) => {
507
- if (this.isRangeOperator(value)) {
508
- if (!this.hasRangeValue(this.rangeGroup.value))
509
- this.onChange(undefined);
510
- else if (!this.rangeGroup.invalid)
511
- this.onChange(this.buildValue(value, this.rangeGroup.value));
512
- }
513
- else {
514
- if (this.isEmptyValue(this.selectControl.value))
515
- this.onChange(undefined);
516
- else
517
- this.onChange(this.buildValue(value, this.selectControl.value));
518
- }
519
- this.changeDetectorRef.markForCheck();
520
- }));
521
- this.changeDetectorRef.detectChanges();
522
- }
523
- ngOnDestroy() {
524
- this.subsink.unsubscribe();
525
- }
526
- clearRange() {
527
- this.rangeGroup.reset();
528
- this.onChange(undefined);
529
- this.onTouched();
530
- this.changeDetectorRef.markForCheck();
531
- }
532
- buildValue(operator, value) {
533
- switch (operator) {
534
- case '=':
535
- return {
536
- operator: '≤≥',
537
- value: { from: moment(value).startOf('day'), to: moment(value).endOf('day') },
538
- };
539
- case '>':
540
- return { operator, value: moment(value).endOf('day') };
541
- case '≥':
542
- return { operator, value: moment(value).startOf('day') };
543
- case '<':
544
- return { operator, value: moment(value).startOf('day') };
545
- case '≤':
546
- return { operator, value: moment(value).endOf('day') };
547
- case '<>':
548
- return { operator, value: { from: moment(value.from).endOf('day'), to: moment(value.to).startOf('day') } };
549
- case '≤≥':
550
- return { operator, value: { from: moment(value.from).startOf('day'), to: moment(value.to).endOf('day') } };
551
- }
552
- }
553
- hasRangeValue(value) {
554
- return !this.isEmptyValue(value?.from) || !this.isEmptyValue(value?.to);
555
- }
556
- isEmptyValue(value) {
557
- return value === null || value === undefined || value === '';
558
- }
559
- isRangeOperator(operator) {
560
- return operator === '<>' || operator === '≤≥';
561
- }
562
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderDateFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
563
- 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: [
564
- {
565
- provide: NG_VALUE_ACCESSOR,
566
- multi: true,
567
- useExisting: forwardRef(() => HeaderDateFilterComponent),
568
- },
569
- provideMomentDateAdapter(),
570
- ], 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 (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 (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$1.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$1.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 });
571
- }
572
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderDateFilterComponent, decorators: [{
573
- type: Component,
574
- args: [{ selector: 'lib-header-date-filter', imports: [
575
- CommonModule,
576
- FormsModule,
577
- MatButtonModule,
578
- MatDatepickerModule,
579
- MatFormFieldModule,
580
- MatIconModule,
581
- MatInputModule,
582
- ReactiveFormsModule,
583
- OperatorSelectComponent,
584
- SafeHtmlPipe,
585
- ], providers: [
586
- {
587
- provide: NG_VALUE_ACCESSOR,
588
- multi: true,
589
- useExisting: forwardRef(() => HeaderDateFilterComponent),
590
- },
591
- provideMomentDateAdapter(),
592
- ], 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 (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 (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"] }]
593
- }], propDecorators: { column: [{
594
- type: Input
595
- }] } });
596
-
597
- /** @format */
598
- const TIME_UNITS = ['second', 'minute', 'hour', 'day', 'month', 'year'];
599
- const MOMENT_RELATIVE_TIME_KEY = ['ss', 'mm', 'hh', 'dd', 'MM', 'yy'];
600
- class TimeUnitSelectComponent {
601
- static toMilliseconds(value, unit) {
602
- return moment.duration(value, unit).as('milliseconds');
603
- }
604
- static convert(value, from, to) {
605
- if (to === undefined)
606
- (to = from), (from = 'millisecond');
607
- return moment.duration(value, from).as(to);
608
- }
609
- set setLocale(locale) {
610
- this.locale = locale || moment.locale();
611
- this.loadUnitNames();
612
- }
613
- locale = moment.locale();
614
- units = TIME_UNITS;
615
- unitNames = {};
616
- isOpen = false;
617
- control;
618
- onChange = () => { };
619
- onTouched = () => { };
620
- injector = inject(Injector);
621
- changeDetectorRef = inject(ChangeDetectorRef);
622
- writeValue = () => { };
623
- registerOnChange(onChange) {
624
- this.onChange = onChange;
625
- }
626
- registerOnTouched(onTouched) {
627
- this.onTouched = onTouched;
628
- }
629
- ngOnInit() {
630
- this.loadUnitNames();
631
- }
632
- async ngAfterViewInit() {
633
- const ngControl = this.injector.get(NgControl, null);
634
- if (!ngControl)
635
- throw new Error(`${this.constructor.name} missing control`);
636
- this.control = ngControl.control;
637
- this.changeDetectorRef.detectChanges();
638
- }
639
- loadUnitNames() {
640
- this.unitNames = this.units.reduce((pv, cv, i) => ((pv[cv] = moment
641
- .localeData(this.locale)
642
- .relativeTime('', true, MOMENT_RELATIVE_TIME_KEY[i], false)
643
- .trim()),
644
- pv), {});
645
- }
646
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: TimeUnitSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
647
- 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: [
648
- {
649
- provide: NG_VALUE_ACCESSOR,
650
- multi: true,
651
- useExisting: forwardRef(() => TimeUnitSelectComponent),
652
- },
653
- ], 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: [
654
- trigger('fade', [
655
- transition(':enter', [
656
- style({ opacity: 0 }), // initial
657
- animate('0.2s', style({ opacity: 1 })), // final
658
- ]),
659
- transition(':leave', [
660
- style({ opacity: 1 }), // initial
661
- animate('0.2s', style({ opacity: 0 })), // final
662
- ]),
663
- ]),
664
- ] });
665
- }
666
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: TimeUnitSelectComponent, decorators: [{
667
- type: Component,
668
- args: [{ selector: 'lib-time-unit-select', imports: [CommonModule, OverlayModule, MatIconModule, MatButtonModule], animations: [
669
- trigger('fade', [
670
- transition(':enter', [
671
- style({ opacity: 0 }), // initial
672
- animate('0.2s', style({ opacity: 1 })), // final
673
- ]),
674
- transition(':leave', [
675
- style({ opacity: 1 }), // initial
676
- animate('0.2s', style({ opacity: 0 })), // final
677
- ]),
678
- ]),
679
- ], providers: [
680
- {
681
- provide: NG_VALUE_ACCESSOR,
682
- multi: true,
683
- useExisting: forwardRef(() => TimeUnitSelectComponent),
684
- },
685
- ], 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"] }]
686
- }], propDecorators: { setLocale: [{
687
- type: Input,
688
- args: ['locale']
689
- }] } });
690
-
691
- /** @format */
692
- class HeaderDurationFilterComponent {
693
- column;
694
- control;
695
- selectControl = new FormControl(undefined);
696
- rangeGroup = new FormGroup({
697
- start: new FormControl(undefined, Validators.required),
698
- end: new FormControl(undefined, Validators.required),
699
- });
700
- operatorControl = new FormControl('=');
701
- timeUnitControl = new FormControl('second');
702
- onChange = () => { };
703
- onTouched = () => { };
704
- injector = inject(Injector);
705
- changeDetectorRef = inject(ChangeDetectorRef);
706
- subsink = new Subscription();
707
- writeValue(value) {
708
- if (value?.unitOfTime)
709
- this.timeUnitControl.setValue(value.unitOfTime, { emitEvent: false });
710
- if (value?.operator)
711
- this.operatorControl.setValue(value.operator, { emitEvent: false });
712
- if (value?.value !== null && value?.value !== undefined) {
713
- let selectValue = TimeUnitSelectComponent.convert(value.value, this.timeUnitControl.value);
714
- if (this.selectControl.value !== selectValue)
715
- this.selectControl.setValue(selectValue, { emitEvent: false });
716
- }
717
- else
718
- this.selectControl.setValue(null, { emitEvent: false });
719
- this.changeDetectorRef.markForCheck();
720
- }
721
- setDisabledState(isDisabled) {
722
- const controls = [this.selectControl, this.operatorControl, this.timeUnitControl];
723
- controls.forEach(control => {
724
- if (isDisabled)
725
- control.disable({ emitEvent: false });
726
- else
727
- control.enable({ emitEvent: false });
728
- });
729
- }
730
- registerOnChange(onChange) {
731
- this.onChange = onChange;
732
- }
733
- registerOnTouched(onTouched) {
734
- this.onTouched = onTouched;
735
- }
736
- ngOnInit() { }
737
- async ngAfterViewInit() {
738
- const ngControl = this.injector.get(NgControl, null);
739
- if (!ngControl)
740
- throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
741
- this.control = ngControl.control;
742
- this.subsink.add(this.selectControl.valueChanges.pipe(debounceTime(500)).subscribe(value => {
743
- if (this.control.invalid)
744
- return;
745
- else if (this.isEmptyValue(value))
746
- this.onChange(undefined);
747
- else {
748
- const unitOfTimeValue = value;
749
- this.onChange({
750
- unitOfTimeValue,
751
- value: TimeUnitSelectComponent.toMilliseconds(unitOfTimeValue, this.timeUnitControl.value),
752
- regex: false,
753
- operator: this.operatorControl.value,
754
- unitOfTime: this.timeUnitControl.value,
755
- });
756
- }
757
- }));
758
- this.subsink.add(this.operatorControl.valueChanges.subscribe((value) => {
759
- if (this.isEmptyValue(this.selectControl.value))
760
- return;
761
- const unitOfTimeValue = this.selectControl.value;
762
- this.onChange({
763
- unitOfTimeValue,
764
- value: TimeUnitSelectComponent.toMilliseconds(unitOfTimeValue, this.timeUnitControl.value),
765
- regex: false,
766
- operator: value,
767
- unitOfTime: this.timeUnitControl.value,
768
- });
769
- }));
770
- this.subsink.add(this.timeUnitControl.valueChanges.subscribe((value) => {
771
- if (this.isEmptyValue(this.selectControl.value) || !this.control.value?.unitOfTime)
772
- return;
773
- const unitOfTimeValue = TimeUnitSelectComponent.convert(this.selectControl.value, this.control.value.unitOfTime, value);
774
- this.selectControl.setValue(unitOfTimeValue, { emitEvent: false });
775
- this.onChange({
776
- unitOfTimeValue,
777
- value: TimeUnitSelectComponent.toMilliseconds(unitOfTimeValue, value),
778
- regex: false,
779
- operator: this.operatorControl.value,
780
- unitOfTime: value,
781
- });
782
- }));
783
- this.changeDetectorRef.detectChanges();
784
- }
785
- ngOnDestroy() {
786
- this.subsink.unsubscribe();
787
- }
788
- isEmptyValue(value) {
789
- return value === null || value === undefined || value === '';
790
- }
791
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderDurationFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
792
- 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: [
793
- {
794
- provide: NG_VALUE_ACCESSOR,
795
- multi: true,
796
- useExisting: forwardRef(() => HeaderDurationFilterComponent),
797
- },
798
- ], 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 (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$1.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$1.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" }] });
799
- }
800
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderDurationFilterComponent, decorators: [{
801
- type: Component,
802
- args: [{ selector: 'lib-header-duration-filter', imports: [
803
- CommonModule,
804
- FormsModule,
805
- MatButtonModule,
806
- MatFormFieldModule,
807
- MatIconModule,
808
- MatInputModule,
809
- ReactiveFormsModule,
810
- OperatorSelectComponent,
811
- TimeUnitSelectComponent,
812
- SafeHtmlPipe,
813
- ], providers: [
814
- {
815
- provide: NG_VALUE_ACCESSOR,
816
- multi: true,
817
- useExisting: forwardRef(() => HeaderDurationFilterComponent),
818
- },
819
- ], 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 (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"] }]
820
- }], propDecorators: { column: [{
821
- type: Input
822
- }] } });
823
-
824
- /** @format */
825
- class HeaderNumberFilterComponent {
826
- column;
827
- control;
828
- selectControl = new FormControl();
829
- operatorControl = new FormControl('=');
830
- onChange = () => { };
831
- onTouched = () => { };
832
- injector = inject(Injector);
833
- changeDetectorRef = inject(ChangeDetectorRef);
834
- subsink = new Subscription();
835
- writeValue(value) {
836
- if (value?.operator && value.operator !== this.operatorControl.value) {
837
- this.operatorControl.setValue(value.operator, { emitEvent: false });
838
- }
839
- if (value?.value !== this.selectControl.value)
840
- this.selectControl.setValue(value?.value, { emitEvent: false });
841
- this.changeDetectorRef.markForCheck();
842
- }
843
- setDisabledState(isDisabled) {
844
- if (isDisabled) {
845
- this.selectControl.disable({ emitEvent: false });
846
- this.operatorControl.disable({ emitEvent: false });
847
- }
848
- else {
849
- this.selectControl.enable({ emitEvent: false });
850
- this.operatorControl.enable({ emitEvent: false });
851
- }
852
- }
853
- registerOnChange(onChange) {
854
- this.onChange = onChange;
855
- }
856
- registerOnTouched(onTouched) {
857
- this.onTouched = onTouched;
858
- }
859
- async ngAfterViewInit() {
860
- const ngControl = this.injector.get(NgControl, null);
861
- if (!ngControl)
862
- throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
863
- this.control = ngControl.control;
864
- this.subsink.add(this.selectControl.valueChanges.subscribe((value) => {
865
- if (this.control.invalid)
866
- return;
867
- else if (this.isEmptyValue(value))
868
- this.onChange(undefined);
869
- else
870
- this.onChange({ value, regex: false, operator: this.operatorControl.value });
871
- }));
872
- this.subsink.add(this.operatorControl.valueChanges.subscribe((value) => {
873
- if (this.isEmptyValue(this.selectControl.value))
874
- return;
875
- this.onChange({ value: this.selectControl.value, regex: false, operator: value });
876
- }));
877
- this.changeDetectorRef.detectChanges();
878
- }
879
- ngOnDestroy() {
880
- this.subsink.unsubscribe();
881
- }
882
- isEmptyValue(value) {
883
- return value === null || value === undefined || value === '';
884
- }
885
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderNumberFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
886
- 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: [
887
- {
888
- provide: NG_VALUE_ACCESSOR,
889
- multi: true,
890
- useExisting: forwardRef(() => HeaderNumberFilterComponent),
891
- },
892
- ], 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 (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$1.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$1.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" }] });
893
- }
894
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderNumberFilterComponent, decorators: [{
895
- type: Component,
896
- args: [{ selector: 'lib-header-number-filter', imports: [
897
- CommonModule,
898
- FormsModule,
899
- MatButtonModule,
900
- MatFormFieldModule,
901
- MatIconModule,
902
- MatInputModule,
903
- MatMenuModule,
904
- ReactiveFormsModule,
905
- OperatorSelectComponent,
906
- SafeHtmlPipe,
907
- ], providers: [
908
- {
909
- provide: NG_VALUE_ACCESSOR,
910
- multi: true,
911
- useExisting: forwardRef(() => HeaderNumberFilterComponent),
912
- },
913
- ], 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 (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"] }]
914
- }], propDecorators: { column: [{
915
- type: Input
916
- }] } });
917
-
918
- /** @format */
919
- class IsArrayPipe {
920
- transform(obj) {
921
- return Array.isArray(obj);
922
- }
923
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: IsArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
924
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: IsArrayPipe, isStandalone: true, name: "isArray" });
925
- }
926
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: IsArrayPipe, decorators: [{
927
- type: Pipe,
928
- args: [{ name: 'isArray' }]
929
- }] });
930
-
931
- /** @format */
932
- class SelectOptionPipe {
933
- transform(value, options) {
934
- if (!options)
935
- return null;
936
- return options.find((option) => option.value === value) || null;
937
- }
938
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SelectOptionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
939
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: SelectOptionPipe, isStandalone: true, name: "selectOption" });
940
- }
941
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SelectOptionPipe, decorators: [{
942
- type: Pipe,
943
- args: [{ name: 'selectOption' }]
944
- }] });
945
-
946
- /** @format */
947
- class HeaderSelectFilterComponent {
948
- column;
949
- options = [];
950
- groups = [];
951
- control;
952
- selectControl = new FormControl();
953
- onChange = () => { };
954
- onTouched = () => { };
955
- injector = inject(Injector);
956
- changeDetectorRef = inject(ChangeDetectorRef);
957
- subsink = new Subscription();
958
- writeValue(controlValue) {
959
- if (controlValue?.value !== this.selectControl.value) {
960
- const value = controlValue?.value;
961
- if (!this.isEmptyValue(value) && !Array.isArray(value) && this.column.multiple) {
962
- this.selectControl.setValue([value], { emitEvent: false });
963
- }
964
- else
965
- this.selectControl.setValue(value, { emitEvent: false });
966
- }
967
- this.changeDetectorRef.markForCheck();
968
- }
969
- setDisabledState(isDisabled) {
970
- if (isDisabled)
971
- this.selectControl.disable({ emitEvent: false });
972
- else
973
- this.selectControl.enable({ emitEvent: false });
974
- }
975
- registerOnChange(onChange) {
976
- this.onChange = onChange;
977
- }
978
- registerOnTouched(onTouched) {
979
- this.onTouched = onTouched;
980
- }
981
- async ngAfterViewInit() {
982
- const ngControl = this.injector.get(NgControl, null);
983
- if (!ngControl)
984
- throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
985
- this.control = ngControl.control;
986
- this.subsink.add(this.selectControl.valueChanges.subscribe((value) => {
987
- if (this.isEmptyValue(value))
988
- this.onChange(undefined);
989
- else
990
- this.onChange({ value, operator: this.column.multiple ? '$in' : undefined, regex: false });
991
- }));
992
- if (Array.isArray(this.column.options))
993
- this.buildOptions(this.column.options);
994
- else
995
- this.subsink.add(this.column.options.subscribe(data => {
996
- this.options = [];
997
- this.groups = [];
998
- this.buildOptions(data);
999
- }));
1000
- this.changeDetectorRef.detectChanges();
1001
- }
1002
- ngOnDestroy() {
1003
- this.subsink.unsubscribe();
1004
- }
1005
- buildOptions(data) {
1006
- data.forEach(d => {
1007
- this.options.push(d);
1008
- const name = d.group ?? '';
1009
- const group = this.groups.find(g => g.name === name);
1010
- if (!group)
1011
- this.groups.push({ name, options: [d] });
1012
- else
1013
- group.options.push(d);
1014
- });
1015
- }
1016
- isEmptyValue(value) {
1017
- return value === null || value === undefined || value === '' || (Array.isArray(value) && !value.length);
1018
- }
1019
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderSelectFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1020
- 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: [
1021
- {
1022
- provide: NG_VALUE_ACCESSOR,
1023
- multi: true,
1024
- useExisting: forwardRef(() => HeaderSelectFilterComponent),
1025
- },
1026
- ], 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 (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$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.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$1.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.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i5.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" }] });
1027
- }
1028
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderSelectFilterComponent, decorators: [{
1029
- type: Component,
1030
- args: [{ selector: 'lib-header-select-filter', imports: [
1031
- CommonModule,
1032
- FormsModule,
1033
- MatButtonModule,
1034
- MatFormFieldModule,
1035
- MatIconModule,
1036
- MatSelectModule,
1037
- ReactiveFormsModule,
1038
- SelectOptionPipe,
1039
- SafeHtmlPipe,
1040
- IsArrayPipe,
1041
- ], providers: [
1042
- {
1043
- provide: NG_VALUE_ACCESSOR,
1044
- multi: true,
1045
- useExisting: forwardRef(() => HeaderSelectFilterComponent),
1046
- },
1047
- ], 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 (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"] }]
1048
- }], propDecorators: { column: [{
1049
- type: Input
1050
- }] } });
1051
-
1052
- /** @format */
1053
- class HeaderTextFilterComponent {
1054
- column;
1055
- control;
1056
- selectControl = new FormControl();
1057
- onChange = () => { };
1058
- onTouched = () => { };
1059
- injector = inject(Injector);
1060
- changeDetectorRef = inject(ChangeDetectorRef);
1061
- subsink = new Subscription();
1062
- writeValue(value) {
1063
- const nextValue = value?.value ?? '';
1064
- if (nextValue !== this.selectControl.value)
1065
- this.selectControl.setValue(nextValue, { emitEvent: false });
1066
- this.changeDetectorRef.markForCheck();
1067
- }
1068
- setDisabledState(isDisabled) {
1069
- if (isDisabled)
1070
- this.selectControl.disable({ emitEvent: false });
1071
- else
1072
- this.selectControl.enable({ emitEvent: false });
1073
- }
1074
- registerOnChange(onChange) {
1075
- this.onChange = onChange;
1076
- }
1077
- registerOnTouched(onTouched) {
1078
- this.onTouched = onTouched;
1079
- }
1080
- async ngAfterViewInit() {
1081
- const ngControl = this.injector.get(NgControl, null);
1082
- if (!ngControl)
1083
- throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
1084
- this.control = ngControl.control;
1085
- this.subsink.add(this.selectControl.valueChanges.subscribe((value) => {
1086
- if (this.isEmptyValue(value))
1087
- this.onChange(undefined);
1088
- else {
1089
- if (this.column.regex)
1090
- this.onChange({ value, regex: true });
1091
- else
1092
- this.onChange({ value: this.escapeRegExp(value), regex: true });
1093
- }
1094
- }));
1095
- this.changeDetectorRef.detectChanges();
1096
- }
1097
- ngOnDestroy() {
1098
- this.subsink.unsubscribe();
1099
- }
1100
- escapeRegExp(value) {
1101
- if (!value)
1102
- return '';
1103
- return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
1104
- }
1105
- isEmptyValue(value) {
1106
- return value === null || value === undefined || value === '';
1107
- }
1108
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderTextFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1109
- 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: [
1110
- {
1111
- provide: NG_VALUE_ACCESSOR,
1112
- multi: true,
1113
- useExisting: forwardRef(() => HeaderTextFilterComponent),
1114
- },
1115
- ], 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 (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$1.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$1.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" }] });
1116
- }
1117
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderTextFilterComponent, decorators: [{
1118
- type: Component,
1119
- args: [{ selector: 'lib-header-text-filter', imports: [
1120
- CommonModule,
1121
- FormsModule,
1122
- MatButtonModule,
1123
- MatFormFieldModule,
1124
- MatIconModule,
1125
- MatInputModule,
1126
- ReactiveFormsModule,
1127
- SafeHtmlPipe,
1128
- ], providers: [
1129
- {
1130
- provide: NG_VALUE_ACCESSOR,
1131
- multi: true,
1132
- useExisting: forwardRef(() => HeaderTextFilterComponent),
1133
- },
1134
- ], 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 (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"] }]
1135
- }], propDecorators: { column: [{
1136
- type: Input
1137
- }] } });
1138
-
1139
- /** @format */
1140
- const DEFAULT_LABELS = {
1141
- noDateLabel: 'No data',
1142
- itemsPerPageLabel: `Items per page:`,
1143
- nextPageLabel: `Next page`,
1144
- lastPageLabel: `Last page`,
1145
- previousPageLabel: `Previous page`,
1146
- firstPageLabel: `First page`,
1147
- onLabel: `on`,
1148
- incrementalLoadingLabel: 'Loading...',
1149
- incrementalLoadMoreLabel: 'Load more',
1150
- };
1151
- const LABELS = {
1152
- fr: {
1153
- noDateLabel: 'Aucune donnée',
1154
- itemsPerPageLabel: `Éléments par page :`,
1155
- nextPageLabel: `Page suivante`,
1156
- lastPageLabel: `Dernière page`,
1157
- previousPageLabel: `Page précédente`,
1158
- firstPageLabel: `Première page`,
1159
- onLabel: `sur`,
1160
- incrementalLoadingLabel: 'Chargement...',
1161
- incrementalLoadMoreLabel: 'Charger plus',
1162
- },
1163
- };
1164
- const DEFAULT_NUMBER_OPTIONS = {
1165
- separator: ',',
1166
- decimal: '.',
1167
- duration: 0.3,
1168
- useEasing: false,
1169
- };
1170
- const NUMBER_OPTIONS = {
1171
- fr: {
1172
- separator: ' ',
1173
- decimal: ',',
1174
- },
1175
- };
1176
- class NgxMatDatatableIntl {
1177
- locale = inject(LOCALE_ID);
1178
- noDateLabel;
1179
- itemsPerPageLabel;
1180
- nextPageLabel;
1181
- lastPageLabel;
1182
- previousPageLabel;
1183
- firstPageLabel;
1184
- onLabel;
1185
- incrementalLoadingLabel;
1186
- incrementalLoadMoreLabel;
1187
- numberOptions;
1188
- getRangeLabel = (page, pageSize, length) => {
1189
- if (length === 0 || pageSize === 0)
1190
- return `0 ${this.onLabel} ${length}`;
1191
- length = Math.max(length, 0);
1192
- const startIndex = page * pageSize;
1193
- const endIndex = startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize;
1194
- return `${startIndex + 1} - ${endIndex} ${this.onLabel} ${length}`;
1195
- };
1196
- constructor() {
1197
- const locale = this.locale.toLowerCase().split(/[-_]/)[0];
1198
- this.setLabels(LABELS[locale] ?? DEFAULT_LABELS);
1199
- this.numberOptions = NUMBER_OPTIONS[locale] ?? DEFAULT_NUMBER_OPTIONS;
1200
- }
1201
- setLabels(labels) {
1202
- this.noDateLabel = labels.noDateLabel;
1203
- this.itemsPerPageLabel = labels.itemsPerPageLabel;
1204
- this.nextPageLabel = labels.nextPageLabel;
1205
- this.lastPageLabel = labels.lastPageLabel;
1206
- this.previousPageLabel = labels.previousPageLabel;
1207
- this.firstPageLabel = labels.firstPageLabel;
1208
- this.onLabel = labels.onLabel;
1209
- this.incrementalLoadingLabel = labels.incrementalLoadingLabel;
1210
- this.incrementalLoadMoreLabel = labels.incrementalLoadMoreLabel;
1211
- }
1212
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1213
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableIntl, providedIn: 'root' });
1214
- }
1215
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableIntl, decorators: [{
1216
- type: Injectable,
1217
- args: [{ providedIn: 'root' }]
1218
- }], ctorParameters: () => [] });
1219
-
1220
- /** @format */
1221
- class MergePipe {
1222
- transform(obj, src) {
1223
- return src ? { ...obj, ...src } : { ...obj };
1224
- }
1225
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: MergePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1226
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: MergePipe, isStandalone: true, name: "merge" });
1227
- }
1228
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: MergePipe, decorators: [{
1229
- type: Pipe,
1230
- args: [{ name: 'merge' }]
1231
- }] });
1232
-
1233
- /** @format */
1234
- class ProgressSpinnerComponent {
1235
- datatableIntl = inject(NgxMatDatatableIntl);
1236
- diameter = 100;
1237
- set setValue(value) {
1238
- if (typeof value === 'string')
1239
- this._value = parseFloat(value);
1240
- else
1241
- this._value = value;
1242
- if (this.animateInView)
1243
- this.load(this.isInView);
1244
- }
1245
- _value = 0;
1246
- value = 0;
1247
- color;
1248
- set setDisplayValue(displayValue) {
1249
- this.displayValue = displayValue !== false;
1250
- }
1251
- displayValue = true;
1252
- get getColor() {
1253
- return this.color;
1254
- }
1255
- fontSize = `${this.diameter / 5}px`;
1256
- set setAnimateInView(animateInView) {
1257
- this.animateInView = animateInView !== false;
1258
- }
1259
- animateInView = true;
1260
- set setDelay(delay) {
1261
- if (typeof delay === 'string')
1262
- this.delay = parseInt(delay);
1263
- else
1264
- this.delay = delay;
1265
- }
1266
- delay;
1267
- isInView = false;
1268
- load(intersect) {
1269
- this.isInView = intersect;
1270
- if (this.isInView) {
1271
- if (this.delay)
1272
- setTimeout(() => (this.value = this._value), this.delay);
1273
- else
1274
- this.value = this._value;
1275
- }
1276
- }
1277
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: ProgressSpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1278
- 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" }] });
1279
- }
1280
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: ProgressSpinnerComponent, decorators: [{
1281
- type: Component,
1282
- 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"] }]
1283
- }], propDecorators: { diameter: [{
1284
- type: Input
1285
- }], setValue: [{
1286
- type: Input,
1287
- args: ['value']
1288
- }], color: [{
1289
- type: Input
1290
- }], setDisplayValue: [{
1291
- type: Input,
1292
- args: ['displayValue']
1293
- }], getColor: [{
1294
- type: HostBinding,
1295
- args: ['style.--progress-spinner-color']
1296
- }], fontSize: [{
1297
- type: Input
1298
- }], setAnimateInView: [{
1299
- type: Input,
1300
- args: ['animateInView']
1301
- }], setDelay: [{
1302
- type: Input,
1303
- args: ['delay']
1304
- }] } });
1305
-
1306
- /** @format */
1307
- class DatagridDataSource extends DataSource {
1308
- service;
1309
- loading$ = new BehaviorSubject(true);
1310
- data = [];
1311
- recordsFiltered = 0;
1312
- recordsTotal;
1313
- facets;
1314
- rowSize = 0; // row size in kb
1315
- options;
1316
- latestRequestId = 0;
1317
- disconnected = false;
1318
- dataStream = new BehaviorSubject([]);
1319
- constructor(service) {
1320
- super();
1321
- this.service = service;
1322
- }
1323
- connect() {
1324
- return this.dataStream;
1325
- }
1326
- disconnect() {
1327
- this.disconnected = true;
1328
- this.latestRequestId++;
1329
- this.loading$.complete();
1330
- this.dataStream.complete();
1331
- }
1332
- async loadData(options, append = false) {
1333
- if (this.disconnected)
1334
- return;
1335
- const requestId = ++this.latestRequestId;
1336
- this.options = options;
1337
- if (!append)
1338
- this.loading$.next(true);
1339
- try {
1340
- const result = await this.service(options);
1341
- if (this.disconnected || requestId !== this.latestRequestId || options.draw !== result.draw)
1342
- return;
1343
- this.recordsTotal = result.recordsTotal;
1344
- this.recordsFiltered = result.recordsFiltered;
1345
- this.facets = result.facets;
1346
- this.setData(result.data, append);
1347
- this.calculateRowSize(this.data);
1348
- }
1349
- finally {
1350
- if (!append && !this.disconnected && requestId === this.latestRequestId)
1351
- this.loading$.next(false);
1352
- }
1353
- }
1354
- refresh() {
1355
- if (this.options)
1356
- void this.loadData(this.options);
1357
- }
1358
- redraw(match) {
1359
- const data = [];
1360
- this.data.forEach((d) => {
1361
- if (match) {
1362
- if (match(d))
1363
- data.push({ ...d });
1364
- else
1365
- data.push(d);
1366
- }
1367
- else
1368
- data.push({ ...d });
1369
- });
1370
- this.setData(data, false);
1371
- }
1372
- setData(data, append) {
1373
- this.data = append ? [...this.data, ...data] : data;
1374
- this.dataStream.next(this.data);
1375
- }
1376
- calculateRowSize(data) {
1377
- let total = 0;
1378
- for (let row of data) {
1379
- const size = new TextEncoder().encode(JSON.stringify(row)).length;
1380
- const kiloBytes = size / 1024;
1381
- total += kiloBytes / 1024;
1382
- }
1383
- this.rowSize = total && data.length ? total / data.length : 0;
1384
- }
1385
- }
1386
-
1387
- /** @format */
1388
- const NGX_MAT_DATATABLE_DEFAULT_OPTIONS = new InjectionToken('NGX_MAT_DATATABLE_DEFAULT_OPTIONS', {
1389
- providedIn: 'root',
1390
- factory: () => ({
1391
- loadMode: 'pagination',
1392
- showRecordsCount: true,
1393
- pageSizeOptions: [20, 50, 100],
1394
- pageSizeOptionsIndex: 1,
1395
- incremental: {
1396
- trigger: 'inView',
1397
- },
1398
- }),
1399
- });
1400
- function provideNgxMatDatatableDefaultOptions(options) {
1401
- return {
1402
- provide: NGX_MAT_DATATABLE_DEFAULT_OPTIONS,
1403
- useValue: options,
1404
- };
1405
- }
1406
-
1407
- /** @format */
1408
- class NgxMatDatatableContentDirective {
1409
- templateRef;
1410
- id;
1411
- constructor(templateRef) {
1412
- this.templateRef = templateRef;
1413
- }
1414
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableContentDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
1415
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.4", type: NgxMatDatatableContentDirective, isStandalone: true, selector: "[ngxMatDatatableContent]", inputs: { id: ["ngxMatDatatableContent", "id"] }, ngImport: i0 });
1416
- }
1417
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableContentDirective, decorators: [{
1418
- type: Directive,
1419
- args: [{
1420
- selector: '[ngxMatDatatableContent]',
1421
- }]
1422
- }], ctorParameters: () => [{ type: i0.TemplateRef }], propDecorators: { id: [{
1423
- type: Input,
1424
- args: ['ngxMatDatatableContent']
1425
- }] } });
1426
-
1427
- /** @format */
1428
- class BackgroundColorPipe {
1429
- transform(row, column, options) {
1430
- if (typeof column.backgroundColor === 'string')
1431
- return column.backgroundColor;
1432
- if (typeof column.backgroundColor === 'function')
1433
- return column.backgroundColor(row);
1434
- if (typeof options.rowBackgroundColor === 'string')
1435
- return options.rowBackgroundColor;
1436
- if (typeof options.rowBackgroundColor === 'function')
1437
- return options.rowBackgroundColor(column, row);
1438
- }
1439
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: BackgroundColorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1440
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: BackgroundColorPipe, isStandalone: true, name: "backgroundColor" });
1441
- }
1442
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: BackgroundColorPipe, decorators: [{
1443
- type: Pipe,
1444
- args: [{ name: 'backgroundColor' }]
1445
- }] });
1446
-
1447
- /** @format */
1448
- class CellColorPipe {
1449
- transform(row, column, options) {
1450
- if (typeof column.color === 'string')
1451
- return column.color;
1452
- if (typeof column.color === 'function')
1453
- return column.color(row);
1454
- if (typeof options.rowColor === 'string')
1455
- return options.rowColor;
1456
- if (typeof options.rowColor === 'function')
1457
- return options.rowColor(column, row);
1458
- }
1459
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellColorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1460
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: CellColorPipe, isStandalone: true, name: "cellColor" });
1461
- }
1462
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellColorPipe, decorators: [{
1463
- type: Pipe,
1464
- args: [{ name: 'cellColor' }]
1465
- }] });
1466
-
1467
- /** @format */
1468
- class CellOpacityPipe {
1469
- transform(row, column, options) {
1470
- if (typeof options.rowOpacity === 'number')
1471
- return options.rowOpacity;
1472
- if (typeof options.rowOpacity === 'function')
1473
- return options.rowOpacity(column, row);
1474
- }
1475
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellOpacityPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1476
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: CellOpacityPipe, isStandalone: true, name: "cellOpacity" });
1477
- }
1478
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellOpacityPipe, decorators: [{
1479
- type: Pipe,
1480
- args: [{ name: 'cellOpacity' }]
1481
- }] });
1482
-
1483
- /** @format */
1484
- class FilterPipe {
1485
- transform(obj, filter) {
1486
- return (obj ?? []).filter(o => {
1487
- for (let key of Object.keys(filter)) {
1488
- if (o[key] !== filter[key])
1489
- return false;
1490
- }
1491
- return true;
1492
- });
1493
- }
1494
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FilterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1495
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: FilterPipe, isStandalone: true, name: "filter" });
1496
- }
1497
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FilterPipe, decorators: [{
1498
- type: Pipe,
1499
- args: [{ name: 'filter' }]
1500
- }] });
1501
-
1502
- /** @format */
1503
- class FindContentPipe {
1504
- transform(contentRefs, id) {
1505
- return contentRefs?.find(ref => ref.id === id);
1506
- }
1507
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FindContentPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1508
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: FindContentPipe, isStandalone: true, name: "findContent" });
1509
- }
1510
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FindContentPipe, decorators: [{
1511
- type: Pipe,
1512
- args: [{ name: 'findContent' }]
1513
- }] });
1514
-
1515
- /** @format */
1516
- class FindPipe {
1517
- transform(obj, filter) {
1518
- return (obj ?? []).find(o => {
1519
- for (let key of Object.keys(filter)) {
1520
- if (o[key] !== filter[key])
1521
- return false;
1522
- }
1523
- return true;
1524
- });
1525
- }
1526
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FindPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1527
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: FindPipe, isStandalone: true, name: "find" });
1528
- }
1529
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FindPipe, decorators: [{
1530
- type: Pipe,
1531
- args: [{ name: 'find' }]
1532
- }] });
1533
-
1534
- /** @format */
1535
- class IncludedInPipe {
1536
- transform(elmt, obj) {
1537
- return (obj ?? []).includes(elmt);
1538
- }
1539
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: IncludedInPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1540
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: IncludedInPipe, isStandalone: true, name: "includedIn" });
1541
- }
1542
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: IncludedInPipe, decorators: [{
1543
- type: Pipe,
1544
- args: [{ name: 'includedIn' }]
1545
- }] });
1546
-
1547
- /** @format */
1548
- class OrderByPipe {
1549
- transform(data, keys, dirs) {
1550
- return lodash.orderBy(data, typeof keys === 'string' ? [keys] : keys, typeof dirs === 'string' ? [dirs] : dirs);
1551
- }
1552
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: OrderByPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1553
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: OrderByPipe, isStandalone: true, name: "orderBy" });
1554
- }
1555
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: OrderByPipe, decorators: [{
1556
- type: Pipe,
1557
- args: [{
1558
- name: 'orderBy',
1559
- }]
1560
- }] });
1561
-
1562
- /** @format */
1563
- class SortFacetEntriesPipe {
1564
- transform(entries, options) {
1565
- if (!entries || !options)
1566
- return entries;
1567
- return [...entries].sort((e1, e2) => {
1568
- const ie1 = options.findIndex(o => o.value === e1._id);
1569
- if (ie1 === -1)
1570
- return 1;
1571
- const ie2 = options.findIndex(o => o.value === e2._id);
1572
- if (ie2 === -1)
1573
- return -1;
1574
- return ie1 - ie2;
1575
- });
1576
- }
1577
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SortFacetEntriesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1578
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: SortFacetEntriesPipe, isStandalone: true, name: "sortFacetEntries" });
1579
- }
1580
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SortFacetEntriesPipe, decorators: [{
1581
- type: Pipe,
1582
- args: [{ name: 'sortFacetEntries' }]
1583
- }] });
1584
-
1585
- /** @format */
1586
- class SumPipe {
1587
- transform(obj, by) {
1588
- if (!obj || !obj.length)
1589
- return 0;
1590
- if (by)
1591
- return obj.reduce((pv, cv) => (pv += cv[by]), 0);
1592
- return obj.reduce((pv, cv) => (pv += cv), 0);
1593
- }
1594
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SumPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1595
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: SumPipe, isStandalone: true, name: "sum" });
1596
- }
1597
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SumPipe, decorators: [{
1598
- type: Pipe,
1599
- args: [{ name: 'sum' }]
1600
- }] });
1601
-
1602
- /** @format */
1603
- function buildDatasourceRequestColumns(options, searchValues) {
1604
- const columns = [];
1605
- const additionalColumns = [];
1606
- options.additionalProperties?.forEach(property => addAdditionalColumn(additionalColumns, property));
1607
- options.columns.forEach(columnOptions => {
1608
- if (columnOptions.hidden)
1609
- return;
1610
- const column = {
1611
- data: columnOptions.property,
1612
- projection: columnOptions.projection,
1613
- name: columnOptions.columnDef,
1614
- searchable: columnOptions.searchable,
1615
- };
1616
- if (columnOptions.sortProperty && columnOptions.order) {
1617
- addAdditionalColumn(additionalColumns, columnOptions.sortProperty);
1618
- }
1619
- if (columnOptions.searchable) {
1620
- const search = searchValues[columnOptions.columnDef];
1621
- if (search) {
1622
- if (columnOptions.searchProperty)
1623
- addAdditionalColumn(additionalColumns, columnOptions.searchProperty, search);
1624
- else
1625
- column.search = search;
1626
- }
1627
- }
1628
- columnOptions.additionalProperties?.forEach(property => addAdditionalColumn(additionalColumns, property));
1629
- columns.push(column);
1630
- });
1631
- additionalColumns.forEach(additionalColumn => {
1632
- const column = columns.find(item => item.data === additionalColumn.data);
1633
- if (!column)
1634
- columns.push(additionalColumn);
1635
- else if (additionalColumn.search && !column.search)
1636
- column.search = additionalColumn.search;
1637
- });
1638
- return columns;
1639
- }
1640
- function buildDatasourceRequestOrder(options, columns) {
1641
- const order = [];
1642
- options.columns
1643
- .filter(column => !!column.order)
1644
- .sort((first, second) => first.order.index - second.order.index)
1645
- .forEach(columnOptions => {
1646
- const property = columnOptions.sortProperty || columnOptions.property;
1647
- const index = columns.findIndex(column => column.data === property);
1648
- if (index !== -1)
1649
- order.push({ column: index, dir: columnOptions.order.dir });
1650
- });
1651
- return order;
1652
- }
1653
- function buildDatasourceRequestOptions(options, searchValues, start, length, draw = Date.now().toString()) {
1654
- const columns = buildDatasourceRequestColumns(options, searchValues);
1655
- return {
1656
- draw,
1657
- columns,
1658
- start,
1659
- length,
1660
- order: buildDatasourceRequestOrder(options, columns),
1661
- facets: options.facets,
1662
- };
1663
- }
1664
- function addAdditionalColumn(additionalColumns, data, search) {
1665
- let column = additionalColumns.find(item => item.data === data);
1666
- if (!column) {
1667
- column = { data };
1668
- additionalColumns.push(column);
1669
- }
1670
- if (search) {
1671
- column.search = search;
1672
- column.searchable = true;
1673
- }
1674
- return column;
1675
- }
1676
-
1677
- /** @format */
1678
- function duration(data, options) {
1679
- const durationOption = { maxDecimalPoints: 0, largest: 1, fallbacks: ['en'] };
1680
- if (options?.locale)
1681
- durationOption.language = options.locale;
1682
- if (options?.largest)
1683
- durationOption.largest = options.largest;
1684
- let value;
1685
- if (typeof data === 'number')
1686
- value = data;
1687
- else if (typeof data === 'string') {
1688
- const date = new Date(data);
1689
- if (isNaN(date.valueOf()))
1690
- return null;
1691
- value = Date.now() - date.valueOf();
1692
- }
1693
- else if (typeof data?.valueOf === 'function')
1694
- value = Date.now() - data.valueOf();
1695
- if (value === undefined || value === null)
1696
- return null;
1697
- return humanizeDuration(value, durationOption);
1698
- }
1699
-
1700
- /** @format */
1701
- function get(obj, path) {
1702
- const chunks = path.split('.');
1703
- let value = obj;
1704
- for (let i = 0; i < chunks.length; ++i) {
1705
- value = value[chunks[i]];
1706
- if (value === undefined || value === null)
1707
- return null;
1708
- }
1709
- return value;
1710
- }
1711
-
1712
- /** @format */
1713
- async function exportDatatable(context) {
1714
- const xlsx = await import('xlsx');
1715
- const data = await loadExportData(context);
1716
- const rows = await buildExportRows(context.options, data);
1717
- const workbook = xlsx.utils.book_new();
1718
- const worksheet = xlsx.utils.json_to_sheet(rows);
1719
- sanitizeExportHeaders(worksheet, xlsx);
1720
- xlsx.utils.book_append_sheet(workbook, worksheet, 'export');
1721
- const filename = typeof context.options.actions?.export === 'string' ? context.options.actions.export : 'export';
1722
- await xlsx.writeFile(workbook, `${filename}-${Date.now()}.xlsx`);
1723
- }
1724
- async function loadExportData(context) {
1725
- const columns = buildDatasourceRequestColumns(context.options, context.searchValues);
1726
- const order = buildDatasourceRequestOrder(context.options, columns);
1727
- const chunkLength = getExportChunkLength(context.recordsFiltered, context.rowSize);
1728
- const chunks = buildExportChunks(context.recordsFiltered, chunkLength);
1729
- const data = [];
1730
- for (const chunk of chunks) {
1731
- const result = await context.options.service({
1732
- draw: Date.now().toString(),
1733
- columns,
1734
- order,
1735
- start: chunk.start,
1736
- length: chunk.length,
1737
- });
1738
- data.push(...result.data);
1739
- }
1740
- return data;
1741
- }
1742
- async function buildExportRows(options, data) {
1743
- const selectOptionsCache = new Map();
1744
- const rows = [];
1745
- for (const record of data) {
1746
- const row = {};
1747
- for (const column of options.columns) {
1748
- if (column.hidden || column.disabled)
1749
- continue;
1750
- let value = get(record, column.property);
1751
- if (column.export) {
1752
- column.export(row, value, record);
1753
- continue;
1754
- }
1755
- value = transformExportValue(column, value, record);
1756
- if (column.type === 'select') {
1757
- await buildSelectExportValue(column, row, value, selectOptionsCache);
1758
- }
1759
- else if (column.type === 'duration') {
1760
- buildDurationExportValue(column, row, value);
1761
- }
1762
- else {
1763
- row[column.header] = value;
1764
- }
1765
- }
1766
- rows.push(row);
1767
- }
1768
- return rows;
1769
- }
1770
- function getExportChunkLength(recordsFiltered, rowSize) {
1771
- if (recordsFiltered <= 0)
1772
- return 0;
1773
- if (!Number.isFinite(rowSize) || rowSize <= 0)
1774
- return recordsFiltered;
1775
- return Math.max(1, Math.min(Math.floor(5 / rowSize), recordsFiltered));
1776
- }
1777
- function buildExportChunks(recordsFiltered, chunkLength) {
1778
- if (recordsFiltered <= 0 || chunkLength <= 0)
1779
- return [];
1780
- const chunks = [];
1781
- for (let index = 0; index < Math.ceil(recordsFiltered / chunkLength); index++) {
1782
- chunks.push({ start: index, length: chunkLength });
1783
- }
1784
- return chunks;
1785
- }
1786
- function sanitizeExportHeaders(worksheet, xlsx) {
1787
- const ref = worksheet['!ref'];
1788
- if (!ref)
1789
- return;
1790
- const range = xlsx.utils.decode_range(ref);
1791
- for (let columnIndex = range.s.c; columnIndex <= range.e.c; columnIndex++) {
1792
- const address = xlsx.utils.encode_cell({ r: range.s.r, c: columnIndex });
1793
- const cell = worksheet[address];
1794
- if (!cell || typeof cell.v !== 'string')
1795
- continue;
1796
- cell.v = stripHtml(cell.v, '');
1797
- delete cell.w;
1798
- }
1799
- }
1800
- function transformExportValue(column, value, record) {
1801
- if (!('transform' in column) || typeof column.transform !== 'function')
1802
- return value;
1803
- return column.transform(value, record);
1804
- }
1805
- async function buildSelectExportValue(column, row, value, cache) {
1806
- const options = await resolveSelectOptions(column, cache);
1807
- const getLabel = (optionValue) => options.find(option => option.value === optionValue)?.name ?? optionValue;
1808
- row[column.header] = column.isArrayValue && Array.isArray(value) ? value.map(getLabel).join(', ') : getLabel(value);
1809
- }
1810
- async function resolveSelectOptions(column, cache) {
1811
- if (Array.isArray(column.options))
1812
- return column.options;
1813
- const cached = cache.get(column);
1814
- if (cached)
1815
- return cached;
1816
- const options = await firstValueFrom(column.options);
1817
- cache.set(column, options);
1818
- return options;
1819
- }
1820
- function buildDurationExportValue(column, row, value) {
1821
- row[`${column.header} ms`] = value;
1822
- row[column.header] = duration(value, column);
1823
- }
1824
-
1825
- /** @format */
1826
- class NgxMatDatatablePaginatorIntl extends MatPaginatorIntl {
1827
- datatableIntl = inject(NgxMatDatatableIntl);
1828
- itemsPerPageLabel = this.datatableIntl.itemsPerPageLabel;
1829
- nextPageLabel = this.datatableIntl.nextPageLabel;
1830
- lastPageLabel = this.datatableIntl.lastPageLabel;
1831
- previousPageLabel = this.datatableIntl.previousPageLabel;
1832
- firstPageLabel = this.datatableIntl.firstPageLabel;
1833
- onLabel = this.datatableIntl.onLabel;
1834
- getRangeLabel = (page, pageSize, length) => {
1835
- return this.datatableIntl.getRangeLabel(page, pageSize, length);
1836
- };
1837
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatablePaginatorIntl, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1838
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatablePaginatorIntl });
1839
- }
1840
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatablePaginatorIntl, decorators: [{
1841
- type: Injectable
1842
- }] });
1843
- class NgxMatDatatableComponent {
1844
- options;
1845
- config;
1846
- rowClicked = new EventEmitter();
1847
- configUpdated = new EventEmitter();
1848
- searchUpdated = new EventEmitter();
1849
- ready = new EventEmitter();
1850
- paginator;
1851
- contentRefs;
1852
- displayedColumns = [];
1853
- visibleColumnsColspan = 1;
1854
- disabledRows = [];
1855
- dataSource;
1856
- expandedRow = null;
1857
- loaded = false;
1858
- datatableIntl = inject(NgxMatDatatableIntl);
1859
- loadMode = 'pagination';
1860
- incrementalTrigger = 'inView';
1861
- incrementalPageSize = 30;
1862
- incrementalPageIndex = 0;
1863
- displayedRecordsCount = 0;
1864
- totalRecordsCount = 0;
1865
- hasMoreRecords = false;
1866
- loadingNextRecords = false;
1867
- showRecordsCount = true;
1868
- incrementalLoadingLabel = this.datatableIntl.incrementalLoadingLabel;
1869
- incrementalLoadMoreLabel = this.datatableIntl.incrementalLoadMoreLabel;
1870
- incrementalRowColumns = ['_incrementalLoad'];
1871
- showIncrementalRow = false;
1872
- showIncrementalInViewTrigger = false;
1873
- showIncrementalButtonTrigger = false;
1874
- paginationPageSizeOptions = [];
1875
- paginationPageSize = 30;
1876
- paginationPageIndex = 0;
1877
- searchFormGroup;
1878
- subscriptions = new rxjs.Subscription();
1879
- changeDetectorRef = inject(ChangeDetectorRef);
1880
- defaultOptions = inject(NGX_MAT_DATATABLE_DEFAULT_OPTIONS);
1881
- incrementalLoadToken = 0;
1882
- restoredState;
1883
- get data() {
1884
- return this._data;
1885
- }
1886
- _data;
1887
- container;
1888
- head;
1889
- tableElement;
1890
- matTable;
1891
- observer = new ResizeObserver(entries => {
1892
- entries.forEach(entry => {
1893
- const containerHeight = this.container?.nativeElement.clientHeight ?? 0;
1894
- const containerWidth = this.container?.nativeElement.clientWidth ?? 0;
1895
- const headerHeight = this.head?.nativeElement.clientHeight ?? 0;
1896
- const headerWidth = this.head?.nativeElement.clientWidth ?? 0;
1897
- const contentHeight = entry.contentRect.height;
1898
- const contentWidth = entry.contentRect.width;
1899
- this.tableContainerOverflowY = containerHeight - headerHeight - contentHeight < 0 ? 'auto' : 'inherit';
1900
- this.tableContainerOverflowX = containerWidth - headerWidth - contentWidth < 0 ? 'auto' : 'inherit';
1901
- this.tableContainerWidth = containerWidth;
1902
- this.changeDetectorRef.markForCheck();
1903
- });
1904
- });
1905
- tableContainerOverflowY = 'inherit';
1906
- tableContainerOverflowX = 'inherit';
1907
- tableContainerWidth = 0;
1908
- async ngOnInit() {
1909
- if (!this.options?.service)
1910
- throw new Error(`missing mongoose datatable component service`);
1911
- if (!this.options?.columns)
1912
- throw new Error(`missing mongoose datatable component columns`);
1913
- this.options = this.resolveOptions(this.options);
1914
- await this.applyConfig();
1915
- await this.applyState();
1916
- this.prepareLoadModeOptions();
1917
- this.buildDisplayColumns();
1918
- this.buildSearchFormGroup();
1919
- this.dataSource = new DatagridDataSource(this.options.service);
1920
- this.ready.emit(this);
1921
- this.changeDetectorRef.detectChanges();
1922
- }
1923
- ngOnDestroy() {
1924
- if (this.tableElement)
1925
- this.observer.unobserve(this.tableElement.nativeElement);
1926
- this.subscriptions.unsubscribe();
1927
- }
1928
- load(intersect) {
1929
- if (!intersect || this.loaded)
1930
- return;
1931
- this.loaded = true;
1932
- if (this.tableElement)
1933
- this.observer.observe(this.tableElement.nativeElement);
1934
- if (this.loadMode === 'pagination') {
1935
- this.subscriptions.add(this.paginator?.page.subscribe(() => {
1936
- this.updateConfig();
1937
- void this.updateState();
1938
- void this.loadPage();
1939
- }));
1940
- }
1941
- void this.loadPage();
1942
- }
1943
- sortColumn(column) {
1944
- if (column.sortable === false)
1945
- return;
1946
- if (!column.order)
1947
- column.order = {
1948
- index: this.options.columns.filter(c => !!c.order).length,
1949
- dir: 'asc',
1950
- };
1951
- else if (column.order.dir === 'asc')
1952
- column.order.dir = 'desc';
1953
- else {
1954
- delete column.order;
1955
- this.consolidateOrderIndex();
1956
- }
1957
- this.loadFirstPage();
1958
- }
1959
- redraw(match) {
1960
- this.dataSource.redraw(match);
1961
- this._data = this.dataSource.data;
1962
- this.buildDisabledRows();
1963
- this.changeDetectorRef.detectChanges();
1964
- }
1965
- refreshColumns() {
1966
- this.buildDisplayColumns();
1967
- }
1968
- exporting = false;
1969
- async export() {
1970
- this.exporting = true;
1971
- try {
1972
- await exportDatatable({
1973
- options: this.options,
1974
- searchValues: this.searchFormGroup?.getRawValue() ?? {},
1975
- recordsFiltered: this.dataSource.recordsFiltered,
1976
- rowSize: this.dataSource.rowSize,
1977
- });
1978
- }
1979
- finally {
1980
- this.exporting = false;
1981
- }
1982
- }
1983
- async loadPage() {
1984
- if (!this.dataSource)
1985
- return;
1986
- if (this.loadMode === 'incremental') {
1987
- await this.loadInitialPage();
1988
- return;
1989
- }
1990
- await this.loadPaginationPage();
1991
- }
1992
- async loadNextIncrementalPage() {
1993
- if (this.loadMode !== 'incremental')
1994
- return;
1995
- if (!this.dataSource || this.dataSource.loading$.value || this.loadingNextRecords || !this.hasMoreRecords)
1996
- return;
1997
- this.loadingNextRecords = true;
1998
- this.updateIncrementalRowState();
1999
- const loadToken = this.incrementalLoadToken;
2000
- try {
2001
- const nextPageIndex = this.incrementalPageIndex + 1;
2002
- await this.dataSource.loadData(buildDatasourceRequestOptions(this.options, this.searchFormGroup.getRawValue(), nextPageIndex, this.incrementalPageSize), true);
2003
- if (loadToken !== this.incrementalLoadToken)
2004
- return;
2005
- this.incrementalPageIndex = nextPageIndex;
2006
- this.updateLoadedDataState();
2007
- }
2008
- finally {
2009
- if (loadToken === this.incrementalLoadToken) {
2010
- this.loadingNextRecords = false;
2011
- this.updateIncrementalRowState();
2012
- this.changeDetectorRef.detectChanges();
2013
- }
2014
- }
2015
- }
2016
- onIncrementalIntersection(intersect) {
2017
- if (!intersect)
2018
- return;
2019
- void this.loadNextIncrementalPage();
2020
- }
2021
- async loadPaginationPage() {
2022
- await this.dataSource.loadData(buildDatasourceRequestOptions(this.options, this.searchFormGroup.getRawValue(), this.paginator.pageIndex, this.paginator.pageSize));
2023
- this.updateLoadedDataState();
2024
- }
2025
- async loadInitialPage() {
2026
- this.resetIncrementalLoading();
2027
- await this.dataSource.loadData(buildDatasourceRequestOptions(this.options, this.searchFormGroup.getRawValue(), 0, this.incrementalPageSize));
2028
- this.updateLoadedDataState();
2029
- }
2030
- loadFirstPage() {
2031
- if (this.loadMode === 'pagination') {
2032
- this.paginationPageIndex = 0;
2033
- if (this.paginator)
2034
- this.paginator.pageIndex = 0;
2035
- }
2036
- void this.updateState();
2037
- void this.loadPage();
2038
- }
2039
- updateLoadedDataState() {
2040
- this._data = this.dataSource.data;
2041
- this.buildDisabledRows();
2042
- this.updateRecordsCountState();
2043
- this.updateHasMoreRecordsState();
2044
- }
2045
- buildDisabledRows() {
2046
- this.disabledRows = [];
2047
- if (this.options.rowDisabled) {
2048
- this.dataSource.data?.forEach(d => {
2049
- if (typeof this.options.rowDisabled === 'string') {
2050
- if (get(d, this.options.rowDisabled) === true)
2051
- this.disabledRows.push(d);
2052
- }
2053
- else if (typeof this.options.rowDisabled === 'function') {
2054
- if (this.options.rowDisabled(d))
2055
- this.disabledRows.push(d);
2056
- }
2057
- });
2058
- }
2059
- }
2060
- updateColumns = [];
2061
- openUpdateColumnDisplay() {
2062
- this.updateColumns = this.options.columns.map(column => ({
2063
- columnDef: column.columnDef,
2064
- header: column.header,
2065
- sticky: column.sticky,
2066
- hidden: column.hidden,
2067
- }));
2068
- }
2069
- reorderColumns(event) {
2070
- moveItemInArray(this.updateColumns, event.previousIndex, event.currentIndex);
2071
- }
2072
- closeUpdateColumnDisplay() {
2073
- let reload = false;
2074
- this.updateColumns.forEach((updated, index) => {
2075
- const columnIndex = this.options.columns.findIndex(c => c.columnDef === updated.columnDef);
2076
- if (columnIndex == -1)
2077
- return;
2078
- if (columnIndex !== index)
2079
- moveItemInArray(this.options.columns, columnIndex, index);
2080
- const column = this.options.columns[index];
2081
- if (updated.sticky !== column.sticky)
2082
- column.sticky = updated.sticky;
2083
- if (updated.hidden !== column.hidden) {
2084
- column.hidden = updated.hidden;
2085
- reload = reload || !updated.hidden;
2086
- }
2087
- });
2088
- this.buildDisplayColumns();
2089
- this.updateConfig();
2090
- if (reload)
2091
- void this.loadPage();
2092
- }
2093
- rowClick(row) {
2094
- if (this.disabledRows.includes(row))
2095
- return;
2096
- if (this.options.actions?.rowClick === true) {
2097
- this.rowClicked.emit(row);
2098
- }
2099
- else if (typeof this.options.actions?.rowClick === 'function') {
2100
- this.options.actions.rowClick(row);
2101
- this.rowClicked.emit(row);
2102
- }
2103
- }
2104
- facetClick(column, result, option) {
2105
- if (!column)
2106
- return;
2107
- const control = this.searchFormGroup?.controls[column.columnDef];
2108
- if (!control)
2109
- return;
2110
- if (option && option.value !== control.value?.value)
2111
- control.setValue({ value: option.value, name: option.name });
2112
- else if (result._id !== control.value?.value)
2113
- control.setValue({ value: result._id });
2114
- }
2115
- buildDisplayColumns() {
2116
- const displayedColumns = [];
2117
- this.options.columns.forEach(column => {
2118
- if (column.hidden || column.disabled)
2119
- return;
2120
- displayedColumns.push(column.columnDef);
2121
- if (column.type && ['number', 'date', 'duration'].includes(column.type)) {
2122
- if (!column.locale)
2123
- column.locale = this.datatableIntl.locale;
2124
- }
2125
- });
2126
- this.displayedColumns = displayedColumns;
2127
- this.visibleColumnsColspan = Math.max(displayedColumns.length, 1);
2128
- }
2129
- prepareLoadModeOptions() {
2130
- this.loadMode = this.options.loadMode ?? 'pagination';
2131
- this.incrementalTrigger = this.options.incremental?.trigger ?? 'inView';
2132
- this.preparePaginationOptions();
2133
- this.incrementalPageSize = this.getDefaultIncrementalPageSize();
2134
- this.showRecordsCount = this.options.showRecordsCount ?? true;
2135
- this.incrementalLoadingLabel = this.datatableIntl.incrementalLoadingLabel;
2136
- this.incrementalLoadMoreLabel = this.datatableIntl.incrementalLoadMoreLabel;
2137
- this.updateRecordsCountState();
2138
- this.updateHasMoreRecordsState();
2139
- }
2140
- preparePaginationOptions() {
2141
- this.paginationPageSizeOptions = this.options.pageSizeOptions || [20, 50, 100];
2142
- this.paginationPageSize =
2143
- this.options.pageSize || this.paginationPageSizeOptions[this.options.pageSizeOptionsIndex ?? 1] || 30;
2144
- this.paginationPageIndex = this.restoredState?.page?.index ?? 0;
2145
- }
2146
- getDefaultIncrementalPageSize() {
2147
- return this.options.incremental?.pageSize || this.options.pageSize || this.paginationPageSize || 30;
2148
- }
2149
- resolveOptions(options) {
2150
- const actions = this.resolveActions(options);
2151
- const incremental = this.resolveIncrementalOptions(options);
2152
- return {
2153
- ...this.defaultOptions,
2154
- ...options,
2155
- service: options.service,
2156
- columns: options.columns,
2157
- ...(actions ? { actions } : {}),
2158
- ...(incremental ? { incremental } : {}),
2159
- };
2160
- }
2161
- resolveActions(options) {
2162
- if (!this.defaultOptions.actions && !options.actions)
2163
- return undefined;
2164
- const columns = this.resolveActionColumns(options);
2165
- return {
2166
- ...this.defaultOptions.actions,
2167
- ...options.actions,
2168
- ...(columns ? { columns } : {}),
2169
- };
2170
- }
2171
- resolveActionColumns(options) {
2172
- if (!this.defaultOptions.actions?.columns && !options.actions?.columns)
2173
- return undefined;
2174
- return {
2175
- ...this.defaultOptions.actions?.columns,
2176
- ...options.actions?.columns,
2177
- };
2178
- }
2179
- resolveIncrementalOptions(options) {
2180
- if (!this.defaultOptions.incremental && !options.incremental)
2181
- return undefined;
2182
- return {
2183
- ...this.defaultOptions.incremental,
2184
- ...options.incremental,
2185
- };
2186
- }
2187
- resetIncrementalLoading() {
2188
- this.incrementalLoadToken++;
2189
- this.incrementalPageIndex = 0;
2190
- this.loadingNextRecords = false;
2191
- this.updateIncrementalRowState();
2192
- }
2193
- updateRecordsCountState() {
2194
- this.displayedRecordsCount = this.dataSource?.data.length ?? 0;
2195
- this.totalRecordsCount = this.dataSource?.recordsFiltered ?? 0;
2196
- }
2197
- updateHasMoreRecordsState() {
2198
- this.hasMoreRecords = this.loadMode === 'incremental' && this.displayedRecordsCount < this.totalRecordsCount;
2199
- this.updateIncrementalRowState();
2200
- }
2201
- updateIncrementalRowState() {
2202
- this.showIncrementalRow = this.loadMode === 'incremental' && (this.hasMoreRecords || this.loadingNextRecords);
2203
- this.showIncrementalInViewTrigger = this.showIncrementalRow && this.incrementalTrigger === 'inView';
2204
- this.showIncrementalButtonTrigger = this.showIncrementalRow && this.incrementalTrigger === 'button';
2205
- this.changeDetectorRef.markForCheck();
2206
- queueMicrotask(() => this.matTable?.renderRows());
2207
- }
2208
- buildSearchFormGroup() {
2209
- this.searchFormGroup = new FormGroup(this.options.columns.reduce((controls, column) => {
2210
- if (column.searchable) {
2211
- const restoredValue = this.restoredState?.filters[column.columnDef];
2212
- const initialValue = restoredValue !== undefined
2213
- ? this.restoreFilterValue(column, restoredValue)
2214
- : column.searchValue !== undefined
2215
- ? { value: column.searchValue }
2216
- : undefined;
2217
- const control = new FormControl({
2218
- value: initialValue,
2219
- disabled: false,
2220
- });
2221
- controls[column.columnDef] = control;
2222
- if (typeof column.searchUpdated === 'function') {
2223
- this.subscriptions.add(control.valueChanges.pipe(rxjs.debounceTime(500)).subscribe(value => column.searchUpdated(value)));
2224
- }
2225
- }
2226
- return controls;
2227
- }, {}));
2228
- this.subscriptions.add(this.searchFormGroup.valueChanges.pipe(rxjs.debounceTime(500)).subscribe(value => {
2229
- this.searchUpdated.next(value);
2230
- this.loadFirstPage();
2231
- }));
2232
- }
2233
- consolidateOrderIndex() {
2234
- let index = 0;
2235
- this.options.columns
2236
- .filter(c => !!c.order)
2237
- .sort((c1, c2) => c1.order.index - c2.order.index)
2238
- .forEach(c => (c.order.index = index++));
2239
- }
2240
- async applyConfig() {
2241
- if (this.options?.configService?.get) {
2242
- const config = await this.options.configService.get();
2243
- this.config = config ?? this.config;
2244
- }
2245
- if (this.options?.columns && this.config?.columns) {
2246
- this.config.columns.forEach((updated, index) => {
2247
- const columnIndex = this.options.columns.findIndex(c => c.columnDef === updated.columnDef);
2248
- if (columnIndex == -1)
2249
- return;
2250
- if (columnIndex !== index)
2251
- moveItemInArray(this.options.columns, columnIndex, index);
2252
- const column = this.options.columns[index];
2253
- if (column && updated.sticky !== column.sticky)
2254
- column.sticky = updated.sticky;
2255
- if (column && updated.hidden !== column.hidden)
2256
- column.hidden = updated.hidden;
2257
- });
2258
- this.buildDisplayColumns();
2259
- }
2260
- if (this.options && typeof this.config?.pageSizeOptionsIndex === 'number') {
2261
- this.options.pageSizeOptionsIndex = this.config.pageSizeOptionsIndex;
2262
- }
2263
- }
2264
- async applyState() {
2265
- if (!this.options.stateService?.get)
2266
- return;
2267
- const state = await this.options.stateService.get();
2268
- if (!state || state.version !== 1)
2269
- return;
2270
- this.restoredState = {
2271
- version: 1,
2272
- filters: state.filters ?? {},
2273
- order: Array.isArray(state.order) ? state.order : [],
2274
- ...(state.page ? { page: state.page } : {}),
2275
- };
2276
- this.applyStateOrder(this.restoredState);
2277
- if (this.restoredState.page?.size)
2278
- this.options.pageSize = this.restoredState.page.size;
2279
- }
2280
- applyStateOrder(state) {
2281
- this.options.columns.forEach(column => delete column.order);
2282
- state.order
2283
- .slice()
2284
- .sort((a, b) => a.index - b.index)
2285
- .forEach(order => {
2286
- const column = this.options.columns.find(item => item.columnDef === order.columnDef);
2287
- if (!column || column.sortable === false)
2288
- return;
2289
- column.order = { index: order.index, dir: order.dir };
2290
- });
2291
- this.consolidateOrderIndex();
2292
- }
2293
- restoreFilterValue(column, value) {
2294
- if (column.type !== 'date' || !value?.value)
2295
- return value;
2296
- if (typeof value.value === 'object' && ('from' in value.value || 'to' in value.value)) {
2297
- return {
2298
- ...value,
2299
- value: {
2300
- from: value.value.from ? moment(value.value.from) : undefined,
2301
- to: value.value.to ? moment(value.value.to) : undefined,
2302
- },
2303
- };
2304
- }
2305
- return { ...value, value: moment(value.value) };
2306
- }
2307
- async updateState() {
2308
- if (!this.options.stateService?.set || !this.searchFormGroup)
2309
- return;
2310
- await this.options.stateService.set(this.buildState());
2311
- }
2312
- buildState() {
2313
- const order = this.options.columns
2314
- .filter(column => !!column.order)
2315
- .map(column => ({
2316
- columnDef: column.columnDef,
2317
- index: column.order.index,
2318
- dir: column.order.dir,
2319
- }));
2320
- const page = this.loadMode === 'pagination'
2321
- ? {
2322
- index: this.paginator?.pageIndex ?? this.paginationPageIndex,
2323
- size: this.paginator?.pageSize ?? this.paginationPageSize,
2324
- }
2325
- : undefined;
2326
- return {
2327
- version: 1,
2328
- filters: this.searchFormGroup.getRawValue(),
2329
- order,
2330
- ...(page ? { page } : {}),
2331
- };
2332
- }
2333
- updateConfig() {
2334
- const pageSizeOptions = this.paginationPageSizeOptions;
2335
- const fallbackPageSize = this.paginationPageSize;
2336
- const pageSizeOptionsIndex = pageSizeOptions.indexOf(this.paginator?.pageSize ?? fallbackPageSize);
2337
- const columns = this.options.columns.map(c => ({
2338
- columnDef: c.columnDef,
2339
- sticky: c.sticky,
2340
- hidden: c.hidden,
2341
- }));
2342
- this.config = { columns, pageSizeOptionsIndex };
2343
- this.configUpdated.next(this.config);
2344
- if (this.options?.configService?.set)
2345
- this.options.configService.set(this.config);
2346
- }
2347
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2348
- 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: [{ provide: MatPaginatorIntl, useClass: NgxMatDatatablePaginatorIntl }], 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) {\n <ng-container [matColumnDef]=\"column.columnDef\" [sticky]=\"column.sticky\">\n <th\n mat-header-cell\n *matHeaderCellDef\n [class.searchable]=\"column.searchable\"\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]=\"options.columns.length\">\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 [class.has-click]=\"options.actions?.rowClick\"\n [class.is-disabled]=\"row | includedIn: disabledRows\"\n (click)=\"rowClick(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) {\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) {\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) {\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 || 'Afficher / masquer des colonnes'\"\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 mat-icon-button color=\"primary\" [disabled]=\"exporting\" (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 mat-icon-button color=\"primary\" [disabled]=\"dataSource.loading$ | async\" (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) {\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 (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 (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 [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-text-filter>\n }\n @case ('number') {\n <lib-header-number-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-number-filter>\n }\n @case ('select') {\n <lib-header-select-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-select-filter>\n }\n @case ('autocomplete') {\n <lib-header-autocomplete-filter\n [column]=\"column\"\n [formControlName]=\"column.columnDef\"></lib-header-autocomplete-filter>\n }\n @case ('checkbox') {\n <lib-header-checkbox-filter\n [column]=\"column\"\n [formControlName]=\"column.columnDef\"></lib-header-checkbox-filter>\n }\n @case ('date') {\n <lib-header-date-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-date-filter>\n }\n @case ('duration') {\n <lib-header-duration-filter\n [column]=\"column\"\n [formControlName]=\"column.columnDef\"></lib-header-duration-filter>\n }\n @default {\n <span>{{ column.header }}</span>\n }\n }\n } @else {\n <span>{{ column.header }}</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 [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 @defer (on viewport) {\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 [outerHTML]=\"value | valueFunction: column.prefixFunction : row : column | safeHtml\"></span>\n } @else if (column.prefix) {\n <span [outerHTML]=\"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 [outerHTML]=\"(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 [outerHTML]=\"value | valueFunction: column.suffixFunction : row : column | safeHtml\"></span>\n } @else if (column.suffix) {\n <span [outerHTML]=\"column.suffix | safeHtml\"></span>\n }\n }\n </div>\n } @placeholder {\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 (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) {\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 !== false\"\n (click)=\"facetClick(column, d, option)\"\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.px]=\"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) {\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 !== false\"\n (click)=\"facetClick(column, d, option)\">\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):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}.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 .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 ::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: "pipe", type: CellColorPipe, name: "cellColor" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.DecimalPipe, name: "number" }, { 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: "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$1.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: "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: IncludedInPipe, name: "includedIn" }, { kind: "pipe", type: CellOpacityPipe, name: "cellOpacity" }], animations: [
2349
- trigger('fade', [
2350
- transition(':enter', [
2351
- style({ opacity: 0 }), // initial
2352
- animate('0.2s', style({ opacity: 1 })), // final
2353
- ]),
2354
- transition(':leave', [
2355
- style({ opacity: 1 }), // initial
2356
- animate('0.2s', style({ opacity: 0 })), // final
2357
- ]),
2358
- ]),
2359
- trigger('detailExpand', [
2360
- state('collapsed', style({ height: '0px', minHeight: '0' })),
2361
- state('expanded', style({ height: '*' })),
2362
- transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
2363
- ]),
2364
- ], deferBlockDependencies: [() => [import('./eherve-angular-material-datatable-cell-checkbox-value.component-Dcer6VNu.mjs').then(m => m.CellCheckboxValueComponent), import('./eherve-angular-material-datatable-cell-date-value.component-CH38s3de.mjs').then(m => m.CellDateValueComponent), import('./eherve-angular-material-datatable-cell-duration-value.component-C96dDNf9.mjs').then(m => m.CellDurationValueComponent), import('./eherve-angular-material-datatable-cell-number-value.component-YPEA9XOc.mjs').then(m => m.CellNumberValueComponent), import('./eherve-angular-material-datatable-cell-select-value.component-DH-Kq9yJ.mjs').then(m => m.CellSelectValueComponent), i1$1.NgComponentOutlet, i1$1.NgTemplateOutlet, import('./eherve-angular-material-datatable-transform.pipe-BOmcXXZU.mjs').then(m => m.TransformPipe), FindContentPipe, import('./eherve-angular-material-datatable-get.pipe-kupjbnPY.mjs').then(m => m.GetPipe), Promise.resolve().then(function () { return safeHtml_pipe; }).then(m => m.SafeHtmlPipe), import('./eherve-angular-material-datatable-suffix-function.pipe-CQO-ghpR.mjs').then(m => m.ValueFunctionPipe)]] });
2365
- }
2366
- i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableComponent, resolveDeferredDeps: () => [import('./eherve-angular-material-datatable-cell-checkbox-value.component-Dcer6VNu.mjs').then(m => m.CellCheckboxValueComponent), import('./eherve-angular-material-datatable-cell-date-value.component-CH38s3de.mjs').then(m => m.CellDateValueComponent), import('./eherve-angular-material-datatable-cell-duration-value.component-C96dDNf9.mjs').then(m => m.CellDurationValueComponent), import('./eherve-angular-material-datatable-cell-number-value.component-YPEA9XOc.mjs').then(m => m.CellNumberValueComponent), import('./eherve-angular-material-datatable-cell-select-value.component-DH-Kq9yJ.mjs').then(m => m.CellSelectValueComponent), import('./eherve-angular-material-datatable-transform.pipe-BOmcXXZU.mjs').then(m => m.TransformPipe), import('./eherve-angular-material-datatable-get.pipe-kupjbnPY.mjs').then(m => m.GetPipe), Promise.resolve().then(function () { return safeHtml_pipe; }).then(m => m.SafeHtmlPipe), import('./eherve-angular-material-datatable-suffix-function.pipe-CQO-ghpR.mjs').then(m => m.ValueFunctionPipe)], resolveMetadata: (CellCheckboxValueComponent, CellDateValueComponent, CellDurationValueComponent, CellNumberValueComponent, CellSelectValueComponent, TransformPipe, GetPipe, SafeHtmlPipe, ValueFunctionPipe) => ({ decorators: [{
2367
- type: Component,
2368
- args: [{ imports: [
2369
- CellCheckboxValueComponent,
2370
- CellDateValueComponent,
2371
- CellDurationValueComponent,
2372
- CellNumberValueComponent,
2373
- CellSelectValueComponent,
2374
- CellColorPipe,
2375
- CommonModule,
2376
- TransformPipe,
2377
- DragDropModule,
2378
- FindContentPipe,
2379
- FormsModule,
2380
- GetPipe,
2381
- HeaderAutocompleteFilterComponent,
2382
- HeaderCheckboxFilterComponent,
2383
- HeaderDateFilterComponent,
2384
- HeaderDurationFilterComponent,
2385
- HeaderNumberFilterComponent,
2386
- HeaderSelectFilterComponent,
2387
- HeaderTextFilterComponent,
2388
- IntersectionObserverModule,
2389
- MatBadgeModule,
2390
- MatButtonModule,
2391
- MatFormFieldModule,
2392
- MatIconModule,
2393
- MatMenuModule,
2394
- MatPaginatorModule,
2395
- MatProgressSpinnerModule,
2396
- MatTableModule,
2397
- MatChipsModule,
2398
- ReactiveFormsModule,
2399
- SafeHtmlPipe,
2400
- MatTooltipModule,
2401
- BackgroundColorPipe,
2402
- FilterPipe,
2403
- SumPipe,
2404
- MatCardModule,
2405
- CountUpModule,
2406
- ProgressSpinnerComponent,
2407
- FindPipe,
2408
- OrderByPipe,
2409
- SortFacetEntriesPipe,
2410
- ValueFunctionPipe,
2411
- IncludedInPipe,
2412
- CellOpacityPipe,
2413
- ], providers: [{ provide: MatPaginatorIntl, useClass: NgxMatDatatablePaginatorIntl }], selector: 'ngx-mat-datatable', animations: [
2414
- trigger('fade', [
2415
- transition(':enter', [
2416
- style({ opacity: 0 }), // initial
2417
- animate('0.2s', style({ opacity: 1 })), // final
2418
- ]),
2419
- transition(':leave', [
2420
- style({ opacity: 1 }), // initial
2421
- animate('0.2s', style({ opacity: 0 })), // final
2422
- ]),
2423
- ]),
2424
- trigger('detailExpand', [
2425
- state('collapsed', style({ height: '0px', minHeight: '0' })),
2426
- state('expanded', style({ height: '*' })),
2427
- transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
2428
- ]),
2429
- ], 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) {\n <ng-container [matColumnDef]=\"column.columnDef\" [sticky]=\"column.sticky\">\n <th\n mat-header-cell\n *matHeaderCellDef\n [class.searchable]=\"column.searchable\"\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]=\"options.columns.length\">\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 [class.has-click]=\"options.actions?.rowClick\"\n [class.is-disabled]=\"row | includedIn: disabledRows\"\n (click)=\"rowClick(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) {\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) {\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) {\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 || 'Afficher / masquer des colonnes'\"\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 mat-icon-button color=\"primary\" [disabled]=\"exporting\" (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 mat-icon-button color=\"primary\" [disabled]=\"dataSource.loading$ | async\" (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) {\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 (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 (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 [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-text-filter>\n }\n @case ('number') {\n <lib-header-number-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-number-filter>\n }\n @case ('select') {\n <lib-header-select-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-select-filter>\n }\n @case ('autocomplete') {\n <lib-header-autocomplete-filter\n [column]=\"column\"\n [formControlName]=\"column.columnDef\"></lib-header-autocomplete-filter>\n }\n @case ('checkbox') {\n <lib-header-checkbox-filter\n [column]=\"column\"\n [formControlName]=\"column.columnDef\"></lib-header-checkbox-filter>\n }\n @case ('date') {\n <lib-header-date-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-date-filter>\n }\n @case ('duration') {\n <lib-header-duration-filter\n [column]=\"column\"\n [formControlName]=\"column.columnDef\"></lib-header-duration-filter>\n }\n @default {\n <span>{{ column.header }}</span>\n }\n }\n } @else {\n <span>{{ column.header }}</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 [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 @defer (on viewport) {\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 [outerHTML]=\"value | valueFunction: column.prefixFunction : row : column | safeHtml\"></span>\n } @else if (column.prefix) {\n <span [outerHTML]=\"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 [outerHTML]=\"(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 [outerHTML]=\"value | valueFunction: column.suffixFunction : row : column | safeHtml\"></span>\n } @else if (column.suffix) {\n <span [outerHTML]=\"column.suffix | safeHtml\"></span>\n }\n }\n </div>\n } @placeholder {\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 (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) {\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 !== false\"\n (click)=\"facetClick(column, d, option)\"\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.px]=\"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) {\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 !== false\"\n (click)=\"facetClick(column, d, option)\">\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):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}.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 .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 ::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"] }]
2430
- }], ctorParameters: null, propDecorators: { options: [{
2431
- type: Input,
2432
- args: ['options']
2433
- }], config: [{
2434
- type: Input
2435
- }], rowClicked: [{
2436
- type: Output
2437
- }], configUpdated: [{
2438
- type: Output
2439
- }], searchUpdated: [{
2440
- type: Output
2441
- }], ready: [{
2442
- type: Output
2443
- }], paginator: [{
2444
- type: ViewChild,
2445
- args: [MatPaginator]
2446
- }], contentRefs: [{
2447
- type: ContentChildren,
2448
- args: [NgxMatDatatableContentDirective]
2449
- }], container: [{
2450
- type: ViewChild,
2451
- args: ['container']
2452
- }], head: [{
2453
- type: ViewChild,
2454
- args: ['head']
2455
- }], tableElement: [{
2456
- type: ViewChild,
2457
- args: ['table', { read: ElementRef }]
2458
- }], matTable: [{
2459
- type: ViewChild,
2460
- args: [MatTable]
2461
- }], tableContainerOverflowY: [{
2462
- type: HostBinding,
2463
- args: ['style.--datatable-container-overflow-y']
2464
- }], tableContainerOverflowX: [{
2465
- type: HostBinding,
2466
- args: ['style.--datatable-container-overflow-x']
2467
- }], tableContainerWidth: [{
2468
- type: HostBinding,
2469
- args: ['style.--datatable-container-width.px']
2470
- }] } }) });
2471
-
2472
- /** @format */
2473
- class NgxMatDatatableModule {
2474
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2475
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableModule, imports: [NgxMatDatatableComponent, NgxMatDatatableContentDirective], exports: [NgxMatDatatableComponent, NgxMatDatatableContentDirective] });
2476
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableModule, providers: [NgxMatDatatableIntl], imports: [NgxMatDatatableComponent] });
2477
- }
2478
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableModule, decorators: [{
2479
- type: NgModule,
2480
- args: [{
2481
- imports: [NgxMatDatatableComponent, NgxMatDatatableContentDirective],
2482
- exports: [NgxMatDatatableComponent, NgxMatDatatableContentDirective],
2483
- providers: [NgxMatDatatableIntl],
2484
- }]
2485
- }] });
2486
-
2487
- /** @format */
2488
-
2489
- /** @format */
2490
-
2491
- /** @format */
2492
-
2493
- /** @format */
2494
-
2495
- /** @format */
2496
-
2497
- /** @format */
2498
-
2499
- /**
2500
- * Public API Surface of @eherve/angular-material-datatable
2501
- *
2502
- * @format
2503
- */
2504
-
2505
- /**
2506
- * Generated bundle index. Do not edit.
2507
- */
2508
-
2509
- export { IsArrayPipe as I, NgxMatDatatableModule as N, SelectOptionPipe as S, SafeHtmlPipe as a, NgxMatDatatableComponent as b, NGX_MAT_DATATABLE_DEFAULT_OPTIONS as c, duration as d, NgxMatDatatableContentDirective as e, NgxMatDatatableIntl as f, get as g, provideNgxMatDatatableDefaultOptions as p };
2510
- //# sourceMappingURL=eherve-angular-material-datatable-eherve-angular-material-datatable-yAj8iPwA.mjs.map