@eherve/angular-material-datatable 19.0.11 → 19.0.12

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.
@@ -0,0 +1,1344 @@
1
+ import { trigger, transition, style, animate } from '@angular/animations';
2
+ import * as i2$1 from '@angular/cdk/drag-drop';
3
+ import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
4
+ import * as i1$1 from '@angular/common';
5
+ import { CommonModule } from '@angular/common';
6
+ import * as i0 from '@angular/core';
7
+ import { Pipe, inject, Injector, ChangeDetectorRef, forwardRef, Component, Input, ViewChild, signal, ChangeDetectionStrategy, Directive, LOCALE_ID, Injectable, Inject, EventEmitter, Output, ContentChildren, NgModule } from '@angular/core';
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 i4$1 from '@angular/material/form-field';
15
+ import { MatFormFieldModule } from '@angular/material/form-field';
16
+ import * as i5$1 from '@angular/material/icon';
17
+ import { MatIconModule } from '@angular/material/icon';
18
+ import * as i8 from '@angular/material/menu';
19
+ import { MatMenuModule } from '@angular/material/menu';
20
+ import * as i9 from '@angular/material/paginator';
21
+ import { MatPaginatorIntl, MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
22
+ import * as i10$1 from '@angular/material/progress-spinner';
23
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
24
+ import * as i11 from '@angular/material/table';
25
+ import { MatTableModule } from '@angular/material/table';
26
+ import * as i12 from '@angular/material/tooltip';
27
+ import { MatTooltipModule } from '@angular/material/tooltip';
28
+ import * as i3 from 'ngx-intersection-observer';
29
+ import { IntersectionObserverModule } from 'ngx-intersection-observer';
30
+ import { BehaviorSubject, Subject, Subscription, filter, debounceTime, switchMap, startWith, tap, map } from 'rxjs';
31
+ import * as i4 from '@angular/material/autocomplete';
32
+ import { MatAutocompleteModule } from '@angular/material/autocomplete';
33
+ import * as i6 from '@angular/material/input';
34
+ import { MatInputModule } from '@angular/material/input';
35
+ import * as i10 from '@angular/material/progress-bar';
36
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
37
+ import * as i1 from '@angular/platform-browser';
38
+ import * as i5 from '@angular/material/core';
39
+ import { DateAdapter, MAT_DATE_LOCALE } from '@angular/material/core';
40
+ import * as i3$2 from '@angular/material/checkbox';
41
+ import { MatCheckboxModule } from '@angular/material/checkbox';
42
+ import { provideMomentDateAdapter } from '@angular/material-moment-adapter';
43
+ import * as i4$2 from '@angular/material/datepicker';
44
+ import { MatDatepickerIntl, MatDatepickerModule } from '@angular/material/datepicker';
45
+ import moment from 'moment';
46
+ import * as i1$2 from '@angular/cdk/overlay';
47
+ import { OverlayModule } from '@angular/cdk/overlay';
48
+ import * as i6$1 from '@angular/material/select';
49
+ import { MatSelectModule } from '@angular/material/select';
50
+ import { DataSource } from '@angular/cdk/collections';
51
+
52
+ /** @format */
53
+ class SafeHtmlPipe {
54
+ sanitizer;
55
+ constructor(sanitizer) {
56
+ this.sanitizer = sanitizer;
57
+ }
58
+ transform(html) {
59
+ return this.sanitizer.bypassSecurityTrustHtml(html);
60
+ }
61
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
62
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: SafeHtmlPipe, isStandalone: true, name: "safeHtml" });
63
+ }
64
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SafeHtmlPipe, decorators: [{
65
+ type: Pipe,
66
+ args: [{
67
+ name: 'safeHtml',
68
+ }]
69
+ }], ctorParameters: () => [{ type: i1.DomSanitizer }] });
70
+
71
+ var safeHtml_pipe = /*#__PURE__*/Object.freeze({
72
+ __proto__: null,
73
+ SafeHtmlPipe: SafeHtmlPipe
74
+ });
75
+
76
+ /** @format */
77
+ class HeaderAutocompleteFilterComponent {
78
+ column;
79
+ options = [];
80
+ hasMore = false;
81
+ searching = false;
82
+ input;
83
+ control;
84
+ selectControl = new FormControl();
85
+ onChange = () => { };
86
+ onTouched = () => { };
87
+ filter$ = new BehaviorSubject(undefined);
88
+ nextPage$ = new Subject();
89
+ injector = inject(Injector);
90
+ changeDetectorRef = inject(ChangeDetectorRef);
91
+ subsink = new Subscription();
92
+ writeValue = (value) => {
93
+ if (value?.value !== this.selectControl.value)
94
+ this.selectControl.setValue(value?.value);
95
+ };
96
+ registerOnChange(onChange) {
97
+ this.onChange = onChange;
98
+ }
99
+ registerOnTouched(onTouched) {
100
+ this.onTouched = onTouched;
101
+ }
102
+ async ngAfterViewInit() {
103
+ const ngControl = this.injector.get(NgControl, null);
104
+ if (!ngControl)
105
+ throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
106
+ this.control = ngControl.control;
107
+ this.subsink.add(this.selectControl.valueChanges.subscribe((value) => {
108
+ if (value === undefined) {
109
+ if (this.control.value !== undefined)
110
+ this.control.setValue(undefined);
111
+ }
112
+ if (value === null && !this.options.find(o => o.value === null)) {
113
+ if (this.control.value !== undefined)
114
+ this.control.setValue(undefined);
115
+ }
116
+ else if (this.control.value?.value !== value)
117
+ this.control.setValue({ value, regex: false });
118
+ }));
119
+ this.buildOptions();
120
+ this.changeDetectorRef.detectChanges();
121
+ }
122
+ ngOnDestroy() {
123
+ this.subsink.unsubscribe();
124
+ }
125
+ loadMore(intersect) {
126
+ if (!intersect)
127
+ return;
128
+ this.nextPage$.next();
129
+ }
130
+ focus() {
131
+ if (this.column.loadOnFocus) {
132
+ const search = this.input.nativeElement.value;
133
+ if (this.filter$.value !== search)
134
+ this.filter$.next(search);
135
+ }
136
+ }
137
+ filter() {
138
+ const search = this.input.nativeElement.value;
139
+ this.filter$.next(search);
140
+ }
141
+ buildOptions() {
142
+ this.subsink.add(this.filter$
143
+ .pipe(filter(value => typeof value === 'string'), debounceTime(300), switchMap((search) => {
144
+ this.options = [];
145
+ let skip = 0;
146
+ return this.nextPage$.pipe(startWith(skip), tap(() => (this.searching = true)), switchMap(async () => this.column.options(this.column.limit || 10, skip, search)), map(data => {
147
+ this.options.push(...data);
148
+ skip += this.column.limit || 10;
149
+ this.hasMore = data?.length === (this.column.limit || 10);
150
+ this.searching = false;
151
+ }));
152
+ }))
153
+ .subscribe());
154
+ }
155
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderAutocompleteFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
156
+ 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: [
157
+ {
158
+ provide: NG_VALUE_ACCESSOR,
159
+ multi: true,
160
+ useExisting: forwardRef(() => HeaderAutocompleteFilterComponent),
161
+ },
162
+ ], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], 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>\n @for (option of options; track option) {\n <mat-option [value]=\"option.value\">\n <ng-container *ngTemplateOutlet=\"autocompleteOption; context: { option }\"></ng-container>\n </mat-option>\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 <mat-icon [style.color]=\"option.iconColor\" [style.margin-right.px]=\"8\">\n {{ option.icon }}\n </mat-icon>\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(--ngx-mat-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: "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" }] });
163
+ }
164
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderAutocompleteFilterComponent, decorators: [{
165
+ type: Component,
166
+ args: [{ selector: 'lib-header-autocomplete-filter', imports: [
167
+ CommonModule,
168
+ FormsModule,
169
+ IntersectionObserverModule,
170
+ MatAutocompleteModule,
171
+ MatButtonModule,
172
+ MatFormFieldModule,
173
+ MatIconModule,
174
+ MatInputModule,
175
+ MatProgressBarModule,
176
+ ReactiveFormsModule,
177
+ SafeHtmlPipe,
178
+ ], providers: [
179
+ {
180
+ provide: NG_VALUE_ACCESSOR,
181
+ multi: true,
182
+ useExisting: forwardRef(() => HeaderAutocompleteFilterComponent),
183
+ },
184
+ ], 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>\n @for (option of options; track option) {\n <mat-option [value]=\"option.value\">\n <ng-container *ngTemplateOutlet=\"autocompleteOption; context: { option }\"></ng-container>\n </mat-option>\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 <mat-icon [style.color]=\"option.iconColor\" [style.margin-right.px]=\"8\">\n {{ option.icon }}\n </mat-icon>\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(--ngx-mat-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"] }]
185
+ }], propDecorators: { column: [{
186
+ type: Input
187
+ }], input: [{
188
+ type: ViewChild,
189
+ args: ['input']
190
+ }] } });
191
+
192
+ /** @format */
193
+ class HeaderCheckboxFilterComponent {
194
+ column;
195
+ control;
196
+ selectControl = new FormControl();
197
+ onChange = () => { };
198
+ onTouched = () => { };
199
+ injector = inject(Injector);
200
+ changeDetectorRef = inject(ChangeDetectorRef);
201
+ subsink = new Subscription();
202
+ writeValue = (value) => {
203
+ if (value?.value !== this.selectControl.value)
204
+ this.selectControl.setValue(value?.value);
205
+ };
206
+ registerOnChange(onChange) {
207
+ this.onChange = onChange;
208
+ }
209
+ registerOnTouched(onTouched) {
210
+ this.onTouched = onTouched;
211
+ }
212
+ async ngAfterViewInit() {
213
+ const ngControl = this.injector.get(NgControl, null);
214
+ if (!ngControl)
215
+ throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
216
+ this.control = ngControl.control;
217
+ let previousValue = this.control.value;
218
+ this.subsink.add(this.selectControl.valueChanges
219
+ .pipe(filter(value => {
220
+ if (value === true && previousValue === false) {
221
+ this.selectControl.setValue(undefined);
222
+ return false;
223
+ }
224
+ return true;
225
+ }), tap(value => (previousValue = value)))
226
+ .subscribe((value) => {
227
+ if (value === undefined)
228
+ this.control.setValue(undefined);
229
+ else
230
+ this.control.setValue({ value, regex: false });
231
+ }));
232
+ this.changeDetectorRef.detectChanges();
233
+ }
234
+ ngOnDestroy() {
235
+ this.subsink.unsubscribe();
236
+ }
237
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderCheckboxFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
238
+ 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: [
239
+ {
240
+ provide: NG_VALUE_ACCESSOR,
241
+ multi: true,
242
+ useExisting: forwardRef(() => HeaderCheckboxFilterComponent),
243
+ },
244
+ ], 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(--ngx-mat-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" }] });
245
+ }
246
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderCheckboxFilterComponent, decorators: [{
247
+ type: Component,
248
+ args: [{ selector: 'lib-header-checkbox-filter', imports: [
249
+ CommonModule,
250
+ FormsModule,
251
+ MatButtonModule,
252
+ MatFormFieldModule,
253
+ MatIconModule,
254
+ MatCheckboxModule,
255
+ ReactiveFormsModule,
256
+ SafeHtmlPipe,
257
+ ], providers: [
258
+ {
259
+ provide: NG_VALUE_ACCESSOR,
260
+ multi: true,
261
+ useExisting: forwardRef(() => HeaderCheckboxFilterComponent),
262
+ },
263
+ ], 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(--ngx-mat-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"] }]
264
+ }], propDecorators: { column: [{
265
+ type: Input
266
+ }] } });
267
+
268
+ /** @format */
269
+ const OPERATORS = ['=', '>', '≥', '<', '≤', '<>', '≤≥'];
270
+ class OperatorSelectComponent {
271
+ set setDisableRange(disableRange) {
272
+ this.disableRange = disableRange !== false;
273
+ if (this.disableRange)
274
+ this.operators = OPERATORS.slice(0, 5);
275
+ else
276
+ this.operators = OPERATORS;
277
+ }
278
+ disableRange = false;
279
+ operators = OPERATORS;
280
+ isOpen = false;
281
+ control;
282
+ onChange = () => { };
283
+ onTouched = () => { };
284
+ injector = inject(Injector);
285
+ changeDetectorRef = inject(ChangeDetectorRef);
286
+ writeValue = () => { };
287
+ registerOnChange(onChange) {
288
+ this.onChange = onChange;
289
+ }
290
+ registerOnTouched(onTouched) {
291
+ this.onTouched = onTouched;
292
+ }
293
+ async ngAfterViewInit() {
294
+ const ngControl = this.injector.get(NgControl, null);
295
+ if (!ngControl)
296
+ throw new Error(`${this.constructor.name} missing control`);
297
+ this.control = ngControl.control;
298
+ this.changeDetectorRef.detectChanges();
299
+ }
300
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: OperatorSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
301
+ 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: [
302
+ {
303
+ provide: NG_VALUE_ACCESSOR,
304
+ multi: true,
305
+ useExisting: forwardRef(() => OperatorSelectComponent),
306
+ },
307
+ ], 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: [
308
+ trigger('fade', [
309
+ transition(':enter', [
310
+ style({ opacity: 0 }), // initial
311
+ animate('0.2s', style({ opacity: 1 })), // final
312
+ ]),
313
+ transition(':leave', [
314
+ style({ opacity: 1 }), // initial
315
+ animate('0.2s', style({ opacity: 0 })), // final
316
+ ]),
317
+ ]),
318
+ ] });
319
+ }
320
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: OperatorSelectComponent, decorators: [{
321
+ type: Component,
322
+ args: [{ selector: 'lib-operator-select', imports: [CommonModule, OverlayModule, MatIconModule, MatButtonModule], animations: [
323
+ trigger('fade', [
324
+ transition(':enter', [
325
+ style({ opacity: 0 }), // initial
326
+ animate('0.2s', style({ opacity: 1 })), // final
327
+ ]),
328
+ transition(':leave', [
329
+ style({ opacity: 1 }), // initial
330
+ animate('0.2s', style({ opacity: 0 })), // final
331
+ ]),
332
+ ]),
333
+ ], providers: [
334
+ {
335
+ provide: NG_VALUE_ACCESSOR,
336
+ multi: true,
337
+ useExisting: forwardRef(() => OperatorSelectComponent),
338
+ },
339
+ ], 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"] }]
340
+ }], propDecorators: { setDisableRange: [{
341
+ type: Input,
342
+ args: ['disableRange']
343
+ }] } });
344
+
345
+ /** @format */
346
+ class HeaderDateFilterComponent {
347
+ column;
348
+ control;
349
+ selectControl = new FormControl(undefined);
350
+ rangeGroup = new FormGroup({
351
+ from: new FormControl(undefined, Validators.required),
352
+ to: new FormControl(undefined, Validators.required),
353
+ });
354
+ operatorControl = new FormControl('=');
355
+ onChange = () => { };
356
+ onTouched = () => { };
357
+ _adapter = inject(DateAdapter);
358
+ _intl = inject(MatDatepickerIntl);
359
+ _locale = signal(inject(MAT_DATE_LOCALE));
360
+ injector = inject(Injector);
361
+ changeDetectorRef = inject(ChangeDetectorRef);
362
+ subsink = new Subscription();
363
+ writeValue = (value) => {
364
+ // if (value?.operator && this.operatorControl.value !== value.operator) this.operatorControl.setValue(value.operator);
365
+ // if (['<>', '≤≥'].includes(this.operatorControl.value!)) {
366
+ // if (value?.value?.from !== this.rangeGroup.value.from && value?.value?.to !== this.rangeGroup.value.to) {
367
+ // this.rangeGroup.setValue({ from: value.value.from, to: value.value.to });
368
+ // }
369
+ // } else if (value?.value !== this.selectControl.value) this.selectControl.setValue(value?.value);
370
+ };
371
+ registerOnChange(onChange) {
372
+ this.onChange = onChange;
373
+ }
374
+ registerOnTouched(onTouched) {
375
+ this.onTouched = onTouched;
376
+ }
377
+ ngOnInit() {
378
+ if (this.column.locale) {
379
+ this._locale.set(this.column.locale);
380
+ this._adapter.setLocale(this._locale());
381
+ this._intl.changes.next();
382
+ }
383
+ }
384
+ async ngAfterViewInit() {
385
+ const ngControl = this.injector.get(NgControl, null);
386
+ if (!ngControl)
387
+ throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
388
+ this.control = ngControl.control;
389
+ this.subsink.add(this.selectControl.valueChanges.pipe(debounceTime(500)).subscribe(value => {
390
+ if (this.control.invalid)
391
+ return;
392
+ else if (!value)
393
+ this.control.setValue(undefined);
394
+ else
395
+ this.control.setValue(this.buildValue(this.operatorControl.value, value));
396
+ }));
397
+ this.subsink.add(this.rangeGroup.valueChanges.pipe(debounceTime(500)).subscribe(value => {
398
+ if (this.rangeGroup.invalid)
399
+ return;
400
+ if (!value)
401
+ this.control.setValue(undefined);
402
+ else
403
+ this.control.setValue(this.buildValue(this.operatorControl.value, value));
404
+ }));
405
+ this.subsink.add(this.operatorControl.valueChanges.subscribe((value) => {
406
+ if (['<>', '≤≥'].includes(value)) {
407
+ if (!this.rangeGroup.value || this.rangeGroup.invalid)
408
+ return;
409
+ this.control.setValue(this.buildValue(value, this.rangeGroup.value));
410
+ }
411
+ else {
412
+ if (!this.selectControl.value)
413
+ return;
414
+ this.control.setValue(this.buildValue(value, this.selectControl.value));
415
+ }
416
+ }));
417
+ this.changeDetectorRef.detectChanges();
418
+ }
419
+ ngOnDestroy() {
420
+ this.subsink.unsubscribe();
421
+ }
422
+ buildValue(operator, value) {
423
+ switch (operator) {
424
+ case '=':
425
+ return {
426
+ operator: '≤≥',
427
+ value: { from: moment(value).startOf('day'), to: moment(value).endOf('day') },
428
+ };
429
+ case '>':
430
+ return { operator, value: moment(value).endOf('day') };
431
+ case '≥':
432
+ return { operator, value: moment(value).startOf('day') };
433
+ case '<':
434
+ return { operator, value: moment(value).startOf('day') };
435
+ case '≤':
436
+ return { operator, value: moment(value).endOf('day') };
437
+ case '<>':
438
+ return { operator, value: { from: moment(value.from).endOf('day'), to: moment(value.to).startOf('day') } };
439
+ case '≤≥':
440
+ return { operator, value: { from: moment(value.from).startOf('day'), to: moment(value.to).endOf('day') } };
441
+ }
442
+ }
443
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderDateFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
444
+ 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: [
445
+ {
446
+ provide: NG_VALUE_ACCESSOR,
447
+ multi: true,
448
+ useExisting: forwardRef(() => HeaderDateFilterComponent),
449
+ },
450
+ provideMomentDateAdapter(),
451
+ ], 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(--ngx-mat-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 });
452
+ }
453
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderDateFilterComponent, decorators: [{
454
+ type: Component,
455
+ args: [{ selector: 'lib-header-date-filter', imports: [
456
+ CommonModule,
457
+ FormsModule,
458
+ MatButtonModule,
459
+ MatDatepickerModule,
460
+ MatFormFieldModule,
461
+ MatIconModule,
462
+ MatInputModule,
463
+ ReactiveFormsModule,
464
+ OperatorSelectComponent,
465
+ SafeHtmlPipe,
466
+ ], providers: [
467
+ {
468
+ provide: NG_VALUE_ACCESSOR,
469
+ multi: true,
470
+ useExisting: forwardRef(() => HeaderDateFilterComponent),
471
+ },
472
+ provideMomentDateAdapter(),
473
+ ], 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(--ngx-mat-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"] }]
474
+ }], propDecorators: { column: [{
475
+ type: Input
476
+ }] } });
477
+
478
+ /** @format */
479
+ const TIME_UNITS = ['second', 'minute', 'hour', 'day', 'month', 'year'];
480
+ const MOMENT_RELATIVE_TIME_KEY = ['ss', 'mm', 'hh', 'dd', 'MM', 'yy'];
481
+ class TimeUnitSelectComponent {
482
+ static toMilliseconds(value, unit) {
483
+ return moment.duration(value, unit).as('milliseconds');
484
+ }
485
+ static convert(value, from, to) {
486
+ if (to === undefined)
487
+ (to = from), (from = 'millisecond');
488
+ return moment.duration(value, from).as(to);
489
+ }
490
+ set setLocale(locale) {
491
+ this.locale = locale || moment.locale();
492
+ this.loadUnitNames();
493
+ }
494
+ locale = moment.locale();
495
+ units = TIME_UNITS;
496
+ unitNames = {};
497
+ isOpen = false;
498
+ control;
499
+ onChange = () => { };
500
+ onTouched = () => { };
501
+ injector = inject(Injector);
502
+ changeDetectorRef = inject(ChangeDetectorRef);
503
+ writeValue = () => { };
504
+ registerOnChange(onChange) {
505
+ this.onChange = onChange;
506
+ }
507
+ registerOnTouched(onTouched) {
508
+ this.onTouched = onTouched;
509
+ }
510
+ ngOnInit() {
511
+ this.loadUnitNames();
512
+ }
513
+ async ngAfterViewInit() {
514
+ const ngControl = this.injector.get(NgControl, null);
515
+ if (!ngControl)
516
+ throw new Error(`${this.constructor.name} missing control`);
517
+ this.control = ngControl.control;
518
+ this.changeDetectorRef.detectChanges();
519
+ }
520
+ loadUnitNames() {
521
+ this.unitNames = this.units.reduce((pv, cv, i) => ((pv[cv] = moment
522
+ .localeData(this.locale)
523
+ .relativeTime('', true, MOMENT_RELATIVE_TIME_KEY[i], false)
524
+ .trim()),
525
+ pv), {});
526
+ }
527
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: TimeUnitSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
528
+ 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: [
529
+ {
530
+ provide: NG_VALUE_ACCESSOR,
531
+ multi: true,
532
+ useExisting: forwardRef(() => TimeUnitSelectComponent),
533
+ },
534
+ ], 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: [
535
+ trigger('fade', [
536
+ transition(':enter', [
537
+ style({ opacity: 0 }), // initial
538
+ animate('0.2s', style({ opacity: 1 })), // final
539
+ ]),
540
+ transition(':leave', [
541
+ style({ opacity: 1 }), // initial
542
+ animate('0.2s', style({ opacity: 0 })), // final
543
+ ]),
544
+ ]),
545
+ ] });
546
+ }
547
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: TimeUnitSelectComponent, decorators: [{
548
+ type: Component,
549
+ args: [{ selector: 'lib-time-unit-select', imports: [CommonModule, OverlayModule, MatIconModule, MatButtonModule], animations: [
550
+ trigger('fade', [
551
+ transition(':enter', [
552
+ style({ opacity: 0 }), // initial
553
+ animate('0.2s', style({ opacity: 1 })), // final
554
+ ]),
555
+ transition(':leave', [
556
+ style({ opacity: 1 }), // initial
557
+ animate('0.2s', style({ opacity: 0 })), // final
558
+ ]),
559
+ ]),
560
+ ], providers: [
561
+ {
562
+ provide: NG_VALUE_ACCESSOR,
563
+ multi: true,
564
+ useExisting: forwardRef(() => TimeUnitSelectComponent),
565
+ },
566
+ ], 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"] }]
567
+ }], propDecorators: { setLocale: [{
568
+ type: Input,
569
+ args: ['locale']
570
+ }] } });
571
+
572
+ /** @format */
573
+ class HeaderDurationFilterComponent {
574
+ column;
575
+ control;
576
+ selectControl = new FormControl(undefined);
577
+ rangeGroup = new FormGroup({
578
+ start: new FormControl(undefined, Validators.required),
579
+ end: new FormControl(undefined, Validators.required),
580
+ });
581
+ operatorControl = new FormControl('=');
582
+ timeUnitControl = new FormControl('second');
583
+ onChange = () => { };
584
+ onTouched = () => { };
585
+ injector = inject(Injector);
586
+ changeDetectorRef = inject(ChangeDetectorRef);
587
+ subsink = new Subscription();
588
+ writeValue = (value) => {
589
+ if (value?.unitOfTime)
590
+ this.timeUnitControl.setValue(value.unitOfTime, { emitEvent: false });
591
+ if (value?.value !== null && value?.value !== undefined) {
592
+ let selectValue = TimeUnitSelectComponent.convert(value.value, this.timeUnitControl.value);
593
+ if (this.selectControl.value !== selectValue)
594
+ this.selectControl.setValue(selectValue);
595
+ }
596
+ else
597
+ this.selectControl.setValue(null);
598
+ };
599
+ registerOnChange(onChange) {
600
+ this.onChange = onChange;
601
+ }
602
+ registerOnTouched(onTouched) {
603
+ this.onTouched = onTouched;
604
+ }
605
+ ngOnInit() { }
606
+ async ngAfterViewInit() {
607
+ const ngControl = this.injector.get(NgControl, null);
608
+ if (!ngControl)
609
+ throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
610
+ this.control = ngControl.control;
611
+ this.subsink.add(this.selectControl.valueChanges.pipe(debounceTime(500)).subscribe(value => {
612
+ if (this.control.invalid)
613
+ return;
614
+ else if (!value)
615
+ this.control.setValue(undefined);
616
+ else
617
+ this.control.setValue({
618
+ unitOfTimeValue: value,
619
+ value: TimeUnitSelectComponent.toMilliseconds(value, this.timeUnitControl.value),
620
+ regex: false,
621
+ operator: this.operatorControl.value,
622
+ unitOfTime: this.timeUnitControl.value,
623
+ });
624
+ }));
625
+ this.subsink.add(this.operatorControl.valueChanges.subscribe((value) => {
626
+ if (!this.selectControl.value)
627
+ return;
628
+ this.control.setValue({
629
+ unitOfTimeValue: this.selectControl.value,
630
+ value: TimeUnitSelectComponent.toMilliseconds(this.selectControl.value, this.timeUnitControl.value),
631
+ regex: false,
632
+ operator: value,
633
+ unitOfTime: this.timeUnitControl.value,
634
+ });
635
+ }));
636
+ this.subsink.add(this.timeUnitControl.valueChanges.subscribe((value) => {
637
+ if (!this.selectControl.value)
638
+ return;
639
+ this.control.setValue({
640
+ unitOfTimeValue: TimeUnitSelectComponent.convert(this.selectControl.value, this.control.value.unitOfTime, value),
641
+ value: TimeUnitSelectComponent.toMilliseconds(this.selectControl.value, this.control.value.unitOfTime),
642
+ regex: false,
643
+ operator: this.operatorControl.value,
644
+ unitOfTime: value,
645
+ });
646
+ }));
647
+ this.changeDetectorRef.detectChanges();
648
+ }
649
+ ngOnDestroy() {
650
+ this.subsink.unsubscribe();
651
+ }
652
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderDurationFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
653
+ 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: [
654
+ {
655
+ provide: NG_VALUE_ACCESSOR,
656
+ multi: true,
657
+ useExisting: forwardRef(() => HeaderDurationFilterComponent),
658
+ },
659
+ ], 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(--ngx-mat-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" }] });
660
+ }
661
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderDurationFilterComponent, decorators: [{
662
+ type: Component,
663
+ args: [{ selector: 'lib-header-duration-filter', imports: [
664
+ CommonModule,
665
+ FormsModule,
666
+ MatButtonModule,
667
+ MatFormFieldModule,
668
+ MatIconModule,
669
+ MatInputModule,
670
+ ReactiveFormsModule,
671
+ OperatorSelectComponent,
672
+ TimeUnitSelectComponent,
673
+ SafeHtmlPipe,
674
+ ], providers: [
675
+ {
676
+ provide: NG_VALUE_ACCESSOR,
677
+ multi: true,
678
+ useExisting: forwardRef(() => HeaderDurationFilterComponent),
679
+ },
680
+ ], 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(--ngx-mat-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"] }]
681
+ }], propDecorators: { column: [{
682
+ type: Input
683
+ }] } });
684
+
685
+ /** @format */
686
+ class HeaderNumberFilterComponent {
687
+ column;
688
+ control;
689
+ selectControl = new FormControl();
690
+ operatorControl = new FormControl('=');
691
+ onChange = () => { };
692
+ onTouched = () => { };
693
+ injector = inject(Injector);
694
+ changeDetectorRef = inject(ChangeDetectorRef);
695
+ subsink = new Subscription();
696
+ writeValue = (value) => {
697
+ if (value?.value !== this.selectControl.value)
698
+ this.selectControl.setValue(value?.value);
699
+ };
700
+ registerOnChange(onChange) {
701
+ this.onChange = onChange;
702
+ }
703
+ registerOnTouched(onTouched) {
704
+ this.onTouched = onTouched;
705
+ }
706
+ async ngAfterViewInit() {
707
+ const ngControl = this.injector.get(NgControl, null);
708
+ if (!ngControl)
709
+ throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
710
+ this.control = ngControl.control;
711
+ this.subsink.add(this.selectControl.valueChanges.subscribe((value) => {
712
+ if (this.control.invalid)
713
+ return;
714
+ else if (!value)
715
+ this.control.setValue(undefined);
716
+ else
717
+ this.control.setValue({ value, regex: false, operator: this.operatorControl.value });
718
+ }));
719
+ this.subsink.add(this.operatorControl.valueChanges.subscribe((value) => {
720
+ if (this.control.value === null || this.control.value === undefined)
721
+ return;
722
+ this.control.setValue({ value: this.selectControl.value, regex: false, operator: value });
723
+ }));
724
+ this.changeDetectorRef.detectChanges();
725
+ }
726
+ ngOnDestroy() {
727
+ this.subsink.unsubscribe();
728
+ }
729
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderNumberFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
730
+ 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: [
731
+ {
732
+ provide: NG_VALUE_ACCESSOR,
733
+ multi: true,
734
+ useExisting: forwardRef(() => HeaderNumberFilterComponent),
735
+ },
736
+ ], 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(--ngx-mat-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" }] });
737
+ }
738
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderNumberFilterComponent, decorators: [{
739
+ type: Component,
740
+ args: [{ selector: 'lib-header-number-filter', imports: [
741
+ CommonModule,
742
+ FormsModule,
743
+ MatButtonModule,
744
+ MatFormFieldModule,
745
+ MatIconModule,
746
+ MatInputModule,
747
+ MatMenuModule,
748
+ ReactiveFormsModule,
749
+ OperatorSelectComponent,
750
+ SafeHtmlPipe,
751
+ ], providers: [
752
+ {
753
+ provide: NG_VALUE_ACCESSOR,
754
+ multi: true,
755
+ useExisting: forwardRef(() => HeaderNumberFilterComponent),
756
+ },
757
+ ], 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(--ngx-mat-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"] }]
758
+ }], propDecorators: { column: [{
759
+ type: Input
760
+ }] } });
761
+
762
+ /** @format */
763
+ class SelectOptionPipe {
764
+ transform(value, options) {
765
+ if (!options)
766
+ return null;
767
+ return options.find((option) => option.value === value) || null;
768
+ }
769
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SelectOptionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
770
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: SelectOptionPipe, isStandalone: true, name: "selectOption" });
771
+ }
772
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SelectOptionPipe, decorators: [{
773
+ type: Pipe,
774
+ args: [{ name: 'selectOption' }]
775
+ }] });
776
+
777
+ /** @format */
778
+ class HeaderSelectFilterComponent {
779
+ column;
780
+ control;
781
+ selectControl = new FormControl();
782
+ onChange = () => { };
783
+ onTouched = () => { };
784
+ injector = inject(Injector);
785
+ changeDetectorRef = inject(ChangeDetectorRef);
786
+ subsink = new Subscription();
787
+ writeValue = (value) => {
788
+ if (value?.value !== this.selectControl.value)
789
+ this.selectControl.setValue(value?.value);
790
+ };
791
+ registerOnChange(onChange) {
792
+ this.onChange = onChange;
793
+ }
794
+ registerOnTouched(onTouched) {
795
+ this.onTouched = onTouched;
796
+ }
797
+ async ngAfterViewInit() {
798
+ const ngControl = this.injector.get(NgControl, null);
799
+ if (!ngControl)
800
+ throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
801
+ this.control = ngControl.control;
802
+ this.subsink.add(this.selectControl.valueChanges.subscribe((value) => {
803
+ if (value === undefined)
804
+ this.control.setValue(undefined);
805
+ else
806
+ this.control.setValue({ value, regex: false });
807
+ }));
808
+ this.changeDetectorRef.detectChanges();
809
+ }
810
+ ngOnDestroy() {
811
+ this.subsink.unsubscribe();
812
+ }
813
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderSelectFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
814
+ 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: [
815
+ {
816
+ provide: NG_VALUE_ACCESSOR,
817
+ multi: true,
818
+ useExisting: forwardRef(() => HeaderSelectFilterComponent),
819
+ },
820
+ ], 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!\">\n @let options = column.options | async;\n\n <mat-select-trigger>\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 </mat-select-trigger>\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 </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 <mat-icon [style.color]=\"option.iconColor\" [style.margin-right.px]=\"8\">\n {{ option.icon }}\n </mat-icon>\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(--ngx-mat-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: "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: "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: "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" }] });
821
+ }
822
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderSelectFilterComponent, decorators: [{
823
+ type: Component,
824
+ args: [{ selector: 'lib-header-select-filter', imports: [
825
+ CommonModule,
826
+ FormsModule,
827
+ MatButtonModule,
828
+ MatFormFieldModule,
829
+ MatIconModule,
830
+ MatSelectModule,
831
+ ReactiveFormsModule,
832
+ SelectOptionPipe,
833
+ SafeHtmlPipe,
834
+ ], providers: [
835
+ {
836
+ provide: NG_VALUE_ACCESSOR,
837
+ multi: true,
838
+ useExisting: forwardRef(() => HeaderSelectFilterComponent),
839
+ },
840
+ ], 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!\">\n @let options = column.options | async;\n\n <mat-select-trigger>\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 </mat-select-trigger>\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 </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 <mat-icon [style.color]=\"option.iconColor\" [style.margin-right.px]=\"8\">\n {{ option.icon }}\n </mat-icon>\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(--ngx-mat-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"] }]
841
+ }], propDecorators: { column: [{
842
+ type: Input
843
+ }] } });
844
+
845
+ /** @format */
846
+ class HeaderTextFilterComponent {
847
+ column;
848
+ control;
849
+ selectControl = new FormControl();
850
+ onChange = () => { };
851
+ onTouched = () => { };
852
+ injector = inject(Injector);
853
+ changeDetectorRef = inject(ChangeDetectorRef);
854
+ subsink = new Subscription();
855
+ writeValue = (value) => {
856
+ if (value?.value !== this.selectControl.value)
857
+ this.selectControl.setValue(value?.value);
858
+ };
859
+ registerOnChange(onChange) {
860
+ this.onChange = onChange;
861
+ }
862
+ registerOnTouched(onTouched) {
863
+ this.onTouched = onTouched;
864
+ }
865
+ async ngAfterViewInit() {
866
+ const ngControl = this.injector.get(NgControl, null);
867
+ if (!ngControl)
868
+ throw new Error(`${this.constructor.name} missing control [column:${this.column.columnDef}]`);
869
+ this.control = ngControl.control;
870
+ this.subsink.add(this.selectControl.valueChanges.subscribe((value) => {
871
+ if (!value)
872
+ this.control.setValue(undefined);
873
+ else
874
+ this.control.setValue({ value, regex: true });
875
+ }));
876
+ this.changeDetectorRef.detectChanges();
877
+ }
878
+ ngOnDestroy() {
879
+ this.subsink.unsubscribe();
880
+ }
881
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderTextFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
882
+ 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: [
883
+ {
884
+ provide: NG_VALUE_ACCESSOR,
885
+ multi: true,
886
+ useExisting: forwardRef(() => HeaderTextFilterComponent),
887
+ },
888
+ ], 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(--ngx-mat-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" }] });
889
+ }
890
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: HeaderTextFilterComponent, decorators: [{
891
+ type: Component,
892
+ args: [{ selector: 'lib-header-text-filter', imports: [
893
+ CommonModule,
894
+ FormsModule,
895
+ MatButtonModule,
896
+ MatFormFieldModule,
897
+ MatIconModule,
898
+ MatInputModule,
899
+ ReactiveFormsModule,
900
+ SafeHtmlPipe,
901
+ ], providers: [
902
+ {
903
+ provide: NG_VALUE_ACCESSOR,
904
+ multi: true,
905
+ useExisting: forwardRef(() => HeaderTextFilterComponent),
906
+ },
907
+ ], 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(--ngx-mat-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"] }]
908
+ }], propDecorators: { column: [{
909
+ type: Input
910
+ }] } });
911
+
912
+ class DatagridDataSource extends DataSource {
913
+ service;
914
+ loading$ = new BehaviorSubject(true);
915
+ recordsTotal = 0;
916
+ recordsFiltered = 0;
917
+ options;
918
+ dataStream = new BehaviorSubject([]);
919
+ constructor(service) {
920
+ super();
921
+ this.service = service;
922
+ }
923
+ connect() {
924
+ return this.dataStream;
925
+ }
926
+ disconnect() { }
927
+ async loadData(options) {
928
+ this.options = options;
929
+ this.loading$.next(true);
930
+ try {
931
+ const result = await this.service(options);
932
+ if (options.draw !== result.draw)
933
+ return;
934
+ this.recordsTotal = result.recordsTotal;
935
+ this.recordsFiltered = result.recordsFiltered;
936
+ this.dataStream.next(result.data);
937
+ }
938
+ finally {
939
+ this.loading$.next(false);
940
+ }
941
+ }
942
+ refresh() {
943
+ if (this.options)
944
+ this.loadData(this.options);
945
+ }
946
+ }
947
+
948
+ /** @format */
949
+ class NgxMatDatatableContentDirective {
950
+ templateRef;
951
+ id;
952
+ constructor(templateRef) {
953
+ this.templateRef = templateRef;
954
+ }
955
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableContentDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
956
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.4", type: NgxMatDatatableContentDirective, isStandalone: true, selector: "[ngxMatDatatableContent]", inputs: { id: ["ngxMatDatatableContent", "id"] }, ngImport: i0 });
957
+ }
958
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableContentDirective, decorators: [{
959
+ type: Directive,
960
+ args: [{
961
+ selector: '[ngxMatDatatableContent]',
962
+ }]
963
+ }], ctorParameters: () => [{ type: i0.TemplateRef }], propDecorators: { id: [{
964
+ type: Input,
965
+ args: ['ngxMatDatatableContent']
966
+ }] } });
967
+
968
+ /** @format */
969
+ const DEFAULT_LABELS = {
970
+ noDateLabel: 'No data',
971
+ itemsPerPageLabel: `Items per page:`,
972
+ nextPageLabel: `Next page`,
973
+ lastPageLabel: `Last page`,
974
+ previousPageLabel: `Previous page`,
975
+ firstPageLabel: `First page`,
976
+ onLabel: `on`,
977
+ };
978
+ const LABELS = {
979
+ fr: {
980
+ noDateLabel: 'Aucune donnée',
981
+ itemsPerPageLabel: `Éléments par page :`,
982
+ nextPageLabel: `Page suivante`,
983
+ lastPageLabel: `Dernière page`,
984
+ previousPageLabel: `Page précédente`,
985
+ firstPageLabel: `Première page`,
986
+ onLabel: `sur`,
987
+ },
988
+ };
989
+ class NgxMatDatatableIntl {
990
+ noDateLabel;
991
+ itemsPerPageLabel;
992
+ nextPageLabel;
993
+ lastPageLabel;
994
+ previousPageLabel;
995
+ firstPageLabel;
996
+ onLabel;
997
+ getRangeLabel = (page, pageSize, length) => {
998
+ if (length === 0 || pageSize === 0)
999
+ return `0 ${this.onLabel} ${length}`;
1000
+ length = Math.max(length, 0);
1001
+ const startIndex = page * pageSize;
1002
+ const endIndex = startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize;
1003
+ return `${startIndex + 1} - ${endIndex} ${this.onLabel} ${length}`;
1004
+ };
1005
+ constructor(locale) {
1006
+ this.setLabels(LABELS[locale] || DEFAULT_LABELS);
1007
+ }
1008
+ setLabels(labels) {
1009
+ this.noDateLabel = labels.noDateLabel;
1010
+ this.itemsPerPageLabel = labels.itemsPerPageLabel;
1011
+ this.nextPageLabel = labels.nextPageLabel;
1012
+ this.lastPageLabel = labels.lastPageLabel;
1013
+ this.previousPageLabel = labels.previousPageLabel;
1014
+ this.firstPageLabel = labels.firstPageLabel;
1015
+ this.onLabel = labels.onLabel;
1016
+ }
1017
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableIntl, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Injectable });
1018
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableIntl });
1019
+ }
1020
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableIntl, decorators: [{
1021
+ type: Injectable
1022
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
1023
+ type: Inject,
1024
+ args: [LOCALE_ID]
1025
+ }] }] });
1026
+
1027
+ /** @format */
1028
+ class ColorPipe {
1029
+ transform(row, column) {
1030
+ if (typeof column.color === 'string')
1031
+ return column.color;
1032
+ if (typeof column.color === 'function')
1033
+ return column.color(row);
1034
+ }
1035
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: ColorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1036
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: ColorPipe, isStandalone: true, name: "color" });
1037
+ }
1038
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: ColorPipe, decorators: [{
1039
+ type: Pipe,
1040
+ args: [{ name: 'color' }]
1041
+ }] });
1042
+
1043
+ /** @format */
1044
+ class NgxMatDatatablePaginatorIntl extends MatPaginatorIntl {
1045
+ datatableIntl = inject(NgxMatDatatableIntl);
1046
+ itemsPerPageLabel = this.datatableIntl.itemsPerPageLabel;
1047
+ nextPageLabel = this.datatableIntl.nextPageLabel;
1048
+ lastPageLabel = this.datatableIntl.lastPageLabel;
1049
+ previousPageLabel = this.datatableIntl.previousPageLabel;
1050
+ firstPageLabel = this.datatableIntl.firstPageLabel;
1051
+ onLabel = this.datatableIntl.onLabel;
1052
+ getRangeLabel = (page, pageSize, length) => {
1053
+ return this.datatableIntl.getRangeLabel(page, pageSize, length);
1054
+ };
1055
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatablePaginatorIntl, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1056
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatablePaginatorIntl });
1057
+ }
1058
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatablePaginatorIntl, decorators: [{
1059
+ type: Injectable
1060
+ }] });
1061
+ class NgxMatDatatableComponent {
1062
+ options;
1063
+ onDisplayChanged = new EventEmitter();
1064
+ rowClicked = new EventEmitter();
1065
+ paginator;
1066
+ contentRefs;
1067
+ displayedColumns = [];
1068
+ dataSource;
1069
+ loaded = false;
1070
+ searchFormGroup;
1071
+ datatableIntl = inject(NgxMatDatatableIntl);
1072
+ subscriptions = new Subscription();
1073
+ changeDetectorRef = inject(ChangeDetectorRef);
1074
+ ngOnInit() {
1075
+ if (!this.options?.service)
1076
+ throw new Error(`missing mongoose datatable component service`);
1077
+ if (!this.options?.columns)
1078
+ throw new Error(`missing mongoose datatable component columns`);
1079
+ this.buildDisplayColumns();
1080
+ this.buildSearchFormGroup();
1081
+ this.dataSource = new DatagridDataSource(this.options.service);
1082
+ this.changeDetectorRef.detectChanges();
1083
+ }
1084
+ ngOnDestroy() {
1085
+ this.subscriptions.unsubscribe();
1086
+ }
1087
+ load(intersect) {
1088
+ if (!intersect || this.loaded)
1089
+ return;
1090
+ this.loaded = true;
1091
+ this.subscriptions.add(this.paginator?.page.subscribe(() => this.loadPage()));
1092
+ this.loadPage();
1093
+ }
1094
+ sortColumn(column) {
1095
+ if (column.sortable === false)
1096
+ return;
1097
+ if (!column.order)
1098
+ column.order = { index: this.options.columns.filter(c => !!c.order).length, dir: 'asc' };
1099
+ else if (column.order.dir === 'asc')
1100
+ column.order.dir = 'desc';
1101
+ else {
1102
+ delete column.order;
1103
+ this.consolidateOrderIndex();
1104
+ }
1105
+ this.paginator.pageIndex = 0;
1106
+ this.loadPage();
1107
+ }
1108
+ loadPage() {
1109
+ const columns = this.buildRequestColumns();
1110
+ const order = [];
1111
+ this.options.columns
1112
+ .filter(c => !!c.order)
1113
+ .sort((c1, c2) => c1.order.index - c2.order.index)
1114
+ .forEach(c => {
1115
+ const index = columns.findIndex(column => column.data === (c.sortProperty || c.property));
1116
+ if (index !== -1)
1117
+ order.push({ column: index, dir: c.order.dir });
1118
+ });
1119
+ this.dataSource.loadData({
1120
+ draw: Date.now().toString(),
1121
+ columns,
1122
+ start: this.paginator.pageIndex,
1123
+ length: this.paginator.pageSize,
1124
+ order,
1125
+ });
1126
+ }
1127
+ updateColumns = [];
1128
+ openUpdateColumnDisplay() {
1129
+ this.updateColumns = this.options.columns.map(column => ({
1130
+ columnDef: column.columnDef,
1131
+ header: column.header,
1132
+ sticky: column.sticky,
1133
+ hidden: column.hidden,
1134
+ }));
1135
+ }
1136
+ reorderColumns(event) {
1137
+ moveItemInArray(this.updateColumns, event.previousIndex, event.currentIndex);
1138
+ }
1139
+ closeUpdateColumnDisplay() {
1140
+ let reload = false;
1141
+ this.updateColumns.forEach((updated, index) => {
1142
+ const columnIndex = this.options.columns.findIndex(c => c.columnDef === updated.columnDef);
1143
+ if (columnIndex == -1)
1144
+ return;
1145
+ if (columnIndex !== index)
1146
+ moveItemInArray(this.options.columns, index, columnIndex);
1147
+ const column = this.options.columns[columnIndex];
1148
+ if (updated.sticky !== column.sticky)
1149
+ column.sticky = updated.sticky;
1150
+ if (updated.hidden !== column.hidden) {
1151
+ column.hidden = updated.hidden;
1152
+ reload = reload || !updated.hidden;
1153
+ }
1154
+ });
1155
+ this.buildDisplayColumns();
1156
+ this.onDisplayChanged.emit(this.options.columns);
1157
+ if (reload)
1158
+ this.loadPage();
1159
+ }
1160
+ rowClick(row) {
1161
+ if (typeof this.options.actions?.rowClick === 'boolean') {
1162
+ this.rowClicked.emit(row);
1163
+ }
1164
+ else if (typeof this.options.actions?.rowClick === 'function') {
1165
+ this.options.actions.rowClick(row);
1166
+ this.rowClicked.emit(row);
1167
+ }
1168
+ }
1169
+ buildRequestColumns() {
1170
+ const columns = [];
1171
+ const additionalColumns = [];
1172
+ this.options.columns.forEach(c => {
1173
+ if (c.hidden)
1174
+ return;
1175
+ const column = { data: c.property, name: c.columnDef, searchable: c.searchable };
1176
+ if (c.sortProperty && c.order)
1177
+ this.addAdditionalColumn(additionalColumns, c.sortProperty);
1178
+ if (c.searchable) {
1179
+ const control = this.searchFormGroup.controls[c.columnDef];
1180
+ if (control.value) {
1181
+ if (c.searchProperty)
1182
+ this.addAdditionalColumn(additionalColumns, c.searchProperty, control.value);
1183
+ else
1184
+ column.search = control.value;
1185
+ }
1186
+ }
1187
+ if (c.additionalProperties) {
1188
+ c.additionalProperties.forEach(property => this.addAdditionalColumn(additionalColumns, property));
1189
+ }
1190
+ columns.push(column);
1191
+ });
1192
+ for (let additionalColumn of additionalColumns) {
1193
+ const c = columns.find(c => c.data === additionalColumn.data);
1194
+ if (!c)
1195
+ columns.push(additionalColumn);
1196
+ else if (additionalColumn.search && !c.search)
1197
+ c.search = additionalColumn.search;
1198
+ }
1199
+ return columns;
1200
+ }
1201
+ addAdditionalColumn(additionalColumns, data, search) {
1202
+ let column = additionalColumns.find(c => c.data === data);
1203
+ if (!column)
1204
+ additionalColumns.push((column = { data }));
1205
+ if (search) {
1206
+ column.search = search;
1207
+ column.searchable = true;
1208
+ }
1209
+ return column;
1210
+ }
1211
+ buildDisplayColumns() {
1212
+ const displayedColumns = [];
1213
+ this.options.columns.forEach(column => {
1214
+ if (column.hidden)
1215
+ return;
1216
+ displayedColumns.push(column.columnDef);
1217
+ });
1218
+ this.displayedColumns = displayedColumns;
1219
+ }
1220
+ buildSearchFormGroup() {
1221
+ this.searchFormGroup = new FormGroup(this.options.columns.reduce((controls, column) => {
1222
+ if (column.searchable) {
1223
+ controls[column.columnDef] = new FormControl({ value: undefined, disabled: false });
1224
+ }
1225
+ return controls;
1226
+ }, {}));
1227
+ this.subscriptions.add(this.searchFormGroup.valueChanges.pipe(debounceTime(500)).subscribe(value => {
1228
+ this.paginator.pageIndex = 0;
1229
+ this.loadPage();
1230
+ }));
1231
+ }
1232
+ consolidateOrderIndex() {
1233
+ let index = 0;
1234
+ this.options.columns
1235
+ .filter(c => !!c.order)
1236
+ .sort((c1, c2) => c1.order.index - c2.order.index)
1237
+ .forEach(c => (c.order.index = index++));
1238
+ }
1239
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1240
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: NgxMatDatatableComponent, isStandalone: true, selector: "ngx-mat-datatable", inputs: { options: "options" }, outputs: { onDisplayChanged: "onDisplayChanged", rowClicked: "rowClicked" }, providers: [{ provide: MatPaginatorIntl, useClass: NgxMatDatatablePaginatorIntl }], queries: [{ propertyName: "contentRefs", predicate: NgxMatDatatableContentDirective }], viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }], ngImport: i0, template: "<!-- @format -->\n\n<div *ngIf=\"dataSource\" id=\"container\" >\n <ng-container *ngTemplateOutlet=\"actionsTmpl\"></ng-container>\n\n <div id=\"table-container\" intersectionObserver (intersection)=\"load($event.intersect)\">\n <table id=\"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 | color: column\">\n <ng-container *ngTemplateOutlet=\"cellTmpl; context: { column, row }\"></ng-container>\n </td>\n </ng-container>\n }\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky: true\"></tr>\n <tr\n mat-row\n *matRowDef=\"let row; columns: displayedColumns\"\n [class.has-click]=\"options.actions?.rowClick\"\n (click)=\"rowClick(row)\"></tr>\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\n <div id=\"loading\" *ngIf=\"dataSource.loading$ | async\" @fade>\n <mat-spinner></mat-spinner>\n </div>\n</div>\n\n<ng-template #actionsTmpl>\n <div id=\"actions\">\n <div id=\"actions-start\"></div>\n\n <div id=\"actions-center\"></div>\n\n <div id=\"actions-end\">\n <div\n *ngIf=\"\n options.actions?.columns?.hideAndShow || options.actions?.columns?.sticky || options.actions?.columns?.reorder\n \">\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 <div *ngIf=\"options.actions?.refresh\" class=\"action\">\n <button\n mat-icon-button\n color=\"primary\"\n class=\"icon-only\"\n [disabled]=\"dataSource.loading$ | async\"\n (click)=\"loadPage()\">\n <mat-icon>sync</mat-icon>\n </button>\n <div class=\"action-loader\" *ngIf=\"dataSource.loading$ | async\" @fade>\n <mat-spinner [diameter]=\"32\"></mat-spinner>\n </div>\n </div>\n </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\">{{ 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\" [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</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 class=\"cell\">\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.prefix) {\n <span [outerHTML]=\"column.prefix | safeHtml\"></span>\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 @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.suffix) {\n <span [outerHTML]=\"column.suffix | safeHtml\"></span>\n }\n }\n </div>\n } @placeholder {\n <div class=\"cell\"></div>\n }\n</ng-template>\n", styles: [":host{overflow:hidden;display:flex;position:relative;max-height:100%;--ngx-mat-datatable-background: #ffffff;--ngx-mat-datatable-border-color: #ccc;--ngx-mat-datatable-sticky-background: var(--ngx-mat-datatable-background);--ngx-mat-datatable-sticky-border: 1px dashed #e6a93a}#container{display:flex;flex:1 1 100%;box-sizing:border-box;flex-direction:column;position:relative;overflow:hidden;width:100%;background-color:var(--ngx-mat-datatable-background)}#actions{width:100%;display:flex;box-sizing:border-box;place-content:center space-between;align-items:center;flex-direction:row;border-bottom:1px solid var(--ngx-mat-datatable-border-color)}#actions #actions-start,#actions #actions-center,#actions #actions-end{display:flex;box-sizing:border-box;align-items:center;flex-direction:row}#actions #actions-start{place-content:center start}#actions #actions-center{place-content:center center}#actions #actions-end{place-content:center end}#actions .action{position:relative}#actions .action .action-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}#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:auto;width:100%;scrollbar-width:thin}#table{width:100%;max-height:100%;--mat-table-background-color: var(--ngx-mat-datatable-background);--mat-table-row-item-outline-color: var(--ngx-mat-datatable-border-color)}#table ::ng-deep .mat-mdc-table-sticky{opacity:1;background:var(--ngx-mat-datatable-sticky-background, var(--ngx-mat-datatable-background, #ffffff))}#table ::ng-deep .mat-mdc-table-sticky.mat-mdc-table-sticky-border-elem-left{border-right:var(--ngx-mat-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%;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(--ngx-mat-datatable-background)}#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{cursor:pointer}#table ::ng-deep .mat-mdc-row.has-click:hover .mat-mdc-cell{color:var(--ngx-mat-datatable-hover-color, var(--mat-sys-on-primary))!important;background-color:var(--ngx-mat-datatable-hover-bgcolor, var(--mat-sys-primary))!important}#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{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%}#paginator{--mat-paginator-container-background-color: var(--ngx-mat-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(--ngx-mat-datatable-border-color)}#paginator ::ng-deep .mat-mdc-select{display:flex}#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}#loading mat-spinner{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}::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}#no-data{position:sticky;width:fit-content;left:50%}#no-data #no-data-label{position:relative;margin-left:-50%}\n"], dependencies: [{ kind: "pipe", type: ColorPipe, name: "color" }, { 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: "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: "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: "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: i8.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: i8.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: i9.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: i10$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i11.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i11.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i11.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i11.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i11.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i11.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i11.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i11.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i11.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i11.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i11.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i12.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { 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"] }], animations: [
1241
+ trigger('fade', [
1242
+ transition(':enter', [
1243
+ style({ opacity: 0 }), // initial
1244
+ animate('0.2s', style({ opacity: 1 })), // final
1245
+ ]),
1246
+ transition(':leave', [
1247
+ style({ opacity: 1 }), // initial
1248
+ animate('0.2s', style({ opacity: 0 })), // final
1249
+ ]),
1250
+ ]),
1251
+ ], deferBlockDependencies: [() => [import('./eherve-angular-material-datatable-cell-checkbox-value.component-BMqF1wsU.mjs').then(m => m.CellCheckboxValueComponent), import('./eherve-angular-material-datatable-cell-date-value.component-Cd6GgJqh.mjs').then(m => m.CellDateValueComponent), import('./eherve-angular-material-datatable-cell-duration-value.component-CQhFk_95.mjs').then(m => m.CellDurationValueComponent), import('./eherve-angular-material-datatable-cell-number-value.component-D2Zu_4_n.mjs').then(m => m.CellNumberValueComponent), import('./eherve-angular-material-datatable-cell-select-value.component-QwVkhgXj.mjs').then(m => m.CellSelectValueComponent), i1$1.NgComponentOutlet, i1$1.NgTemplateOutlet, import('./eherve-angular-material-datatable-transform.pipe-BOmcXXZU.mjs').then(m => m.TransformPipe), import('./eherve-angular-material-datatable-find-cell-content.pipe-On98SQ1u.mjs').then(m => m.FindContentPipe), import('./eherve-angular-material-datatable-get.pipe-CCgMUDDx.mjs').then(m => m.GetPipe), Promise.resolve().then(function () { return safeHtml_pipe; }).then(m => m.SafeHtmlPipe)]] });
1252
+ }
1253
+ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableComponent, resolveDeferredDeps: () => [import('./eherve-angular-material-datatable-cell-checkbox-value.component-BMqF1wsU.mjs').then(m => m.CellCheckboxValueComponent), import('./eherve-angular-material-datatable-cell-date-value.component-Cd6GgJqh.mjs').then(m => m.CellDateValueComponent), import('./eherve-angular-material-datatable-cell-duration-value.component-CQhFk_95.mjs').then(m => m.CellDurationValueComponent), import('./eherve-angular-material-datatable-cell-number-value.component-D2Zu_4_n.mjs').then(m => m.CellNumberValueComponent), import('./eherve-angular-material-datatable-cell-select-value.component-QwVkhgXj.mjs').then(m => m.CellSelectValueComponent), import('./eherve-angular-material-datatable-transform.pipe-BOmcXXZU.mjs').then(m => m.TransformPipe), import('./eherve-angular-material-datatable-find-cell-content.pipe-On98SQ1u.mjs').then(m => m.FindContentPipe), import('./eherve-angular-material-datatable-get.pipe-CCgMUDDx.mjs').then(m => m.GetPipe), Promise.resolve().then(function () { return safeHtml_pipe; }).then(m => m.SafeHtmlPipe)], resolveMetadata: (CellCheckboxValueComponent, CellDateValueComponent, CellDurationValueComponent, CellNumberValueComponent, CellSelectValueComponent, TransformPipe, FindContentPipe, GetPipe, SafeHtmlPipe) => ({ decorators: [{
1254
+ type: Component,
1255
+ args: [{ imports: [
1256
+ CellCheckboxValueComponent,
1257
+ CellDateValueComponent,
1258
+ CellDurationValueComponent,
1259
+ CellNumberValueComponent,
1260
+ CellSelectValueComponent,
1261
+ ColorPipe,
1262
+ CommonModule,
1263
+ TransformPipe,
1264
+ DragDropModule,
1265
+ FindContentPipe,
1266
+ FormsModule,
1267
+ GetPipe,
1268
+ HeaderAutocompleteFilterComponent,
1269
+ HeaderCheckboxFilterComponent,
1270
+ HeaderDateFilterComponent,
1271
+ HeaderDurationFilterComponent,
1272
+ HeaderNumberFilterComponent,
1273
+ HeaderSelectFilterComponent,
1274
+ HeaderTextFilterComponent,
1275
+ IntersectionObserverModule,
1276
+ MatBadgeModule,
1277
+ MatButtonModule,
1278
+ MatFormFieldModule,
1279
+ MatIconModule,
1280
+ MatMenuModule,
1281
+ MatPaginatorModule,
1282
+ MatProgressSpinnerModule,
1283
+ MatTableModule,
1284
+ MatTooltipModule,
1285
+ ReactiveFormsModule,
1286
+ SafeHtmlPipe,
1287
+ ], providers: [{ provide: MatPaginatorIntl, useClass: NgxMatDatatablePaginatorIntl }], selector: 'ngx-mat-datatable', animations: [
1288
+ trigger('fade', [
1289
+ transition(':enter', [
1290
+ style({ opacity: 0 }), // initial
1291
+ animate('0.2s', style({ opacity: 1 })), // final
1292
+ ]),
1293
+ transition(':leave', [
1294
+ style({ opacity: 1 }), // initial
1295
+ animate('0.2s', style({ opacity: 0 })), // final
1296
+ ]),
1297
+ ]),
1298
+ ], template: "<!-- @format -->\n\n<div *ngIf=\"dataSource\" id=\"container\" >\n <ng-container *ngTemplateOutlet=\"actionsTmpl\"></ng-container>\n\n <div id=\"table-container\" intersectionObserver (intersection)=\"load($event.intersect)\">\n <table id=\"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 | color: column\">\n <ng-container *ngTemplateOutlet=\"cellTmpl; context: { column, row }\"></ng-container>\n </td>\n </ng-container>\n }\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky: true\"></tr>\n <tr\n mat-row\n *matRowDef=\"let row; columns: displayedColumns\"\n [class.has-click]=\"options.actions?.rowClick\"\n (click)=\"rowClick(row)\"></tr>\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\n <div id=\"loading\" *ngIf=\"dataSource.loading$ | async\" @fade>\n <mat-spinner></mat-spinner>\n </div>\n</div>\n\n<ng-template #actionsTmpl>\n <div id=\"actions\">\n <div id=\"actions-start\"></div>\n\n <div id=\"actions-center\"></div>\n\n <div id=\"actions-end\">\n <div\n *ngIf=\"\n options.actions?.columns?.hideAndShow || options.actions?.columns?.sticky || options.actions?.columns?.reorder\n \">\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 <div *ngIf=\"options.actions?.refresh\" class=\"action\">\n <button\n mat-icon-button\n color=\"primary\"\n class=\"icon-only\"\n [disabled]=\"dataSource.loading$ | async\"\n (click)=\"loadPage()\">\n <mat-icon>sync</mat-icon>\n </button>\n <div class=\"action-loader\" *ngIf=\"dataSource.loading$ | async\" @fade>\n <mat-spinner [diameter]=\"32\"></mat-spinner>\n </div>\n </div>\n </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\">{{ 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\" [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</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 class=\"cell\">\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.prefix) {\n <span [outerHTML]=\"column.prefix | safeHtml\"></span>\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 @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.suffix) {\n <span [outerHTML]=\"column.suffix | safeHtml\"></span>\n }\n }\n </div>\n } @placeholder {\n <div class=\"cell\"></div>\n }\n</ng-template>\n", styles: [":host{overflow:hidden;display:flex;position:relative;max-height:100%;--ngx-mat-datatable-background: #ffffff;--ngx-mat-datatable-border-color: #ccc;--ngx-mat-datatable-sticky-background: var(--ngx-mat-datatable-background);--ngx-mat-datatable-sticky-border: 1px dashed #e6a93a}#container{display:flex;flex:1 1 100%;box-sizing:border-box;flex-direction:column;position:relative;overflow:hidden;width:100%;background-color:var(--ngx-mat-datatable-background)}#actions{width:100%;display:flex;box-sizing:border-box;place-content:center space-between;align-items:center;flex-direction:row;border-bottom:1px solid var(--ngx-mat-datatable-border-color)}#actions #actions-start,#actions #actions-center,#actions #actions-end{display:flex;box-sizing:border-box;align-items:center;flex-direction:row}#actions #actions-start{place-content:center start}#actions #actions-center{place-content:center center}#actions #actions-end{place-content:center end}#actions .action{position:relative}#actions .action .action-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}#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:auto;width:100%;scrollbar-width:thin}#table{width:100%;max-height:100%;--mat-table-background-color: var(--ngx-mat-datatable-background);--mat-table-row-item-outline-color: var(--ngx-mat-datatable-border-color)}#table ::ng-deep .mat-mdc-table-sticky{opacity:1;background:var(--ngx-mat-datatable-sticky-background, var(--ngx-mat-datatable-background, #ffffff))}#table ::ng-deep .mat-mdc-table-sticky.mat-mdc-table-sticky-border-elem-left{border-right:var(--ngx-mat-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%;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(--ngx-mat-datatable-background)}#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{cursor:pointer}#table ::ng-deep .mat-mdc-row.has-click:hover .mat-mdc-cell{color:var(--ngx-mat-datatable-hover-color, var(--mat-sys-on-primary))!important;background-color:var(--ngx-mat-datatable-hover-bgcolor, var(--mat-sys-primary))!important}#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{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%}#paginator{--mat-paginator-container-background-color: var(--ngx-mat-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(--ngx-mat-datatable-border-color)}#paginator ::ng-deep .mat-mdc-select{display:flex}#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}#loading mat-spinner{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}::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}#no-data{position:sticky;width:fit-content;left:50%}#no-data #no-data-label{position:relative;margin-left:-50%}\n"] }]
1299
+ }], ctorParameters: null, propDecorators: { options: [{
1300
+ type: Input,
1301
+ args: ['options']
1302
+ }], onDisplayChanged: [{
1303
+ type: Output
1304
+ }], rowClicked: [{
1305
+ type: Output
1306
+ }], paginator: [{
1307
+ type: ViewChild,
1308
+ args: [MatPaginator]
1309
+ }], contentRefs: [{
1310
+ type: ContentChildren,
1311
+ args: [NgxMatDatatableContentDirective]
1312
+ }] } }) });
1313
+
1314
+ /** @format */
1315
+ class NgxMatDatatableModule {
1316
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1317
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableModule, imports: [CommonModule, NgxMatDatatableComponent, NgxMatDatatableContentDirective], exports: [NgxMatDatatableComponent, NgxMatDatatableContentDirective] });
1318
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableModule, providers: [NgxMatDatatableIntl], imports: [CommonModule, NgxMatDatatableComponent] });
1319
+ }
1320
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableModule, decorators: [{
1321
+ type: NgModule,
1322
+ args: [{
1323
+ imports: [CommonModule, NgxMatDatatableComponent, NgxMatDatatableContentDirective],
1324
+ exports: [NgxMatDatatableComponent, NgxMatDatatableContentDirective],
1325
+ providers: [NgxMatDatatableIntl],
1326
+ }]
1327
+ }] });
1328
+
1329
+ /** @format */
1330
+
1331
+ /** @format */
1332
+
1333
+ /**
1334
+ * Public API Surface of mongoose-datatable
1335
+ *
1336
+ * @format
1337
+ */
1338
+
1339
+ /**
1340
+ * Generated bundle index. Do not edit.
1341
+ */
1342
+
1343
+ export { NgxMatDatatableComponent as N, SelectOptionPipe as S, SafeHtmlPipe as a, NgxMatDatatableModule as b, NgxMatDatatableContentDirective as c };
1344
+ //# sourceMappingURL=eherve-angular-material-datatable-eherve-angular-material-datatable-Ze49aFqd.mjs.map