@eherve/angular-material-datatable 19.23.3 → 19.23.5

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 (34) hide show
  1. package/fesm2022/{eherve-angular-material-datatable-cell-checkbox-value.component-B1xA4rcx.mjs → eherve-angular-material-datatable-cell-checkbox-value.component-PHY0X0wz.mjs} +2 -2
  2. package/fesm2022/{eherve-angular-material-datatable-cell-checkbox-value.component-B1xA4rcx.mjs.map → eherve-angular-material-datatable-cell-checkbox-value.component-PHY0X0wz.mjs.map} +1 -1
  3. package/fesm2022/{eherve-angular-material-datatable-cell-date-value.component-SmZolfO2.mjs → eherve-angular-material-datatable-cell-date-value.component-DYO_rIFt.mjs} +2 -2
  4. package/fesm2022/{eherve-angular-material-datatable-cell-date-value.component-SmZolfO2.mjs.map → eherve-angular-material-datatable-cell-date-value.component-DYO_rIFt.mjs.map} +1 -1
  5. package/fesm2022/{eherve-angular-material-datatable-cell-duration-value.component-CCoKwOCi.mjs → eherve-angular-material-datatable-cell-duration-value.component-BbHM4MxI.mjs} +2 -2
  6. package/fesm2022/{eherve-angular-material-datatable-cell-duration-value.component-CCoKwOCi.mjs.map → eherve-angular-material-datatable-cell-duration-value.component-BbHM4MxI.mjs.map} +1 -1
  7. package/fesm2022/{eherve-angular-material-datatable-cell-number-value.component-CVh45vmC.mjs → eherve-angular-material-datatable-cell-number-value.component-Ip_V5vNB.mjs} +2 -2
  8. package/fesm2022/{eherve-angular-material-datatable-cell-number-value.component-CVh45vmC.mjs.map → eherve-angular-material-datatable-cell-number-value.component-Ip_V5vNB.mjs.map} +1 -1
  9. package/fesm2022/{eherve-angular-material-datatable-cell-select-value.component-omrgKZsE.mjs → eherve-angular-material-datatable-cell-select-value.component-C5TwovoH.mjs} +3 -3
  10. package/fesm2022/{eherve-angular-material-datatable-cell-select-value.component-omrgKZsE.mjs.map → eherve-angular-material-datatable-cell-select-value.component-C5TwovoH.mjs.map} +1 -1
  11. package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-B9NS2F1a.mjs +2460 -0
  12. package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-B9NS2F1a.mjs.map +1 -0
  13. package/fesm2022/{eherve-angular-material-datatable-get.pipe-DLd8yb47.mjs → eherve-angular-material-datatable-get.pipe-CFZSdKSW.mjs} +2 -2
  14. package/fesm2022/{eherve-angular-material-datatable-get.pipe-DLd8yb47.mjs.map → eherve-angular-material-datatable-get.pipe-CFZSdKSW.mjs.map} +1 -1
  15. package/fesm2022/eherve-angular-material-datatable.mjs +1 -1
  16. package/lib/components/header-autocomplete-filter/header-autocomplete-filter.component.d.ts +7 -5
  17. package/lib/components/header-checkbox-filter/header-checkbox-filter.component.d.ts +6 -4
  18. package/lib/components/header-date-filter/header-date-filter.component.d.ts +9 -4
  19. package/lib/components/header-duration-filter/header-duration-filter.component.d.ts +6 -4
  20. package/lib/components/header-number-filter/header-number-filter.component.d.ts +6 -4
  21. package/lib/components/header-select-filter/header-select-filter.component.d.ts +6 -4
  22. package/lib/components/header-text-filter/header-text-filter.component.d.ts +6 -4
  23. package/lib/datasource.d.ts +5 -2
  24. package/lib/datatable-default-options.d.ts +5 -0
  25. package/lib/datatable.component.d.ts +51 -3
  26. package/lib/datatable.intl.d.ts +2 -0
  27. package/lib/pipes/safe-html.pipe.d.ts +1 -1
  28. package/lib/types/action.type.d.ts +2 -0
  29. package/lib/types/datatable-options.type.d.ts +35 -0
  30. package/lib/types/datatable-state.type.d.ts +22 -0
  31. package/package.json +1 -1
  32. package/public-api.d.ts +2 -0
  33. package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-DEVM6I6-.mjs +0 -2027
  34. package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-DEVM6I6-.mjs.map +0 -1
