@eherve/angular-material-datatable 19.27.0 → 22.0.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.mjs +5804 -2970
- package/fesm2022/eherve-angular-material-datatable.mjs.map +1 -1
- package/package.json +13 -12
- package/types/eherve-angular-material-datatable.d.ts +565 -0
- package/index.d.ts +0 -5
- package/lib/components/cell-checkbox-value/cell-checkbox-value.component.d.ts +0 -8
- package/lib/components/cell-date-value/cell-date-value.component.d.ts +0 -17
- package/lib/components/cell-duration-value/cell-duration-value.component.d.ts +0 -11
- package/lib/components/cell-number-value/cell-number-value.component.d.ts +0 -8
- package/lib/components/cell-select-value/cell-select-value.component.d.ts +0 -14
- package/lib/components/header-autocomplete-filter/header-autocomplete-filter.component.d.ts +0 -46
- package/lib/components/header-checkbox-filter/header-checkbox-filter.component.d.ts +0 -23
- package/lib/components/header-date-filter/header-date-filter.component.d.ts +0 -39
- package/lib/components/header-duration-filter/header-duration-filter.component.d.ts +0 -34
- package/lib/components/header-number-filter/header-number-filter.component.d.ts +0 -26
- package/lib/components/header-select-filter/header-select-filter.component.d.ts +0 -32
- package/lib/components/header-text-filter/header-text-filter.component.d.ts +0 -26
- package/lib/components/operator-select/operator-select.component.d.ts +0 -21
- package/lib/components/progress-spinner/progress-spinner.component.d.ts +0 -22
- package/lib/components/time-unit-select/time-unit-select.component.d.ts +0 -28
- package/lib/datasource.d.ts +0 -30
- package/lib/datatable-default-options.d.ts +0 -5
- package/lib/datatable.component.d.ts +0 -123
- package/lib/datatable.intl.d.ts +0 -35
- package/lib/datatable.module.d.ts +0 -8
- package/lib/date-refresh.service.d.ts +0 -8
- package/lib/directives/datatable-cell.directive.d.ts +0 -10
- package/lib/directives/datatable-row-viewport.directive.d.ts +0 -22
- package/lib/pipes/background-color.pipe.d.ts +0 -10
- package/lib/pipes/cell-color.pipe.d.ts +0 -10
- package/lib/pipes/cell-opacity.pipe.d.ts +0 -10
- package/lib/pipes/filter.pipe.d.ts +0 -10
- package/lib/pipes/find-cell-content.pipe.d.ts +0 -9
- package/lib/pipes/find.pipe.d.ts +0 -10
- package/lib/pipes/get.pipe.d.ts +0 -8
- package/lib/pipes/included-in.pipe.d.ts +0 -8
- package/lib/pipes/is-array.pipe.d.ts +0 -8
- package/lib/pipes/merge.pipe.d.ts +0 -8
- package/lib/pipes/moment-format.pipe.d.ts +0 -12
- package/lib/pipes/order-by.pipe.d.ts +0 -8
- package/lib/pipes/safe-html.pipe.d.ts +0 -10
- package/lib/pipes/select-option.pipe.d.ts +0 -9
- package/lib/pipes/sort-facet-entries.pipe.d.ts +0 -10
- package/lib/pipes/suffix-function.pipe.d.ts +0 -10
- package/lib/pipes/sum.pipe.d.ts +0 -8
- package/lib/pipes/transform.pipe.d.ts +0 -9
- package/lib/select-options-cache.service.d.ts +0 -9
- package/lib/tools/datasource-request.tool.d.ts +0 -9
- package/lib/tools/datatable-export.tool.d.ts +0 -21
- package/lib/tools/duration.tool.d.ts +0 -5
- package/lib/tools/get.tool.d.ts +0 -2
- package/lib/tools/strip-html.tool.d.ts +0 -2
- package/lib/types/action.type.d.ts +0 -21
- package/lib/types/config.type.d.ts +0 -10
- package/lib/types/datasource-service.type.d.ts +0 -55
- package/lib/types/datatable-column.type.d.ts +0 -141
- package/lib/types/datatable-facet.type.d.ts +0 -40
- package/lib/types/datatable-options.type.d.ts +0 -77
- package/lib/types/datatable-state.type.d.ts +0 -22
- package/public-api.d.ts +0 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eherve/angular-material-datatable",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.0.0",
|
|
4
4
|
"author": "Eric Herve <eric.herve.95@gmail.com>",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@angular/animations": "^
|
|
15
|
-
"@angular/cdk": "^
|
|
16
|
-
"@angular/common": "^
|
|
17
|
-
"@angular/core": "^
|
|
18
|
-
"@angular/forms": "^
|
|
19
|
-
"@angular/material": "^
|
|
20
|
-
"@angular/material-moment-adapter": "^
|
|
21
|
-
"@angular/platform-browser": "^
|
|
14
|
+
"@angular/animations": "^22.0.0",
|
|
15
|
+
"@angular/cdk": "^22.0.0",
|
|
16
|
+
"@angular/common": "^22.0.0",
|
|
17
|
+
"@angular/core": "^22.0.0",
|
|
18
|
+
"@angular/forms": "^22.0.0",
|
|
19
|
+
"@angular/material": "^22.0.0",
|
|
20
|
+
"@angular/material-moment-adapter": "^22.0.0",
|
|
21
|
+
"@angular/platform-browser": "^22.0.0",
|
|
22
22
|
"humanize-duration": "^3.32.1",
|
|
23
23
|
"lodash-es": "^4.17.21",
|
|
24
24
|
"moment": "^2.30.1",
|
|
@@ -32,14 +32,15 @@
|
|
|
32
32
|
},
|
|
33
33
|
"sideEffects": false,
|
|
34
34
|
"module": "fesm2022/eherve-angular-material-datatable.mjs",
|
|
35
|
-
"typings": "
|
|
35
|
+
"typings": "types/eherve-angular-material-datatable.d.ts",
|
|
36
36
|
"exports": {
|
|
37
37
|
"./package.json": {
|
|
38
38
|
"default": "./package.json"
|
|
39
39
|
},
|
|
40
40
|
".": {
|
|
41
|
-
"types": "./
|
|
41
|
+
"types": "./types/eherve-angular-material-datatable.d.ts",
|
|
42
42
|
"default": "./fesm2022/eherve-angular-material-datatable.mjs"
|
|
43
43
|
}
|
|
44
|
-
}
|
|
44
|
+
},
|
|
45
|
+
"type": "module"
|
|
45
46
|
}
|
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ElementRef, EventEmitter, InjectionToken, OnDestroy, OnInit, PipeTransform, Provider, QueryList, TemplateRef } from "@angular/core";
|
|
3
|
+
import { CdkDragDrop } from "@angular/cdk/drag-drop";
|
|
4
|
+
import { FormGroup } from "@angular/forms";
|
|
5
|
+
import { MatPaginator } from "@angular/material/paginator";
|
|
6
|
+
import { MatTable } from "@angular/material/table";
|
|
7
|
+
import { DataSource } from "@angular/cdk/collections";
|
|
8
|
+
import { BehaviorSubject, Observable } from "rxjs";
|
|
9
|
+
import { ComponentType } from "@angular/cdk/portal";
|
|
10
|
+
/** @format */
|
|
11
|
+
export type NgxMatDatasourceRequestSearchOperator = '=' | '>' | '>=' | '≥' | '<' | '≤' | '<>' | '≤≥' | '><' | '≥≤' | '$in' | '$nin';
|
|
12
|
+
export type NgxMatDatasourceRequestSearch = {
|
|
13
|
+
value: any;
|
|
14
|
+
regex?: boolean;
|
|
15
|
+
operator?: NgxMatDatasourceRequestSearchOperator;
|
|
16
|
+
};
|
|
17
|
+
export type NgxMatDatasourceRequestColumnType = 'string' | 'boolean' | 'number' | 'date' | 'objectid';
|
|
18
|
+
export type NgxMatDatasourceRequestColumn = {
|
|
19
|
+
data: string;
|
|
20
|
+
projection?: any;
|
|
21
|
+
name?: string;
|
|
22
|
+
searchable?: boolean;
|
|
23
|
+
orderable?: boolean;
|
|
24
|
+
type?: NgxMatDatasourceRequestColumnType;
|
|
25
|
+
search?: NgxMatDatasourceRequestSearch;
|
|
26
|
+
};
|
|
27
|
+
export type NgxMatDatasourceRequestOrderDir = 'asc' | 'desc';
|
|
28
|
+
export type NgxMatDatasourceRequestOrder = {
|
|
29
|
+
column: number;
|
|
30
|
+
dir: NgxMatDatasourceRequestOrderDir;
|
|
31
|
+
};
|
|
32
|
+
export type NgxMatDatasourceRequestFacetOperator = 'count' | ['sum', string] | ['avg', string];
|
|
33
|
+
export type NgxMatDatasourceRequestFacet = {
|
|
34
|
+
id: string;
|
|
35
|
+
kind: 'indicator';
|
|
36
|
+
property: string;
|
|
37
|
+
operator: NgxMatDatasourceRequestFacetOperator;
|
|
38
|
+
info?: any;
|
|
39
|
+
};
|
|
40
|
+
export type NgxMatDatasourceRequestOptions = {
|
|
41
|
+
draw: string;
|
|
42
|
+
columns: NgxMatDatasourceRequestColumn[];
|
|
43
|
+
order?: NgxMatDatasourceRequestOrder[];
|
|
44
|
+
start?: number;
|
|
45
|
+
length?: number;
|
|
46
|
+
search?: NgxMatDatasourceRequestSearch;
|
|
47
|
+
enableUnfilteredInfo?: boolean;
|
|
48
|
+
facets?: NgxMatDatasourceRequestFacet[];
|
|
49
|
+
};
|
|
50
|
+
export type NgxMatDatasourceResultFacet = {
|
|
51
|
+
_id: any;
|
|
52
|
+
value: number;
|
|
53
|
+
info?: any;
|
|
54
|
+
};
|
|
55
|
+
export type NgxMatDatasourceResult<T> = {
|
|
56
|
+
draw: string;
|
|
57
|
+
recordsTotal: number;
|
|
58
|
+
recordsFiltered: number;
|
|
59
|
+
data: T[];
|
|
60
|
+
facets?: {
|
|
61
|
+
[id: string]: NgxMatDatasourceResultFacet[];
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export type NgxMatDatasourceService<Record> = (options: NgxMatDatasourceRequestOptions) => Promise<NgxMatDatasourceResult<Record>>;
|
|
65
|
+
declare class DatagridDataSource<Record> extends DataSource<Record> {
|
|
66
|
+
private service;
|
|
67
|
+
loading$: BehaviorSubject<boolean>;
|
|
68
|
+
data: Record[];
|
|
69
|
+
recordsFiltered: number;
|
|
70
|
+
recordsTotal?: number;
|
|
71
|
+
facets?: {
|
|
72
|
+
[id: string]: NgxMatDatasourceResultFacet[];
|
|
73
|
+
};
|
|
74
|
+
rowSize: number;
|
|
75
|
+
private options?;
|
|
76
|
+
private latestRequestId;
|
|
77
|
+
private disconnected;
|
|
78
|
+
private measuredRowSize;
|
|
79
|
+
private measuredRowCount;
|
|
80
|
+
private readonly textEncoder;
|
|
81
|
+
protected dataStream: BehaviorSubject<Record[]>;
|
|
82
|
+
constructor(service: NgxMatDatasourceService<Record>);
|
|
83
|
+
connect(): Observable<Record[]>;
|
|
84
|
+
disconnect(): void;
|
|
85
|
+
loadData(options: NgxMatDatasourceRequestOptions, append?: boolean): Promise<void>;
|
|
86
|
+
refresh(): void;
|
|
87
|
+
redraw(match?: (record: Record) => boolean): void;
|
|
88
|
+
private setData;
|
|
89
|
+
private updateRowSize;
|
|
90
|
+
}
|
|
91
|
+
type NumberOptions = {
|
|
92
|
+
separator: string;
|
|
93
|
+
decimal: string;
|
|
94
|
+
duration: number;
|
|
95
|
+
useEasing: boolean;
|
|
96
|
+
};
|
|
97
|
+
export declare class NgxMatDatatableIntl {
|
|
98
|
+
locale: string;
|
|
99
|
+
noDateLabel: string;
|
|
100
|
+
itemsPerPageLabel: string;
|
|
101
|
+
nextPageLabel: string;
|
|
102
|
+
lastPageLabel: string;
|
|
103
|
+
previousPageLabel: string;
|
|
104
|
+
firstPageLabel: string;
|
|
105
|
+
onLabel: string;
|
|
106
|
+
incrementalLoadingLabel: string;
|
|
107
|
+
incrementalLoadMoreLabel: string;
|
|
108
|
+
columnsActionLabel: string;
|
|
109
|
+
exportActionLabel: string;
|
|
110
|
+
refreshActionLabel: string;
|
|
111
|
+
showColumnActionLabel: string;
|
|
112
|
+
hideColumnActionLabel: string;
|
|
113
|
+
pinColumnActionLabel: string;
|
|
114
|
+
unpinColumnActionLabel: string;
|
|
115
|
+
sortColumnActionLabel: string;
|
|
116
|
+
clearFilterLabel: string;
|
|
117
|
+
numberOptions: NumberOptions;
|
|
118
|
+
getRangeLabel: (page: number, pageSize: number, length: number) => string;
|
|
119
|
+
constructor();
|
|
120
|
+
private setLabels;
|
|
121
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatDatatableIntl, never>;
|
|
122
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
123
|
+
}
|
|
124
|
+
declare namespace datatable_cell_directive_d_exports {
|
|
125
|
+
export { NgxMatDatatableContentDirective };
|
|
126
|
+
}
|
|
127
|
+
export declare class NgxMatDatatableContentDirective {
|
|
128
|
+
templateRef: TemplateRef<any>;
|
|
129
|
+
id: string;
|
|
130
|
+
constructor(templateRef: TemplateRef<any>);
|
|
131
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatDatatableContentDirective, never>;
|
|
132
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgxMatDatatableContentDirective, "[ngxMatDatatableContent]", never, {
|
|
133
|
+
"id": {
|
|
134
|
+
"alias": "ngxMatDatatableContent";
|
|
135
|
+
"required": false;
|
|
136
|
+
};
|
|
137
|
+
}, {}, never, never, true, never>;
|
|
138
|
+
}
|
|
139
|
+
/** @format */
|
|
140
|
+
export type DatatableColumnConfig = {
|
|
141
|
+
columnDef: string;
|
|
142
|
+
sticky?: boolean;
|
|
143
|
+
hidden?: boolean;
|
|
144
|
+
};
|
|
145
|
+
export type DatatableConfig = {
|
|
146
|
+
columns: DatatableColumnConfig[];
|
|
147
|
+
pageSizeOptionsIndex: number;
|
|
148
|
+
};
|
|
149
|
+
type PipeFunction<Record> = (value: any, row: Record, column: DatatableValueColumn<Record>) => string;
|
|
150
|
+
declare class ValueFunctionPipe<Record> implements PipeTransform {
|
|
151
|
+
transform(value: any, valueFunction: PipeFunction<Record>, row: Record, column: DatatableValueColumn<Record>): string | null;
|
|
152
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ValueFunctionPipe<any>, never>;
|
|
153
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<ValueFunctionPipe<any>, "valueFunction", true>;
|
|
154
|
+
}
|
|
155
|
+
type Color$1<Record> = string | ((row: Record) => string | undefined);
|
|
156
|
+
type BaseColumn = {
|
|
157
|
+
type?: string;
|
|
158
|
+
columnDef: string;
|
|
159
|
+
header: string;
|
|
160
|
+
property: string;
|
|
161
|
+
projection?: any;
|
|
162
|
+
additionalProperties?: string[];
|
|
163
|
+
minWidth?: number;
|
|
164
|
+
sticky?: boolean;
|
|
165
|
+
hidden?: boolean;
|
|
166
|
+
disabled?: boolean;
|
|
167
|
+
searchable?: boolean;
|
|
168
|
+
searchProperty?: string;
|
|
169
|
+
searchType?: NgxMatDatasourceRequestColumnType;
|
|
170
|
+
searchValue?: any;
|
|
171
|
+
sortable?: boolean;
|
|
172
|
+
sortProperty?: string;
|
|
173
|
+
order?: {
|
|
174
|
+
index: number;
|
|
175
|
+
dir: NgxMatDatasourceRequestOrderDir;
|
|
176
|
+
};
|
|
177
|
+
tooltip?: string;
|
|
178
|
+
align?: 'start' | 'center' | 'end';
|
|
179
|
+
/**
|
|
180
|
+
* Adds one or more values to an export row. It may resolve asynchronous data
|
|
181
|
+
* before the next column or row is processed.
|
|
182
|
+
*/
|
|
183
|
+
export?: (exportRow: any, value: any, row: any) => void | Promise<void>;
|
|
184
|
+
searchUpdated?: (value: any) => void;
|
|
185
|
+
};
|
|
186
|
+
export type DatatableComponentColumn = BaseColumn & {
|
|
187
|
+
cellComponent: ComponentType<any>;
|
|
188
|
+
};
|
|
189
|
+
export type DatatableContentColumn = BaseColumn & {
|
|
190
|
+
cellContentId: string;
|
|
191
|
+
};
|
|
192
|
+
export type DatatablePrefixColumn<Record> = {
|
|
193
|
+
prefix?: string;
|
|
194
|
+
} | {
|
|
195
|
+
prefixContentId?: string;
|
|
196
|
+
} | {
|
|
197
|
+
prefixFunction?: PipeFunction<Record>;
|
|
198
|
+
} | {
|
|
199
|
+
prefixComponent?: ComponentType<any>;
|
|
200
|
+
};
|
|
201
|
+
export type DatatableSuffixColumn<Record> = {
|
|
202
|
+
suffix?: string;
|
|
203
|
+
} | {
|
|
204
|
+
suffixContentId?: string;
|
|
205
|
+
} | {
|
|
206
|
+
suffixFunction?: PipeFunction<Record>;
|
|
207
|
+
} | {
|
|
208
|
+
suffixComponent?: ComponentType<any>;
|
|
209
|
+
};
|
|
210
|
+
export type DatatableValueColumn<Record> = BaseColumn & {
|
|
211
|
+
color?: Color$1<Record>;
|
|
212
|
+
backgroundColor?: Color$1<Record>;
|
|
213
|
+
transform?: (value: any, row: Record) => any;
|
|
214
|
+
} & DatatablePrefixColumn<Record> & DatatableSuffixColumn<Record>;
|
|
215
|
+
type Column<Record> = DatatableComponentColumn | DatatableContentColumn | DatatableValueColumn<Record>;
|
|
216
|
+
type SearchableColumn = {
|
|
217
|
+
searchable: true;
|
|
218
|
+
searchProperty?: string;
|
|
219
|
+
};
|
|
220
|
+
export type DatatableSearchListOption = {
|
|
221
|
+
value: any;
|
|
222
|
+
name: string;
|
|
223
|
+
group?: string;
|
|
224
|
+
color?: string;
|
|
225
|
+
iconSrc?: 'mat-icon' | 'svg' | string;
|
|
226
|
+
icon?: string;
|
|
227
|
+
iconColor?: string;
|
|
228
|
+
};
|
|
229
|
+
export type DatatableTextColumn<Record> = Column<Record> & {
|
|
230
|
+
type: 'text';
|
|
231
|
+
};
|
|
232
|
+
export type DatatableSearchTextColumn<Record> = DatatableTextColumn<Record> & SearchableColumn & {
|
|
233
|
+
regex?: boolean;
|
|
234
|
+
};
|
|
235
|
+
export type DatatableNumberColumn<Record> = Column<Record> & {
|
|
236
|
+
type: 'number';
|
|
237
|
+
format?: string;
|
|
238
|
+
locale?: string;
|
|
239
|
+
};
|
|
240
|
+
export type DatatableSearchNumberColumn<Record> = DatatableNumberColumn<Record> & SearchableColumn & {};
|
|
241
|
+
export type DatatableSelectColumn<Record> = Column<Record> & {
|
|
242
|
+
type: 'select';
|
|
243
|
+
isArrayValue?: boolean;
|
|
244
|
+
iconOnly?: boolean;
|
|
245
|
+
options: Observable<DatatableSearchListOption[]> | DatatableSearchListOption[];
|
|
246
|
+
};
|
|
247
|
+
export type DatatableSearchSelectColumn<Record> = DatatableSelectColumn<Record> & SearchableColumn & {
|
|
248
|
+
multiple?: boolean;
|
|
249
|
+
placeholder?: string;
|
|
250
|
+
hasGroup?: boolean;
|
|
251
|
+
};
|
|
252
|
+
export type DatatableAutocompleteColumn<Record> = Column<Record> & {
|
|
253
|
+
type: 'autocomplete';
|
|
254
|
+
};
|
|
255
|
+
export type DatatableSearchAutocompleteColumn<Record> = DatatableAutocompleteColumn<Record> & SearchableColumn & {
|
|
256
|
+
placeholder?: string;
|
|
257
|
+
limit?: number;
|
|
258
|
+
loadOnFocus?: boolean;
|
|
259
|
+
hasGroup?: boolean;
|
|
260
|
+
options: (limit: number, skip: number, search: string, filter: any) => Promise<DatatableSearchListOption[]>;
|
|
261
|
+
searchValueOptions?: DatatableSearchListOption[];
|
|
262
|
+
};
|
|
263
|
+
export type DatatableCheckboxColumn<Record> = Column<Record> & {
|
|
264
|
+
type: 'checkbox';
|
|
265
|
+
};
|
|
266
|
+
export type DatatableSearchCheckboxColumn<Record> = DatatableCheckboxColumn<Record> & SearchableColumn;
|
|
267
|
+
export type DatatableDateColumn<Record> = Column<Record> & {
|
|
268
|
+
type: 'date';
|
|
269
|
+
format?: string;
|
|
270
|
+
timezone?: string;
|
|
271
|
+
locale?: string;
|
|
272
|
+
withDuration?: boolean;
|
|
273
|
+
durationRefreshTime?: number;
|
|
274
|
+
};
|
|
275
|
+
export type DatatableSearchDateColumn<Record> = DatatableDateColumn<Record> & SearchableColumn & {
|
|
276
|
+
placeholder?: string;
|
|
277
|
+
};
|
|
278
|
+
export type DatatableDurationColumn<Record> = Column<Record> & {
|
|
279
|
+
type: 'duration';
|
|
280
|
+
locale?: string;
|
|
281
|
+
largest?: number;
|
|
282
|
+
};
|
|
283
|
+
export type DatatableSearchDurationColumn<Record> = DatatableDurationColumn<Record> & SearchableColumn & {
|
|
284
|
+
placeholder?: string;
|
|
285
|
+
};
|
|
286
|
+
export type DatatableDefaultColumn<Record> = Column<Record> & {
|
|
287
|
+
searchable?: false;
|
|
288
|
+
};
|
|
289
|
+
export type DatatableColumn<Record> = DatatableDefaultColumn<Record> | DatatableTextColumn<Record> | DatatableSearchTextColumn<Record> | DatatableNumberColumn<Record> | DatatableSearchNumberColumn<Record> | DatatableSelectColumn<Record> | DatatableSearchSelectColumn<Record> | DatatableAutocompleteColumn<Record> | DatatableSearchAutocompleteColumn<Record> | DatatableCheckboxColumn<Record> | DatatableSearchCheckboxColumn<Record> | DatatableDateColumn<Record> | DatatableSearchDateColumn<Record> | DatatableDurationColumn<Record> | DatatableSearchDurationColumn<Record>;
|
|
290
|
+
export type FacetOptionsOperator = 'count' | ['sum', string] | ['avg', string];
|
|
291
|
+
type BaseFacetOptions = {
|
|
292
|
+
id: string;
|
|
293
|
+
name?: string;
|
|
294
|
+
position: 'start' | 'center' | 'end';
|
|
295
|
+
};
|
|
296
|
+
export type FacetOptionsOptions = {
|
|
297
|
+
value: any;
|
|
298
|
+
name?: string;
|
|
299
|
+
color?: string;
|
|
300
|
+
labelColor?: string;
|
|
301
|
+
};
|
|
302
|
+
type IndicatorFacetOptions = BaseFacetOptions & {
|
|
303
|
+
kind: 'indicator';
|
|
304
|
+
property: string;
|
|
305
|
+
operator: FacetOptionsOperator;
|
|
306
|
+
info?: any;
|
|
307
|
+
columnDef?: string;
|
|
308
|
+
};
|
|
309
|
+
export type ContentIdFacetOptions = IndicatorFacetOptions & {
|
|
310
|
+
contentId?: string;
|
|
311
|
+
};
|
|
312
|
+
export type ProgressSpinnerFacetOptions = IndicatorFacetOptions & {
|
|
313
|
+
display: 'progress-spinner';
|
|
314
|
+
options?: FacetOptionsOptions[];
|
|
315
|
+
size?: number;
|
|
316
|
+
fontSize?: string;
|
|
317
|
+
option?: (res: NgxMatDatasourceResultFacet) => FacetOptionsOptions | undefined;
|
|
318
|
+
};
|
|
319
|
+
export type ChipFacetOptions = IndicatorFacetOptions & {
|
|
320
|
+
display: 'chips';
|
|
321
|
+
options?: FacetOptionsOptions[];
|
|
322
|
+
size?: number;
|
|
323
|
+
fontSize?: string;
|
|
324
|
+
option?: (res: NgxMatDatasourceResultFacet) => FacetOptionsOptions | undefined;
|
|
325
|
+
};
|
|
326
|
+
export type FacetOptions = ContentIdFacetOptions | ProgressSpinnerFacetOptions | ChipFacetOptions;
|
|
327
|
+
type BaseAction = {
|
|
328
|
+
position: 'start' | 'center' | 'end';
|
|
329
|
+
isHidden?: boolean;
|
|
330
|
+
isDisabled?: boolean;
|
|
331
|
+
};
|
|
332
|
+
export type IconAction<Record> = BaseAction & {
|
|
333
|
+
kind: 'icon';
|
|
334
|
+
icon: string;
|
|
335
|
+
onclick: (datagrid: NgxMatDatatableComponent<Record>) => void;
|
|
336
|
+
tooltip?: string;
|
|
337
|
+
ariaLabel?: string;
|
|
338
|
+
color?: string;
|
|
339
|
+
};
|
|
340
|
+
export type TemplateAction = BaseAction & {
|
|
341
|
+
kind: 'template';
|
|
342
|
+
contentId: string;
|
|
343
|
+
};
|
|
344
|
+
export type Action<Record> = IconAction<Record> | TemplateAction;
|
|
345
|
+
export type NgxMatDatatableStateOrder = {
|
|
346
|
+
columnDef: string;
|
|
347
|
+
index: number;
|
|
348
|
+
dir: NgxMatDatasourceRequestOrderDir;
|
|
349
|
+
};
|
|
350
|
+
export type NgxMatDatatableStatePage = {
|
|
351
|
+
index: number;
|
|
352
|
+
size: number;
|
|
353
|
+
};
|
|
354
|
+
export type NgxMatDatatableState = {
|
|
355
|
+
version: 1;
|
|
356
|
+
filters: Record<string, any>;
|
|
357
|
+
order: NgxMatDatatableStateOrder[];
|
|
358
|
+
page?: NgxMatDatatableStatePage;
|
|
359
|
+
};
|
|
360
|
+
export type NgxMatDatatableStateService = {
|
|
361
|
+
get?: () => Promise<NgxMatDatatableState | undefined>;
|
|
362
|
+
set?: (state: NgxMatDatatableState) => Promise<void>;
|
|
363
|
+
clear?: () => Promise<void>;
|
|
364
|
+
};
|
|
365
|
+
type Opacity<Record> = number | ((column: DatatableValueColumn<Record>, row: Record) => number | undefined);
|
|
366
|
+
type Color<Record> = string | ((column: DatatableValueColumn<Record>, row: Record) => string | undefined);
|
|
367
|
+
export type NgxMatDatatableLoadMode = 'pagination' | 'incremental';
|
|
368
|
+
export type NgxMatDatatableIncrementalTrigger = 'inView' | 'button';
|
|
369
|
+
export interface NgxMatDatatableIncrementalOptions {
|
|
370
|
+
trigger?: NgxMatDatatableIncrementalTrigger;
|
|
371
|
+
pageSize?: number;
|
|
372
|
+
}
|
|
373
|
+
export type NgxMatDatatableOptions<Record> = {
|
|
374
|
+
title?: string;
|
|
375
|
+
service: NgxMatDatasourceService<Record>;
|
|
376
|
+
configService?: {
|
|
377
|
+
get?: () => Promise<DatatableConfig | undefined>;
|
|
378
|
+
set?: (config: DatatableConfig) => Promise<void>;
|
|
379
|
+
};
|
|
380
|
+
stateService?: NgxMatDatatableStateService;
|
|
381
|
+
columns: DatatableColumn<Record>[];
|
|
382
|
+
columnMinWith?: number;
|
|
383
|
+
rowMaxHeight?: number;
|
|
384
|
+
pageSizeOptions?: number[];
|
|
385
|
+
pageSizeOptionsIndex?: number;
|
|
386
|
+
pageSize?: number;
|
|
387
|
+
loadMode?: NgxMatDatatableLoadMode;
|
|
388
|
+
incremental?: NgxMatDatatableIncrementalOptions;
|
|
389
|
+
showRecordsCount?: boolean;
|
|
390
|
+
additionalProperties?: string[];
|
|
391
|
+
actions?: {
|
|
392
|
+
columns?: {
|
|
393
|
+
tooltip?: string;
|
|
394
|
+
hideAndShow?: boolean;
|
|
395
|
+
sticky?: boolean;
|
|
396
|
+
reorder?: boolean;
|
|
397
|
+
};
|
|
398
|
+
refresh?: boolean;
|
|
399
|
+
rowClick?: boolean | ((row: Record) => void);
|
|
400
|
+
export?: string | boolean;
|
|
401
|
+
user?: Action<Record>[];
|
|
402
|
+
};
|
|
403
|
+
facets?: FacetOptions[];
|
|
404
|
+
rowOpacity?: Opacity<Record>;
|
|
405
|
+
rowColor?: Color<Record>;
|
|
406
|
+
rowBackgroundColor?: Color<Record>;
|
|
407
|
+
rowDisabled?: string | ((row: Record) => boolean);
|
|
408
|
+
disableRowAnimation?: boolean;
|
|
409
|
+
expandedDetailContentId?: string;
|
|
410
|
+
};
|
|
411
|
+
export interface NgxMatDatatableDefaultOptions<Record = any> {
|
|
412
|
+
loadMode?: NgxMatDatatableLoadMode;
|
|
413
|
+
incremental?: NgxMatDatatableIncrementalOptions;
|
|
414
|
+
showRecordsCount?: boolean;
|
|
415
|
+
pageSizeOptions?: number[];
|
|
416
|
+
pageSizeOptionsIndex?: number;
|
|
417
|
+
pageSize?: number;
|
|
418
|
+
columnMinWith?: number;
|
|
419
|
+
rowMaxHeight?: number;
|
|
420
|
+
disableRowAnimation?: boolean;
|
|
421
|
+
actions?: {
|
|
422
|
+
columns?: {
|
|
423
|
+
tooltip?: string;
|
|
424
|
+
hideAndShow?: boolean;
|
|
425
|
+
sticky?: boolean;
|
|
426
|
+
reorder?: boolean;
|
|
427
|
+
};
|
|
428
|
+
refresh?: boolean;
|
|
429
|
+
rowClick?: boolean | ((row: Record) => void);
|
|
430
|
+
export?: string | boolean;
|
|
431
|
+
user?: Action<Record>[];
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
declare namespace datatable_component_d_exports {
|
|
435
|
+
export { NgxMatDatatableComponent };
|
|
436
|
+
}
|
|
437
|
+
type UpdateColumn<Record> = Pick<DatatableColumn<Record>, "columnDef" | "header" | "sticky" | "hidden">;
|
|
438
|
+
export declare class NgxMatDatatableComponent<Record = any> implements OnInit, OnDestroy {
|
|
439
|
+
options: NgxMatDatatableOptions<Record>;
|
|
440
|
+
config?: DatatableConfig;
|
|
441
|
+
rowClicked: EventEmitter<Record>;
|
|
442
|
+
configUpdated: EventEmitter<DatatableConfig>;
|
|
443
|
+
searchUpdated: EventEmitter<any>;
|
|
444
|
+
ready: EventEmitter<NgxMatDatatableComponent<any>>;
|
|
445
|
+
paginator: MatPaginator | undefined;
|
|
446
|
+
contentRefs?: QueryList<NgxMatDatatableContentDirective>;
|
|
447
|
+
displayedColumns: string[];
|
|
448
|
+
visibleColumnsColspan: number;
|
|
449
|
+
disabledRows: Record[];
|
|
450
|
+
protected renderedRows: Set<Record>;
|
|
451
|
+
dataSource: DatagridDataSource<Record>;
|
|
452
|
+
expandedRow: any | null;
|
|
453
|
+
loaded: boolean;
|
|
454
|
+
datatableIntl: NgxMatDatatableIntl;
|
|
455
|
+
loadMode: NgxMatDatatableLoadMode;
|
|
456
|
+
incrementalTrigger: NgxMatDatatableIncrementalTrigger;
|
|
457
|
+
incrementalPageSize: number;
|
|
458
|
+
incrementalPageIndex: number;
|
|
459
|
+
displayedRecordsCount: number;
|
|
460
|
+
totalRecordsCount: number;
|
|
461
|
+
hasMoreRecords: boolean;
|
|
462
|
+
loadingNextRecords: boolean;
|
|
463
|
+
showRecordsCount: boolean;
|
|
464
|
+
incrementalLoadingLabel: string;
|
|
465
|
+
incrementalLoadMoreLabel: string;
|
|
466
|
+
incrementalRowColumns: string[];
|
|
467
|
+
showIncrementalRow: boolean;
|
|
468
|
+
showIncrementalInViewTrigger: boolean;
|
|
469
|
+
showIncrementalButtonTrigger: boolean;
|
|
470
|
+
paginationPageSizeOptions: number[];
|
|
471
|
+
paginationPageSize: number;
|
|
472
|
+
paginationPageIndex: number;
|
|
473
|
+
searchFormGroup: FormGroup;
|
|
474
|
+
protected searchControlNames: {
|
|
475
|
+
[columnDef: string]: string;
|
|
476
|
+
};
|
|
477
|
+
private subscriptions;
|
|
478
|
+
private changeDetectorRef;
|
|
479
|
+
private defaultOptions;
|
|
480
|
+
private incrementalLoadToken;
|
|
481
|
+
private restoredState?;
|
|
482
|
+
private rowRenderChangeScheduled;
|
|
483
|
+
private destroyed;
|
|
484
|
+
get data(): Record[] | undefined;
|
|
485
|
+
private _data?;
|
|
486
|
+
container?: ElementRef<HTMLDivElement>;
|
|
487
|
+
head?: ElementRef;
|
|
488
|
+
tableElement?: ElementRef<HTMLTableElement>;
|
|
489
|
+
matTable?: MatTable<Record>;
|
|
490
|
+
observer: ResizeObserver;
|
|
491
|
+
tableContainerOverflowY: string;
|
|
492
|
+
tableContainerOverflowX: string;
|
|
493
|
+
tableContainerWidth: number;
|
|
494
|
+
ngOnInit(): Promise<void>;
|
|
495
|
+
ngOnDestroy(): void;
|
|
496
|
+
load(intersect: boolean): void;
|
|
497
|
+
sortColumn(column: DatatableColumn<Record>): void;
|
|
498
|
+
redraw(match?: (record: Record) => boolean): void;
|
|
499
|
+
refreshColumns(): void;
|
|
500
|
+
exporting: boolean;
|
|
501
|
+
export(): Promise<void>;
|
|
502
|
+
loadPage(): Promise<void>;
|
|
503
|
+
loadNextIncrementalPage(): Promise<void>;
|
|
504
|
+
onIncrementalIntersection(intersect: boolean): void;
|
|
505
|
+
private loadPaginationPage;
|
|
506
|
+
private loadInitialPage;
|
|
507
|
+
private loadFirstPage;
|
|
508
|
+
private updateLoadedDataState;
|
|
509
|
+
private pruneRenderedRows;
|
|
510
|
+
private buildDisabledRows;
|
|
511
|
+
updateColumns: UpdateColumn<Record>[];
|
|
512
|
+
openUpdateColumnDisplay(): void;
|
|
513
|
+
reorderColumns(event: CdkDragDrop<any[]>): void;
|
|
514
|
+
closeUpdateColumnDisplay(): void;
|
|
515
|
+
rowClick(row: Record): void;
|
|
516
|
+
rowKeydown(event: KeyboardEvent, row: Record): void;
|
|
517
|
+
protected renderRow(row: Record): void;
|
|
518
|
+
facetClick(column: DatatableColumn<Record> | undefined, result: NgxMatDatasourceResultFacet, option: FacetOptionsOptions): void;
|
|
519
|
+
private buildDisplayColumns;
|
|
520
|
+
private prepareLoadModeOptions;
|
|
521
|
+
private preparePaginationOptions;
|
|
522
|
+
private getDefaultIncrementalPageSize;
|
|
523
|
+
private resolveOptions;
|
|
524
|
+
private resolveActions;
|
|
525
|
+
private resolveActionColumns;
|
|
526
|
+
private resolveIncrementalOptions;
|
|
527
|
+
private resetIncrementalLoading;
|
|
528
|
+
private updateRecordsCountState;
|
|
529
|
+
private updateHasMoreRecordsState;
|
|
530
|
+
private updateIncrementalRowState;
|
|
531
|
+
private buildSearchFormGroup;
|
|
532
|
+
private getSearchValues;
|
|
533
|
+
private getSearchControlName;
|
|
534
|
+
private consolidateOrderIndex;
|
|
535
|
+
private applyConfig;
|
|
536
|
+
private applyState;
|
|
537
|
+
private applyStateOrder;
|
|
538
|
+
private restoreFilterValue;
|
|
539
|
+
private updateState;
|
|
540
|
+
private buildState;
|
|
541
|
+
private updateConfig;
|
|
542
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatDatatableComponent<any>, never>;
|
|
543
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatDatatableComponent<any>, "ngx-mat-datatable", never, {
|
|
544
|
+
"options": {
|
|
545
|
+
"alias": "options";
|
|
546
|
+
"required": false;
|
|
547
|
+
};
|
|
548
|
+
"config": {
|
|
549
|
+
"alias": "config";
|
|
550
|
+
"required": false;
|
|
551
|
+
};
|
|
552
|
+
}, {
|
|
553
|
+
"rowClicked": "rowClicked";
|
|
554
|
+
"configUpdated": "configUpdated";
|
|
555
|
+
"searchUpdated": "searchUpdated";
|
|
556
|
+
"ready": "ready";
|
|
557
|
+
}, ["contentRefs"], ["[loader-spinner]"], true, never>;
|
|
558
|
+
}
|
|
559
|
+
export declare class NgxMatDatatableModule {
|
|
560
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatDatatableModule, never>;
|
|
561
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatDatatableModule, never, [typeof NgxMatDatatableComponent, typeof NgxMatDatatableContentDirective], [typeof NgxMatDatatableComponent, typeof NgxMatDatatableContentDirective]>;
|
|
562
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgxMatDatatableModule>;
|
|
563
|
+
}
|
|
564
|
+
export declare const NGX_MAT_DATATABLE_DEFAULT_OPTIONS: InjectionToken<NgxMatDatatableDefaultOptions<any>>;
|
|
565
|
+
export declare function provideNgxMatDatatableDefaultOptions<Record = any>(options: NgxMatDatatableDefaultOptions<Record>): Provider;
|
package/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DatatableCheckboxColumn } from '../../types/datatable-column.type';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class CellCheckboxValueComponent<Record> {
|
|
4
|
-
column: DatatableCheckboxColumn<Record>;
|
|
5
|
-
row: any;
|
|
6
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CellCheckboxValueComponent<any>, never>;
|
|
7
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CellCheckboxValueComponent<any>, "lib-cell-checkbox-value", never, { "column": { "alias": "column"; "required": false; }; "row": { "alias": "row"; "required": false; }; }, {}, never, never, true, never>;
|
|
8
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { DatatableDateColumn } from '../../types/datatable-column.type';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class CellDateValueComponent<Record> implements OnInit, OnDestroy {
|
|
5
|
-
private changeDetectorRef;
|
|
6
|
-
private dateRefreshService;
|
|
7
|
-
column: DatatableDateColumn<Record>;
|
|
8
|
-
set setRow(row: any);
|
|
9
|
-
row: any;
|
|
10
|
-
value?: any;
|
|
11
|
-
duration?: string | null;
|
|
12
|
-
private refreshSubscription?;
|
|
13
|
-
ngOnInit(): void;
|
|
14
|
-
ngOnDestroy(): void;
|
|
15
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CellDateValueComponent<any>, never>;
|
|
16
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CellDateValueComponent<any>, "lib-cell-date-value", never, { "column": { "alias": "column"; "required": false; }; "setRow": { "alias": "row"; "required": false; }; }, {}, never, never, true, never>;
|
|
17
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { DatatableDurationColumn } from '../../types/datatable-column.type';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class CellDurationValueComponent<Record> {
|
|
4
|
-
column: DatatableDurationColumn<Record>;
|
|
5
|
-
set setRow(row: any);
|
|
6
|
-
row: any;
|
|
7
|
-
value?: any;
|
|
8
|
-
duration?: string | null;
|
|
9
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CellDurationValueComponent<any>, never>;
|
|
10
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CellDurationValueComponent<any>, "lib-cell-duration-value", never, { "column": { "alias": "column"; "required": false; }; "setRow": { "alias": "row"; "required": false; }; }, {}, never, never, true, never>;
|
|
11
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DatatableNumberColumn } from '../../types/datatable-column.type';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class CellNumberValueComponent<Record> {
|
|
4
|
-
column: DatatableNumberColumn<Record>;
|
|
5
|
-
row: any;
|
|
6
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CellNumberValueComponent<any>, never>;
|
|
7
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CellNumberValueComponent<any>, "lib-cell-number-value", never, { "column": { "alias": "column"; "required": false; }; "row": { "alias": "row"; "required": false; }; }, {}, never, never, true, never>;
|
|
8
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { DatatableSearchListOption, DatatableSelectColumn } from '../../types/datatable-column.type';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class CellSelectValueComponent<Record> implements OnInit, OnDestroy {
|
|
5
|
-
column: DatatableSelectColumn<Record>;
|
|
6
|
-
row: any;
|
|
7
|
-
options: DatatableSearchListOption[];
|
|
8
|
-
private selectOptionsCache;
|
|
9
|
-
private subsink;
|
|
10
|
-
ngOnInit(): void;
|
|
11
|
-
ngOnDestroy(): void;
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CellSelectValueComponent<any>, never>;
|
|
13
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CellSelectValueComponent<any>, "lib-cell-select-value", never, { "column": { "alias": "column"; "required": false; }; "row": { "alias": "row"; "required": false; }; }, {}, never, never, true, never>;
|
|
14
|
-
}
|