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