@@ -1,2027 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Pipe, inject, Injector, ChangeDetectorRef, forwardRef, Component, Input, ViewChild, signal, ChangeDetectionStrategy, LOCALE_ID, Injectable, HostBinding, Directive, EventEmitter, 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 * as rxjs from 'rxjs';
37
- import { BehaviorSubject, Subject, Subscription, filter, debounceTime, switchMap, startWith, tap, map } from 'rxjs';
38
- import * as XLSX from 'xlsx';
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 moment from 'moment';
54
- import * as i1$2 from '@angular/cdk/overlay';
55
- import { OverlayModule } from '@angular/cdk/overlay';
56
- import * as i6$1 from '@angular/material/select';
57
- import { MatSelectModule } from '@angular/material/select';
58
- import { DataSource } from '@angular/cdk/collections';
59
- import * as lodash from 'lodash-es';
60
- import humanizeDuration from 'humanize-duration';
61
-
62
- /** @format */
63
- class SafeHtmlPipe {
64
- sanitizer;
65
- constructor(sanitizer) {
66
- this.sanitizer = sanitizer;
67
- }
68
- transform(html) {
69
- return this.sanitizer.bypassSecurityTrustHtml(html);
70
- }
71
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
72
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: SafeHtmlPipe, isStandalone: true, name: "safeHtml" });
73
- }
74
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SafeHtmlPipe, decorators: [{
75
- type: Pipe,
76
- args: [{
77
- name: 'safeHtml',
78
- }]
79
- }], ctorParameters: () => [{ type: i1.DomSanitizer }] });
80
-
81
- var safeHtml_pipe = /*#__PURE__*/Object.freeze({
82
- __proto__: null,
83
- SafeHtmlPipe: SafeHtmlPipe
84
- });
85
-
86
- /** @format */
87
- function stripHtml(value) {
88
- if (!value)
89
- return '';
90
- return value
91
- .replace(/<[^>]+>/g, ' ') // remove tags
92
- .replace(/\s+/g, ' ') // collapse spaces
93
- .trim();
94
- }
95
-
96
- /** @format */
97
- class HeaderAutocompleteFilterComponent {
98
- column;
99
- options = [];
100
- groups = [];
101
- hasMore = false;
102
- searching = false;
103
- input;
104
- auto;
105
- control;
106
- selectControl = new FormControl();
107
- onChange = () => { };
108
- onTouched = () => { };
109
- filter$ = new BehaviorSubject(undefined);
110
- nextPage$ = new Subject();
111
- injector = inject(Injector);
112
- changeDetectorRef = inject(ChangeDetectorRef);
113
- subsink = new Subscription();
114
- writeValue = (value) => {
115
- if (value?.value !== this.selectControl.value) {
116
- if (value?.name) {
117
- if (!this.options.find(o => o.value === value.value)) {
118
- this.options.push({ value: value.value, name: value.name });
119
- }
120
- }
121
- this.selectControl.setValue(value?.value);
122
- }
123
- };
124
- registerOnChange(onChange) {
125
- this.onChange = onChange;
126
- }
127
- registerOnTouched(onTouched) {
128
- this.onTouched = onTouched;
129
- }
130
- async ngAfterViewInit() {
131
- const ngControl = this.injector.get(NgControl, null);
132
- if (!ngControl)
133
- throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
134
- this.control = ngControl.control;
135
- this.subsink.add(this.selectControl.valueChanges.subscribe((value) => {
136
- if (value === undefined) {
137
- if (this.control.value !== undefined)
138
- this.control.setValue(undefined);
139
- }
140
- else if (value === null && !this.options.find(o => o.value === null)) {
141
- if (this.control.value !== undefined)
142
- this.control.setValue(undefined);
143
- }
144
- else if (this.control.value?.value !== value)
145
- this.control.setValue({ value, regex: false });
146
- }));
147
- this.buildOptions();
148
- this.changeDetectorRef.detectChanges();
149
- }
150
- ngOnDestroy() {
151
- this.subsink.unsubscribe();
152
- }
153
- loadMore(intersect) {
154
- if (!intersect)
155
- return;
156
- this.nextPage$.next();
157
- }
158
- focus() {
159
- if (this.column.loadOnFocus && !this.selectControl.value) {
160
- const search = this.input.nativeElement.value;
161
- if (!search.length || this.filter$.value !== search)
162
- this.filter$.next(search);
163
- }
164
- }
165
- filter() {
166
- const search = this.input.nativeElement.value;
167
- this.filter$.next(search);
168
- }
169
- displayWith = (value) => {
170
- let val;
171
- if (!this.options)
172
- val = value;
173
- else
174
- val = this.options.find(o => o.value === value)?.name ?? value;
175
- return stripHtml(val);
176
- };
177
- getGlobalSearchValue() {
178
- if (!this.control.parent)
179
- return null;
180
- let parent = this.control.parent;
181
- while (parent.parent)
182
- parent = parent.parent;
183
- return parent.value;
184
- }
185
- buildOptions() {
186
- this.options = this.column.searchValue !== undefined ? (this.column.searchValueOptions ?? []) : [];
187
- this.subsink.add(this.filter$
188
- .pipe(filter(value => typeof value === 'string'), debounceTime(300), switchMap((search) => {
189
- this.auto.panel;
190
- this.options = [];
191
- this.groups = [];
192
- let skip = 0;
193
- return this.nextPage$.pipe(startWith(skip), tap(() => (this.searching = true)), switchMap(async () => this.column.options(this.column.limit || 10, skip, search, this.getGlobalSearchValue())), map(data => {
194
- data.forEach(d => {
195
- this.options.push(d);
196
- const name = d.group ?? '';
197
- const group = this.groups.find(g => g.name === name);
198
- if (!group)
199
- this.groups.push({ name, options: [d] });
200
- else
201
- group.options.push(d);
202
- });
203
- skip += this.column.limit || 10;
204
- this.hasMore = data?.length === (this.column.limit || 10);
205
- this.searching = false;
206
- }));
207
- }))
208
- .subscribe());
209
- }
210
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderAutocompleteFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
211
- 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: [
212
- {
213
- provide: NG_VALUE_ACCESSOR,
214
- multi: true,
215
- useExisting: forwardRef(() => HeaderAutocompleteFilterComponent),
216
- },
217
- ], 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 <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\"\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" }] });
218
- }
219
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderAutocompleteFilterComponent, decorators: [{
220
- type: Component,
221
- args: [{ selector: 'lib-header-autocomplete-filter', imports: [
222
- CommonModule,
223
- FormsModule,
224
- IntersectionObserverModule,
225
- MatAutocompleteModule,
226
- MatButtonModule,
227
- MatFormFieldModule,
228
- MatIconModule,
229
- MatInputModule,
230
- MatProgressBarModule,
231
- ReactiveFormsModule,
232
- SafeHtmlPipe,
233
- ], providers: [
234
- {
235
- provide: NG_VALUE_ACCESSOR,
236
- multi: true,
237
- useExisting: forwardRef(() => HeaderAutocompleteFilterComponent),
238
- },
239
- ], 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 <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\"\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"] }]
240
- }], propDecorators: { column: [{
241
- type: Input
242
- }], input: [{
243
- type: ViewChild,
244
- args: ['input']
245
- }], auto: [{
246
- type: ViewChild,
247
- args: [MatAutocomplete]
248
- }] } });
249
-
250
- /** @format */
251
- class HeaderCheckboxFilterComponent {
252
- column;
253
- control;
254
- selectControl = new FormControl();
255
- onChange = () => { };
256
- onTouched = () => { };
257
- injector = inject(Injector);
258
- changeDetectorRef = inject(ChangeDetectorRef);
259
- subsink = new Subscription();
260
- writeValue = (value) => {
261
- if (value?.value !== this.selectControl.value)
262
- this.selectControl.setValue(value?.value);
263
- };
264
- registerOnChange(onChange) {
265
- this.onChange = onChange;
266
- }
267
- registerOnTouched(onTouched) {
268
- this.onTouched = onTouched;
269
- }
270
- async ngAfterViewInit() {
271
- const ngControl = this.injector.get(NgControl, null);
272
- if (!ngControl)
273
- throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
274
- this.control = ngControl.control;
275
- let previousValue = this.control.value;
276
- this.subsink.add(this.selectControl.valueChanges
277
- .pipe(filter(value => {
278
- if (value === true && previousValue === false) {
279
- this.selectControl.setValue(undefined);
280
- return false;
281
- }
282
- return true;
283
- }), tap(value => (previousValue = value)))
284
- .subscribe((value) => {
285
- if (value === undefined)
286
- this.control.setValue(undefined);
287
- else
288
- this.control.setValue({ value, regex: false });
289
- }));
290
- this.changeDetectorRef.detectChanges();
291
- }
292
- ngOnDestroy() {
293
- this.subsink.unsubscribe();
294
- }
295
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderCheckboxFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
296
- 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: [
297
- {
298
- provide: NG_VALUE_ACCESSOR,
299
- multi: true,
300
- useExisting: forwardRef(() => HeaderCheckboxFilterComponent),
301
- },
302
- ], ngImport: i0, template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-checkbox [formControl]=\"selectControl\" [indeterminate]=\"selectControl.value === undefined\">\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" }] });
303
- }
304
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderCheckboxFilterComponent, decorators: [{
305
- type: Component,
306
- args: [{ selector: 'lib-header-checkbox-filter', imports: [
307
- CommonModule,
308
- FormsModule,
309
- MatButtonModule,
310
- MatFormFieldModule,
311
- MatIconModule,
312
- MatCheckboxModule,
313
- ReactiveFormsModule,
314
- SafeHtmlPipe,
315
- ], providers: [
316
- {
317
- provide: NG_VALUE_ACCESSOR,
318
- multi: true,
319
- useExisting: forwardRef(() => HeaderCheckboxFilterComponent),
320
- },
321
- ], template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-checkbox [formControl]=\"selectControl\" [indeterminate]=\"selectControl.value === undefined\">\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"] }]
322
- }], propDecorators: { column: [{
323
- type: Input
324
- }] } });
325
-
326
- /** @format */
327
- const OPERATORS = ['=', '>', '≥', '<', '≤', '<>', '≤≥'];
328
- class OperatorSelectComponent {
329
- set setDisableRange(disableRange) {
330
- this.disableRange = disableRange !== false;
331
- if (this.disableRange)
332
- this.operators = OPERATORS.slice(0, 5);
333
- else
334
- this.operators = OPERATORS;
335
- }
336
- disableRange = false;
337
- operators = OPERATORS;
338
- isOpen = false;
339
- control;
340
- onChange = () => { };
341
- onTouched = () => { };
342
- injector = inject(Injector);
343
- changeDetectorRef = inject(ChangeDetectorRef);
344
- writeValue = () => { };
345
- registerOnChange(onChange) {
346
- this.onChange = onChange;
347
- }
348
- registerOnTouched(onTouched) {
349
- this.onTouched = onTouched;
350
- }
351
- async ngAfterViewInit() {
352
- const ngControl = this.injector.get(NgControl, null);
353
- if (!ngControl)
354
- throw new Error(`${this.constructor.name} missing control`);
355
- this.control = ngControl.control;
356
- this.changeDetectorRef.detectChanges();
357
- }
358
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: OperatorSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
359
- 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: [
360
- {
361
- provide: NG_VALUE_ACCESSOR,
362
- multi: true,
363
- useExisting: forwardRef(() => OperatorSelectComponent),
364
- },
365
- ], 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: [
366
- trigger('fade', [
367
- transition(':enter', [
368
- style({ opacity: 0 }), // initial
369
- animate('0.2s', style({ opacity: 1 })), // final
370
- ]),
371
- transition(':leave', [
372
- style({ opacity: 1 }), // initial
373
- animate('0.2s', style({ opacity: 0 })), // final
374
- ]),
375
- ]),
376
- ] });
377
- }
378
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: OperatorSelectComponent, decorators: [{
379
- type: Component,
380
- args: [{ selector: 'lib-operator-select', imports: [CommonModule, OverlayModule, MatIconModule, MatButtonModule], animations: [
381
- trigger('fade', [
382
- transition(':enter', [
383
- style({ opacity: 0 }), // initial
384
- animate('0.2s', style({ opacity: 1 })), // final
385
- ]),
386
- transition(':leave', [
387
- style({ opacity: 1 }), // initial
388
- animate('0.2s', style({ opacity: 0 })), // final
389
- ]),
390
- ]),
391
- ], providers: [
392
- {
393
- provide: NG_VALUE_ACCESSOR,
394
- multi: true,
395
- useExisting: forwardRef(() => OperatorSelectComponent),
396
- },
397
- ], 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"] }]
398
- }], propDecorators: { setDisableRange: [{
399
- type: Input,
400
- args: ['disableRange']
401
- }] } });
402
-
403
- /** @format */
404
- class HeaderDateFilterComponent {
405
- column;
406
- control;
407
- selectControl = new FormControl(undefined);
408
- rangeGroup = new FormGroup({
409
- from: new FormControl(undefined, Validators.required),
410
- to: new FormControl(undefined, Validators.required),
411
- });
412
- operatorControl = new FormControl('=');
413
- onChange = () => { };
414
- onTouched = () => { };
415
- _adapter = inject(DateAdapter);
416
- _intl = inject(MatDatepickerIntl);
417
- _locale = signal(inject(MAT_DATE_LOCALE));
418
- injector = inject(Injector);
419
- changeDetectorRef = inject(ChangeDetectorRef);
420
- subsink = new Subscription();
421
- writeValue = (value) => {
422
- // if (value?.operator && this.operatorControl.value !== value.operator) this.operatorControl.setValue(value.operator);
423
- // if (['<>', '≤≥'].includes(this.operatorControl.value!)) {
424
- // if (value?.value?.from !== this.rangeGroup.value.from && value?.value?.to !== this.rangeGroup.value.to) {
425
- // this.rangeGroup.setValue({ from: value.value.from, to: value.value.to });
426
- // }
427
- // } else if (value?.value !== this.selectControl.value) this.selectControl.setValue(value?.value);
428
- };
429
- registerOnChange(onChange) {
430
- this.onChange = onChange;
431
- }
432
- registerOnTouched(onTouched) {
433
- this.onTouched = onTouched;
434
- }
435
- ngOnInit() {
436
- if (this.column.locale) {
437
- this._locale.set(this.column.locale);
438
- this._adapter.setLocale(this._locale());
439
- this._intl.changes.next();
440
- }
441
- }
442
- async ngAfterViewInit() {
443
- const ngControl = this.injector.get(NgControl, null);
444
- if (!ngControl)
445
- throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
446
- this.control = ngControl.control;
447
- this.subsink.add(this.selectControl.valueChanges.pipe(debounceTime(500)).subscribe(value => {
448
- if (this.control.invalid)
449
- return;
450
- else if (!value)
451
- this.control.setValue(undefined);
452
- else
453
- this.control.setValue(this.buildValue(this.operatorControl.value, value));
454
- }));
455
- this.subsink.add(this.rangeGroup.valueChanges.pipe(debounceTime(500)).subscribe(value => {
456
- if (this.rangeGroup.invalid)
457
- return;
458
- if (!value)
459
- this.control.setValue(undefined);
460
- else
461
- this.control.setValue(this.buildValue(this.operatorControl.value, value));
462
- }));
463
- this.subsink.add(this.operatorControl.valueChanges.subscribe((value) => {
464
- if (['<>', '≤≥'].includes(value)) {
465
- if (!this.rangeGroup.value || this.rangeGroup.invalid)
466
- return;
467
- this.control.setValue(this.buildValue(value, this.rangeGroup.value));
468
- }
469
- else {
470
- if (!this.selectControl.value)
471
- return;
472
- this.control.setValue(this.buildValue(value, this.selectControl.value));
473
- }
474
- }));
475
- this.changeDetectorRef.detectChanges();
476
- }
477
- ngOnDestroy() {
478
- this.subsink.unsubscribe();
479
- }
480
- buildValue(operator, value) {
481
- switch (operator) {
482
- case '=':
483
- return {
484
- operator: '≤≥',
485
- value: { from: moment(value).startOf('day'), to: moment(value).endOf('day') },
486
- };
487
- case '>':
488
- return { operator, value: moment(value).endOf('day') };
489
- case '≥':
490
- return { operator, value: moment(value).startOf('day') };
491
- case '<':
492
- return { operator, value: moment(value).startOf('day') };
493
- case '≤':
494
- return { operator, value: moment(value).endOf('day') };
495
- case '<>':
496
- return { operator, value: { from: moment(value.from).endOf('day'), to: moment(value.to).startOf('day') } };
497
- case '≤≥':
498
- return { operator, value: { from: moment(value.from).startOf('day'), to: moment(value.to).endOf('day') } };
499
- }
500
- }
501
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderDateFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
502
- 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: [
503
- {
504
- provide: NG_VALUE_ACCESSOR,
505
- multi: true,
506
- useExisting: forwardRef(() => HeaderDateFilterComponent),
507
- },
508
- provideMomentDateAdapter(),
509
- ], ngImport: i0, template: "<!-- @format -->\n\n@if (selectControl) {\n @if (['<>', '\u2264\u2265'].includes(operatorControl.value!)) {\n <mat-form-field class=\"ngx-datatable-date-filter\" appearance=\"fill\" [class.has-value]=\"selectControl.value\">\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!\" />\n <input matEndDate formControlName=\"to\" [placeholder]=\"column.placeholder!\" />\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 *ngIf=\"selectControl.value\" mat-icon-button matSuffix size=\"small\" (click)=\"rangeGroup.reset()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n } @else {\n <mat-form-field class=\"ngx-datatable-date-filter\" appearance=\"fill\" [class.has-value]=\"selectControl.value\">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n\n <lib-operator-select matPrefix [formControl]=\"operatorControl\"></lib-operator-select>\n\n <input matInput [matDatepicker]=\"datePicker\" [formControl]=\"selectControl\" [placeholder]=\"column.placeholder!\" />\n <mat-datepicker-toggle matIconSuffix [for]=\"datePicker\"></mat-datepicker-toggle>\n <mat-datepicker #datePicker></mat-datepicker>\n\n <button\n *ngIf=\"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", 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 });
510
- }
511
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderDateFilterComponent, decorators: [{
512
- type: Component,
513
- args: [{ selector: 'lib-header-date-filter', imports: [
514
- CommonModule,
515
- FormsModule,
516
- MatButtonModule,
517
- MatDatepickerModule,
518
- MatFormFieldModule,
519
- MatIconModule,
520
- MatInputModule,
521
- ReactiveFormsModule,
522
- OperatorSelectComponent,
523
- SafeHtmlPipe,
524
- ], providers: [
525
- {
526
- provide: NG_VALUE_ACCESSOR,
527
- multi: true,
528
- useExisting: forwardRef(() => HeaderDateFilterComponent),
529
- },
530
- provideMomentDateAdapter(),
531
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- @format -->\n\n@if (selectControl) {\n @if (['<>', '\u2264\u2265'].includes(operatorControl.value!)) {\n <mat-form-field class=\"ngx-datatable-date-filter\" appearance=\"fill\" [class.has-value]=\"selectControl.value\">\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!\" />\n <input matEndDate formControlName=\"to\" [placeholder]=\"column.placeholder!\" />\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 *ngIf=\"selectControl.value\" mat-icon-button matSuffix size=\"small\" (click)=\"rangeGroup.reset()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n } @else {\n <mat-form-field class=\"ngx-datatable-date-filter\" appearance=\"fill\" [class.has-value]=\"selectControl.value\">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n\n <lib-operator-select matPrefix [formControl]=\"operatorControl\"></lib-operator-select>\n\n <input matInput [matDatepicker]=\"datePicker\" [formControl]=\"selectControl\" [placeholder]=\"column.placeholder!\" />\n <mat-datepicker-toggle matIconSuffix [for]=\"datePicker\"></mat-datepicker-toggle>\n <mat-datepicker #datePicker></mat-datepicker>\n\n <button\n *ngIf=\"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", 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"] }]
532
- }], propDecorators: { column: [{
533
- type: Input
534
- }] } });
535
-
536
- /** @format */
537
- const TIME_UNITS = ['second', 'minute', 'hour', 'day', 'month', 'year'];
538
- const MOMENT_RELATIVE_TIME_KEY = ['ss', 'mm', 'hh', 'dd', 'MM', 'yy'];
539
- class TimeUnitSelectComponent {
540
- static toMilliseconds(value, unit) {
541
- return moment.duration(value, unit).as('milliseconds');
542
- }
543
- static convert(value, from, to) {
544
- if (to === undefined)
545
- (to = from), (from = 'millisecond');
546
- return moment.duration(value, from).as(to);
547
- }
548
- set setLocale(locale) {
549
- this.locale = locale || moment.locale();
550
- this.loadUnitNames();
551
- }
552
- locale = moment.locale();
553
- units = TIME_UNITS;
554
- unitNames = {};
555
- isOpen = false;
556
- control;
557
- onChange = () => { };
558
- onTouched = () => { };
559
- injector = inject(Injector);
560
- changeDetectorRef = inject(ChangeDetectorRef);
561
- writeValue = () => { };
562
- registerOnChange(onChange) {
563
- this.onChange = onChange;
564
- }
565
- registerOnTouched(onTouched) {
566
- this.onTouched = onTouched;
567
- }
568
- ngOnInit() {
569
- this.loadUnitNames();
570
- }
571
- async ngAfterViewInit() {
572
- const ngControl = this.injector.get(NgControl, null);
573
- if (!ngControl)
574
- throw new Error(`${this.constructor.name} missing control`);
575
- this.control = ngControl.control;
576
- this.changeDetectorRef.detectChanges();
577
- }
578
- loadUnitNames() {
579
- this.unitNames = this.units.reduce((pv, cv, i) => ((pv[cv] = moment
580
- .localeData(this.locale)
581
- .relativeTime('', true, MOMENT_RELATIVE_TIME_KEY[i], false)
582
- .trim()),
583
- pv), {});
584
- }
585
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: TimeUnitSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
586
- 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: [
587
- {
588
- provide: NG_VALUE_ACCESSOR,
589
- multi: true,
590
- useExisting: forwardRef(() => TimeUnitSelectComponent),
591
- },
592
- ], 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: [
593
- trigger('fade', [
594
- transition(':enter', [
595
- style({ opacity: 0 }), // initial
596
- animate('0.2s', style({ opacity: 1 })), // final
597
- ]),
598
- transition(':leave', [
599
- style({ opacity: 1 }), // initial
600
- animate('0.2s', style({ opacity: 0 })), // final
601
- ]),
602
- ]),
603
- ] });
604
- }
605
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: TimeUnitSelectComponent, decorators: [{
606
- type: Component,
607
- args: [{ selector: 'lib-time-unit-select', imports: [CommonModule, OverlayModule, MatIconModule, MatButtonModule], animations: [
608
- trigger('fade', [
609
- transition(':enter', [
610
- style({ opacity: 0 }), // initial
611
- animate('0.2s', style({ opacity: 1 })), // final
612
- ]),
613
- transition(':leave', [
614
- style({ opacity: 1 }), // initial
615
- animate('0.2s', style({ opacity: 0 })), // final
616
- ]),
617
- ]),
618
- ], providers: [
619
- {
620
- provide: NG_VALUE_ACCESSOR,
621
- multi: true,
622
- useExisting: forwardRef(() => TimeUnitSelectComponent),
623
- },
624
- ], 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"] }]
625
- }], propDecorators: { setLocale: [{
626
- type: Input,
627
- args: ['locale']
628
- }] } });
629
-
630
- /** @format */
631
- class HeaderDurationFilterComponent {
632
- column;
633
- control;
634
- selectControl = new FormControl(undefined);
635
- rangeGroup = new FormGroup({
636
- start: new FormControl(undefined, Validators.required),
637
- end: new FormControl(undefined, Validators.required),
638
- });
639
- operatorControl = new FormControl('=');
640
- timeUnitControl = new FormControl('second');
641
- onChange = () => { };
642
- onTouched = () => { };
643
- injector = inject(Injector);
644
- changeDetectorRef = inject(ChangeDetectorRef);
645
- subsink = new Subscription();
646
- writeValue = (value) => {
647
- if (value?.unitOfTime)
648
- this.timeUnitControl.setValue(value.unitOfTime, { emitEvent: false });
649
- if (value?.value !== null && value?.value !== undefined) {
650
- let selectValue = TimeUnitSelectComponent.convert(value.value, this.timeUnitControl.value);
651
- if (this.selectControl.value !== selectValue)
652
- this.selectControl.setValue(selectValue);
653
- }
654
- else
655
- this.selectControl.setValue(null);
656
- };
657
- registerOnChange(onChange) {
658
- this.onChange = onChange;
659
- }
660
- registerOnTouched(onTouched) {
661
- this.onTouched = onTouched;
662
- }
663
- ngOnInit() { }
664
- async ngAfterViewInit() {
665
- const ngControl = this.injector.get(NgControl, null);
666
- if (!ngControl)
667
- throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
668
- this.control = ngControl.control;
669
- this.subsink.add(this.selectControl.valueChanges.pipe(debounceTime(500)).subscribe(value => {
670
- if (this.control.invalid)
671
- return;
672
- else if (!value)
673
- this.control.setValue(undefined);
674
- else
675
- this.control.setValue({
676
- unitOfTimeValue: value,
677
- value: TimeUnitSelectComponent.toMilliseconds(value, this.timeUnitControl.value),
678
- regex: false,
679
- operator: this.operatorControl.value,
680
- unitOfTime: this.timeUnitControl.value,
681
- });
682
- }));
683
- this.subsink.add(this.operatorControl.valueChanges.subscribe((value) => {
684
- if (!this.selectControl.value)
685
- return;
686
- this.control.setValue({
687
- unitOfTimeValue: this.selectControl.value,
688
- value: TimeUnitSelectComponent.toMilliseconds(this.selectControl.value, this.timeUnitControl.value),
689
- regex: false,
690
- operator: value,
691
- unitOfTime: this.timeUnitControl.value,
692
- });
693
- }));
694
- this.subsink.add(this.timeUnitControl.valueChanges.subscribe((value) => {
695
- if (!this.selectControl.value)
696
- return;
697
- this.control.setValue({
698
- unitOfTimeValue: TimeUnitSelectComponent.convert(this.selectControl.value, this.control.value.unitOfTime, value),
699
- value: TimeUnitSelectComponent.toMilliseconds(this.selectControl.value, this.control.value.unitOfTime),
700
- regex: false,
701
- operator: this.operatorControl.value,
702
- unitOfTime: value,
703
- });
704
- }));
705
- this.changeDetectorRef.detectChanges();
706
- }
707
- ngOnDestroy() {
708
- this.subsink.unsubscribe();
709
- }
710
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderDurationFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
711
- 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: [
712
- {
713
- provide: NG_VALUE_ACCESSOR,
714
- multi: true,
715
- useExisting: forwardRef(() => HeaderDurationFilterComponent),
716
- },
717
- ], ngImport: i0, template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field class=\"ngx-datatable-duration-filter\" appearance=\"fill\" [class.has-value]=\"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 type=\"number\" [formControl]=\"selectControl\" [placeholder]=\"column.placeholder!\" />\n\n <lib-time-unit-select [locale]=\"column.locale\" matSuffix [formControl]=\"timeUnitControl\"></lib-time-unit-select>\n\n <button\n *ngIf=\"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}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" }] });
718
- }
719
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderDurationFilterComponent, decorators: [{
720
- type: Component,
721
- args: [{ selector: 'lib-header-duration-filter', imports: [
722
- CommonModule,
723
- FormsModule,
724
- MatButtonModule,
725
- MatFormFieldModule,
726
- MatIconModule,
727
- MatInputModule,
728
- ReactiveFormsModule,
729
- OperatorSelectComponent,
730
- TimeUnitSelectComponent,
731
- SafeHtmlPipe,
732
- ], providers: [
733
- {
734
- provide: NG_VALUE_ACCESSOR,
735
- multi: true,
736
- useExisting: forwardRef(() => HeaderDurationFilterComponent),
737
- },
738
- ], template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field class=\"ngx-datatable-duration-filter\" appearance=\"fill\" [class.has-value]=\"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 type=\"number\" [formControl]=\"selectControl\" [placeholder]=\"column.placeholder!\" />\n\n <lib-time-unit-select [locale]=\"column.locale\" matSuffix [formControl]=\"timeUnitControl\"></lib-time-unit-select>\n\n <button\n *ngIf=\"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}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"] }]
739
- }], propDecorators: { column: [{
740
- type: Input
741
- }] } });
742
-
743
- /** @format */
744
- class HeaderNumberFilterComponent {
745
- column;
746
- control;
747
- selectControl = new FormControl();
748
- operatorControl = new FormControl('=');
749
- onChange = () => { };
750
- onTouched = () => { };
751
- injector = inject(Injector);
752
- changeDetectorRef = inject(ChangeDetectorRef);
753
- subsink = new Subscription();
754
- writeValue = (value) => {
755
- if (value?.value !== this.selectControl.value)
756
- this.selectControl.setValue(value?.value);
757
- };
758
- registerOnChange(onChange) {
759
- this.onChange = onChange;
760
- }
761
- registerOnTouched(onTouched) {
762
- this.onTouched = onTouched;
763
- }
764
- async ngAfterViewInit() {
765
- const ngControl = this.injector.get(NgControl, null);
766
- if (!ngControl)
767
- throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
768
- this.control = ngControl.control;
769
- this.subsink.add(this.selectControl.valueChanges.subscribe((value) => {
770
- if (this.control.invalid)
771
- return;
772
- else if (!value)
773
- this.control.setValue(undefined);
774
- else
775
- this.control.setValue({ value, regex: false, operator: this.operatorControl.value });
776
- }));
777
- this.subsink.add(this.operatorControl.valueChanges.subscribe((value) => {
778
- if (this.control.value === null || this.control.value === undefined)
779
- return;
780
- this.control.setValue({ value: this.selectControl.value, regex: false, operator: value });
781
- }));
782
- this.changeDetectorRef.detectChanges();
783
- }
784
- ngOnDestroy() {
785
- this.subsink.unsubscribe();
786
- }
787
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderNumberFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
788
- 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: [
789
- {
790
- provide: NG_VALUE_ACCESSOR,
791
- multi: true,
792
- useExisting: forwardRef(() => HeaderNumberFilterComponent),
793
- },
794
- ], ngImport: i0, template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field class=\"ngx-datatable-number-filter\" appearance=\"fill\" [class.has-value]=\"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\" />\n\n <button\n *ngIf=\"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" }] });
795
- }
796
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderNumberFilterComponent, decorators: [{
797
- type: Component,
798
- args: [{ selector: 'lib-header-number-filter', imports: [
799
- CommonModule,
800
- FormsModule,
801
- MatButtonModule,
802
- MatFormFieldModule,
803
- MatIconModule,
804
- MatInputModule,
805
- MatMenuModule,
806
- ReactiveFormsModule,
807
- OperatorSelectComponent,
808
- SafeHtmlPipe,
809
- ], providers: [
810
- {
811
- provide: NG_VALUE_ACCESSOR,
812
- multi: true,
813
- useExisting: forwardRef(() => HeaderNumberFilterComponent),
814
- },
815
- ], template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field class=\"ngx-datatable-number-filter\" appearance=\"fill\" [class.has-value]=\"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\" />\n\n <button\n *ngIf=\"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"] }]
816
- }], propDecorators: { column: [{
817
- type: Input
818
- }] } });
819
-
820
- /** @format */
821
- class IsArrayPipe {
822
- transform(obj) {
823
- return Array.isArray(obj);
824
- }
825
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: IsArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
826
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: IsArrayPipe, isStandalone: true, name: "isArray" });
827
- }
828
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: IsArrayPipe, decorators: [{
829
- type: Pipe,
830
- args: [{ name: 'isArray' }]
831
- }] });
832
-
833
- /** @format */
834
- class SelectOptionPipe {
835
- transform(value, options) {
836
- if (!options)
837
- return null;
838
- return options.find((option) => option.value === value) || null;
839
- }
840
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SelectOptionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
841
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: SelectOptionPipe, isStandalone: true, name: "selectOption" });
842
- }
843
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SelectOptionPipe, decorators: [{
844
- type: Pipe,
845
- args: [{ name: 'selectOption' }]
846
- }] });
847
-
848
- /** @format */
849
- class HeaderSelectFilterComponent {
850
- column;
851
- options = [];
852
- groups = [];
853
- control;
854
- selectControl = new FormControl();
855
- onChange = () => { };
856
- onTouched = () => { };
857
- injector = inject(Injector);
858
- changeDetectorRef = inject(ChangeDetectorRef);
859
- subsink = new Subscription();
860
- writeValue = (controlValue) => {
861
- if (controlValue?.value !== this.selectControl.value) {
862
- const value = controlValue?.value;
863
- if (value && !Array.isArray(value) && this.column.multiple) {
864
- this.selectControl.setValue([value]);
865
- }
866
- else
867
- this.selectControl.setValue(value);
868
- }
869
- this.changeDetectorRef.detectChanges();
870
- };
871
- registerOnChange(onChange) {
872
- this.onChange = onChange;
873
- }
874
- registerOnTouched(onTouched) {
875
- this.onTouched = onTouched;
876
- }
877
- async ngAfterViewInit() {
878
- const ngControl = this.injector.get(NgControl, null);
879
- if (!ngControl)
880
- throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
881
- this.control = ngControl.control;
882
- this.subsink.add(this.selectControl.valueChanges.subscribe((value) => {
883
- if (value === undefined)
884
- this.control.setValue(undefined);
885
- else
886
- this.control.setValue({ value, operator: this.column.multiple ? '$in' : undefined, regex: false });
887
- }));
888
- if (Array.isArray(this.column.options))
889
- this.buildOptions(this.column.options);
890
- else
891
- this.subsink.add(this.column.options.subscribe(data => {
892
- this.options = [];
893
- this.groups = [];
894
- this.buildOptions(data);
895
- }));
896
- this.changeDetectorRef.detectChanges();
897
- }
898
- ngOnDestroy() {
899
- this.subsink.unsubscribe();
900
- }
901
- buildOptions(data) {
902
- data.forEach(d => {
903
- this.options.push(d);
904
- const name = d.group ?? '';
905
- const group = this.groups.find(g => g.name === name);
906
- if (!group)
907
- this.groups.push({ name, options: [d] });
908
- else
909
- group.options.push(d);
910
- });
911
- }
912
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderSelectFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
913
- 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: [
914
- {
915
- provide: NG_VALUE_ACCESSOR,
916
- multi: true,
917
- useExisting: forwardRef(() => HeaderSelectFilterComponent),
918
- },
919
- ], 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 [formControl]=\"selectControl\" [placeholder]=\"column.placeholder!\" [multiple]=\"column.multiple\">\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\"\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" }] });
920
- }
921
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderSelectFilterComponent, decorators: [{
922
- type: Component,
923
- args: [{ selector: 'lib-header-select-filter', imports: [
924
- CommonModule,
925
- FormsModule,
926
- MatButtonModule,
927
- MatFormFieldModule,
928
- MatIconModule,
929
- MatSelectModule,
930
- ReactiveFormsModule,
931
- SelectOptionPipe,
932
- SafeHtmlPipe,
933
- IsArrayPipe,
934
- ], providers: [
935
- {
936
- provide: NG_VALUE_ACCESSOR,
937
- multi: true,
938
- useExisting: forwardRef(() => HeaderSelectFilterComponent),
939
- },
940
- ], template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field appearance=\"fill\">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n <mat-select [formControl]=\"selectControl\" [placeholder]=\"column.placeholder!\" [multiple]=\"column.multiple\">\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\"\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"] }]
941
- }], propDecorators: { column: [{
942
- type: Input
943
- }] } });
944
-
945
- /** @format */
946
- class HeaderTextFilterComponent {
947
- column;
948
- control;
949
- selectControl = new FormControl();
950
- onChange = () => { };
951
- onTouched = () => { };
952
- injector = inject(Injector);
953
- changeDetectorRef = inject(ChangeDetectorRef);
954
- subsink = new Subscription();
955
- writeValue = (value) => {
956
- if (this.column.regex) {
957
- if (value?.value !== this.selectControl.value)
958
- this.selectControl.setValue(value?.value);
959
- }
960
- else {
961
- const val = this.escapeRegExp(this.selectControl.value);
962
- if (val !== (value?.value ?? ''))
963
- this.selectControl.setValue(val);
964
- }
965
- };
966
- registerOnChange(onChange) {
967
- this.onChange = onChange;
968
- }
969
- registerOnTouched(onTouched) {
970
- this.onTouched = onTouched;
971
- }
972
- async ngAfterViewInit() {
973
- const ngControl = this.injector.get(NgControl, null);
974
- if (!ngControl)
975
- throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
976
- this.control = ngControl.control;
977
- this.subsink.add(this.selectControl.valueChanges.subscribe((value) => {
978
- if (!value)
979
- this.control.setValue(undefined);
980
- else {
981
- if (this.column.regex)
982
- this.control.setValue({ value, regex: true });
983
- else
984
- this.control.setValue({ value: this.escapeRegExp(value), regex: true });
985
- }
986
- }));
987
- this.changeDetectorRef.detectChanges();
988
- }
989
- ngOnDestroy() {
990
- this.subsink.unsubscribe();
991
- }
992
- escapeRegExp(value) {
993
- if (!value)
994
- return '';
995
- return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
996
- }
997
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderTextFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
998
- 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: [
999
- {
1000
- provide: NG_VALUE_ACCESSOR,
1001
- multi: true,
1002
- useExisting: forwardRef(() => HeaderTextFilterComponent),
1003
- },
1004
- ], ngImport: i0, template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field appearance=\"fill\" [class.has-value]=\"selectControl.value\">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n <input matInput [formControl]=\"selectControl\" />\n <button\n *ngIf=\"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" }] });
1005
- }
1006
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderTextFilterComponent, decorators: [{
1007
- type: Component,
1008
- args: [{ selector: 'lib-header-text-filter', imports: [
1009
- CommonModule,
1010
- FormsModule,
1011
- MatButtonModule,
1012
- MatFormFieldModule,
1013
- MatIconModule,
1014
- MatInputModule,
1015
- ReactiveFormsModule,
1016
- SafeHtmlPipe,
1017
- ], providers: [
1018
- {
1019
- provide: NG_VALUE_ACCESSOR,
1020
- multi: true,
1021
- useExisting: forwardRef(() => HeaderTextFilterComponent),
1022
- },
1023
- ], template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field appearance=\"fill\" [class.has-value]=\"selectControl.value\">\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n <input matInput [formControl]=\"selectControl\" />\n <button\n *ngIf=\"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"] }]
1024
- }], propDecorators: { column: [{
1025
- type: Input
1026
- }] } });
1027
-
1028
- /** @format */
1029
- const DEFAULT_LABELS = {
1030
- noDateLabel: 'No data',
1031
- itemsPerPageLabel: `Items per page:`,
1032
- nextPageLabel: `Next page`,
1033
- lastPageLabel: `Last page`,
1034
- previousPageLabel: `Previous page`,
1035
- firstPageLabel: `First page`,
1036
- onLabel: `on`,
1037
- };
1038
- const LABELS = {
1039
- fr: {
1040
- noDateLabel: 'Aucune donnée',
1041
- itemsPerPageLabel: `Éléments par page :`,
1042
- nextPageLabel: `Page suivante`,
1043
- lastPageLabel: `Dernière page`,
1044
- previousPageLabel: `Page précédente`,
1045
- firstPageLabel: `Première page`,
1046
- onLabel: `sur`,
1047
- },
1048
- };
1049
- const DEFAULT_NUMBER_OPTIONS = {
1050
- separator: ',',
1051
- decimal: '.',
1052
- };
1053
- const NUMBER_OPTIONS = {
1054
- fr: {
1055
- separator: ' ',
1056
- decimal: ',',
1057
- },
1058
- };
1059
- class NgxMatDatatableIntl {
1060
- locale = inject(LOCALE_ID);
1061
- noDateLabel;
1062
- itemsPerPageLabel;
1063
- nextPageLabel;
1064
- lastPageLabel;
1065
- previousPageLabel;
1066
- firstPageLabel;
1067
- onLabel;
1068
- numberOptions;
1069
- getRangeLabel = (page, pageSize, length) => {
1070
- if (length === 0 || pageSize === 0)
1071
- return `0 ${this.onLabel} ${length}`;
1072
- length = Math.max(length, 0);
1073
- const startIndex = page * pageSize;
1074
- const endIndex = startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize;
1075
- return `${startIndex + 1} - ${endIndex} ${this.onLabel} ${length}`;
1076
- };
1077
- constructor() {
1078
- this.setLabels(LABELS[this.locale] ?? DEFAULT_LABELS);
1079
- this.numberOptions = NUMBER_OPTIONS[this.locale] ?? DEFAULT_NUMBER_OPTIONS;
1080
- }
1081
- setLabels(labels) {
1082
- this.noDateLabel = labels.noDateLabel;
1083
- this.itemsPerPageLabel = labels.itemsPerPageLabel;
1084
- this.nextPageLabel = labels.nextPageLabel;
1085
- this.lastPageLabel = labels.lastPageLabel;
1086
- this.previousPageLabel = labels.previousPageLabel;
1087
- this.firstPageLabel = labels.firstPageLabel;
1088
- this.onLabel = labels.onLabel;
1089
- }
1090
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1091
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableIntl });
1092
- }
1093
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableIntl, decorators: [{
1094
- type: Injectable
1095
- }], ctorParameters: () => [] });
1096
-
1097
- /** @format */
1098
- class MergePipe {
1099
- transform(obj, src) {
1100
- return src ? { ...obj, ...src } : { ...obj };
1101
- }
1102
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: MergePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1103
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: MergePipe, isStandalone: true, name: "merge" });
1104
- }
1105
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: MergePipe, decorators: [{
1106
- type: Pipe,
1107
- args: [{ name: 'merge' }]
1108
- }] });
1109
-
1110
- /** @format */
1111
- class ProgressSpinnerComponent {
1112
- datatableIntl = inject(NgxMatDatatableIntl);
1113
- diameter = 100;
1114
- set setValue(value) {
1115
- if (typeof value === 'string')
1116
- this._value = parseFloat(value);
1117
- else
1118
- this._value = value;
1119
- if (this.animateInView)
1120
- this.load(this.isInView);
1121
- }
1122
- _value = 0;
1123
- value = 0;
1124
- color;
1125
- set setDisplayValue(displayValue) {
1126
- this.displayValue = displayValue !== false;
1127
- }
1128
- displayValue = true;
1129
- get getColor() {
1130
- return this.color;
1131
- }
1132
- fontSize = `${this.diameter / 5}px`;
1133
- set setAnimateInView(animateInView) {
1134
- this.animateInView = animateInView !== false;
1135
- }
1136
- animateInView = true;
1137
- set setDelay(delay) {
1138
- if (typeof delay === 'string')
1139
- this.delay = parseInt(delay);
1140
- else
1141
- this.delay = delay;
1142
- }
1143
- delay;
1144
- isInView = false;
1145
- load(intersect) {
1146
- this.isInView = intersect;
1147
- if (this.isInView) {
1148
- if (this.delay)
1149
- setTimeout(() => (this.value = this._value), this.delay);
1150
- else
1151
- this.value = this._value;
1152
- }
1153
- }
1154
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: ProgressSpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1155
- 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" }] });
1156
- }
1157
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: ProgressSpinnerComponent, decorators: [{
1158
- type: Component,
1159
- 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"] }]
1160
- }], propDecorators: { diameter: [{
1161
- type: Input
1162
- }], setValue: [{
1163
- type: Input,
1164
- args: ['value']
1165
- }], color: [{
1166
- type: Input
1167
- }], setDisplayValue: [{
1168
- type: Input,
1169
- args: ['displayValue']
1170
- }], getColor: [{
1171
- type: HostBinding,
1172
- args: ['style.--progress-spinner-color']
1173
- }], fontSize: [{
1174
- type: Input
1175
- }], setAnimateInView: [{
1176
- type: Input,
1177
- args: ['animateInView']
1178
- }], setDelay: [{
1179
- type: Input,
1180
- args: ['delay']
1181
- }] } });
1182
-
1183
- /** @format */
1184
- class DatagridDataSource extends DataSource {
1185
- service;
1186
- loading$ = new BehaviorSubject(true);
1187
- recordsFiltered = 0;
1188
- recordsTotal;
1189
- facets;
1190
- rowSize = 0; // row size in kb
1191
- get data() {
1192
- return this.dataStream.value;
1193
- }
1194
- options;
1195
- dataStream = new BehaviorSubject([]);
1196
- constructor(service) {
1197
- super();
1198
- this.service = service;
1199
- }
1200
- connect() {
1201
- return this.dataStream;
1202
- }
1203
- disconnect() { }
1204
- async loadData(options) {
1205
- this.options = options;
1206
- this.loading$.next(true);
1207
- try {
1208
- const result = await this.service(options);
1209
- if (options.draw !== result.draw)
1210
- return;
1211
- this.recordsTotal = result.recordsTotal;
1212
- this.recordsFiltered = result.recordsFiltered;
1213
- this.facets = result.facets;
1214
- this.dataStream.next(result.data);
1215
- this.calculateRowSize(result.data);
1216
- }
1217
- finally {
1218
- this.loading$.next(false);
1219
- }
1220
- }
1221
- refresh() {
1222
- if (this.options)
1223
- this.loadData(this.options);
1224
- }
1225
- redraw(match) {
1226
- const data = [];
1227
- this.dataStream.value.forEach(d => {
1228
- if (match) {
1229
- if (match(d))
1230
- data.push({ ...d });
1231
- else
1232
- data.push(d);
1233
- }
1234
- else
1235
- data.push({ ...d });
1236
- });
1237
- this.dataStream.next(data);
1238
- }
1239
- calculateRowSize(data) {
1240
- let total = 0;
1241
- for (let row of data) {
1242
- const size = new TextEncoder().encode(JSON.stringify(row)).length;
1243
- const kiloBytes = size / 1024;
1244
- total += kiloBytes / 1024;
1245
- }
1246
- this.rowSize = total && data.length ? total / data.length : 0;
1247
- }
1248
- }
1249
-
1250
- /** @format */
1251
- class NgxMatDatatableContentDirective {
1252
- templateRef;
1253
- id;
1254
- constructor(templateRef) {
1255
- this.templateRef = templateRef;
1256
- }
1257
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableContentDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
1258
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.4", type: NgxMatDatatableContentDirective, isStandalone: true, selector: "[ngxMatDatatableContent]", inputs: { id: ["ngxMatDatatableContent", "id"] }, ngImport: i0 });
1259
- }
1260
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableContentDirective, decorators: [{
1261
- type: Directive,
1262
- args: [{
1263
- selector: '[ngxMatDatatableContent]',
1264
- }]
1265
- }], ctorParameters: () => [{ type: i0.TemplateRef }], propDecorators: { id: [{
1266
- type: Input,
1267
- args: ['ngxMatDatatableContent']
1268
- }] } });
1269
-
1270
- /** @format */
1271
- class BackgroundColorPipe {
1272
- transform(row, column, options) {
1273
- if (typeof column.backgroundColor === 'string')
1274
- return column.backgroundColor;
1275
- if (typeof column.backgroundColor === 'function')
1276
- return column.backgroundColor(row);
1277
- if (typeof options.rowBackgroundColor === 'string')
1278
- return options.rowBackgroundColor;
1279
- if (typeof options.rowBackgroundColor === 'function')
1280
- return options.rowBackgroundColor(column, row);
1281
- }
1282
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: BackgroundColorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1283
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: BackgroundColorPipe, isStandalone: true, name: "backgroundColor" });
1284
- }
1285
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: BackgroundColorPipe, decorators: [{
1286
- type: Pipe,
1287
- args: [{ name: 'backgroundColor' }]
1288
- }] });
1289
-
1290
- /** @format */
1291
- class CellColorPipe {
1292
- transform(row, column, options) {
1293
- if (typeof column.color === 'string')
1294
- return column.color;
1295
- if (typeof column.color === 'function')
1296
- return column.color(row);
1297
- if (typeof options.rowColor === 'string')
1298
- return options.rowColor;
1299
- if (typeof options.rowColor === 'function')
1300
- return options.rowColor(column, row);
1301
- }
1302
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellColorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1303
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: CellColorPipe, isStandalone: true, name: "cellColor" });
1304
- }
1305
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellColorPipe, decorators: [{
1306
- type: Pipe,
1307
- args: [{ name: 'cellColor' }]
1308
- }] });
1309
-
1310
- /** @format */
1311
- class CellOpacityPipe {
1312
- transform(row, column, options) {
1313
- if (typeof options.rowOpacity === 'string')
1314
- return options.rowOpacity;
1315
- if (typeof options.rowOpacity === 'function')
1316
- return options.rowOpacity(column, row);
1317
- }
1318
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellOpacityPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1319
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: CellOpacityPipe, isStandalone: true, name: "cellOpacity" });
1320
- }
1321
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellOpacityPipe, decorators: [{
1322
- type: Pipe,
1323
- args: [{ name: 'cellOpacity' }]
1324
- }] });
1325
-
1326
- /** @format */
1327
- class FilterPipe {
1328
- transform(obj, filter) {
1329
- return (obj ?? []).filter(o => {
1330
- for (let key of Object.keys(filter)) {
1331
- if (o[key] !== filter[key])
1332
- return false;
1333
- }
1334
- return true;
1335
- });
1336
- }
1337
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FilterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1338
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: FilterPipe, isStandalone: true, name: "filter" });
1339
- }
1340
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FilterPipe, decorators: [{
1341
- type: Pipe,
1342
- args: [{ name: 'filter' }]
1343
- }] });
1344
-
1345
- /** @format */
1346
- class FindContentPipe {
1347
- transform(contentRefs, id) {
1348
- return contentRefs?.find(ref => ref.id === id);
1349
- }
1350
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FindContentPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1351
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: FindContentPipe, isStandalone: true, name: "findContent" });
1352
- }
1353
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FindContentPipe, decorators: [{
1354
- type: Pipe,
1355
- args: [{ name: 'findContent' }]
1356
- }] });
1357
-
1358
- /** @format */
1359
- class FindPipe {
1360
- transform(obj, filter) {
1361
- return (obj ?? []).find(o => {
1362
- for (let key of Object.keys(filter)) {
1363
- if (o[key] !== filter[key])
1364
- return false;
1365
- }
1366
- return true;
1367
- });
1368
- }
1369
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FindPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1370
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: FindPipe, isStandalone: true, name: "find" });
1371
- }
1372
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FindPipe, decorators: [{
1373
- type: Pipe,
1374
- args: [{ name: 'find' }]
1375
- }] });
1376
-
1377
- /** @format */
1378
- class IncludedInPipe {
1379
- transform(elmt, obj) {
1380
- return (obj ?? []).includes(elmt);
1381
- }
1382
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: IncludedInPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1383
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: IncludedInPipe, isStandalone: true, name: "includedIn" });
1384
- }
1385
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: IncludedInPipe, decorators: [{
1386
- type: Pipe,
1387
- args: [{ name: 'includedIn' }]
1388
- }] });
1389
-
1390
- /** @format */
1391
- class OrderByPipe {
1392
- transform(data, keys, dirs) {
1393
- return lodash.orderBy(data, typeof keys === 'string' ? [keys] : keys, typeof dirs === 'string' ? [dirs] : dirs);
1394
- }
1395
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: OrderByPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1396
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: OrderByPipe, isStandalone: true, name: "orderBy" });
1397
- }
1398
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: OrderByPipe, decorators: [{
1399
- type: Pipe,
1400
- args: [{
1401
- name: 'orderBy',
1402
- }]
1403
- }] });
1404
-
1405
- /** @format */
1406
- class SortFacetEntriesPipe {
1407
- transform(entries, options) {
1408
- if (!entries || !options)
1409
- return entries;
1410
- return entries.sort((e1, e2) => {
1411
- const ie1 = options.findIndex(o => o.value === e1._id);
1412
- if (ie1 === -1)
1413
- return 1;
1414
- const ie2 = options.findIndex(o => o.value === e2._id);
1415
- if (ie2 === -1)
1416
- return -1;
1417
- return ie1 - ie2;
1418
- });
1419
- }
1420
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SortFacetEntriesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1421
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: SortFacetEntriesPipe, isStandalone: true, name: "sortFacetEntries" });
1422
- }
1423
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SortFacetEntriesPipe, decorators: [{
1424
- type: Pipe,
1425
- args: [{ name: 'sortFacetEntries' }]
1426
- }] });
1427
-
1428
- /** @format */
1429
- class SumPipe {
1430
- transform(obj, by) {
1431
- if (!obj || !obj.length)
1432
- return 0;
1433
- if (by)
1434
- return obj.reduce((pv, cv) => (pv += cv[by]), 0);
1435
- return obj.reduce((pv, cv) => (pv += cv), 0);
1436
- }
1437
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SumPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1438
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: SumPipe, isStandalone: true, name: "sum" });
1439
- }
1440
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SumPipe, decorators: [{
1441
- type: Pipe,
1442
- args: [{ name: 'sum' }]
1443
- }] });
1444
-
1445
- /** @format */
1446
- function duration(data, options) {
1447
- const durationOption = { maxDecimalPoints: 0, largest: 1, fallbacks: ['en'] };
1448
- if (options?.locale)
1449
- durationOption.language = options.locale;
1450
- if (options?.largest)
1451
- durationOption.largest = options.largest;
1452
- let value;
1453
- if (typeof data === 'number')
1454
- value = data;
1455
- else if (typeof data === 'string') {
1456
- const date = new Date(data);
1457
- if (isNaN(date.valueOf()))
1458
- return null;
1459
- value = Date.now() - date.valueOf();
1460
- }
1461
- else if (typeof data?.valueOf === 'function')
1462
- value = Date.now() - data.valueOf();
1463
- if (value === undefined || value === null)
1464
- return null;
1465
- return humanizeDuration(value, durationOption);
1466
- }
1467
-
1468
- /** @format */
1469
- function get(obj, path) {
1470
- const chunks = path.split('.');
1471
- let value = obj;
1472
- for (let i = 0; i < chunks.length; ++i) {
1473
- value = value[chunks[i]];
1474
- if (value === undefined || value === null)
1475
- return null;
1476
- }
1477
- return value;
1478
- }
1479
-
1480
- /** @format */
1481
- class NgxMatDatatablePaginatorIntl extends MatPaginatorIntl {
1482
- datatableIntl = inject(NgxMatDatatableIntl);
1483
- itemsPerPageLabel = this.datatableIntl.itemsPerPageLabel;
1484
- nextPageLabel = this.datatableIntl.nextPageLabel;
1485
- lastPageLabel = this.datatableIntl.lastPageLabel;
1486
- previousPageLabel = this.datatableIntl.previousPageLabel;
1487
- firstPageLabel = this.datatableIntl.firstPageLabel;
1488
- onLabel = this.datatableIntl.onLabel;
1489
- getRangeLabel = (page, pageSize, length) => {
1490
- return this.datatableIntl.getRangeLabel(page, pageSize, length);
1491
- };
1492
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatablePaginatorIntl, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1493
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatablePaginatorIntl });
1494
- }
1495
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatablePaginatorIntl, decorators: [{
1496
- type: Injectable
1497
- }] });
1498
- class NgxMatDatatableComponent {
1499
- options;
1500
- config;
1501
- rowClicked = new EventEmitter();
1502
- configUpdated = new EventEmitter();
1503
- searchUpdated = new EventEmitter();
1504
- ready = new EventEmitter();
1505
- paginator;
1506
- contentRefs;
1507
- displayedColumns = [];
1508
- disabledRows = [];
1509
- dataSource;
1510
- expandedRow = null;
1511
- loaded = false;
1512
- searchFormGroup;
1513
- datatableIntl = inject(NgxMatDatatableIntl);
1514
- subscriptions = new rxjs.Subscription();
1515
- changeDetectorRef = inject(ChangeDetectorRef);
1516
- get data() {
1517
- return this._data;
1518
- }
1519
- _data;
1520
- container;
1521
- head;
1522
- matTable;
1523
- observer = new ResizeObserver(entries => {
1524
- entries.forEach(entry => {
1525
- const containerHeight = this.container?.nativeElement.clientHeight ?? 0;
1526
- const containerWidth = this.container?.nativeElement.clientWidth ?? 0;
1527
- const headerHeight = this.head?.nativeElement.clientHeight ?? 0;
1528
- const headerWidth = this.head?.nativeElement.clientWidth ?? 0;
1529
- const contentHeight = entry.contentRect.height;
1530
- const contentWidth = entry.contentRect.width;
1531
- this.tableContainerOverflowY = containerHeight - headerHeight - contentHeight < 0 ? 'auto' : 'inherit';
1532
- this.tableContainerOverflowX = containerWidth - headerWidth - contentWidth < 0 ? 'auto' : 'inherit';
1533
- });
1534
- });
1535
- tableContainerOverflowY = 'inherit';
1536
- tableContainerOverflowX = 'inherit';
1537
- async ngOnInit() {
1538
- if (!this.options?.service)
1539
- throw new Error(`missing mongoose datatable component service`);
1540
- if (!this.options?.columns)
1541
- throw new Error(`missing mongoose datatable component columns`);
1542
- await this.applyConfig();
1543
- this.buildDisplayColumns();
1544
- this.buildSearchFormGroup();
1545
- this.dataSource = new DatagridDataSource(this.options.service);
1546
- this.ready.emit(this);
1547
- this.changeDetectorRef.detectChanges();
1548
- }
1549
- ngOnDestroy() {
1550
- if (this.matTable)
1551
- this.observer.unobserve(this.matTable._elementRef.nativeElement);
1552
- this.subscriptions.unsubscribe();
1553
- }
1554
- load(intersect) {
1555
- if (!intersect || this.loaded)
1556
- return;
1557
- this.loaded = true;
1558
- if (this.matTable)
1559
- this.observer.observe(this.matTable?._elementRef.nativeElement);
1560
- this.subscriptions.add(this.paginator?.page.subscribe(() => {
1561
- this.updateConfig();
1562
- this.loadPage();
1563
- }));
1564
- this.loadPage();
1565
- }
1566
- sortColumn(column) {
1567
- if (column.sortable === false)
1568
- return;
1569
- if (!column.order)
1570
- column.order = { index: this.options.columns.filter(c => !!c.order).length, dir: 'asc' };
1571
- else if (column.order.dir === 'asc')
1572
- column.order.dir = 'desc';
1573
- else {
1574
- delete column.order;
1575
- this.consolidateOrderIndex();
1576
- }
1577
- this.paginator.pageIndex = 0;
1578
- this.loadPage();
1579
- }
1580
- redraw(match) {
1581
- this.dataSource.redraw(match);
1582
- this.changeDetectorRef.detectChanges();
1583
- }
1584
- refreshColumns() {
1585
- this.buildDisplayColumns();
1586
- }
1587
- exporting = false;
1588
- async export() {
1589
- this.exporting = true;
1590
- try {
1591
- const columns = this.buildRequestColumns();
1592
- const order = this.buildOrder(columns);
1593
- const max = Math.min(Math.floor(5 / this.dataSource.rowSize), this.dataSource.recordsFiltered);
1594
- const chunks = [];
1595
- for (let i = 0; i < Math.ceil(this.dataSource.recordsFiltered / max); ++i) {
1596
- chunks.push({ start: i, length: max });
1597
- }
1598
- const data = (await Promise.all(chunks.map(c => this.options.service({ draw: Date.now().toString(), columns, order, start: c.start, length: c.length })))).reduce((pv, cv) => (pv.push(...cv.data), pv), []);
1599
- const rows = [];
1600
- for (let d of data) {
1601
- const row = {};
1602
- for (let c of this.options.columns) {
1603
- if (c.hidden || c.disabled)
1604
- continue;
1605
- let value = get(d, c.property);
1606
- if (c.export)
1607
- c.export(row, value, d);
1608
- else {
1609
- if (c.transform)
1610
- value = c.transform(value, d);
1611
- switch (c.type) {
1612
- case 'select':
1613
- this.buildExportSelectColumn(c, row, value);
1614
- break;
1615
- case 'duration':
1616
- this.buildExportDurationColumn(c, row, value);
1617
- break;
1618
- default:
1619
- row[c.header] = value;
1620
- }
1621
- }
1622
- }
1623
- rows.push(row);
1624
- }
1625
- const workbook = XLSX.utils.book_new();
1626
- const worksheet = XLSX.utils.json_to_sheet(rows);
1627
- XLSX.utils.book_append_sheet(workbook, worksheet, 'export');
1628
- const filename = typeof this.options.actions?.export === 'string' ? this.options.actions.export : 'export';
1629
- await XLSX.writeFile(workbook, `${filename}-${Date.now()}.xlsx`);
1630
- }
1631
- finally {
1632
- this.exporting = false;
1633
- }
1634
- }
1635
- async buildExportSelectColumn(column, row, value) {
1636
- if (Array.isArray(column.options)) {
1637
- row[column.header] = column.options.find(option => option.value === value)?.name ?? value;
1638
- }
1639
- else if (column.__options) {
1640
- row[column.header] = column.__options.find(option => option.value === value)?.name ?? value;
1641
- }
1642
- else {
1643
- const options = await rxjs.lastValueFrom(column.options);
1644
- row[column.header] = options.find(option => option.value === value)?.name ?? value;
1645
- }
1646
- }
1647
- async buildExportDurationColumn(column, row, value) {
1648
- row[`${column.header} ms`] = value;
1649
- row[column.header] = duration(value, column);
1650
- }
1651
- async loadPage() {
1652
- if (!this.dataSource)
1653
- return;
1654
- const columns = this.buildRequestColumns();
1655
- const order = this.buildOrder(columns);
1656
- await this.dataSource.loadData({
1657
- draw: Date.now().toString(),
1658
- columns,
1659
- start: this.paginator.pageIndex,
1660
- length: this.paginator.pageSize,
1661
- order,
1662
- facets: this.options.facets,
1663
- });
1664
- this._data = this.dataSource.data;
1665
- this.buildDisabledRows();
1666
- }
1667
- buildDisabledRows() {
1668
- this.disabledRows = [];
1669
- if (this.options.rowDisabled) {
1670
- this.dataSource.data?.forEach(d => {
1671
- if (typeof this.options.rowDisabled === 'string') {
1672
- if (get(d, this.options.rowDisabled) === true)
1673
- this.disabledRows.push(d);
1674
- }
1675
- else if (typeof this.options.rowDisabled === 'function') {
1676
- if (this.options.rowDisabled(d))
1677
- this.disabledRows.push(d);
1678
- }
1679
- });
1680
- }
1681
- }
1682
- buildOrder(columns) {
1683
- const order = [];
1684
- this.options.columns
1685
- .filter(c => !!c.order)
1686
- .sort((c1, c2) => c1.order.index - c2.order.index)
1687
- .forEach(c => {
1688
- const index = columns.findIndex(column => column.data === (c.sortProperty || c.property));
1689
- if (index !== -1)
1690
- order.push({ column: index, dir: c.order.dir });
1691
- });
1692
- return order;
1693
- }
1694
- updateColumns = [];
1695
- openUpdateColumnDisplay() {
1696
- this.updateColumns = this.options.columns.map(column => ({
1697
- columnDef: column.columnDef,
1698
- header: column.header,
1699
- sticky: column.sticky,
1700
- hidden: column.hidden,
1701
- }));
1702
- }
1703
- reorderColumns(event) {
1704
- moveItemInArray(this.updateColumns, event.previousIndex, event.currentIndex);
1705
- }
1706
- closeUpdateColumnDisplay() {
1707
- let reload = false;
1708
- this.updateColumns.forEach((updated, index) => {
1709
- const columnIndex = this.options.columns.findIndex(c => c.columnDef === updated.columnDef);
1710
- if (columnIndex == -1)
1711
- return;
1712
- if (columnIndex !== index)
1713
- moveItemInArray(this.options.columns, columnIndex, index);
1714
- const column = this.options.columns[index];
1715
- if (updated.sticky !== column.sticky)
1716
- column.sticky = updated.sticky;
1717
- if (updated.hidden !== column.hidden) {
1718
- column.hidden = updated.hidden;
1719
- reload = reload || !updated.hidden;
1720
- }
1721
- });
1722
- this.buildDisplayColumns();
1723
- this.updateConfig();
1724
- if (reload)
1725
- this.loadPage();
1726
- }
1727
- rowClick(row) {
1728
- if (this.disabledRows.includes(row))
1729
- return;
1730
- if (typeof this.options.actions?.rowClick === 'boolean') {
1731
- this.rowClicked.emit(row);
1732
- }
1733
- else if (typeof this.options.actions?.rowClick === 'function') {
1734
- this.options.actions.rowClick(row);
1735
- this.rowClicked.emit(row);
1736
- }
1737
- }
1738
- facetClick(column, result, option) {
1739
- if (!column)
1740
- return;
1741
- const control = this.searchFormGroup?.controls[column.columnDef];
1742
- if (!control)
1743
- return;
1744
- if (option && option.value !== control.value?.value)
1745
- control.setValue({ value: option.value, name: option.name });
1746
- else if (result._id !== control.value?.value)
1747
- control.setValue({ value: result._id });
1748
- }
1749
- buildRequestColumns() {
1750
- const columns = [];
1751
- const additionalColumns = [];
1752
- if (this.options.additionalProperties) {
1753
- this.options.additionalProperties.forEach(property => this.addAdditionalColumn(additionalColumns, property));
1754
- }
1755
- this.options.columns.forEach(c => {
1756
- if (c.hidden)
1757
- return;
1758
- const column = {
1759
- data: c.property,
1760
- projection: c.projection,
1761
- name: c.columnDef,
1762
- searchable: c.searchable,
1763
- };
1764
- if (c.sortProperty && c.order)
1765
- this.addAdditionalColumn(additionalColumns, c.sortProperty);
1766
- if (c.searchable) {
1767
- const control = this.searchFormGroup.controls[c.columnDef];
1768
- if (control.value) {
1769
- if (c.searchProperty)
1770
- this.addAdditionalColumn(additionalColumns, c.searchProperty, control.value);
1771
- else
1772
- column.search = control.value;
1773
- }
1774
- }
1775
- if (c.additionalProperties) {
1776
- c.additionalProperties.forEach(property => this.addAdditionalColumn(additionalColumns, property));
1777
- }
1778
- columns.push(column);
1779
- });
1780
- for (let additionalColumn of additionalColumns) {
1781
- const c = columns.find(c => c.data === additionalColumn.data);
1782
- if (!c)
1783
- columns.push(additionalColumn);
1784
- else if (additionalColumn.search && !c.search)
1785
- c.search = additionalColumn.search;
1786
- }
1787
- return columns;
1788
- }
1789
- addAdditionalColumn(additionalColumns, data, search) {
1790
- let column = additionalColumns.find(c => c.data === data);
1791
- if (!column)
1792
- additionalColumns.push((column = { data }));
1793
- if (search) {
1794
- column.search = search;
1795
- column.searchable = true;
1796
- }
1797
- return column;
1798
- }
1799
- buildDisplayColumns() {
1800
- const displayedColumns = [];
1801
- this.options.columns.forEach(column => {
1802
- if (column.hidden || column.disabled)
1803
- return;
1804
- displayedColumns.push(column.columnDef);
1805
- if (column.type && ['number', 'date', 'duration'].includes(column.type)) {
1806
- if (!column.locale)
1807
- column.locale = this.datatableIntl.locale;
1808
- }
1809
- });
1810
- this.displayedColumns = displayedColumns;
1811
- }
1812
- buildSearchFormGroup() {
1813
- this.searchFormGroup = new FormGroup(this.options.columns.reduce((controls, column) => {
1814
- if (column.searchable) {
1815
- const control = new FormControl({
1816
- value: column.searchValue !== undefined ? { value: column.searchValue } : undefined,
1817
- disabled: false,
1818
- });
1819
- controls[column.columnDef] = control;
1820
- if (typeof column.searchUpdated === 'function') {
1821
- this.subscriptions.add(control.valueChanges.pipe(rxjs.debounceTime(500)).subscribe(value => column.searchUpdated(value)));
1822
- }
1823
- }
1824
- return controls;
1825
- }, {}));
1826
- this.subscriptions.add(this.searchFormGroup.valueChanges.pipe(rxjs.debounceTime(500)).subscribe(value => {
1827
- this.searchUpdated.next(value);
1828
- this.paginator.pageIndex = 0;
1829
- this.loadPage();
1830
- }));
1831
- }
1832
- consolidateOrderIndex() {
1833
- let index = 0;
1834
- this.options.columns
1835
- .filter(c => !!c.order)
1836
- .sort((c1, c2) => c1.order.index - c2.order.index)
1837
- .forEach(c => (c.order.index = index++));
1838
- }
1839
- async applyConfig() {
1840
- if (this.options?.configService?.get) {
1841
- const config = await this.options.configService.get();
1842
- this.config = config ?? this.config;
1843
- }
1844
- if (this.options?.columns && this.config?.columns) {
1845
- this.config.columns.forEach((updated, index) => {
1846
- const columnIndex = this.options.columns.findIndex(c => c.columnDef === updated.columnDef);
1847
- if (columnIndex == -1)
1848
- return;
1849
- if (columnIndex !== index)
1850
- moveItemInArray(this.options.columns, columnIndex, index);
1851
- const column = this.options.columns[index];
1852
- if (column && updated.sticky !== column.sticky)
1853
- column.sticky = updated.sticky;
1854
- if (column && updated.hidden !== column.hidden)
1855
- column.hidden = updated.hidden;
1856
- });
1857
- this.buildDisplayColumns();
1858
- }
1859
- if (this.options && typeof this.config?.pageSizeOptionsIndex === 'number') {
1860
- this.options.pageSizeOptionsIndex = this.config.pageSizeOptionsIndex;
1861
- }
1862
- }
1863
- updateConfig() {
1864
- const pageSizeOptions = this.options.pageSizeOptions ?? [5, 10, 20, 50, 100];
1865
- const pageSizeOptionsIndex = pageSizeOptions.indexOf(this.paginator?.pageSize ?? 0);
1866
- const columns = this.options.columns.map(c => ({ columnDef: c.columnDef, sticky: c.sticky, hidden: c.hidden }));
1867
- this.config = { columns, pageSizeOptionsIndex };
1868
- this.configUpdated.next(this.config);
1869
- if (this.options?.configService?.set)
1870
- this.options.configService.set(this.config);
1871
- }
1872
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1873
- 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" } }, 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: "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 <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 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 id=\"paginator\"\n [length]=\"dataSource.recordsFiltered\"\n [pageSizeOptions]=\"options.pageSizeOptions || [5, 10, 20, 50, 100]\"\n [pageSize]=\"(options.pageSizeOptions ?? [5, 10, 20, 50, 100])[options.pageSizeOptionsIndex ?? 0]\"\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 <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 </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 @switch (action.kind) {\n @case ('icon') {\n <div class=\"action user-action\" [matTooltip]=\"action.tooltip\">\n <button [style.--action-color]=\"action.color\" mat-icon-button (click)=\"action.onclick(this)\">\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 }\" />\n }\n </div>\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))}#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-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}#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.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.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i12.MatCell, selector: "mat-cell, td[mat-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: "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: [
1874
- trigger('fade', [
1875
- transition(':enter', [
1876
- style({ opacity: 0 }), // initial
1877
- animate('0.2s', style({ opacity: 1 })), // final
1878
- ]),
1879
- transition(':leave', [
1880
- style({ opacity: 1 }), // initial
1881
- animate('0.2s', style({ opacity: 0 })), // final
1882
- ]),
1883
- ]),
1884
- trigger('detailExpand', [
1885
- state('collapsed', style({ height: '0px', minHeight: '0' })),
1886
- state('expanded', style({ height: '*' })),
1887
- transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
1888
- ]),
1889
- ], deferBlockDependencies: [() => [import('./eherve-angular-material-datatable-cell-checkbox-value.component-B1xA4rcx.mjs').then(m => m.CellCheckboxValueComponent), import('./eherve-angular-material-datatable-cell-date-value.component-SmZolfO2.mjs').then(m => m.CellDateValueComponent), import('./eherve-angular-material-datatable-cell-duration-value.component-CCoKwOCi.mjs').then(m => m.CellDurationValueComponent), import('./eherve-angular-material-datatable-cell-number-value.component-CVh45vmC.mjs').then(m => m.CellNumberValueComponent), import('./eherve-angular-material-datatable-cell-select-value.component-omrgKZsE.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-DLd8yb47.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)]] });
1890
- }
1891
- i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableComponent, resolveDeferredDeps: () => [import('./eherve-angular-material-datatable-cell-checkbox-value.component-B1xA4rcx.mjs').then(m => m.CellCheckboxValueComponent), import('./eherve-angular-material-datatable-cell-date-value.component-SmZolfO2.mjs').then(m => m.CellDateValueComponent), import('./eherve-angular-material-datatable-cell-duration-value.component-CCoKwOCi.mjs').then(m => m.CellDurationValueComponent), import('./eherve-angular-material-datatable-cell-number-value.component-CVh45vmC.mjs').then(m => m.CellNumberValueComponent), import('./eherve-angular-material-datatable-cell-select-value.component-omrgKZsE.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-DLd8yb47.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: [{
1892
- type: Component,
1893
- args: [{ imports: [
1894
- CellCheckboxValueComponent,
1895
- CellDateValueComponent,
1896
- CellDurationValueComponent,
1897
- CellNumberValueComponent,
1898
- CellSelectValueComponent,
1899
- CellColorPipe,
1900
- CommonModule,
1901
- TransformPipe,
1902
- DragDropModule,
1903
- FindContentPipe,
1904
- FormsModule,
1905
- GetPipe,
1906
- HeaderAutocompleteFilterComponent,
1907
- HeaderCheckboxFilterComponent,
1908
- HeaderDateFilterComponent,
1909
- HeaderDurationFilterComponent,
1910
- HeaderNumberFilterComponent,
1911
- HeaderSelectFilterComponent,
1912
- HeaderTextFilterComponent,
1913
- IntersectionObserverModule,
1914
- MatBadgeModule,
1915
- MatButtonModule,
1916
- MatFormFieldModule,
1917
- MatIconModule,
1918
- MatMenuModule,
1919
- MatPaginatorModule,
1920
- MatProgressSpinnerModule,
1921
- MatTableModule,
1922
- MatChipsModule,
1923
- ReactiveFormsModule,
1924
- SafeHtmlPipe,
1925
- MatTooltipModule,
1926
- BackgroundColorPipe,
1927
- FilterPipe,
1928
- SumPipe,
1929
- MatCardModule,
1930
- CountUpModule,
1931
- ProgressSpinnerComponent,
1932
- FindPipe,
1933
- OrderByPipe,
1934
- SortFacetEntriesPipe,
1935
- ValueFunctionPipe,
1936
- IncludedInPipe,
1937
- CellOpacityPipe,
1938
- ], providers: [{ provide: MatPaginatorIntl, useClass: NgxMatDatatablePaginatorIntl }], selector: 'ngx-mat-datatable', animations: [
1939
- trigger('fade', [
1940
- transition(':enter', [
1941
- style({ opacity: 0 }), // initial
1942
- animate('0.2s', style({ opacity: 1 })), // final
1943
- ]),
1944
- transition(':leave', [
1945
- style({ opacity: 1 }), // initial
1946
- animate('0.2s', style({ opacity: 0 })), // final
1947
- ]),
1948
- ]),
1949
- trigger('detailExpand', [
1950
- state('collapsed', style({ height: '0px', minHeight: '0' })),
1951
- state('expanded', style({ height: '*' })),
1952
- transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
1953
- ]),
1954
- ], 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 <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 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 id=\"paginator\"\n [length]=\"dataSource.recordsFiltered\"\n [pageSizeOptions]=\"options.pageSizeOptions || [5, 10, 20, 50, 100]\"\n [pageSize]=\"(options.pageSizeOptions ?? [5, 10, 20, 50, 100])[options.pageSizeOptionsIndex ?? 0]\"\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 <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 </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 @switch (action.kind) {\n @case ('icon') {\n <div class=\"action user-action\" [matTooltip]=\"action.tooltip\">\n <button [style.--action-color]=\"action.color\" mat-icon-button (click)=\"action.onclick(this)\">\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 }\" />\n }\n </div>\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))}#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-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}#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"] }]
1955
- }], ctorParameters: null, propDecorators: { options: [{
1956
- type: Input,
1957
- args: ['options']
1958
- }], config: [{
1959
- type: Input
1960
- }], rowClicked: [{
1961
- type: Output
1962
- }], configUpdated: [{
1963
- type: Output
1964
- }], searchUpdated: [{
1965
- type: Output
1966
- }], ready: [{
1967
- type: Output
1968
- }], paginator: [{
1969
- type: ViewChild,
1970
- args: [MatPaginator]
1971
- }], contentRefs: [{
1972
- type: ContentChildren,
1973
- args: [NgxMatDatatableContentDirective]
1974
- }], container: [{
1975
- type: ViewChild,
1976
- args: ['container']
1977
- }], head: [{
1978
- type: ViewChild,
1979
- args: ['head']
1980
- }], matTable: [{
1981
- type: ViewChild,
1982
- args: [MatTable]
1983
- }], tableContainerOverflowY: [{
1984
- type: HostBinding,
1985
- args: ['style.--datatable-container-overflow-y']
1986
- }], tableContainerOverflowX: [{
1987
- type: HostBinding,
1988
- args: ['style.--datatable-container-overflow-x']
1989
- }] } }) });
1990
-
1991
- /** @format */
1992
- class NgxMatDatatableModule {
1993
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1994
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableModule, imports: [NgxMatDatatableComponent, NgxMatDatatableContentDirective], exports: [NgxMatDatatableComponent, NgxMatDatatableContentDirective] });
1995
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableModule, providers: [NgxMatDatatableIntl], imports: [NgxMatDatatableComponent] });
1996
- }
1997
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableModule, decorators: [{
1998
- type: NgModule,
1999
- args: [{
2000
- imports: [NgxMatDatatableComponent, NgxMatDatatableContentDirective],
2001
- exports: [NgxMatDatatableComponent, NgxMatDatatableContentDirective],
2002
- providers: [NgxMatDatatableIntl],
2003
- }]
2004
- }] });
2005
-
2006
- /** @format */
2007
-
2008
- /** @format */
2009
-
2010
- /** @format */
2011
-
2012
- /** @format */
2013
-
2014
- /** @format */
2015
-
2016
- /**
2017
- * Public API Surface of mongoose-datatable
2018
- *
2019
- * @format
2020
- */
2021
-
2022
- /**
2023
- * Generated bundle index. Do not edit.
2024
- */
2025
-
2026
- export { IsArrayPipe as I, NgxMatDatatableModule as N, SelectOptionPipe as S, SafeHtmlPipe as a, NgxMatDatatableComponent as b, NgxMatDatatableContentDirective as c, duration as d, NgxMatDatatableIntl as e, get as g };
2027
- //# sourceMappingURL=eherve-angular-material-datatable-eherve-angular-material-datatable-DEVM6I6-.mjs.map