@eherve/angular-material-datatable 19.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/README.md +63 -0
- package/fesm2022/eherve-angular-material-datatable.mjs +1031 -0
- package/fesm2022/eherve-angular-material-datatable.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/cell-checkbox-value/cell-checkbox-value.component.d.ts +8 -0
- package/lib/components/cell-date-value/cell-date-value.component.d.ts +8 -0
- package/lib/components/cell-select-value/cell-select-value.component.d.ts +8 -0
- package/lib/components/header-autocomplete-filter/header-autocomplete-filter.component.d.ts +31 -0
- package/lib/components/header-checkbox-filter/header-checkbox-filter.component.d.ts +21 -0
- package/lib/components/header-date-filter/header-date-filter.component.d.ts +30 -0
- package/lib/components/header-number-filter/header-number-filter.component.d.ts +22 -0
- package/lib/components/header-select-filter/header-select-filter.component.d.ts +21 -0
- package/lib/components/header-text-filter/header-text-filter.component.d.ts +21 -0
- package/lib/components/operator-select/operator-select.component.d.ts +18 -0
- package/lib/datasource.d.ts +16 -0
- package/lib/datatable.component.d.ts +39 -0
- package/lib/datatable.module.d.ts +9 -0
- package/lib/directives/datatable-cell.directive.d.ts +10 -0
- package/lib/pipes/find-cell-content.pipe.d.ts +10 -0
- package/lib/pipes/get.pipe.d.ts +8 -0
- package/lib/pipes/select-option.pipe.d.ts +9 -0
- package/lib/types/datasource-service.type.d.ts +32 -0
- package/lib/types/datatable-column.type.d.ts +85 -0
- package/lib/types/datatable-options.type.d.ts +19 -0
- package/package.json +37 -0
- package/public-api.d.ts +11 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type DatasourceRequestSearch = {
|
|
2
|
+
value: any;
|
|
3
|
+
regex?: boolean;
|
|
4
|
+
chunks?: string[];
|
|
5
|
+
};
|
|
6
|
+
export type DatasourceRequestColumn = {
|
|
7
|
+
data: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
searchable?: boolean;
|
|
10
|
+
orderable?: boolean;
|
|
11
|
+
search?: DatasourceRequestSearch;
|
|
12
|
+
};
|
|
13
|
+
export type DatasourceRequestOrderDir = 'asc' | 'desc';
|
|
14
|
+
export type DatasourceRequestOrder = {
|
|
15
|
+
column: number;
|
|
16
|
+
dir: DatasourceRequestOrderDir;
|
|
17
|
+
};
|
|
18
|
+
export type DatasourceRequestOptions = {
|
|
19
|
+
draw: string;
|
|
20
|
+
columns: DatasourceRequestColumn[];
|
|
21
|
+
order?: DatasourceRequestOrder[];
|
|
22
|
+
start?: number;
|
|
23
|
+
length?: number;
|
|
24
|
+
search?: DatasourceRequestSearch;
|
|
25
|
+
};
|
|
26
|
+
export type DatasourceResult<T> = {
|
|
27
|
+
draw: string;
|
|
28
|
+
recordsTotal: number;
|
|
29
|
+
recordsFiltered: number;
|
|
30
|
+
data: T[];
|
|
31
|
+
};
|
|
32
|
+
export type DatasourceService<Record> = (options: DatasourceRequestOptions) => Promise<DatasourceResult<Record>>;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
import { ComponentType } from '@angular/cdk/portal';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { DatasourceRequestOrderDir } from './datasource-service.type';
|
|
5
|
+
type BaseColumn = {
|
|
6
|
+
type: string;
|
|
7
|
+
columnDef: string;
|
|
8
|
+
header: string;
|
|
9
|
+
property: string;
|
|
10
|
+
minWidth?: number;
|
|
11
|
+
sticky?: boolean;
|
|
12
|
+
hidden?: boolean;
|
|
13
|
+
searchable?: boolean;
|
|
14
|
+
searchProperty?: string;
|
|
15
|
+
sortable?: boolean;
|
|
16
|
+
sortProperty?: string;
|
|
17
|
+
order?: {
|
|
18
|
+
index: number;
|
|
19
|
+
dir: DatasourceRequestOrderDir;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type DatatableComponentColumn = BaseColumn & {
|
|
23
|
+
cellComponent: ComponentType<any>;
|
|
24
|
+
};
|
|
25
|
+
export type DatatableContentColumn = BaseColumn & {
|
|
26
|
+
cellContent: string;
|
|
27
|
+
};
|
|
28
|
+
export type DatatableValueColumn = BaseColumn & ({
|
|
29
|
+
prefix?: string;
|
|
30
|
+
} | {
|
|
31
|
+
prefixContent?: string;
|
|
32
|
+
}) & ({
|
|
33
|
+
suffix?: string;
|
|
34
|
+
} | {
|
|
35
|
+
suffixContent?: string;
|
|
36
|
+
});
|
|
37
|
+
type Column = DatatableComponentColumn | DatatableContentColumn | DatatableValueColumn;
|
|
38
|
+
type SearchableColumn = Column & {
|
|
39
|
+
searchable: true;
|
|
40
|
+
searchProperty?: string;
|
|
41
|
+
};
|
|
42
|
+
export type DatatableTextColumn = Column & {
|
|
43
|
+
type: 'text';
|
|
44
|
+
};
|
|
45
|
+
export type DatatableSearchTextColumn = DatatableTextColumn & SearchableColumn & {};
|
|
46
|
+
export type DatatableNumberColumn = Column & {
|
|
47
|
+
type: 'number';
|
|
48
|
+
};
|
|
49
|
+
export type DatatableSearchNumberColumn = DatatableNumberColumn & SearchableColumn & {};
|
|
50
|
+
export type DatatableSearchListOption = {
|
|
51
|
+
value: any;
|
|
52
|
+
label: string;
|
|
53
|
+
color?: string;
|
|
54
|
+
icon?: string;
|
|
55
|
+
iconColor?: string;
|
|
56
|
+
};
|
|
57
|
+
export type DatatableSelectColumn = Column & {
|
|
58
|
+
type: 'select';
|
|
59
|
+
options: Observable<DatatableSearchListOption[]>;
|
|
60
|
+
};
|
|
61
|
+
export type DatatableSearchSelectColumn = DatatableSelectColumn & SearchableColumn & {
|
|
62
|
+
placeholder?: string;
|
|
63
|
+
};
|
|
64
|
+
export type DatatableAutocompleteColumn = Column & {
|
|
65
|
+
type: 'autocomplete';
|
|
66
|
+
};
|
|
67
|
+
export type DatatableSearchAutocompleteColumn = DatatableAutocompleteColumn & SearchableColumn & {
|
|
68
|
+
placeholder?: string;
|
|
69
|
+
limit?: number;
|
|
70
|
+
loadOnFocus?: boolean;
|
|
71
|
+
options: (limit: number, skip: number, search: string) => Promise<DatatableSearchListOption[]>;
|
|
72
|
+
};
|
|
73
|
+
export type DatatableCheckboxColumn = Column & {
|
|
74
|
+
type: 'checkbox';
|
|
75
|
+
};
|
|
76
|
+
export type DatatableSearchCheckboxColumn = DatatableCheckboxColumn & SearchableColumn & {};
|
|
77
|
+
export type DatatableDateColumn = Column & {
|
|
78
|
+
type: 'date';
|
|
79
|
+
locale?: string;
|
|
80
|
+
};
|
|
81
|
+
export type DatatableSearchDateColumn = DatatableDateColumn & SearchableColumn & {
|
|
82
|
+
placeholder?: string;
|
|
83
|
+
};
|
|
84
|
+
export type DatatableColumn = DatatableTextColumn | DatatableSearchTextColumn | DatatableNumberColumn | DatatableSearchNumberColumn | DatatableSelectColumn | DatatableSearchSelectColumn | DatatableAutocompleteColumn | DatatableSearchAutocompleteColumn | DatatableCheckboxColumn | DatatableSearchCheckboxColumn | DatatableDateColumn | DatatableSearchDateColumn;
|
|
85
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
import { DatasourceService } from './datasource-service.type';
|
|
3
|
+
import { DatatableColumn } from './datatable-column.type';
|
|
4
|
+
export type DatatableOptions<Record> = {
|
|
5
|
+
service: DatasourceService<Record>;
|
|
6
|
+
columns: DatatableColumn[];
|
|
7
|
+
columnMinWith?: number;
|
|
8
|
+
pageSizeOptions?: number[];
|
|
9
|
+
pageSizeOptionsIndex?: number;
|
|
10
|
+
actions?: {
|
|
11
|
+
columns?: {
|
|
12
|
+
tooltip?: string;
|
|
13
|
+
hideAndShow?: boolean;
|
|
14
|
+
sticky?: boolean;
|
|
15
|
+
reorder?: boolean;
|
|
16
|
+
};
|
|
17
|
+
refresh?: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@eherve/angular-material-datatable",
|
|
3
|
+
"version": "19.0.0",
|
|
4
|
+
"author": "Eric Herve <eric.herve.95@gmail.com>",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/eherve/angular-material-extended.git"
|
|
8
|
+
},
|
|
9
|
+
"private": false,
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"peerDependencies": {
|
|
14
|
+
"@angular/cdk": "^19.0.4",
|
|
15
|
+
"@angular/common": "^19.0.4",
|
|
16
|
+
"@angular/core": "^19.0.4",
|
|
17
|
+
"@angular/material": "^19.0.4",
|
|
18
|
+
"@angular/material-moment-adapter": "^19.0.4",
|
|
19
|
+
"ngx-intersection-observer": "^1.0.13",
|
|
20
|
+
"rxjs": "~7.8.0"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"tslib": "^2.3.0"
|
|
24
|
+
},
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"module": "fesm2022/eherve-angular-material-datatable.mjs",
|
|
27
|
+
"typings": "index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
"./package.json": {
|
|
30
|
+
"default": "./package.json"
|
|
31
|
+
},
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./index.d.ts",
|
|
34
|
+
"default": "./fesm2022/eherve-angular-material-datatable.mjs"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public API Surface of mongoose-datatable
|
|
3
|
+
*
|
|
4
|
+
* @format
|
|
5
|
+
*/
|
|
6
|
+
export * from './lib/datatable.component';
|
|
7
|
+
export * from './lib/datatable.module';
|
|
8
|
+
export * from './lib/directives/datatable-cell.directive';
|
|
9
|
+
export * from './lib/types/datasource-service.type';
|
|
10
|
+
export * from './lib/types/datatable-column.type';
|
|
11
|
+
export * from './lib/types/datatable-options.type';
|