@eherve/angular-material-datatable 19.3.1 → 19.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/{eherve-angular-material-datatable-cell-checkbox-value.component-Dbzg9FxR.mjs → eherve-angular-material-datatable-cell-checkbox-value.component-DDe_Pxw3.mjs} +4 -4
- package/fesm2022/eherve-angular-material-datatable-cell-checkbox-value.component-DDe_Pxw3.mjs.map +1 -0
- package/fesm2022/{eherve-angular-material-datatable-cell-date-value.component-DIHWqVZR.mjs → eherve-angular-material-datatable-cell-date-value.component-DLWLxIE8.mjs} +2 -2
- package/fesm2022/{eherve-angular-material-datatable-cell-date-value.component-DIHWqVZR.mjs.map → eherve-angular-material-datatable-cell-date-value.component-DLWLxIE8.mjs.map} +1 -1
- package/fesm2022/{eherve-angular-material-datatable-cell-duration-value.component-BW7Fa0fl.mjs → eherve-angular-material-datatable-cell-duration-value.component-7XEEW3uX.mjs} +4 -4
- package/fesm2022/{eherve-angular-material-datatable-cell-duration-value.component-BW7Fa0fl.mjs.map → eherve-angular-material-datatable-cell-duration-value.component-7XEEW3uX.mjs.map} +1 -1
- package/fesm2022/{eherve-angular-material-datatable-cell-number-value.component-CfXQdh66.mjs → eherve-angular-material-datatable-cell-number-value.component-CK0RC4b-.mjs} +2 -2
- package/fesm2022/{eherve-angular-material-datatable-cell-number-value.component-CfXQdh66.mjs.map → eherve-angular-material-datatable-cell-number-value.component-CK0RC4b-.mjs.map} +1 -1
- package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-cEFgCV26.mjs +29 -0
- package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-cEFgCV26.mjs.map +1 -0
- package/fesm2022/{eherve-angular-material-datatable-eherve-angular-material-datatable-MKNysR_9.mjs → eherve-angular-material-datatable-eherve-angular-material-datatable-DBFRL62_.mjs} +297 -77
- package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-DBFRL62_.mjs.map +1 -0
- package/fesm2022/{eherve-angular-material-datatable-get.pipe-C_JNMRuY.mjs → eherve-angular-material-datatable-get.pipe-c_eIjBUL.mjs} +2 -2
- package/fesm2022/{eherve-angular-material-datatable-get.pipe-C_JNMRuY.mjs.map → eherve-angular-material-datatable-get.pipe-c_eIjBUL.mjs.map} +1 -1
- package/fesm2022/eherve-angular-material-datatable.mjs +1 -1
- package/lib/components/progress-spinner/progress-spinner.component.d.ts +22 -0
- package/lib/datasource.d.ts +5 -2
- package/lib/datatable.component.d.ts +2 -0
- package/lib/datatable.intl.d.ts +6 -0
- package/lib/pipes/filter.pipe.d.ts +10 -0
- package/lib/pipes/find.pipe.d.ts +12 -0
- package/lib/pipes/merge.pipe.d.ts +8 -0
- package/lib/pipes/sort-facet-entries.pipe.d.ts +10 -0
- package/lib/pipes/sum.pipe.d.ts +8 -0
- package/lib/tools/duration.tool.d.ts +1 -0
- package/lib/types/action.type.d.ts +13 -0
- package/lib/types/datasource-service.type.d.ts +16 -0
- package/lib/types/datatable-column.type.d.ts +2 -0
- package/lib/types/datatable-facet.type.d.ts +27 -0
- package/lib/types/datatable-options.type.d.ts +4 -0
- package/package.json +2 -1
- package/public-api.d.ts +2 -0
- package/fesm2022/eherve-angular-material-datatable-cell-checkbox-value.component-Dbzg9FxR.mjs.map +0 -1
- package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-CXg-CD_k.mjs +0 -29
- package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-CXg-CD_k.mjs.map +0 -1
- package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-MKNysR_9.mjs.map +0 -1
- package/fesm2022/eherve-angular-material-datatable-find-cell-content.pipe-On98SQ1u.mjs +0 -18
- package/fesm2022/eherve-angular-material-datatable-find-cell-content.pipe-On98SQ1u.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe, inject, Injector, ChangeDetectorRef, forwardRef, Component, Input, ViewChild, signal, ChangeDetectionStrategy, LOCALE_ID, Injectable, Directive, EventEmitter, Output, ContentChildren, NgModule } from '@angular/core';
|
|
2
|
+
import { Pipe, inject, Injector, ChangeDetectorRef, forwardRef, Component, Input, ViewChild, signal, ChangeDetectionStrategy, LOCALE_ID, Injectable, HostBinding, Directive, EventEmitter, Output, ContentChildren, NgModule } from '@angular/core';
|
|
3
3
|
import { trigger, transition, style, animate } from '@angular/animations';
|
|
4
4
|
import * as i2$1 from '@angular/cdk/drag-drop';
|
|
5
5
|
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
@@ -11,20 +11,24 @@ import * as i5$2 from '@angular/material/badge';
|
|
|
11
11
|
import { MatBadgeModule } from '@angular/material/badge';
|
|
12
12
|
import * as i3$1 from '@angular/material/button';
|
|
13
13
|
import { MatButtonModule } from '@angular/material/button';
|
|
14
|
+
import * as i14 from '@angular/material/card';
|
|
15
|
+
import { MatCardModule } from '@angular/material/card';
|
|
14
16
|
import * as i4$1 from '@angular/material/form-field';
|
|
15
17
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
16
18
|
import * as i5$1 from '@angular/material/icon';
|
|
17
19
|
import { MatIconModule } from '@angular/material/icon';
|
|
18
|
-
import * as
|
|
20
|
+
import * as i9 from '@angular/material/menu';
|
|
19
21
|
import { MatMenuModule } from '@angular/material/menu';
|
|
20
|
-
import * as
|
|
22
|
+
import * as i10$1 from '@angular/material/paginator';
|
|
21
23
|
import { MatPaginatorIntl, MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
22
|
-
import * as
|
|
24
|
+
import * as i1$3 from '@angular/material/progress-spinner';
|
|
23
25
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
24
|
-
import * as
|
|
26
|
+
import * as i12 from '@angular/material/table';
|
|
25
27
|
import { MatTableModule } from '@angular/material/table';
|
|
26
|
-
import * as
|
|
28
|
+
import * as i13 from '@angular/material/tooltip';
|
|
27
29
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
30
|
+
import * as i3$3 from 'ngx-countup';
|
|
31
|
+
import { CountUpModule } from 'ngx-countup';
|
|
28
32
|
import * as i3 from 'ngx-intersection-observer';
|
|
29
33
|
import { IntersectionObserverModule } from 'ngx-intersection-observer';
|
|
30
34
|
import { BehaviorSubject, Subject, Subscription, filter, debounceTime, switchMap, startWith, tap, map, lastValueFrom } from 'rxjs';
|
|
@@ -911,12 +915,168 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
|
911
915
|
type: Input
|
|
912
916
|
}] } });
|
|
913
917
|
|
|
918
|
+
/** @format */
|
|
919
|
+
const DEFAULT_LABELS = {
|
|
920
|
+
noDateLabel: 'No data',
|
|
921
|
+
itemsPerPageLabel: `Items per page:`,
|
|
922
|
+
nextPageLabel: `Next page`,
|
|
923
|
+
lastPageLabel: `Last page`,
|
|
924
|
+
previousPageLabel: `Previous page`,
|
|
925
|
+
firstPageLabel: `First page`,
|
|
926
|
+
onLabel: `on`,
|
|
927
|
+
};
|
|
928
|
+
const LABELS = {
|
|
929
|
+
fr: {
|
|
930
|
+
noDateLabel: 'Aucune donnée',
|
|
931
|
+
itemsPerPageLabel: `Éléments par page :`,
|
|
932
|
+
nextPageLabel: `Page suivante`,
|
|
933
|
+
lastPageLabel: `Dernière page`,
|
|
934
|
+
previousPageLabel: `Page précédente`,
|
|
935
|
+
firstPageLabel: `Première page`,
|
|
936
|
+
onLabel: `sur`,
|
|
937
|
+
},
|
|
938
|
+
};
|
|
939
|
+
const DEFAULT_NUMBER_OPTIONS = {
|
|
940
|
+
separator: ',',
|
|
941
|
+
decimal: '.',
|
|
942
|
+
};
|
|
943
|
+
const NUMBER_OPTIONS = {
|
|
944
|
+
fr: {
|
|
945
|
+
separator: ' ',
|
|
946
|
+
decimal: ',',
|
|
947
|
+
},
|
|
948
|
+
};
|
|
949
|
+
class NgxMatDatatableIntl {
|
|
950
|
+
locale = inject(LOCALE_ID);
|
|
951
|
+
noDateLabel;
|
|
952
|
+
itemsPerPageLabel;
|
|
953
|
+
nextPageLabel;
|
|
954
|
+
lastPageLabel;
|
|
955
|
+
previousPageLabel;
|
|
956
|
+
firstPageLabel;
|
|
957
|
+
onLabel;
|
|
958
|
+
numberOptions;
|
|
959
|
+
getRangeLabel = (page, pageSize, length) => {
|
|
960
|
+
if (length === 0 || pageSize === 0)
|
|
961
|
+
return `0 ${this.onLabel} ${length}`;
|
|
962
|
+
length = Math.max(length, 0);
|
|
963
|
+
const startIndex = page * pageSize;
|
|
964
|
+
const endIndex = startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize;
|
|
965
|
+
return `${startIndex + 1} - ${endIndex} ${this.onLabel} ${length}`;
|
|
966
|
+
};
|
|
967
|
+
constructor() {
|
|
968
|
+
this.setLabels(LABELS[this.locale] ?? DEFAULT_LABELS);
|
|
969
|
+
this.numberOptions = NUMBER_OPTIONS[this.locale] ?? DEFAULT_NUMBER_OPTIONS;
|
|
970
|
+
}
|
|
971
|
+
setLabels(labels) {
|
|
972
|
+
this.noDateLabel = labels.noDateLabel;
|
|
973
|
+
this.itemsPerPageLabel = labels.itemsPerPageLabel;
|
|
974
|
+
this.nextPageLabel = labels.nextPageLabel;
|
|
975
|
+
this.lastPageLabel = labels.lastPageLabel;
|
|
976
|
+
this.previousPageLabel = labels.previousPageLabel;
|
|
977
|
+
this.firstPageLabel = labels.firstPageLabel;
|
|
978
|
+
this.onLabel = labels.onLabel;
|
|
979
|
+
}
|
|
980
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
981
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableIntl });
|
|
982
|
+
}
|
|
983
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableIntl, decorators: [{
|
|
984
|
+
type: Injectable
|
|
985
|
+
}], ctorParameters: () => [] });
|
|
986
|
+
|
|
987
|
+
/** @format */
|
|
988
|
+
class MergePipe {
|
|
989
|
+
transform(obj, src) {
|
|
990
|
+
return src ? { ...obj, ...src } : { ...obj };
|
|
991
|
+
}
|
|
992
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: MergePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
993
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: MergePipe, isStandalone: true, name: "merge" });
|
|
994
|
+
}
|
|
995
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: MergePipe, decorators: [{
|
|
996
|
+
type: Pipe,
|
|
997
|
+
args: [{ name: 'merge' }]
|
|
998
|
+
}] });
|
|
999
|
+
|
|
1000
|
+
/** @format */
|
|
1001
|
+
class ProgressSpinnerComponent {
|
|
1002
|
+
datatableIntl = inject(NgxMatDatatableIntl);
|
|
1003
|
+
diameter = 100;
|
|
1004
|
+
set setValue(value) {
|
|
1005
|
+
if (typeof value === 'string')
|
|
1006
|
+
this._value = parseFloat(value);
|
|
1007
|
+
else
|
|
1008
|
+
this._value = value;
|
|
1009
|
+
if (this.animateInView)
|
|
1010
|
+
this.load(this.isInView);
|
|
1011
|
+
}
|
|
1012
|
+
_value = 0;
|
|
1013
|
+
value = 0;
|
|
1014
|
+
color;
|
|
1015
|
+
set setDisplayValue(displayValue) {
|
|
1016
|
+
this.displayValue = displayValue !== false;
|
|
1017
|
+
}
|
|
1018
|
+
displayValue = true;
|
|
1019
|
+
get getColor() {
|
|
1020
|
+
return this.color;
|
|
1021
|
+
}
|
|
1022
|
+
fontSize = `${this.diameter / 5}px`;
|
|
1023
|
+
set setAnimateInView(animateInView) {
|
|
1024
|
+
this.animateInView = animateInView !== false;
|
|
1025
|
+
}
|
|
1026
|
+
animateInView = true;
|
|
1027
|
+
set setDelay(delay) {
|
|
1028
|
+
if (typeof delay === 'string')
|
|
1029
|
+
this.delay = parseInt(delay);
|
|
1030
|
+
else
|
|
1031
|
+
this.delay = delay;
|
|
1032
|
+
}
|
|
1033
|
+
delay;
|
|
1034
|
+
isInView = false;
|
|
1035
|
+
load(intersect) {
|
|
1036
|
+
this.isInView = intersect;
|
|
1037
|
+
if (this.isInView) {
|
|
1038
|
+
if (this.delay)
|
|
1039
|
+
setTimeout(() => (this.value = this._value), this.delay);
|
|
1040
|
+
else
|
|
1041
|
+
this.value = this._value;
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: ProgressSpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1045
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.4", type: ProgressSpinnerComponent, isStandalone: true, selector: "lib-progress-spinner", inputs: { diameter: "diameter", setValue: ["value", "setValue"], color: "color", setDisplayValue: ["displayValue", "setDisplayValue"], fontSize: "fontSize", setAnimateInView: ["animateInView", "setAnimateInView"], setDelay: ["delay", "setDelay"] }, host: { properties: { "style.--progress-spinner-color": "this.getColor" } }, ngImport: i0, template: "<!-- @format -->\n\n<div id=\"container\" [style.font-size]=\"fontSize\" [style.width.px]=\"diameter\" [style.height.px]=\"diameter\">\n <mat-progress-spinner id=\"background\" [diameter]=\"diameter\" mode=\"determinate\" [value]=\"100\"> </mat-progress-spinner>\n <mat-progress-spinner\n id=\"foreground\"\n [diameter]=\"diameter\"\n mode=\"determinate\"\n [value]=\"value\"\n intersectionObserver\n (intersection)=\"load($event.intersect)\">\n </mat-progress-spinner>\n <div id=\"inner-block\">\n <mat-label\n [countUp]=\"value\"\n [options]=\"datatableIntl.numberOptions | merge: { suffix: '%', duration: 0.6 }\"\n [reanimateOnClick]=\"false\"></mat-label>\n <ng-content></ng-content>\n </div>\n</div>\n", styles: ["#container{position:relative}#container #foreground{--mdc-circular-progress-active-indicator-color: var(--progress-spinner-color, varvar(--mat-sys-primary))}#container #foreground ::ng-deep .mdc-circular-progress__determinate-circle{stroke-width:var(--progress-spinner-stroke-width, 5%)!important}#container #background{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);--mdc-circular-progress-active-indicator-color: var(--progress-spinner-color, var(--mat-sys-primary))}#container #background ::ng-deep .mdc-circular-progress__determinate-circle{stroke-width:var(--progress-spinner-stroke-width, calc(5% + 2px) )!important;stroke-opacity:var(--progress-spinner-background-opacity, .2)}#container #inner-block{position:absolute;inset:0;box-sizing:content-box;display:flex;flex-direction:column;place-content:center center;align-items:center;overflow:hidden;border-radius:50%;margin:calc(var(--progress-spinner-stroke-width, calc(5% + 2px) ) + 2px);line-height:1em}#container:hover #foreground ::ng-deep .mdc-circular-progress__determinate-circle{stroke-width:var(--progress-spinner-stroke-width, calc(5% + 2px) )!important}#container:hover #background ::ng-deep .mdc-circular-progress__determinate-circle{stroke-opacity:var(--progress-spinner-background-opacity, .33)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i1$3.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: IntersectionObserverModule }, { kind: "directive", type: i3.IntersectionObserverDirective, selector: "[intersectionObserver]", inputs: ["visitClass", "leaveClass", "removeVisitClass", "removeLeaveClass", "useScroll", "threshold", "autoRemove"], outputs: ["intersection"] }, { kind: "ngmodule", type: CountUpModule }, { kind: "directive", type: i3$3.CountUpDirective, selector: "[countUp]", inputs: ["countUp", "options", "reanimateOnClick"], outputs: ["complete"] }, { kind: "pipe", type: MergePipe, name: "merge" }] });
|
|
1046
|
+
}
|
|
1047
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: ProgressSpinnerComponent, decorators: [{
|
|
1048
|
+
type: Component,
|
|
1049
|
+
args: [{ selector: 'lib-progress-spinner', imports: [CommonModule, MatProgressSpinnerModule, IntersectionObserverModule, CountUpModule, MergePipe], template: "<!-- @format -->\n\n<div id=\"container\" [style.font-size]=\"fontSize\" [style.width.px]=\"diameter\" [style.height.px]=\"diameter\">\n <mat-progress-spinner id=\"background\" [diameter]=\"diameter\" mode=\"determinate\" [value]=\"100\"> </mat-progress-spinner>\n <mat-progress-spinner\n id=\"foreground\"\n [diameter]=\"diameter\"\n mode=\"determinate\"\n [value]=\"value\"\n intersectionObserver\n (intersection)=\"load($event.intersect)\">\n </mat-progress-spinner>\n <div id=\"inner-block\">\n <mat-label\n [countUp]=\"value\"\n [options]=\"datatableIntl.numberOptions | merge: { suffix: '%', duration: 0.6 }\"\n [reanimateOnClick]=\"false\"></mat-label>\n <ng-content></ng-content>\n </div>\n</div>\n", styles: ["#container{position:relative}#container #foreground{--mdc-circular-progress-active-indicator-color: var(--progress-spinner-color, varvar(--mat-sys-primary))}#container #foreground ::ng-deep .mdc-circular-progress__determinate-circle{stroke-width:var(--progress-spinner-stroke-width, 5%)!important}#container #background{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);--mdc-circular-progress-active-indicator-color: var(--progress-spinner-color, var(--mat-sys-primary))}#container #background ::ng-deep .mdc-circular-progress__determinate-circle{stroke-width:var(--progress-spinner-stroke-width, calc(5% + 2px) )!important;stroke-opacity:var(--progress-spinner-background-opacity, .2)}#container #inner-block{position:absolute;inset:0;box-sizing:content-box;display:flex;flex-direction:column;place-content:center center;align-items:center;overflow:hidden;border-radius:50%;margin:calc(var(--progress-spinner-stroke-width, calc(5% + 2px) ) + 2px);line-height:1em}#container:hover #foreground ::ng-deep .mdc-circular-progress__determinate-circle{stroke-width:var(--progress-spinner-stroke-width, calc(5% + 2px) )!important}#container:hover #background ::ng-deep .mdc-circular-progress__determinate-circle{stroke-opacity:var(--progress-spinner-background-opacity, .33)}\n"] }]
|
|
1050
|
+
}], propDecorators: { diameter: [{
|
|
1051
|
+
type: Input
|
|
1052
|
+
}], setValue: [{
|
|
1053
|
+
type: Input,
|
|
1054
|
+
args: ['value']
|
|
1055
|
+
}], color: [{
|
|
1056
|
+
type: Input
|
|
1057
|
+
}], setDisplayValue: [{
|
|
1058
|
+
type: Input,
|
|
1059
|
+
args: ['displayValue']
|
|
1060
|
+
}], getColor: [{
|
|
1061
|
+
type: HostBinding,
|
|
1062
|
+
args: ['style.--progress-spinner-color']
|
|
1063
|
+
}], fontSize: [{
|
|
1064
|
+
type: Input
|
|
1065
|
+
}], setAnimateInView: [{
|
|
1066
|
+
type: Input,
|
|
1067
|
+
args: ['animateInView']
|
|
1068
|
+
}], setDelay: [{
|
|
1069
|
+
type: Input,
|
|
1070
|
+
args: ['delay']
|
|
1071
|
+
}] } });
|
|
1072
|
+
|
|
914
1073
|
/** @format */
|
|
915
1074
|
class DatagridDataSource extends DataSource {
|
|
916
1075
|
service;
|
|
917
1076
|
loading$ = new BehaviorSubject(true);
|
|
918
|
-
recordsTotal = 0;
|
|
919
1077
|
recordsFiltered = 0;
|
|
1078
|
+
recordsTotal;
|
|
1079
|
+
facets;
|
|
920
1080
|
rowSize = 0; // row size in kb
|
|
921
1081
|
options;
|
|
922
1082
|
dataStream = new BehaviorSubject([]);
|
|
@@ -937,6 +1097,7 @@ class DatagridDataSource extends DataSource {
|
|
|
937
1097
|
return;
|
|
938
1098
|
this.recordsTotal = result.recordsTotal;
|
|
939
1099
|
this.recordsFiltered = result.recordsFiltered;
|
|
1100
|
+
this.facets = result.facets;
|
|
940
1101
|
this.dataStream.next(result.data);
|
|
941
1102
|
this.calculateRowSize(result.data);
|
|
942
1103
|
}
|
|
@@ -973,63 +1134,6 @@ class DatagridDataSource extends DataSource {
|
|
|
973
1134
|
}
|
|
974
1135
|
}
|
|
975
1136
|
|
|
976
|
-
/** @format */
|
|
977
|
-
const DEFAULT_LABELS = {
|
|
978
|
-
noDateLabel: 'No data',
|
|
979
|
-
itemsPerPageLabel: `Items per page:`,
|
|
980
|
-
nextPageLabel: `Next page`,
|
|
981
|
-
lastPageLabel: `Last page`,
|
|
982
|
-
previousPageLabel: `Previous page`,
|
|
983
|
-
firstPageLabel: `First page`,
|
|
984
|
-
onLabel: `on`,
|
|
985
|
-
};
|
|
986
|
-
const LABELS = {
|
|
987
|
-
fr: {
|
|
988
|
-
noDateLabel: 'Aucune donnée',
|
|
989
|
-
itemsPerPageLabel: `Éléments par page :`,
|
|
990
|
-
nextPageLabel: `Page suivante`,
|
|
991
|
-
lastPageLabel: `Dernière page`,
|
|
992
|
-
previousPageLabel: `Page précédente`,
|
|
993
|
-
firstPageLabel: `Première page`,
|
|
994
|
-
onLabel: `sur`,
|
|
995
|
-
},
|
|
996
|
-
};
|
|
997
|
-
class NgxMatDatatableIntl {
|
|
998
|
-
locale = inject(LOCALE_ID);
|
|
999
|
-
noDateLabel;
|
|
1000
|
-
itemsPerPageLabel;
|
|
1001
|
-
nextPageLabel;
|
|
1002
|
-
lastPageLabel;
|
|
1003
|
-
previousPageLabel;
|
|
1004
|
-
firstPageLabel;
|
|
1005
|
-
onLabel;
|
|
1006
|
-
getRangeLabel = (page, pageSize, length) => {
|
|
1007
|
-
if (length === 0 || pageSize === 0)
|
|
1008
|
-
return `0 ${this.onLabel} ${length}`;
|
|
1009
|
-
length = Math.max(length, 0);
|
|
1010
|
-
const startIndex = page * pageSize;
|
|
1011
|
-
const endIndex = startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize;
|
|
1012
|
-
return `${startIndex + 1} - ${endIndex} ${this.onLabel} ${length}`;
|
|
1013
|
-
};
|
|
1014
|
-
constructor() {
|
|
1015
|
-
this.setLabels(LABELS[this.locale] || DEFAULT_LABELS);
|
|
1016
|
-
}
|
|
1017
|
-
setLabels(labels) {
|
|
1018
|
-
this.noDateLabel = labels.noDateLabel;
|
|
1019
|
-
this.itemsPerPageLabel = labels.itemsPerPageLabel;
|
|
1020
|
-
this.nextPageLabel = labels.nextPageLabel;
|
|
1021
|
-
this.lastPageLabel = labels.lastPageLabel;
|
|
1022
|
-
this.previousPageLabel = labels.previousPageLabel;
|
|
1023
|
-
this.firstPageLabel = labels.firstPageLabel;
|
|
1024
|
-
this.onLabel = labels.onLabel;
|
|
1025
|
-
}
|
|
1026
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1027
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableIntl });
|
|
1028
|
-
}
|
|
1029
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableIntl, decorators: [{
|
|
1030
|
-
type: Injectable
|
|
1031
|
-
}], ctorParameters: () => [] });
|
|
1032
|
-
|
|
1033
1137
|
/** @format */
|
|
1034
1138
|
class NgxMatDatatableContentDirective {
|
|
1035
1139
|
templateRef;
|
|
@@ -1091,22 +1195,103 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
|
1091
1195
|
}] });
|
|
1092
1196
|
|
|
1093
1197
|
/** @format */
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1198
|
+
class FilterPipe {
|
|
1199
|
+
transform(obj, filter) {
|
|
1200
|
+
return (obj ?? []).filter(o => {
|
|
1201
|
+
for (let key of Object.keys(filter)) {
|
|
1202
|
+
if (o[key] !== filter[key])
|
|
1203
|
+
return false;
|
|
1204
|
+
}
|
|
1205
|
+
return true;
|
|
1206
|
+
});
|
|
1101
1207
|
}
|
|
1102
|
-
|
|
1208
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FilterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1209
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: FilterPipe, isStandalone: true, name: "filter" });
|
|
1103
1210
|
}
|
|
1211
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FilterPipe, decorators: [{
|
|
1212
|
+
type: Pipe,
|
|
1213
|
+
args: [{ name: 'filter' }]
|
|
1214
|
+
}] });
|
|
1215
|
+
|
|
1216
|
+
/** @format */
|
|
1217
|
+
class FindContentPipe {
|
|
1218
|
+
transform(contentRefs, id) {
|
|
1219
|
+
return contentRefs?.find(ref => ref.id === id);
|
|
1220
|
+
}
|
|
1221
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FindContentPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1222
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: FindContentPipe, isStandalone: true, name: "findContent" });
|
|
1223
|
+
}
|
|
1224
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FindContentPipe, decorators: [{
|
|
1225
|
+
type: Pipe,
|
|
1226
|
+
args: [{ name: 'findContent' }]
|
|
1227
|
+
}] });
|
|
1228
|
+
|
|
1229
|
+
/** @format */
|
|
1230
|
+
class FindPipe {
|
|
1231
|
+
transform(obj, filter) {
|
|
1232
|
+
return (obj ?? []).find(o => {
|
|
1233
|
+
for (let key of Object.keys(filter)) {
|
|
1234
|
+
if (o[key] !== filter[key])
|
|
1235
|
+
return false;
|
|
1236
|
+
}
|
|
1237
|
+
return true;
|
|
1238
|
+
});
|
|
1239
|
+
}
|
|
1240
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FindPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1241
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: FindPipe, isStandalone: true, name: "find" });
|
|
1242
|
+
}
|
|
1243
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: FindPipe, decorators: [{
|
|
1244
|
+
type: Pipe,
|
|
1245
|
+
args: [{ name: 'find' }]
|
|
1246
|
+
}] });
|
|
1247
|
+
|
|
1248
|
+
/** @format */
|
|
1249
|
+
class SortFacetEntriesPipe {
|
|
1250
|
+
transform(entries, options) {
|
|
1251
|
+
if (!options.options)
|
|
1252
|
+
return entries;
|
|
1253
|
+
return entries.sort((e1, e2) => {
|
|
1254
|
+
const ie1 = options.options.findIndex(o => o._id === e1._id);
|
|
1255
|
+
if (ie1 === -1)
|
|
1256
|
+
return 1;
|
|
1257
|
+
const ie2 = options.options.findIndex(o => o._id === e2._id);
|
|
1258
|
+
if (ie2 === -1)
|
|
1259
|
+
return -1;
|
|
1260
|
+
return ie1 - ie2;
|
|
1261
|
+
});
|
|
1262
|
+
}
|
|
1263
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SortFacetEntriesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1264
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: SortFacetEntriesPipe, isStandalone: true, name: "sortFacetEntries" });
|
|
1265
|
+
}
|
|
1266
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SortFacetEntriesPipe, decorators: [{
|
|
1267
|
+
type: Pipe,
|
|
1268
|
+
args: [{ name: 'sortFacetEntries' }]
|
|
1269
|
+
}] });
|
|
1270
|
+
|
|
1271
|
+
/** @format */
|
|
1272
|
+
class SumPipe {
|
|
1273
|
+
transform(obj, by) {
|
|
1274
|
+
if (!obj || !obj.length)
|
|
1275
|
+
return 0;
|
|
1276
|
+
if (by)
|
|
1277
|
+
return obj.reduce((pv, cv) => (pv += cv[by]), 0);
|
|
1278
|
+
return obj.reduce((pv, cv) => (pv += cv), 0);
|
|
1279
|
+
}
|
|
1280
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SumPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1281
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: SumPipe, isStandalone: true, name: "sum" });
|
|
1282
|
+
}
|
|
1283
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: SumPipe, decorators: [{
|
|
1284
|
+
type: Pipe,
|
|
1285
|
+
args: [{ name: 'sum' }]
|
|
1286
|
+
}] });
|
|
1104
1287
|
|
|
1105
1288
|
/** @format */
|
|
1106
1289
|
function duration(data, options) {
|
|
1107
1290
|
const durationOption = { maxDecimalPoints: 0, largest: 1, fallbacks: ['en'] };
|
|
1108
1291
|
if (options?.locale)
|
|
1109
1292
|
durationOption.language = options.locale;
|
|
1293
|
+
if (options?.largest)
|
|
1294
|
+
durationOption.largest = options.largest;
|
|
1110
1295
|
let value;
|
|
1111
1296
|
if (typeof data === 'number')
|
|
1112
1297
|
value = data;
|
|
@@ -1123,6 +1308,18 @@ function duration(data, options) {
|
|
|
1123
1308
|
return humanizeDuration(value, durationOption);
|
|
1124
1309
|
}
|
|
1125
1310
|
|
|
1311
|
+
/** @format */
|
|
1312
|
+
function get(obj, path) {
|
|
1313
|
+
const chunks = path.split('.');
|
|
1314
|
+
let value = obj;
|
|
1315
|
+
for (let i = 0; i < chunks.length; ++i) {
|
|
1316
|
+
value = value[chunks[i]];
|
|
1317
|
+
if (value === undefined || value === null)
|
|
1318
|
+
return null;
|
|
1319
|
+
}
|
|
1320
|
+
return value;
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1126
1323
|
/** @format */
|
|
1127
1324
|
class NgxMatDatatablePaginatorIntl extends MatPaginatorIntl {
|
|
1128
1325
|
datatableIntl = inject(NgxMatDatatableIntl);
|
|
@@ -1255,6 +1452,7 @@ class NgxMatDatatableComponent {
|
|
|
1255
1452
|
start: this.paginator.pageIndex,
|
|
1256
1453
|
length: this.paginator.pageSize,
|
|
1257
1454
|
order,
|
|
1455
|
+
facets: this.options.facets,
|
|
1258
1456
|
});
|
|
1259
1457
|
}
|
|
1260
1458
|
buildOrder(columns) {
|
|
@@ -1311,6 +1509,15 @@ class NgxMatDatatableComponent {
|
|
|
1311
1509
|
this.rowClicked.emit(row);
|
|
1312
1510
|
}
|
|
1313
1511
|
}
|
|
1512
|
+
facetClick(column, result) {
|
|
1513
|
+
if (!column)
|
|
1514
|
+
return;
|
|
1515
|
+
const control = this.searchFormGroup?.controls[column.columnDef];
|
|
1516
|
+
if (!control)
|
|
1517
|
+
return;
|
|
1518
|
+
if (result._id !== control.value?.value)
|
|
1519
|
+
control.setValue({ value: result._id });
|
|
1520
|
+
}
|
|
1314
1521
|
buildRequestColumns() {
|
|
1315
1522
|
const columns = [];
|
|
1316
1523
|
const additionalColumns = [];
|
|
@@ -1386,7 +1593,7 @@ class NgxMatDatatableComponent {
|
|
|
1386
1593
|
.forEach(c => (c.order.index = index++));
|
|
1387
1594
|
}
|
|
1388
1595
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1389
|
-
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 : options\"\n [style.background-color]=\"row | backgroundColor: column : options\">\n <ng-container *ngTemplateOutlet=\"cellTmpl; context: { column, row }\"></ng-container>\n </td>\n </ng-container>\n }\n\n <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?.export\" class=\"action\">\n <button mat-icon-button color=\"primary\" class=\"icon-only\" [disabled]=\"exporting\" (click)=\"export()\">\n <mat-icon>download</mat-icon>\n </button>\n <div class=\"action-loader\" *ngIf=\"exporting\" @fade>\n <mat-spinner [diameter]=\"32\"></mat-spinner>\n </div>\n </div>\n\n <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-container\" [matTooltip]=\"column.tooltip\">\n <div class=\"header\" [formGroup]=\"searchFormGroup\">\n @if (column.searchable) {\n @switch (column.type) {\n @case ('text') {\n <lib-header-text-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-text-filter>\n }\n @case ('number') {\n <lib-header-number-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-number-filter>\n }\n @case ('select') {\n <lib-header-select-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-select-filter>\n }\n @case ('autocomplete') {\n <lib-header-autocomplete-filter\n [column]=\"column\"\n [formControlName]=\"column.columnDef\"></lib-header-autocomplete-filter>\n }\n @case ('checkbox') {\n <lib-header-checkbox-filter\n [column]=\"column\"\n [formControlName]=\"column.columnDef\"></lib-header-checkbox-filter>\n }\n @case ('date') {\n <lib-header-date-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-date-filter>\n }\n @case ('duration') {\n <lib-header-duration-filter\n [column]=\"column\"\n [formControlName]=\"column.columnDef\"></lib-header-duration-filter>\n }\n @default {\n <span>{{ column.header }}</span>\n }\n }\n } @else {\n <span>{{ column.header }}</span>\n }\n <ng-container *ngTemplateOutlet=\"headerActionsTmpl; context: { column }\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #headerActionsTmpl let-column=\"column\">\n <div class=\"header-actions\">\n <ng-container *ngIf=\"column.sortable\">\n <button\n class=\"sort-btn\"\n mat-icon-button\n size=\"small\"\n (click)=\"sortColumn(column)\"\n [matBadgeHidden]=\"!column.order\"\n [matBadge]=\"column.order?.index + 1\">\n @switch (column.order?.dir) {\n @case ('asc') {\n <mat-icon size=\"small\">arrow_upward</mat-icon>\n }\n @case ('desc') {\n <mat-icon size=\"small\">arrow_downward</mat-icon>\n }\n @default {\n <mat-icon size=\"small\">sort</mat-icon>\n }\n }\n </button>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #cellTmpl let-column=\"column\" let-row=\"row\">\n @defer (on viewport) {\n <div class=\"cell\" [style.place-content]=\"column.align\" [style.max-height.px]=\"options.rowMaxHeight\">\n @let value = row | get: column.property;\n @if (column.cellComponent) {\n <ng-container *ngComponentOutlet=\"column.cellComponent; inputs: { column, row, value }\" />\n } @else if (column.cellContentId) {\n @let cell = contentRefs | findContent: column.cellContentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, row, value }\" />\n }\n } @else {\n @if (column.prefixContentId) {\n @let cell = contentRefs | findContent: column.prefixContentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, row, value }\" />\n }\n } @else if (column.prefix) {\n <span [outerHTML]=\"column.prefix | safeHtml\"></span>\n }\n @switch (column.type) {\n @case ('number') {\n <lib-cell-number-value [column]=\"column\" [row]=\"row\"></lib-cell-number-value>\n }\n @case ('select') {\n <lib-cell-select-value [column]=\"column\" [row]=\"row\"></lib-cell-select-value>\n }\n @case ('checkbox') {\n <lib-cell-checkbox-value [column]=\"column\" [row]=\"row\"></lib-cell-checkbox-value>\n }\n @case ('date') {\n <lib-cell-date-value [column]=\"column\" [row]=\"row\"></lib-cell-date-value>\n }\n @case ('duration') {\n <lib-cell-duration-value [column]=\"column\" [row]=\"row\"></lib-cell-duration-value>\n }\n @default {\n <span [outerHTML]=\"value | transform: row : column | safeHtml\"></span>\n }\n }\n @if (column.suffixContentId) {\n @let cell = contentRefs | findContent: column.suffixContentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, row, value }\" />\n }\n } @else if (column.suffix) {\n <span [outerHTML]=\"column.suffix | safeHtml\"></span>\n }\n }\n </div>\n } @placeholder {\n <div class=\"cell\"></div>\n }\n</ng-template>\n", styles: [":host{overflow:hidden;display:flex;position:relative;max-height:100%;--ngx-mat-datatable-background: #ffffff;--ngx-mat-datatable-border-color: #ccc;--ngx-mat-datatable-sticky-background: var(--ngx-mat-datatable-background);--ngx-mat-datatable-sticky-border: 1px dashed #e6a93a}#container{display:flex;flex:1 1 100%;box-sizing:border-box;flex-direction:column;position:relative;overflow:hidden;width:100%;background-color:var(--ngx-mat-datatable-background)}#actions{width:100%;display:flex;box-sizing:border-box;place-content:center space-between;align-items:center;flex-direction:row;border-bottom:1px solid var(--ngx-mat-datatable-border-color)}#actions #actions-start,#actions #actions-center,#actions #actions-end{display:flex;box-sizing:border-box;align-items:center;flex-direction:row}#actions #actions-start{place-content:center start}#actions #actions-center{place-content:center center}#actions #actions-end{place-content:center end}#actions .action{position:relative}#actions .action .action-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}#column-options .column-options-item{overflow:hidden;display:flex;box-sizing:border-box;align-items:center;flex-direction:row;place-content:center start}#column-options .column-options-item button.toggle-off{--mdc-icon-button-icon-color: var(--mdc-icon-button-disabled-icon-color)}#column-options .column-options-item mat-icon.handle{color:var(--mdc-icon-button-disabled-icon-color)}#table-container{flex:1 1 100%;overflow:auto;width:100%;scrollbar-width:thin}#table{width:100%;max-height:100%;--mat-table-background-color: var(--ngx-mat-datatable-background);--mat-table-row-item-outline-color: var(--ngx-mat-datatable-border-color)}#table ::ng-deep .mat-mdc-table-sticky{opacity:1;background:var(--ngx-mat-datatable-sticky-background, var(--ngx-mat-datatable-background, #ffffff))}#table ::ng-deep .mat-mdc-table-sticky.mat-mdc-table-sticky-border-elem-left{border-right:var(--ngx-mat-datatable-sticky-border)}#table ::ng-deep .mat-mdc-header-cell{padding:0 8px}#table ::ng-deep .mat-mdc-header-cell mat-form-field{min-width:auto;flex:1 1 100%;--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-container{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;width:100%;min-height:var(--mat-form-field-container-height, 56px);margin:6px 0}#table .header{width:100%;display:flex;box-sizing:border-box;place-content:center space-between;align-items:center;flex-direction:row}#table .header .header-actions .sort-btn{--mat-badge-container-size: 12px;--mat-badge-line-height: 16px;--mat-badge-text-size: 10px;--mat-badge-legacy-container-size: 18px}#table .cell{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;width:100%}#paginator{--mat-paginator-container-background-color: var(--ngx-mat-datatable-background);--mat-form-field-container-height: 24px;--mat-form-field-container-vertical-padding: 4px;--mat-paginator-container-size: 46px;border-top:1px solid var(--ngx-mat-datatable-border-color)}#paginator ::ng-deep .mat-mdc-select{display:flex;height:24px}#paginator ::ng-deep .mat-mdc-paginator-touch-target{height:24px}#paginator ::ng-deep .mat-mdc-paginator-range-actions button{--mdc-icon-button-state-layer-size: 36px;padding:6px}#loading{position:absolute;z-index:200;inset:0;background-color:#00000029}#loading mat-spinner{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}::ng-deep .mat-mdc-icon-button[mat-icon-button][size=small]{--mdc-icon-button-state-layer-size: 30px;--mdc-icon-button-icon-size: 18px}::ng-deep .mat-mdc-icon-button[mat-icon-button][size=small] .mat-mdc-button-touch-target{height:36px;width:36px}::ng-deep .mat-mdc-icon-button[mat-icon-button][size=small] mat-icon{height:18px;width:18px;font-size:18px}.row{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row}#no-data{position:sticky;width:fit-content;left:50%}#no-data #no-data-label{position:relative;margin-left:-50%}\n"], dependencies: [{ kind: "pipe", type: ColorPipe, name: "color" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: HeaderAutocompleteFilterComponent, selector: "lib-header-autocomplete-filter", inputs: ["column"] }, { kind: "component", type: HeaderCheckboxFilterComponent, selector: "lib-header-checkbox-filter", inputs: ["column"] }, { kind: "component", type: HeaderDateFilterComponent, selector: "lib-header-date-filter", inputs: ["column"] }, { kind: "component", type: HeaderDurationFilterComponent, selector: "lib-header-duration-filter", inputs: ["column"] }, { kind: "component", type: HeaderNumberFilterComponent, selector: "lib-header-number-filter", inputs: ["column"] }, { kind: "component", type: HeaderSelectFilterComponent, selector: "lib-header-select-filter", inputs: ["column"] }, { kind: "component", type: HeaderTextFilterComponent, selector: "lib-header-text-filter", inputs: ["column"] }, { kind: "ngmodule", type: IntersectionObserverModule }, { kind: "directive", type: i3.IntersectionObserverDirective, selector: "[intersectionObserver]", inputs: ["visitClass", "leaveClass", "removeVisitClass", "removeLeaveClass", "useScroll", "threshold", "autoRemove"], outputs: ["intersection"] }, { kind: "ngmodule", type: MatBadgeModule }, { kind: "directive", type: i5$2.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i8.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i8.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i9.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i10$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i11.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i11.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i11.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i11.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i11.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i11.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i11.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i11.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i11.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i11.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i11.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i12.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: BackgroundColorPipe, name: "backgroundColor" }], animations: [
|
|
1596
|
+
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=\"headTmpl\"></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 : options\"\n [style.background-color]=\"row | backgroundColor: column : options\">\n <ng-container *ngTemplateOutlet=\"cellTmpl; context: { column, row }\"></ng-container>\n </td>\n </ng-container>\n }\n\n <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 #headTmpl>\n <div id=\"head\">\n <div id=\"head-start\">\n @for (facetOptions of options.facets | filter: { position: 'start' }; track facetOptions) {\n <ng-container *ngTemplateOutlet=\"facetsTmpl; context: { facetOptions }\"></ng-container>\n }\n @for (action of options.actions?.user | filter: { position: 'start' }; track action) {\n <ng-container *ngTemplateOutlet=\"actionTmpl; context: { action }\"></ng-container>\n }\n </div>\n\n <div id=\"head-center\">\n @for (facetOptions of options.facets | filter: { position: 'center' }; track facetOptions) {\n <ng-container *ngTemplateOutlet=\"facetsTmpl; context: { facetOptions }\"></ng-container>\n }\n @for (action of options.actions?.user | filter: { position: 'center' }; track action) {\n <ng-container *ngTemplateOutlet=\"actionTmpl; context: { action }\"></ng-container>\n }\n </div>\n\n <div id=\"head-end\">\n @for (facetOptions of options.facets | filter: { position: 'end' }; track facetOptions) {\n <ng-container *ngTemplateOutlet=\"facetsTmpl; context: { facetOptions }\"></ng-container>\n }\n @for (action of options.actions?.user | filter: { position: 'end' }; track action) {\n <ng-container *ngTemplateOutlet=\"actionTmpl; context: { action }\"></ng-container>\n }\n\n <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?.export\" class=\"action\">\n <button mat-icon-button color=\"primary\" class=\"icon-only\" [disabled]=\"exporting\" (click)=\"export()\">\n <mat-icon>download</mat-icon>\n </button>\n <div class=\"action-loader\" *ngIf=\"exporting\" @fade>\n <mat-spinner [diameter]=\"32\"></mat-spinner>\n </div>\n </div>\n\n <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-container\" [matTooltip]=\"column.tooltip\">\n <div class=\"header\" [formGroup]=\"searchFormGroup\">\n @if (column.searchable) {\n @switch (column.type) {\n @case ('text') {\n <lib-header-text-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-text-filter>\n }\n @case ('number') {\n <lib-header-number-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-number-filter>\n }\n @case ('select') {\n <lib-header-select-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-select-filter>\n }\n @case ('autocomplete') {\n <lib-header-autocomplete-filter\n [column]=\"column\"\n [formControlName]=\"column.columnDef\"></lib-header-autocomplete-filter>\n }\n @case ('checkbox') {\n <lib-header-checkbox-filter\n [column]=\"column\"\n [formControlName]=\"column.columnDef\"></lib-header-checkbox-filter>\n }\n @case ('date') {\n <lib-header-date-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-date-filter>\n }\n @case ('duration') {\n <lib-header-duration-filter\n [column]=\"column\"\n [formControlName]=\"column.columnDef\"></lib-header-duration-filter>\n }\n @default {\n <span>{{ column.header }}</span>\n }\n }\n } @else {\n <span>{{ column.header }}</span>\n }\n <ng-container *ngTemplateOutlet=\"headerActionsTmpl; context: { column }\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #headerActionsTmpl let-column=\"column\">\n <div class=\"header-actions\">\n <ng-container *ngIf=\"column.sortable\">\n <button\n class=\"sort-btn\"\n mat-icon-button\n size=\"small\"\n (click)=\"sortColumn(column)\"\n [matBadgeHidden]=\"!column.order\"\n [matBadge]=\"column.order?.index + 1\">\n @switch (column.order?.dir) {\n @case ('asc') {\n <mat-icon size=\"small\">arrow_upward</mat-icon>\n }\n @case ('desc') {\n <mat-icon size=\"small\">arrow_downward</mat-icon>\n }\n @default {\n <mat-icon size=\"small\">sort</mat-icon>\n }\n }\n </button>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #cellTmpl let-column=\"column\" let-row=\"row\">\n @defer (on viewport) {\n <div class=\"cell\" [style.place-content]=\"column.align\" [style.max-height.px]=\"options.rowMaxHeight\">\n @let value = row | get: column.property;\n @if (column.cellComponent) {\n <ng-container *ngComponentOutlet=\"column.cellComponent; inputs: { column, row, value }\" />\n } @else if (column.cellContentId) {\n @let cell = contentRefs | findContent: column.cellContentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, row, value }\" />\n }\n } @else {\n @if (column.prefixContentId) {\n @let cell = contentRefs | findContent: column.prefixContentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, row, value }\" />\n }\n } @else if (column.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\n<ng-template #actionTmpl let-action=\"action\">\n <div [matTooltip]=\"action.tooltip\">\n <button mat-icon-button (click)=\"action.onclick(this)\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #facetsTmpl let-facetOptions=\"facetOptions\">\n @let column = options.columns | find: { property: facetOptions.property };\n @let data = (dataSource.facets ?? {})[facetOptions.id] | sortFacetEntries: facetOptions;\n @if (data) {\n @if (facetOptions.contentId) {\n @let cell = contentRefs | findContent: facetOptions.contentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, facetOptions, data }\" />\n }\n } @else {\n @let size = facetOptions.size ?? 80;\n @let fontSize = facetOptions.fontSize ?? '1em';\n @let total = (data | sum: 'value') || 1;\n <mat-card class=\"facet\">\n @if (facetOptions.name) {\n <mat-card-header>\n <mat-label>{{ facetOptions.name }}</mat-label>\n </mat-card-header>\n }\n <mat-card-content>\n @for (d of data; track d) {\n @let style = facetOptions.style ? facetOptions.style(d._id) : null;\n @let percent = (d.value / total) * 100;\n <div\n class=\"facet-indicator\"\n [class.has-action]=\"column?.searchable !== false\"\n (click)=\"facetClick(column, d)\">\n <lib-progress-spinner [diameter]=\"size\" [color]=\"style?.color\" [fontSize]=\"fontSize\" [value]=\"percent\">\n <mat-label>{{ style?.name ?? d._id }}</mat-label>\n </lib-progress-spinner>\n <mat-label\n class=\"facet-indicator-label\"\n [style.font-size]=\"fontSize\"\n [countUp]=\"d.value\"\n [options]=\"datatableIntl.numberOptions\"\n [reanimateOnClick]=\"false\">\n {{ d.value | number: '0.0-2' }}\n </mat-label>\n </div>\n }\n </mat-card-content>\n </mat-card>\n }\n }\n</ng-template>\n", styles: [":host{overflow:hidden;display:flex;position:relative;max-height:100%;--ngx-mat-datatable-background: #ffffff;--ngx-mat-datatable-border-color: #ccc;--ngx-mat-datatable-sticky-background: var(--ngx-mat-datatable-background);--ngx-mat-datatable-sticky-border: 1px dashed #e6a93a}#container{display:flex;flex:1 1 100%;box-sizing:border-box;flex-direction:column;position:relative;overflow:hidden;width:100%;background-color:var(--ngx-mat-datatable-background)}#head{width:100%;display:flex;box-sizing:border-box;place-content:end space-between;align-items:end;flex-direction:row;border-bottom:1px solid var(--ngx-mat-datatable-border-color)}#head #head-start,#head #head-center,#head #head-end{display:flex;box-sizing:border-box;align-items:end;flex-direction:row}#head #head-start{place-content:end start}#head #head-center{place-content:end center}#head #head-end{place-content:end end}#head .action{position:relative}#head .action .action-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}#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%;--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-container{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;width:100%;min-height:var(--mat-form-field-container-height, 56px);margin:6px 0}#table .header{width:100%;display:flex;box-sizing:border-box;place-content:center space-between;align-items:center;flex-direction:row}#table .header .header-actions .sort-btn{--mat-badge-container-size: 12px;--mat-badge-line-height: 16px;--mat-badge-text-size: 10px;--mat-badge-legacy-container-size: 18px}#table .cell{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;width:100%}#table .cell>*{display:inline-flex}#paginator{--mat-paginator-container-background-color: var(--ngx-mat-datatable-background);--mat-form-field-container-height: 24px;--mat-form-field-container-vertical-padding: 4px;--mat-paginator-container-size: 46px;border-top:1px solid var(--ngx-mat-datatable-border-color)}#paginator ::ng-deep .mat-mdc-select{display:flex;height:24px}#paginator ::ng-deep .mat-mdc-paginator-touch-target{height:24px}#paginator ::ng-deep .mat-mdc-paginator-range-actions button{--mdc-icon-button-state-layer-size: 36px;padding:6px}#loading{position:absolute;z-index:200;inset:0;background-color:#00000029}#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%}.facet{margin:8px;--mdc-elevated-card-container-color: transparent}.facet mat-card-content{display:flex;box-sizing:border-box;place-content:center center;align-items:center;flex-direction:row;flex-wrap:wrap;padding:4px}.facet .facet-indicator{display:flex;box-sizing:border-box;flex-direction:column;place-content:center center;align-items:center;position:relative;margin:4px}.facet .facet-indicator.has-action{cursor:pointer}.facet .facet-indicator .facet-indicator-label{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1em;padding:2px}\n"], dependencies: [{ kind: "pipe", type: ColorPipe, name: "color" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.DecimalPipe, name: "number" }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "pipe", type: FindContentPipe, name: "findContent" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: HeaderAutocompleteFilterComponent, selector: "lib-header-autocomplete-filter", inputs: ["column"] }, { kind: "component", type: HeaderCheckboxFilterComponent, selector: "lib-header-checkbox-filter", inputs: ["column"] }, { kind: "component", type: HeaderDateFilterComponent, selector: "lib-header-date-filter", inputs: ["column"] }, { kind: "component", type: HeaderDurationFilterComponent, selector: "lib-header-duration-filter", inputs: ["column"] }, { kind: "component", type: HeaderNumberFilterComponent, selector: "lib-header-number-filter", inputs: ["column"] }, { kind: "component", type: HeaderSelectFilterComponent, selector: "lib-header-select-filter", inputs: ["column"] }, { kind: "component", type: HeaderTextFilterComponent, selector: "lib-header-text-filter", inputs: ["column"] }, { kind: "ngmodule", type: IntersectionObserverModule }, { kind: "directive", type: i3.IntersectionObserverDirective, selector: "[intersectionObserver]", inputs: ["visitClass", "leaveClass", "removeVisitClass", "removeLeaveClass", "useScroll", "threshold", "autoRemove"], outputs: ["intersection"] }, { kind: "ngmodule", type: MatBadgeModule }, { kind: "directive", type: i5$2.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i9.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i9.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i10$1.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i1$3.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i12.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i12.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i12.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i12.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i12.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i12.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i12.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i12.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i12.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i12.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i12.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i13.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: BackgroundColorPipe, name: "backgroundColor" }, { kind: "pipe", type: FilterPipe, name: "filter" }, { kind: "pipe", type: SumPipe, name: "sum" }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i14.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i14.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i14.MatCardHeader, selector: "mat-card-header" }, { kind: "ngmodule", type: CountUpModule }, { kind: "directive", type: i3$3.CountUpDirective, selector: "[countUp]", inputs: ["countUp", "options", "reanimateOnClick"], outputs: ["complete"] }, { kind: "component", type: ProgressSpinnerComponent, selector: "lib-progress-spinner", inputs: ["diameter", "value", "color", "displayValue", "fontSize", "animateInView", "delay"] }, { kind: "pipe", type: FindPipe, name: "find" }, { kind: "pipe", type: SortFacetEntriesPipe, name: "sortFacetEntries" }], animations: [
|
|
1390
1597
|
trigger('fade', [
|
|
1391
1598
|
transition(':enter', [
|
|
1392
1599
|
style({ opacity: 0 }), // initial
|
|
@@ -1397,9 +1604,9 @@ class NgxMatDatatableComponent {
|
|
|
1397
1604
|
animate('0.2s', style({ opacity: 0 })), // final
|
|
1398
1605
|
]),
|
|
1399
1606
|
]),
|
|
1400
|
-
], deferBlockDependencies: [() => [import('./eherve-angular-material-datatable-cell-checkbox-value.component-
|
|
1607
|
+
], deferBlockDependencies: [() => [import('./eherve-angular-material-datatable-cell-checkbox-value.component-DDe_Pxw3.mjs').then(m => m.CellCheckboxValueComponent), import('./eherve-angular-material-datatable-cell-date-value.component-DLWLxIE8.mjs').then(m => m.CellDateValueComponent), import('./eherve-angular-material-datatable-cell-duration-value.component-7XEEW3uX.mjs').then(m => m.CellDurationValueComponent), import('./eherve-angular-material-datatable-cell-number-value.component-CK0RC4b-.mjs').then(m => m.CellNumberValueComponent), import('./eherve-angular-material-datatable-cell-select-value.component-cEFgCV26.mjs').then(m => m.CellSelectValueComponent), i1$1.NgComponentOutlet, i1$1.NgTemplateOutlet, import('./eherve-angular-material-datatable-transform.pipe-BOmcXXZU.mjs').then(m => m.TransformPipe), FindContentPipe, import('./eherve-angular-material-datatable-get.pipe-c_eIjBUL.mjs').then(m => m.GetPipe), Promise.resolve().then(function () { return safeHtml_pipe; }).then(m => m.SafeHtmlPipe)]] });
|
|
1401
1608
|
}
|
|
1402
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableComponent, resolveDeferredDeps: () => [import('./eherve-angular-material-datatable-cell-checkbox-value.component-
|
|
1609
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "19.0.4", ngImport: i0, type: NgxMatDatatableComponent, resolveDeferredDeps: () => [import('./eherve-angular-material-datatable-cell-checkbox-value.component-DDe_Pxw3.mjs').then(m => m.CellCheckboxValueComponent), import('./eherve-angular-material-datatable-cell-date-value.component-DLWLxIE8.mjs').then(m => m.CellDateValueComponent), import('./eherve-angular-material-datatable-cell-duration-value.component-7XEEW3uX.mjs').then(m => m.CellDurationValueComponent), import('./eherve-angular-material-datatable-cell-number-value.component-CK0RC4b-.mjs').then(m => m.CellNumberValueComponent), import('./eherve-angular-material-datatable-cell-select-value.component-cEFgCV26.mjs').then(m => m.CellSelectValueComponent), import('./eherve-angular-material-datatable-transform.pipe-BOmcXXZU.mjs').then(m => m.TransformPipe), import('./eherve-angular-material-datatable-get.pipe-c_eIjBUL.mjs').then(m => m.GetPipe), Promise.resolve().then(function () { return safeHtml_pipe; }).then(m => m.SafeHtmlPipe)], resolveMetadata: (CellCheckboxValueComponent, CellDateValueComponent, CellDurationValueComponent, CellNumberValueComponent, CellSelectValueComponent, TransformPipe, GetPipe, SafeHtmlPipe) => ({ decorators: [{
|
|
1403
1610
|
type: Component,
|
|
1404
1611
|
args: [{ imports: [
|
|
1405
1612
|
CellCheckboxValueComponent,
|
|
@@ -1434,6 +1641,13 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "19.0.4", ng
|
|
|
1434
1641
|
SafeHtmlPipe,
|
|
1435
1642
|
MatTooltipModule,
|
|
1436
1643
|
BackgroundColorPipe,
|
|
1644
|
+
FilterPipe,
|
|
1645
|
+
SumPipe,
|
|
1646
|
+
MatCardModule,
|
|
1647
|
+
CountUpModule,
|
|
1648
|
+
ProgressSpinnerComponent,
|
|
1649
|
+
FindPipe,
|
|
1650
|
+
SortFacetEntriesPipe,
|
|
1437
1651
|
], providers: [{ provide: MatPaginatorIntl, useClass: NgxMatDatatablePaginatorIntl }], selector: 'ngx-mat-datatable', animations: [
|
|
1438
1652
|
trigger('fade', [
|
|
1439
1653
|
transition(':enter', [
|
|
@@ -1445,7 +1659,7 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "19.0.4", ng
|
|
|
1445
1659
|
animate('0.2s', style({ opacity: 0 })), // final
|
|
1446
1660
|
]),
|
|
1447
1661
|
]),
|
|
1448
|
-
], 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 : options\"\n [style.background-color]=\"row | backgroundColor: column : options\">\n <ng-container *ngTemplateOutlet=\"cellTmpl; context: { column, row }\"></ng-container>\n </td>\n </ng-container>\n }\n\n <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?.export\" class=\"action\">\n <button mat-icon-button color=\"primary\" class=\"icon-only\" [disabled]=\"exporting\" (click)=\"export()\">\n <mat-icon>download</mat-icon>\n </button>\n <div class=\"action-loader\" *ngIf=\"exporting\" @fade>\n <mat-spinner [diameter]=\"32\"></mat-spinner>\n </div>\n </div>\n\n <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-container\" [matTooltip]=\"column.tooltip\">\n <div class=\"header\" [formGroup]=\"searchFormGroup\">\n @if (column.searchable) {\n @switch (column.type) {\n @case ('text') {\n <lib-header-text-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-text-filter>\n }\n @case ('number') {\n <lib-header-number-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-number-filter>\n }\n @case ('select') {\n <lib-header-select-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-select-filter>\n }\n @case ('autocomplete') {\n <lib-header-autocomplete-filter\n [column]=\"column\"\n [formControlName]=\"column.columnDef\"></lib-header-autocomplete-filter>\n }\n @case ('checkbox') {\n <lib-header-checkbox-filter\n [column]=\"column\"\n [formControlName]=\"column.columnDef\"></lib-header-checkbox-filter>\n }\n @case ('date') {\n <lib-header-date-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-date-filter>\n }\n @case ('duration') {\n <lib-header-duration-filter\n [column]=\"column\"\n [formControlName]=\"column.columnDef\"></lib-header-duration-filter>\n }\n @default {\n <span>{{ column.header }}</span>\n }\n }\n } @else {\n <span>{{ column.header }}</span>\n }\n <ng-container *ngTemplateOutlet=\"headerActionsTmpl; context: { column }\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #headerActionsTmpl let-column=\"column\">\n <div class=\"header-actions\">\n <ng-container *ngIf=\"column.sortable\">\n <button\n class=\"sort-btn\"\n mat-icon-button\n size=\"small\"\n (click)=\"sortColumn(column)\"\n [matBadgeHidden]=\"!column.order\"\n [matBadge]=\"column.order?.index + 1\">\n @switch (column.order?.dir) {\n @case ('asc') {\n <mat-icon size=\"small\">arrow_upward</mat-icon>\n }\n @case ('desc') {\n <mat-icon size=\"small\">arrow_downward</mat-icon>\n }\n @default {\n <mat-icon size=\"small\">sort</mat-icon>\n }\n }\n </button>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #cellTmpl let-column=\"column\" let-row=\"row\">\n @defer (on viewport) {\n <div class=\"cell\" [style.place-content]=\"column.align\" [style.max-height.px]=\"options.rowMaxHeight\">\n @let value = row | get: column.property;\n @if (column.cellComponent) {\n <ng-container *ngComponentOutlet=\"column.cellComponent; inputs: { column, row, value }\" />\n } @else if (column.cellContentId) {\n @let cell = contentRefs | findContent: column.cellContentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, row, value }\" />\n }\n } @else {\n @if (column.prefixContentId) {\n @let cell = contentRefs | findContent: column.prefixContentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, row, value }\" />\n }\n } @else if (column.prefix) {\n <span [outerHTML]=\"column.prefix | safeHtml\"></span>\n }\n @switch (column.type) {\n @case ('number') {\n <lib-cell-number-value [column]=\"column\" [row]=\"row\"></lib-cell-number-value>\n }\n @case ('select') {\n <lib-cell-select-value [column]=\"column\" [row]=\"row\"></lib-cell-select-value>\n }\n @case ('checkbox') {\n <lib-cell-checkbox-value [column]=\"column\" [row]=\"row\"></lib-cell-checkbox-value>\n }\n @case ('date') {\n <lib-cell-date-value [column]=\"column\" [row]=\"row\"></lib-cell-date-value>\n }\n @case ('duration') {\n <lib-cell-duration-value [column]=\"column\" [row]=\"row\"></lib-cell-duration-value>\n }\n @default {\n <span [outerHTML]=\"value | transform: row : column | safeHtml\"></span>\n }\n }\n @if (column.suffixContentId) {\n @let cell = contentRefs | findContent: column.suffixContentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, row, value }\" />\n }\n } @else if (column.suffix) {\n <span [outerHTML]=\"column.suffix | safeHtml\"></span>\n }\n }\n </div>\n } @placeholder {\n <div class=\"cell\"></div>\n }\n</ng-template>\n", styles: [":host{overflow:hidden;display:flex;position:relative;max-height:100%;--ngx-mat-datatable-background: #ffffff;--ngx-mat-datatable-border-color: #ccc;--ngx-mat-datatable-sticky-background: var(--ngx-mat-datatable-background);--ngx-mat-datatable-sticky-border: 1px dashed #e6a93a}#container{display:flex;flex:1 1 100%;box-sizing:border-box;flex-direction:column;position:relative;overflow:hidden;width:100%;background-color:var(--ngx-mat-datatable-background)}#actions{width:100%;display:flex;box-sizing:border-box;place-content:center space-between;align-items:center;flex-direction:row;border-bottom:1px solid var(--ngx-mat-datatable-border-color)}#actions #actions-start,#actions #actions-center,#actions #actions-end{display:flex;box-sizing:border-box;align-items:center;flex-direction:row}#actions #actions-start{place-content:center start}#actions #actions-center{place-content:center center}#actions #actions-end{place-content:center end}#actions .action{position:relative}#actions .action .action-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}#column-options .column-options-item{overflow:hidden;display:flex;box-sizing:border-box;align-items:center;flex-direction:row;place-content:center start}#column-options .column-options-item button.toggle-off{--mdc-icon-button-icon-color: var(--mdc-icon-button-disabled-icon-color)}#column-options .column-options-item mat-icon.handle{color:var(--mdc-icon-button-disabled-icon-color)}#table-container{flex:1 1 100%;overflow:auto;width:100%;scrollbar-width:thin}#table{width:100%;max-height:100%;--mat-table-background-color: var(--ngx-mat-datatable-background);--mat-table-row-item-outline-color: var(--ngx-mat-datatable-border-color)}#table ::ng-deep .mat-mdc-table-sticky{opacity:1;background:var(--ngx-mat-datatable-sticky-background, var(--ngx-mat-datatable-background, #ffffff))}#table ::ng-deep .mat-mdc-table-sticky.mat-mdc-table-sticky-border-elem-left{border-right:var(--ngx-mat-datatable-sticky-border)}#table ::ng-deep .mat-mdc-header-cell{padding:0 8px}#table ::ng-deep .mat-mdc-header-cell mat-form-field{min-width:auto;flex:1 1 100%;--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-container{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;width:100%;min-height:var(--mat-form-field-container-height, 56px);margin:6px 0}#table .header{width:100%;display:flex;box-sizing:border-box;place-content:center space-between;align-items:center;flex-direction:row}#table .header .header-actions .sort-btn{--mat-badge-container-size: 12px;--mat-badge-line-height: 16px;--mat-badge-text-size: 10px;--mat-badge-legacy-container-size: 18px}#table .cell{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;width:100%}#paginator{--mat-paginator-container-background-color: var(--ngx-mat-datatable-background);--mat-form-field-container-height: 24px;--mat-form-field-container-vertical-padding: 4px;--mat-paginator-container-size: 46px;border-top:1px solid var(--ngx-mat-datatable-border-color)}#paginator ::ng-deep .mat-mdc-select{display:flex;height:24px}#paginator ::ng-deep .mat-mdc-paginator-touch-target{height:24px}#paginator ::ng-deep .mat-mdc-paginator-range-actions button{--mdc-icon-button-state-layer-size: 36px;padding:6px}#loading{position:absolute;z-index:200;inset:0;background-color:#00000029}#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"] }]
|
|
1662
|
+
], template: "<!-- @format -->\n\n<div *ngIf=\"dataSource\" id=\"container\">\n <ng-container *ngTemplateOutlet=\"headTmpl\"></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 : options\"\n [style.background-color]=\"row | backgroundColor: column : options\">\n <ng-container *ngTemplateOutlet=\"cellTmpl; context: { column, row }\"></ng-container>\n </td>\n </ng-container>\n }\n\n <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 #headTmpl>\n <div id=\"head\">\n <div id=\"head-start\">\n @for (facetOptions of options.facets | filter: { position: 'start' }; track facetOptions) {\n <ng-container *ngTemplateOutlet=\"facetsTmpl; context: { facetOptions }\"></ng-container>\n }\n @for (action of options.actions?.user | filter: { position: 'start' }; track action) {\n <ng-container *ngTemplateOutlet=\"actionTmpl; context: { action }\"></ng-container>\n }\n </div>\n\n <div id=\"head-center\">\n @for (facetOptions of options.facets | filter: { position: 'center' }; track facetOptions) {\n <ng-container *ngTemplateOutlet=\"facetsTmpl; context: { facetOptions }\"></ng-container>\n }\n @for (action of options.actions?.user | filter: { position: 'center' }; track action) {\n <ng-container *ngTemplateOutlet=\"actionTmpl; context: { action }\"></ng-container>\n }\n </div>\n\n <div id=\"head-end\">\n @for (facetOptions of options.facets | filter: { position: 'end' }; track facetOptions) {\n <ng-container *ngTemplateOutlet=\"facetsTmpl; context: { facetOptions }\"></ng-container>\n }\n @for (action of options.actions?.user | filter: { position: 'end' }; track action) {\n <ng-container *ngTemplateOutlet=\"actionTmpl; context: { action }\"></ng-container>\n }\n\n <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?.export\" class=\"action\">\n <button mat-icon-button color=\"primary\" class=\"icon-only\" [disabled]=\"exporting\" (click)=\"export()\">\n <mat-icon>download</mat-icon>\n </button>\n <div class=\"action-loader\" *ngIf=\"exporting\" @fade>\n <mat-spinner [diameter]=\"32\"></mat-spinner>\n </div>\n </div>\n\n <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-container\" [matTooltip]=\"column.tooltip\">\n <div class=\"header\" [formGroup]=\"searchFormGroup\">\n @if (column.searchable) {\n @switch (column.type) {\n @case ('text') {\n <lib-header-text-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-text-filter>\n }\n @case ('number') {\n <lib-header-number-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-number-filter>\n }\n @case ('select') {\n <lib-header-select-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-select-filter>\n }\n @case ('autocomplete') {\n <lib-header-autocomplete-filter\n [column]=\"column\"\n [formControlName]=\"column.columnDef\"></lib-header-autocomplete-filter>\n }\n @case ('checkbox') {\n <lib-header-checkbox-filter\n [column]=\"column\"\n [formControlName]=\"column.columnDef\"></lib-header-checkbox-filter>\n }\n @case ('date') {\n <lib-header-date-filter [column]=\"column\" [formControlName]=\"column.columnDef\"></lib-header-date-filter>\n }\n @case ('duration') {\n <lib-header-duration-filter\n [column]=\"column\"\n [formControlName]=\"column.columnDef\"></lib-header-duration-filter>\n }\n @default {\n <span>{{ column.header }}</span>\n }\n }\n } @else {\n <span>{{ column.header }}</span>\n }\n <ng-container *ngTemplateOutlet=\"headerActionsTmpl; context: { column }\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #headerActionsTmpl let-column=\"column\">\n <div class=\"header-actions\">\n <ng-container *ngIf=\"column.sortable\">\n <button\n class=\"sort-btn\"\n mat-icon-button\n size=\"small\"\n (click)=\"sortColumn(column)\"\n [matBadgeHidden]=\"!column.order\"\n [matBadge]=\"column.order?.index + 1\">\n @switch (column.order?.dir) {\n @case ('asc') {\n <mat-icon size=\"small\">arrow_upward</mat-icon>\n }\n @case ('desc') {\n <mat-icon size=\"small\">arrow_downward</mat-icon>\n }\n @default {\n <mat-icon size=\"small\">sort</mat-icon>\n }\n }\n </button>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #cellTmpl let-column=\"column\" let-row=\"row\">\n @defer (on viewport) {\n <div class=\"cell\" [style.place-content]=\"column.align\" [style.max-height.px]=\"options.rowMaxHeight\">\n @let value = row | get: column.property;\n @if (column.cellComponent) {\n <ng-container *ngComponentOutlet=\"column.cellComponent; inputs: { column, row, value }\" />\n } @else if (column.cellContentId) {\n @let cell = contentRefs | findContent: column.cellContentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, row, value }\" />\n }\n } @else {\n @if (column.prefixContentId) {\n @let cell = contentRefs | findContent: column.prefixContentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, row, value }\" />\n }\n } @else if (column.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\n<ng-template #actionTmpl let-action=\"action\">\n <div [matTooltip]=\"action.tooltip\">\n <button mat-icon-button (click)=\"action.onclick(this)\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #facetsTmpl let-facetOptions=\"facetOptions\">\n @let column = options.columns | find: { property: facetOptions.property };\n @let data = (dataSource.facets ?? {})[facetOptions.id] | sortFacetEntries: facetOptions;\n @if (data) {\n @if (facetOptions.contentId) {\n @let cell = contentRefs | findContent: facetOptions.contentId;\n @if (cell) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: { column, facetOptions, data }\" />\n }\n } @else {\n @let size = facetOptions.size ?? 80;\n @let fontSize = facetOptions.fontSize ?? '1em';\n @let total = (data | sum: 'value') || 1;\n <mat-card class=\"facet\">\n @if (facetOptions.name) {\n <mat-card-header>\n <mat-label>{{ facetOptions.name }}</mat-label>\n </mat-card-header>\n }\n <mat-card-content>\n @for (d of data; track d) {\n @let style = facetOptions.style ? facetOptions.style(d._id) : null;\n @let percent = (d.value / total) * 100;\n <div\n class=\"facet-indicator\"\n [class.has-action]=\"column?.searchable !== false\"\n (click)=\"facetClick(column, d)\">\n <lib-progress-spinner [diameter]=\"size\" [color]=\"style?.color\" [fontSize]=\"fontSize\" [value]=\"percent\">\n <mat-label>{{ style?.name ?? d._id }}</mat-label>\n </lib-progress-spinner>\n <mat-label\n class=\"facet-indicator-label\"\n [style.font-size]=\"fontSize\"\n [countUp]=\"d.value\"\n [options]=\"datatableIntl.numberOptions\"\n [reanimateOnClick]=\"false\">\n {{ d.value | number: '0.0-2' }}\n </mat-label>\n </div>\n }\n </mat-card-content>\n </mat-card>\n }\n }\n</ng-template>\n", styles: [":host{overflow:hidden;display:flex;position:relative;max-height:100%;--ngx-mat-datatable-background: #ffffff;--ngx-mat-datatable-border-color: #ccc;--ngx-mat-datatable-sticky-background: var(--ngx-mat-datatable-background);--ngx-mat-datatable-sticky-border: 1px dashed #e6a93a}#container{display:flex;flex:1 1 100%;box-sizing:border-box;flex-direction:column;position:relative;overflow:hidden;width:100%;background-color:var(--ngx-mat-datatable-background)}#head{width:100%;display:flex;box-sizing:border-box;place-content:end space-between;align-items:end;flex-direction:row;border-bottom:1px solid var(--ngx-mat-datatable-border-color)}#head #head-start,#head #head-center,#head #head-end{display:flex;box-sizing:border-box;align-items:end;flex-direction:row}#head #head-start{place-content:end start}#head #head-center{place-content:end center}#head #head-end{place-content:end end}#head .action{position:relative}#head .action .action-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}#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%;--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-container{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;width:100%;min-height:var(--mat-form-field-container-height, 56px);margin:6px 0}#table .header{width:100%;display:flex;box-sizing:border-box;place-content:center space-between;align-items:center;flex-direction:row}#table .header .header-actions .sort-btn{--mat-badge-container-size: 12px;--mat-badge-line-height: 16px;--mat-badge-text-size: 10px;--mat-badge-legacy-container-size: 18px}#table .cell{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;width:100%}#table .cell>*{display:inline-flex}#paginator{--mat-paginator-container-background-color: var(--ngx-mat-datatable-background);--mat-form-field-container-height: 24px;--mat-form-field-container-vertical-padding: 4px;--mat-paginator-container-size: 46px;border-top:1px solid var(--ngx-mat-datatable-border-color)}#paginator ::ng-deep .mat-mdc-select{display:flex;height:24px}#paginator ::ng-deep .mat-mdc-paginator-touch-target{height:24px}#paginator ::ng-deep .mat-mdc-paginator-range-actions button{--mdc-icon-button-state-layer-size: 36px;padding:6px}#loading{position:absolute;z-index:200;inset:0;background-color:#00000029}#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%}.facet{margin:8px;--mdc-elevated-card-container-color: transparent}.facet mat-card-content{display:flex;box-sizing:border-box;place-content:center center;align-items:center;flex-direction:row;flex-wrap:wrap;padding:4px}.facet .facet-indicator{display:flex;box-sizing:border-box;flex-direction:column;place-content:center center;align-items:center;position:relative;margin:4px}.facet .facet-indicator.has-action{cursor:pointer}.facet .facet-indicator .facet-indicator-label{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1em;padding:2px}\n"] }]
|
|
1449
1663
|
}], ctorParameters: null, propDecorators: { options: [{
|
|
1450
1664
|
type: Input,
|
|
1451
1665
|
args: ['options']
|
|
@@ -1480,6 +1694,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
|
1480
1694
|
|
|
1481
1695
|
/** @format */
|
|
1482
1696
|
|
|
1697
|
+
/** @format */
|
|
1698
|
+
|
|
1699
|
+
/** @format */
|
|
1700
|
+
|
|
1701
|
+
/** @format */
|
|
1702
|
+
|
|
1483
1703
|
/**
|
|
1484
1704
|
* Public API Surface of mongoose-datatable
|
|
1485
1705
|
*
|
|
@@ -1491,4 +1711,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
|
1491
1711
|
*/
|
|
1492
1712
|
|
|
1493
1713
|
export { NgxMatDatatableModule as N, SelectOptionPipe as S, SafeHtmlPipe as a, NgxMatDatatableComponent as b, NgxMatDatatableContentDirective as c, duration as d, NgxMatDatatableIntl as e, get as g };
|
|
1494
|
-
//# sourceMappingURL=eherve-angular-material-datatable-eherve-angular-material-datatable-
|
|
1714
|
+
//# sourceMappingURL=eherve-angular-material-datatable-eherve-angular-material-datatable-DBFRL62_.mjs.map
|