@eherve/angular-material-datatable 19.22.3 → 19.23.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-DgLUapi6.mjs → eherve-angular-material-datatable-cell-checkbox-value.component-BzVZSH1C.mjs} +2 -2
- package/fesm2022/{eherve-angular-material-datatable-cell-checkbox-value.component-DgLUapi6.mjs.map → eherve-angular-material-datatable-cell-checkbox-value.component-BzVZSH1C.mjs.map} +1 -1
- package/fesm2022/{eherve-angular-material-datatable-cell-date-value.component-y4g5Jd5V.mjs → eherve-angular-material-datatable-cell-date-value.component-DCh3-kAN.mjs} +2 -2
- package/fesm2022/{eherve-angular-material-datatable-cell-date-value.component-y4g5Jd5V.mjs.map → eherve-angular-material-datatable-cell-date-value.component-DCh3-kAN.mjs.map} +1 -1
- package/fesm2022/{eherve-angular-material-datatable-cell-duration-value.component-Cdgdtvn_.mjs → eherve-angular-material-datatable-cell-duration-value.component-BXrbufA_.mjs} +2 -2
- package/fesm2022/{eherve-angular-material-datatable-cell-duration-value.component-Cdgdtvn_.mjs.map → eherve-angular-material-datatable-cell-duration-value.component-BXrbufA_.mjs.map} +1 -1
- package/fesm2022/{eherve-angular-material-datatable-cell-number-value.component-BqtgvkdP.mjs → eherve-angular-material-datatable-cell-number-value.component-rYLk4KSn.mjs} +2 -2
- package/fesm2022/{eherve-angular-material-datatable-cell-number-value.component-BqtgvkdP.mjs.map → eherve-angular-material-datatable-cell-number-value.component-rYLk4KSn.mjs.map} +1 -1
- package/fesm2022/{eherve-angular-material-datatable-cell-select-value.component-r-3en-ZP.mjs → eherve-angular-material-datatable-cell-select-value.component-mqa9s-0K.mjs} +3 -3
- package/fesm2022/{eherve-angular-material-datatable-cell-select-value.component-r-3en-ZP.mjs.map → eherve-angular-material-datatable-cell-select-value.component-mqa9s-0K.mjs.map} +1 -1
- package/fesm2022/{eherve-angular-material-datatable-eherve-angular-material-datatable-ou1s2w3Q.mjs → eherve-angular-material-datatable-eherve-angular-material-datatable-BvgAlvMW.mjs} +25 -10
- package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-BvgAlvMW.mjs.map +1 -0
- package/fesm2022/{eherve-angular-material-datatable-get.pipe-lQCP7kAG.mjs → eherve-angular-material-datatable-get.pipe-1NTEO8Sb.mjs} +2 -2
- package/fesm2022/{eherve-angular-material-datatable-get.pipe-lQCP7kAG.mjs.map → eherve-angular-material-datatable-get.pipe-1NTEO8Sb.mjs.map} +1 -1
- package/fesm2022/eherve-angular-material-datatable-suffix-function.pipe-CQO-ghpR.mjs +20 -0
- package/fesm2022/eherve-angular-material-datatable-suffix-function.pipe-CQO-ghpR.mjs.map +1 -0
- package/fesm2022/eherve-angular-material-datatable.mjs +1 -1
- package/lib/components/header-autocomplete-filter/header-autocomplete-filter.component.d.ts +3 -0
- package/lib/pipes/suffix-function.pipe.d.ts +10 -0
- package/lib/types/datatable-column.type.d.ts +27 -18
- package/package.json +1 -1
- package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-ou1s2w3Q.mjs.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
import { PipeTransform } from '@angular/core';
|
|
3
|
+
import { DatatableValueColumn } from '../types/datatable-column.type';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export type PipeFunction<Record> = (value: any, row: Record, column: DatatableValueColumn<Record>) => string;
|
|
6
|
+
export declare class ValueFunctionPipe<Record> implements PipeTransform {
|
|
7
|
+
transform(value: any, valueFunction: PipeFunction<Record>, row: Record, column: DatatableValueColumn<Record>): string | null;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ValueFunctionPipe<any>, never>;
|
|
9
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<ValueFunctionPipe<any>, "valueFunction", true>;
|
|
10
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @format */
|
|
2
2
|
import { ComponentType } from '@angular/cdk/portal';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
|
+
import { PipeFunction } from '../pipes/suffix-function.pipe';
|
|
4
5
|
import { NgxMatDatasourceRequestOrderDir } from './datasource-service.type';
|
|
5
6
|
type Color<Record> = string | ((row: Record) => string | undefined);
|
|
6
7
|
type BaseColumn = {
|
|
@@ -35,23 +36,31 @@ export type DatatableComponentColumn = BaseColumn & {
|
|
|
35
36
|
export type DatatableContentColumn = BaseColumn & {
|
|
36
37
|
cellContentId: string;
|
|
37
38
|
};
|
|
38
|
-
export type
|
|
39
|
-
color?: Color<Record>;
|
|
40
|
-
backgroundColor?: Color<Record>;
|
|
41
|
-
transform?: (value: any, row: Record) => any;
|
|
42
|
-
} & ({
|
|
39
|
+
export type DatatablePrefixColumn<Record> = {
|
|
43
40
|
prefix?: string;
|
|
44
|
-
prefixContentId?: undefined;
|
|
45
41
|
} | {
|
|
46
|
-
prefix?: undefined;
|
|
47
42
|
prefixContentId?: string;
|
|
48
|
-
}
|
|
43
|
+
} | {
|
|
44
|
+
prefixFunction?: PipeFunction<Record>;
|
|
45
|
+
} | {
|
|
46
|
+
prefixComponent?: ComponentType<any>;
|
|
47
|
+
};
|
|
48
|
+
export type DatatableSuffixColumn<Record> = {
|
|
49
49
|
suffix?: string;
|
|
50
50
|
} | {
|
|
51
51
|
suffixContentId?: string;
|
|
52
|
-
}
|
|
52
|
+
} | {
|
|
53
|
+
suffixFunction?: PipeFunction<Record>;
|
|
54
|
+
} | {
|
|
55
|
+
suffixComponent?: ComponentType<any>;
|
|
56
|
+
};
|
|
57
|
+
export type DatatableValueColumn<Record> = BaseColumn & {
|
|
58
|
+
color?: Color<Record>;
|
|
59
|
+
backgroundColor?: Color<Record>;
|
|
60
|
+
transform?: (value: any, row: Record) => any;
|
|
61
|
+
} & DatatablePrefixColumn<Record> & DatatableSuffixColumn<Record>;
|
|
53
62
|
type Column<Record> = DatatableComponentColumn | DatatableContentColumn | DatatableValueColumn<Record>;
|
|
54
|
-
type SearchableColumn
|
|
63
|
+
type SearchableColumn = {
|
|
55
64
|
searchable: true;
|
|
56
65
|
searchProperty?: string;
|
|
57
66
|
};
|
|
@@ -67,7 +76,7 @@ export type DatatableSearchListOption = {
|
|
|
67
76
|
export type DatatableTextColumn<Record> = Column<Record> & {
|
|
68
77
|
type: 'text';
|
|
69
78
|
};
|
|
70
|
-
export type DatatableSearchTextColumn<Record> = DatatableTextColumn<Record> & SearchableColumn
|
|
79
|
+
export type DatatableSearchTextColumn<Record> = DatatableTextColumn<Record> & SearchableColumn & {
|
|
71
80
|
regexp?: boolean;
|
|
72
81
|
};
|
|
73
82
|
export type DatatableNumberColumn<Record> = Column<Record> & {
|
|
@@ -75,13 +84,13 @@ export type DatatableNumberColumn<Record> = Column<Record> & {
|
|
|
75
84
|
format?: string;
|
|
76
85
|
locale?: string;
|
|
77
86
|
};
|
|
78
|
-
export type DatatableSearchNumberColumn<Record> = DatatableNumberColumn<Record> & SearchableColumn
|
|
87
|
+
export type DatatableSearchNumberColumn<Record> = DatatableNumberColumn<Record> & SearchableColumn & {};
|
|
79
88
|
export type DatatableSelectColumn<Record> = Column<Record> & {
|
|
80
89
|
type: 'select';
|
|
81
90
|
isArrayValue?: boolean;
|
|
82
91
|
options: Observable<DatatableSearchListOption[]> | DatatableSearchListOption[];
|
|
83
92
|
};
|
|
84
|
-
export type DatatableSearchSelectColumn<Record> = DatatableSelectColumn<Record> & SearchableColumn
|
|
93
|
+
export type DatatableSearchSelectColumn<Record> = DatatableSelectColumn<Record> & SearchableColumn & {
|
|
85
94
|
multiple?: boolean;
|
|
86
95
|
placeholder?: string;
|
|
87
96
|
hasGroup?: boolean;
|
|
@@ -89,18 +98,18 @@ export type DatatableSearchSelectColumn<Record> = DatatableSelectColumn<Record>
|
|
|
89
98
|
export type DatatableAutocompleteColumn<Record> = Column<Record> & {
|
|
90
99
|
type: 'autocomplete';
|
|
91
100
|
};
|
|
92
|
-
export type DatatableSearchAutocompleteColumn<Record> = DatatableAutocompleteColumn<Record> & SearchableColumn
|
|
101
|
+
export type DatatableSearchAutocompleteColumn<Record> = DatatableAutocompleteColumn<Record> & SearchableColumn & {
|
|
93
102
|
placeholder?: string;
|
|
94
103
|
limit?: number;
|
|
95
104
|
loadOnFocus?: boolean;
|
|
96
105
|
hasGroup?: boolean;
|
|
97
|
-
options: (limit: number, skip: number, search: string) => Promise<DatatableSearchListOption[]>;
|
|
106
|
+
options: (limit: number, skip: number, search: string, filter: any) => Promise<DatatableSearchListOption[]>;
|
|
98
107
|
searchValueOptions?: DatatableSearchListOption[];
|
|
99
108
|
};
|
|
100
109
|
export type DatatableCheckboxColumn<Record> = Column<Record> & {
|
|
101
110
|
type: 'checkbox';
|
|
102
111
|
};
|
|
103
|
-
export type DatatableSearchCheckboxColumn<Record> = DatatableCheckboxColumn<Record> & SearchableColumn
|
|
112
|
+
export type DatatableSearchCheckboxColumn<Record> = DatatableCheckboxColumn<Record> & SearchableColumn;
|
|
104
113
|
export type DatatableDateColumn<Record> = Column<Record> & {
|
|
105
114
|
type: 'date';
|
|
106
115
|
format?: string;
|
|
@@ -109,7 +118,7 @@ export type DatatableDateColumn<Record> = Column<Record> & {
|
|
|
109
118
|
withDuration?: boolean;
|
|
110
119
|
durationRefreshTime?: number;
|
|
111
120
|
};
|
|
112
|
-
export type DatatableSearchDateColumn<Record> = DatatableDateColumn<Record> & SearchableColumn
|
|
121
|
+
export type DatatableSearchDateColumn<Record> = DatatableDateColumn<Record> & SearchableColumn & {
|
|
113
122
|
placeholder?: string;
|
|
114
123
|
};
|
|
115
124
|
export type DatatableDurationColumn<Record> = Column<Record> & {
|
|
@@ -117,7 +126,7 @@ export type DatatableDurationColumn<Record> = Column<Record> & {
|
|
|
117
126
|
locale?: string;
|
|
118
127
|
largest?: number;
|
|
119
128
|
};
|
|
120
|
-
export type DatatableSearchDurationColumn<Record> = DatatableDurationColumn<Record> & SearchableColumn
|
|
129
|
+
export type DatatableSearchDurationColumn<Record> = DatatableDurationColumn<Record> & SearchableColumn & {
|
|
121
130
|
placeholder?: string;
|
|
122
131
|
};
|
|
123
132
|
export type DatatableDefaultColumn<Record> = Column<Record> & {
|