@eherve/angular-material-datatable 19.0.9 → 19.0.11
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-xQEp_EJL.mjs → eherve-angular-material-datatable-cell-checkbox-value.component-BMqF1wsU.mjs} +4 -3
- package/fesm2022/eherve-angular-material-datatable-cell-checkbox-value.component-BMqF1wsU.mjs.map +1 -0
- package/fesm2022/{eherve-angular-material-datatable-cell-date-value.component-CfQSWZTu.mjs → eherve-angular-material-datatable-cell-date-value.component-Cd6GgJqh.mjs} +5 -4
- package/fesm2022/eherve-angular-material-datatable-cell-date-value.component-Cd6GgJqh.mjs.map +1 -0
- package/fesm2022/{eherve-angular-material-datatable-cell-duration-value.component-CvZSXAJn.mjs → eherve-angular-material-datatable-cell-duration-value.component-CQhFk_95.mjs} +5 -4
- package/fesm2022/eherve-angular-material-datatable-cell-duration-value.component-CQhFk_95.mjs.map +1 -0
- package/fesm2022/{eherve-angular-material-datatable-cell-number-value.component-i4BYCWFQ.mjs → eherve-angular-material-datatable-cell-number-value.component-D2Zu_4_n.mjs} +4 -3
- package/fesm2022/eherve-angular-material-datatable-cell-number-value.component-D2Zu_4_n.mjs.map +1 -0
- package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-Nsx_VAa1.mjs +29 -0
- package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-Nsx_VAa1.mjs.map +1 -0
- package/fesm2022/{eherve-angular-material-datatable-duration.pipe-DGcTUICF.mjs → eherve-angular-material-datatable-duration.pipe-J-cJbdHg.mjs} +3 -1
- package/fesm2022/eherve-angular-material-datatable-duration.pipe-J-cJbdHg.mjs.map +1 -0
- package/fesm2022/{eherve-angular-material-datatable-eherve-angular-material-datatable-DPrnvS5p.mjs → eherve-angular-material-datatable-eherve-angular-material-datatable-Ub2vIwqV.mjs} +49 -19
- package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-Ub2vIwqV.mjs.map +1 -0
- package/fesm2022/eherve-angular-material-datatable-safe-html.pipe-rk0w4NjN.mjs +25 -0
- package/fesm2022/eherve-angular-material-datatable-safe-html.pipe-rk0w4NjN.mjs.map +1 -0
- package/fesm2022/eherve-angular-material-datatable-transform.pipe-BOmcXXZU.mjs +21 -0
- package/fesm2022/eherve-angular-material-datatable-transform.pipe-BOmcXXZU.mjs.map +1 -0
- package/fesm2022/eherve-angular-material-datatable.mjs +1 -1
- package/lib/components/cell-checkbox-value/cell-checkbox-value.component.d.ts +4 -4
- package/lib/components/cell-date-value/cell-date-value.component.d.ts +4 -4
- package/lib/components/cell-duration-value/cell-duration-value.component.d.ts +4 -4
- package/lib/components/cell-number-value/cell-number-value.component.d.ts +4 -4
- package/lib/components/cell-select-value/cell-select-value.component.d.ts +4 -4
- package/lib/components/header-autocomplete-filter/header-autocomplete-filter.component.d.ts +4 -4
- package/lib/components/header-checkbox-filter/header-checkbox-filter.component.d.ts +4 -4
- package/lib/components/header-date-filter/header-date-filter.component.d.ts +4 -4
- package/lib/components/header-duration-filter/header-duration-filter.component.d.ts +4 -4
- package/lib/components/header-number-filter/header-number-filter.component.d.ts +4 -4
- package/lib/components/header-select-filter/header-select-filter.component.d.ts +4 -4
- package/lib/components/header-text-filter/header-text-filter.component.d.ts +4 -4
- package/lib/datatable.component.d.ts +8 -6
- package/lib/pipes/color.pipe.d.ts +4 -4
- package/lib/pipes/duration.pipe.d.ts +1 -1
- package/lib/pipes/safe-html.pipe.d.ts +9 -0
- package/lib/pipes/transform.pipe.d.ts +9 -0
- package/lib/types/datatable-column.type.d.ts +24 -22
- package/lib/types/datatable-options.type.d.ts +2 -1
- package/package.json +1 -1
- package/fesm2022/eherve-angular-material-datatable-cell-checkbox-value.component-xQEp_EJL.mjs.map +0 -1
- package/fesm2022/eherve-angular-material-datatable-cell-date-value.component-CfQSWZTu.mjs.map +0 -1
- package/fesm2022/eherve-angular-material-datatable-cell-duration-value.component-CvZSXAJn.mjs.map +0 -1
- package/fesm2022/eherve-angular-material-datatable-cell-number-value.component-i4BYCWFQ.mjs.map +0 -1
- package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-DW9CGEAB.mjs +0 -28
- package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-DW9CGEAB.mjs.map +0 -1
- package/fesm2022/eherve-angular-material-datatable-color.pipe-CSakeiTF.mjs +0 -21
- package/fesm2022/eherve-angular-material-datatable-color.pipe-CSakeiTF.mjs.map +0 -1
- package/fesm2022/eherve-angular-material-datatable-duration.pipe-DGcTUICF.mjs.map +0 -1
- package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-DPrnvS5p.mjs.map +0 -1
|
@@ -2,8 +2,8 @@ import { AfterViewInit, OnDestroy } from '@angular/core';
|
|
|
2
2
|
import { ControlValueAccessor, FormControl } from '@angular/forms';
|
|
3
3
|
import { DatatableSearchNumberColumn } from '../../types/datatable-column.type';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class HeaderNumberFilterComponent implements AfterViewInit, OnDestroy, ControlValueAccessor {
|
|
6
|
-
column: DatatableSearchNumberColumn
|
|
5
|
+
export declare class HeaderNumberFilterComponent<Record> implements AfterViewInit, OnDestroy, ControlValueAccessor {
|
|
6
|
+
column: DatatableSearchNumberColumn<Record>;
|
|
7
7
|
control: FormControl<any>;
|
|
8
8
|
selectControl: FormControl<any>;
|
|
9
9
|
operatorControl: FormControl<string | null>;
|
|
@@ -17,6 +17,6 @@ export declare class HeaderNumberFilterComponent implements AfterViewInit, OnDes
|
|
|
17
17
|
registerOnTouched(onTouched: any): void;
|
|
18
18
|
ngAfterViewInit(): Promise<void>;
|
|
19
19
|
ngOnDestroy(): void;
|
|
20
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<HeaderNumberFilterComponent
|
|
21
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<HeaderNumberFilterComponent
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HeaderNumberFilterComponent<any>, never>;
|
|
21
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HeaderNumberFilterComponent<any>, "lib-header-number-filter", never, { "column": { "alias": "column"; "required": false; }; }, {}, never, never, true, never>;
|
|
22
22
|
}
|
|
@@ -2,8 +2,8 @@ import { AfterViewInit, OnDestroy } from '@angular/core';
|
|
|
2
2
|
import { ControlValueAccessor, FormControl } from '@angular/forms';
|
|
3
3
|
import { DatatableSearchSelectColumn } from '../../types/datatable-column.type';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class HeaderSelectFilterComponent implements AfterViewInit, OnDestroy, ControlValueAccessor {
|
|
6
|
-
column: DatatableSearchSelectColumn
|
|
5
|
+
export declare class HeaderSelectFilterComponent<Record> implements AfterViewInit, OnDestroy, ControlValueAccessor {
|
|
6
|
+
column: DatatableSearchSelectColumn<Record>;
|
|
7
7
|
control: FormControl<any>;
|
|
8
8
|
selectControl: FormControl<any>;
|
|
9
9
|
onChange: () => void;
|
|
@@ -16,6 +16,6 @@ export declare class HeaderSelectFilterComponent implements AfterViewInit, OnDes
|
|
|
16
16
|
registerOnTouched(onTouched: any): void;
|
|
17
17
|
ngAfterViewInit(): Promise<void>;
|
|
18
18
|
ngOnDestroy(): void;
|
|
19
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<HeaderSelectFilterComponent
|
|
20
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<HeaderSelectFilterComponent
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HeaderSelectFilterComponent<any>, never>;
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HeaderSelectFilterComponent<any>, "lib-header-select-filter", never, { "column": { "alias": "column"; "required": false; }; }, {}, never, never, true, never>;
|
|
21
21
|
}
|
|
@@ -2,8 +2,8 @@ import { AfterViewInit, OnDestroy } from '@angular/core';
|
|
|
2
2
|
import { ControlValueAccessor, FormControl } from '@angular/forms';
|
|
3
3
|
import { DatatableSearchTextColumn } from '../../types/datatable-column.type';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class HeaderTextFilterComponent implements AfterViewInit, OnDestroy, ControlValueAccessor {
|
|
6
|
-
column: DatatableSearchTextColumn
|
|
5
|
+
export declare class HeaderTextFilterComponent<Record> implements AfterViewInit, OnDestroy, ControlValueAccessor {
|
|
6
|
+
column: DatatableSearchTextColumn<Record>;
|
|
7
7
|
control: FormControl<any>;
|
|
8
8
|
selectControl: FormControl<any>;
|
|
9
9
|
onChange: () => void;
|
|
@@ -16,6 +16,6 @@ export declare class HeaderTextFilterComponent implements AfterViewInit, OnDestr
|
|
|
16
16
|
registerOnTouched(onTouched: any): void;
|
|
17
17
|
ngAfterViewInit(): Promise<void>;
|
|
18
18
|
ngOnDestroy(): void;
|
|
19
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<HeaderTextFilterComponent
|
|
20
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<HeaderTextFilterComponent
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HeaderTextFilterComponent<any>, never>;
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HeaderTextFilterComponent<any>, "lib-header-text-filter", never, { "column": { "alias": "column"; "required": false; }; }, {}, never, never, true, never>;
|
|
21
21
|
}
|
|
@@ -4,14 +4,15 @@ import { FormGroup } from '@angular/forms';
|
|
|
4
4
|
import { MatPaginator } from '@angular/material/paginator';
|
|
5
5
|
import { DatagridDataSource } from './datasource';
|
|
6
6
|
import { NgxMatDatatableContentDirective } from './directives/datatable-cell.directive';
|
|
7
|
+
import { NgxMatDatatableIntl } from './datatable.intl';
|
|
7
8
|
import { DatatableColumn } from './types/datatable-column.type';
|
|
8
9
|
import { DatatableOptions } from './types/datatable-options.type';
|
|
9
|
-
import { NgxMatDatatableIntl } from './datatable.intl';
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
|
-
type UpdateColumn = Pick<DatatableColumn
|
|
11
|
+
type UpdateColumn<Record> = Pick<DatatableColumn<Record>, 'columnDef' | 'header' | 'sticky' | 'hidden'>;
|
|
12
12
|
export declare class NgxMatDatatableComponent<Record = any> implements OnInit, OnDestroy {
|
|
13
13
|
options: DatatableOptions<Record>;
|
|
14
|
-
onDisplayChanged: EventEmitter<DatatableColumn[]>;
|
|
14
|
+
onDisplayChanged: EventEmitter<DatatableColumn<Record>[]>;
|
|
15
|
+
rowClicked: EventEmitter<Record>;
|
|
15
16
|
paginator: MatPaginator | undefined;
|
|
16
17
|
contentRefs?: QueryList<NgxMatDatatableContentDirective>;
|
|
17
18
|
displayedColumns: string[];
|
|
@@ -24,18 +25,19 @@ export declare class NgxMatDatatableComponent<Record = any> implements OnInit, O
|
|
|
24
25
|
ngOnInit(): void;
|
|
25
26
|
ngOnDestroy(): void;
|
|
26
27
|
load(intersect: boolean): void;
|
|
27
|
-
sortColumn(column: DatatableColumn): void;
|
|
28
|
+
sortColumn(column: DatatableColumn<Record>): void;
|
|
28
29
|
loadPage(): void;
|
|
29
|
-
updateColumns: UpdateColumn[];
|
|
30
|
+
updateColumns: UpdateColumn<Record>[];
|
|
30
31
|
openUpdateColumnDisplay(): void;
|
|
31
32
|
reorderColumns(event: CdkDragDrop<any[]>): void;
|
|
32
33
|
closeUpdateColumnDisplay(): void;
|
|
34
|
+
rowClick(row: Record): void;
|
|
33
35
|
private buildRequestColumns;
|
|
34
36
|
private addAdditionalColumn;
|
|
35
37
|
private buildDisplayColumns;
|
|
36
38
|
private buildSearchFormGroup;
|
|
37
39
|
private consolidateOrderIndex;
|
|
38
40
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatDatatableComponent<any>, never>;
|
|
39
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatDatatableComponent<any>, "ngx-mat-datatable", never, { "options": { "alias": "options"; "required": false; }; }, { "onDisplayChanged": "onDisplayChanged"; }, ["contentRefs"], never, true, never>;
|
|
41
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatDatatableComponent<any>, "ngx-mat-datatable", never, { "options": { "alias": "options"; "required": false; }; }, { "onDisplayChanged": "onDisplayChanged"; "rowClicked": "rowClicked"; }, ["contentRefs"], never, true, never>;
|
|
40
42
|
}
|
|
41
43
|
export {};
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { PipeTransform } from '@angular/core';
|
|
3
3
|
import { DatatableValueColumn } from '../types/datatable-column.type';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class ColorPipe implements PipeTransform {
|
|
6
|
-
transform(row:
|
|
7
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ColorPipe
|
|
8
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<ColorPipe
|
|
5
|
+
export declare class ColorPipe<Record> implements PipeTransform {
|
|
6
|
+
transform(row: Record, column: DatatableValueColumn<Record>): string | void;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ColorPipe<any>, never>;
|
|
8
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<ColorPipe<any>, "color", true>;
|
|
9
9
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { PipeTransform } from '@angular/core';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class DurationPipe implements PipeTransform {
|
|
5
|
-
transform(data: number | Date, options: {
|
|
5
|
+
transform(data: number | string | Date, options: {
|
|
6
6
|
locale?: string;
|
|
7
7
|
}): string;
|
|
8
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<DurationPipe, never>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SafeHtmlPipe {
|
|
4
|
+
private sanitizer;
|
|
5
|
+
constructor(sanitizer: DomSanitizer);
|
|
6
|
+
transform(html: string): import("@angular/platform-browser").SafeHtml;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SafeHtmlPipe, never>;
|
|
8
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<SafeHtmlPipe, "safeHtml", true>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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 declare class TransformPipe<Record> implements PipeTransform {
|
|
6
|
+
transform(value: any, row: Record, column: DatatableValueColumn<Record>): any;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TransformPipe<any>, never>;
|
|
8
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<TransformPipe<any>, "transform", true>;
|
|
9
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ComponentType } from '@angular/cdk/portal';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { DatasourceRequestOrderDir } from './datasource-service.type';
|
|
5
|
-
type Color = string | ((row:
|
|
5
|
+
type Color<Record> = string | ((row: Record) => string | undefined);
|
|
6
6
|
type BaseColumn = {
|
|
7
7
|
type?: string;
|
|
8
8
|
columnDef: string;
|
|
@@ -27,8 +27,8 @@ export type DatatableComponentColumn = BaseColumn & {
|
|
|
27
27
|
export type DatatableContentColumn = BaseColumn & {
|
|
28
28
|
cellContentId: string;
|
|
29
29
|
};
|
|
30
|
-
export type DatatableValueColumn = BaseColumn & {
|
|
31
|
-
color?: Color
|
|
30
|
+
export type DatatableValueColumn<Record> = BaseColumn & {
|
|
31
|
+
color?: Color<Record>;
|
|
32
32
|
} & ({
|
|
33
33
|
prefix?: string;
|
|
34
34
|
} | {
|
|
@@ -37,22 +37,24 @@ export type DatatableValueColumn = BaseColumn & {
|
|
|
37
37
|
suffix?: string;
|
|
38
38
|
} | {
|
|
39
39
|
suffixContentId?: string;
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
}) & {
|
|
41
|
+
transform?: (value: any, row: Record) => any;
|
|
42
|
+
};
|
|
43
|
+
type Column<Record> = DatatableComponentColumn | DatatableContentColumn | DatatableValueColumn<Record>;
|
|
44
|
+
type SearchableColumn<Record> = Column<Record> & {
|
|
43
45
|
searchable: true;
|
|
44
46
|
searchProperty?: string;
|
|
45
47
|
};
|
|
46
|
-
export type DatatableTextColumn = Column & {
|
|
48
|
+
export type DatatableTextColumn<Record> = Column<Record> & {
|
|
47
49
|
type: 'text';
|
|
48
50
|
};
|
|
49
|
-
export type DatatableSearchTextColumn = DatatableTextColumn & SearchableColumn & {};
|
|
50
|
-
export type DatatableNumberColumn = Column & {
|
|
51
|
+
export type DatatableSearchTextColumn<Record> = DatatableTextColumn<Record> & SearchableColumn<Record> & {};
|
|
52
|
+
export type DatatableNumberColumn<Record> = Column<Record> & {
|
|
51
53
|
type: 'number';
|
|
52
54
|
format?: string;
|
|
53
55
|
locale?: string;
|
|
54
56
|
};
|
|
55
|
-
export type DatatableSearchNumberColumn = DatatableNumberColumn & SearchableColumn & {};
|
|
57
|
+
export type DatatableSearchNumberColumn<Record> = DatatableNumberColumn<Record> & SearchableColumn<Record> & {};
|
|
56
58
|
export type DatatableSearchListOption = {
|
|
57
59
|
value: any;
|
|
58
60
|
name: string;
|
|
@@ -60,45 +62,45 @@ export type DatatableSearchListOption = {
|
|
|
60
62
|
icon?: string;
|
|
61
63
|
iconColor?: string;
|
|
62
64
|
};
|
|
63
|
-
export type DatatableSelectColumn = Column & {
|
|
65
|
+
export type DatatableSelectColumn<Record> = Column<Record> & {
|
|
64
66
|
type: 'select';
|
|
65
67
|
options: Observable<DatatableSearchListOption[]>;
|
|
66
68
|
};
|
|
67
|
-
export type DatatableSearchSelectColumn = DatatableSelectColumn & SearchableColumn & {
|
|
69
|
+
export type DatatableSearchSelectColumn<Record> = DatatableSelectColumn<Record> & SearchableColumn<Record> & {
|
|
68
70
|
placeholder?: string;
|
|
69
71
|
};
|
|
70
|
-
export type DatatableAutocompleteColumn = Column & {
|
|
72
|
+
export type DatatableAutocompleteColumn<Record> = Column<Record> & {
|
|
71
73
|
type: 'autocomplete';
|
|
72
74
|
};
|
|
73
|
-
export type DatatableSearchAutocompleteColumn = DatatableAutocompleteColumn & SearchableColumn & {
|
|
75
|
+
export type DatatableSearchAutocompleteColumn<Record> = DatatableAutocompleteColumn<Record> & SearchableColumn<Record> & {
|
|
74
76
|
placeholder?: string;
|
|
75
77
|
limit?: number;
|
|
76
78
|
loadOnFocus?: boolean;
|
|
77
79
|
options: (limit: number, skip: number, search: string) => Promise<DatatableSearchListOption[]>;
|
|
78
80
|
};
|
|
79
|
-
export type DatatableCheckboxColumn = Column & {
|
|
81
|
+
export type DatatableCheckboxColumn<Record> = Column<Record> & {
|
|
80
82
|
type: 'checkbox';
|
|
81
83
|
};
|
|
82
|
-
export type DatatableSearchCheckboxColumn = DatatableCheckboxColumn & SearchableColumn
|
|
83
|
-
export type DatatableDateColumn = Column & {
|
|
84
|
+
export type DatatableSearchCheckboxColumn<Record> = DatatableCheckboxColumn<Record> & SearchableColumn<Record>;
|
|
85
|
+
export type DatatableDateColumn<Record> = Column<Record> & {
|
|
84
86
|
type: 'date';
|
|
85
87
|
format?: string;
|
|
86
88
|
timezone?: string;
|
|
87
89
|
locale?: string;
|
|
88
90
|
withDuration?: boolean;
|
|
89
91
|
};
|
|
90
|
-
export type DatatableSearchDateColumn = DatatableDateColumn & SearchableColumn & {
|
|
92
|
+
export type DatatableSearchDateColumn<Record> = DatatableDateColumn<Record> & SearchableColumn<Record> & {
|
|
91
93
|
placeholder?: string;
|
|
92
94
|
};
|
|
93
|
-
export type DatatableDurationColumn = Column & {
|
|
95
|
+
export type DatatableDurationColumn<Record> = Column<Record> & {
|
|
94
96
|
type: 'duration';
|
|
95
97
|
locale?: string;
|
|
96
98
|
};
|
|
97
|
-
export type DatatableSearchDurationColumn = DatatableDurationColumn & SearchableColumn & {
|
|
99
|
+
export type DatatableSearchDurationColumn<Record> = DatatableDurationColumn<Record> & SearchableColumn<Record> & {
|
|
98
100
|
placeholder?: string;
|
|
99
101
|
};
|
|
100
|
-
export type DatatableDefaultColumn = Column & {
|
|
102
|
+
export type DatatableDefaultColumn<Record> = Column<Record> & {
|
|
101
103
|
searchable?: false;
|
|
102
104
|
};
|
|
103
|
-
export type DatatableColumn = DatatableDefaultColumn | DatatableTextColumn | DatatableSearchTextColumn | DatatableNumberColumn | DatatableSearchNumberColumn | DatatableSelectColumn | DatatableSearchSelectColumn | DatatableAutocompleteColumn | DatatableSearchAutocompleteColumn | DatatableCheckboxColumn | DatatableSearchCheckboxColumn | DatatableDateColumn | DatatableSearchDateColumn | DatatableDurationColumn | DatatableSearchDurationColumn
|
|
105
|
+
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>;
|
|
104
106
|
export {};
|
|
@@ -3,7 +3,7 @@ import { DatasourceService } from './datasource-service.type';
|
|
|
3
3
|
import { DatatableColumn } from './datatable-column.type';
|
|
4
4
|
export type DatatableOptions<Record> = {
|
|
5
5
|
service: DatasourceService<Record>;
|
|
6
|
-
columns: DatatableColumn[];
|
|
6
|
+
columns: DatatableColumn<Record>[];
|
|
7
7
|
columnMinWith?: number;
|
|
8
8
|
pageSizeOptions?: number[];
|
|
9
9
|
pageSizeOptionsIndex?: number;
|
|
@@ -15,5 +15,6 @@ export type DatatableOptions<Record> = {
|
|
|
15
15
|
reorder?: boolean;
|
|
16
16
|
};
|
|
17
17
|
refresh?: boolean;
|
|
18
|
+
rowClick?: boolean | ((row: Record) => void);
|
|
18
19
|
};
|
|
19
20
|
};
|
package/package.json
CHANGED
package/fesm2022/eherve-angular-material-datatable-cell-checkbox-value.component-xQEp_EJL.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eherve-angular-material-datatable-cell-checkbox-value.component-xQEp_EJL.mjs","sources":["../../../projects/datatable/src/lib/components/cell-checkbox-value/cell-checkbox-value.component.ts","../../../projects/datatable/src/lib/components/cell-checkbox-value/cell-checkbox-value.component.html"],"sourcesContent":["/** @format */\n\nimport { CommonModule } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport { MatIconModule } from '@angular/material/icon';\nimport { GetPipe } from '../../pipes/get.pipe';\nimport { DatatableCheckboxColumn } from '../../types/datatable-column.type';\n\n@Component({\n selector: 'lib-cell-checkbox-value',\n imports: [CommonModule, GetPipe, MatIconModule],\n templateUrl: './cell-checkbox-value.component.html',\n styleUrl: './cell-checkbox-value.component.scss',\n})\nexport class CellCheckboxValueComponent {\n @Input()\n column!: DatatableCheckboxColumn;\n\n @Input()\n row: any;\n}\n","<!-- @format -->\n\n@let value = row | get: column.property;\n@if (value === false) {\n <mat-icon>check_box_outline_blank</mat-icon>\n} @else if (value === true) {\n <mat-icon color=\"primary\">check_box</mat-icon>\n}\n"],"names":["i1"],"mappings":";;;;;;;AAAA;MAca,0BAA0B,CAAA;AAErC,IAAA,MAAM;AAGN,IAAA,GAAG;uGALQ,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA1B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,0BAA0B,6HCdvC,+NAQA,EAAA,MAAA,EAAA,CAAA,yBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDEY,YAAY,EAAE,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,OAAO,2CAAE,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,SAAA,EAAA,SAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAInC,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBANtC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,yBAAyB,WAC1B,CAAC,YAAY,EAAE,OAAO,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,+NAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,CAAA,EAAA;8BAM/C,MAAM,EAAA,CAAA;sBADL;gBAID,GAAG,EAAA,CAAA;sBADF;;;;;"}
|
package/fesm2022/eherve-angular-material-datatable-cell-date-value.component-CfQSWZTu.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eherve-angular-material-datatable-cell-date-value.component-CfQSWZTu.mjs","sources":["../../../projects/datatable/src/lib/pipes/moment-format.pipe.ts","../../../projects/datatable/src/lib/components/cell-date-value/cell-date-value.component.ts","../../../projects/datatable/src/lib/components/cell-date-value/cell-date-value.component.html"],"sourcesContent":["/** @format */\n\nimport { Pipe, PipeTransform } from '@angular/core';\nimport moment, { Moment } from 'moment';\n\n@Pipe({ name: 'momentFormat' })\nexport class MomentFormatPipe implements PipeTransform {\n transform(data: any, options: { format?: string; locale?: string }): string {\n const date = this.getMoment(data);\n if (!date) return '';\n const format = options?.format || 'LLL';\n return options?.locale ? date.locale(options.locale).format(format) : date.format(format);\n }\n\n private getMoment(data: any): Moment | null {\n if (typeof data === 'string') return moment(data);\n if (typeof data === 'number') return moment(data);\n if (data instanceof Date) return moment(data);\n if (moment.isMoment(data)) return data.clone();\n if (typeof data?.valueOf === 'function') {\n const value = data.valueOf();\n if (typeof value === 'number') return moment(data);\n }\n return null;\n }\n}\n","/** @format */\n\nimport { CommonModule } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport { MatIconModule } from '@angular/material/icon';\nimport { GetPipe } from '../../pipes/get.pipe';\nimport { MomentFormatPipe } from '../../pipes/moment-format.pipe';\nimport { DatatableDateColumn } from '../../types/datatable-column.type';\nimport { DurationPipe } from '../../pipes/duration.pipe';\n\n@Component({\n selector: 'lib-cell-date-value',\n imports: [CommonModule, GetPipe, MatIconModule, MomentFormatPipe, DurationPipe],\n templateUrl: './cell-date-value.component.html',\n styleUrl: './cell-date-value.component.scss',\n})\nexport class CellDateValueComponent {\n @Input()\n column!: DatatableDateColumn;\n\n @Input()\n row: any;\n}\n","<!-- @format -->\n\n@let value = row | get: column.property;\n@if (value) {\n {{ value | momentFormat: column }}\n @if (column.withDuration) {\n ({{ value | duration: column }})\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;MAMa,gBAAgB,CAAA;IAC3B,SAAS,CAAC,IAAS,EAAE,OAA6C,EAAA;QAChE,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;AACjC,QAAA,IAAI,CAAC,IAAI;AAAE,YAAA,OAAO,EAAE;AACpB,QAAA,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,KAAK;AACvC,QAAA,OAAO,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;;AAGnF,IAAA,SAAS,CAAC,IAAS,EAAA;QACzB,IAAI,OAAO,IAAI,KAAK,QAAQ;AAAE,YAAA,OAAO,MAAM,CAAC,IAAI,CAAC;QACjD,IAAI,OAAO,IAAI,KAAK,QAAQ;AAAE,YAAA,OAAO,MAAM,CAAC,IAAI,CAAC;QACjD,IAAI,IAAI,YAAY,IAAI;AAAE,YAAA,OAAO,MAAM,CAAC,IAAI,CAAC;AAC7C,QAAA,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;AAAE,YAAA,OAAO,IAAI,CAAC,KAAK,EAAE;AAC9C,QAAA,IAAI,OAAO,IAAI,EAAE,OAAO,KAAK,UAAU,EAAE;AACvC,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,EAAE;YAC5B,IAAI,OAAO,KAAK,KAAK,QAAQ;AAAE,gBAAA,OAAO,MAAM,CAAC,IAAI,CAAC;;AAEpD,QAAA,OAAO,IAAI;;uGAjBF,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,cAAA,EAAA,CAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAD5B,IAAI;mBAAC,EAAE,IAAI,EAAE,cAAc,EAAE;;;ACL9B;MAgBa,sBAAsB,CAAA;AAEjC,IAAA,MAAM;AAGN,IAAA,GAAG;uGALQ,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,GAAA,EAAA,KAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EChBnC,kMASA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDGY,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAE,OAAO,EAAA,IAAA,EAAA,KAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAE,gBAAgB,EAAA,IAAA,EAAA,cAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAE,YAAY,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,EAAA,CAAA;;2FAInE,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBANlC,SAAS;+BACE,qBAAqB,EAAA,OAAA,EACtB,CAAC,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,CAAC,EAAA,QAAA,EAAA,kMAAA,EAAA;8BAM/E,MAAM,EAAA,CAAA;sBADL;gBAID,GAAG,EAAA,CAAA;sBADF;;;;;"}
|
package/fesm2022/eherve-angular-material-datatable-cell-duration-value.component-CvZSXAJn.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eherve-angular-material-datatable-cell-duration-value.component-CvZSXAJn.mjs","sources":["../../../projects/datatable/src/lib/components/cell-duration-value/cell-duration-value.component.ts","../../../projects/datatable/src/lib/components/cell-duration-value/cell-duration-value.component.html"],"sourcesContent":["/** @format */\n\nimport { CommonModule } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport { MatIconModule } from '@angular/material/icon';\nimport { DurationPipe } from '../../pipes/duration.pipe';\nimport { GetPipe } from '../../pipes/get.pipe';\nimport { DatatableDurationColumn } from '../../types/datatable-column.type';\n\n@Component({\n selector: 'lib-cell-duration-value',\n imports: [CommonModule, GetPipe, MatIconModule, DurationPipe],\n templateUrl: './cell-duration-value.component.html',\n styleUrl: './cell-duration-value.component.scss',\n})\nexport class CellDurationValueComponent {\n @Input()\n column!: DatatableDurationColumn;\n\n @Input()\n row: any;\n}\n","<!-- @format -->\n\n@let value = row | get: column.property;\n@if (value) {\n {{ value | duration: column }}\n}\n"],"names":[],"mappings":";;;;;;;AAAA;MAea,0BAA0B,CAAA;AAErC,IAAA,MAAM;AAGN,IAAA,GAAG;uGALQ,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yBAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,GAAA,EAAA,KAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECfvC,oHAMA,EDKY,MAAA,EAAA,CAAA,yBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,YAAY,0BAAE,OAAO,EAAA,IAAA,EAAA,KAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAE,YAAY,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,EAAA,CAAA;;2FAIjD,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBANtC,SAAS;+BACE,yBAAyB,EAAA,OAAA,EAC1B,CAAC,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,CAAC,EAAA,QAAA,EAAA,oHAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,CAAA,EAAA;8BAM7D,MAAM,EAAA,CAAA;sBADL;gBAID,GAAG,EAAA,CAAA;sBADF;;;;;"}
|
package/fesm2022/eherve-angular-material-datatable-cell-number-value.component-i4BYCWFQ.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eherve-angular-material-datatable-cell-number-value.component-i4BYCWFQ.mjs","sources":["../../../projects/datatable/src/lib/components/cell-number-value/cell-number-value.component.ts","../../../projects/datatable/src/lib/components/cell-number-value/cell-number-value.component.html"],"sourcesContent":["/** @format */\n\nimport { CommonModule } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport { MatIconModule } from '@angular/material/icon';\nimport { GetPipe } from '../../pipes/get.pipe';\nimport { DatatableNumberColumn } from '../../types/datatable-column.type';\n\n@Component({\n selector: 'lib-cell-number-value',\n imports: [CommonModule, GetPipe, MatIconModule],\n templateUrl: './cell-number-value.component.html',\n styleUrl: './cell-number-value.component.scss',\n})\nexport class CellNumberValueComponent {\n @Input()\n column!: DatatableNumberColumn;\n\n @Input()\n row: any;\n}\n","<!-- @format -->\n\n@let value = row | get: column.property;\n{{ value | number: column.format : column.locale }}\n"],"names":[],"mappings":";;;;;;;AAAA;MAca,wBAAwB,CAAA;AAEnC,IAAA,MAAM;AAGN,IAAA,GAAG;uGALQ,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAxB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,2HCdrC,qHAIA,EAAA,MAAA,EAAA,CAAA,yBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDMY,YAAY,EAAE,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,OAAO,2CAAE,aAAa,EAAA,CAAA,EAAA,CAAA;;2FAInC,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBANpC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,uBAAuB,WACxB,CAAC,YAAY,EAAE,OAAO,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,qHAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,CAAA,EAAA;8BAM/C,MAAM,EAAA,CAAA;sBADL;gBAID,GAAG,EAAA,CAAA;sBADF;;;;;"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as i1 from '@angular/common';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
|
-
import { Component, Input } from '@angular/core';
|
|
5
|
-
import { MatLabel } from '@angular/material/form-field';
|
|
6
|
-
import * as i5 from '@angular/material/icon';
|
|
7
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
8
|
-
import { GetPipe } from './eherve-angular-material-datatable-get.pipe-CCgMUDDx.mjs';
|
|
9
|
-
import { S as SelectOptionPipe } from './eherve-angular-material-datatable-eherve-angular-material-datatable-DPrnvS5p.mjs';
|
|
10
|
-
|
|
11
|
-
/** @format */
|
|
12
|
-
class CellSelectValueComponent {
|
|
13
|
-
column;
|
|
14
|
-
row;
|
|
15
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellSelectValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
16
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: CellSelectValueComponent, isStandalone: true, selector: "lib-cell-select-value", inputs: { column: "column", row: "row" }, ngImport: i0, template: "<!-- @format -->\n\n@let options = $any(column.options | async);\n@let value = row | get: column.property;\n@let option = row | get: column.property | selectOption: options;\n\n@if (option) {\n <div class=\"option\">\n @if (option.icon) {\n <mat-icon [style.color]=\"option.iconColor\" [style.margin-right.px]=\"8\">\n {{ option.icon }}\n </mat-icon>\n }\n <mat-label [style.color]=\"option.color\" [innerHTML]=\"option.name\"></mat-label>\n </div>\n} @else {\n {{ value }}\n}\n", styles: [".option{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: SelectOptionPipe, name: "selectOption" }, { kind: "pipe", type: GetPipe, name: "get" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }] });
|
|
17
|
-
}
|
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellSelectValueComponent, decorators: [{
|
|
19
|
-
type: Component,
|
|
20
|
-
args: [{ selector: 'lib-cell-select-value', imports: [CommonModule, SelectOptionPipe, GetPipe, MatIconModule, MatLabel], template: "<!-- @format -->\n\n@let options = $any(column.options | async);\n@let value = row | get: column.property;\n@let option = row | get: column.property | selectOption: options;\n\n@if (option) {\n <div class=\"option\">\n @if (option.icon) {\n <mat-icon [style.color]=\"option.iconColor\" [style.margin-right.px]=\"8\">\n {{ option.icon }}\n </mat-icon>\n }\n <mat-label [style.color]=\"option.color\" [innerHTML]=\"option.name\"></mat-label>\n </div>\n} @else {\n {{ value }}\n}\n", styles: [".option{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row}\n"] }]
|
|
21
|
-
}], propDecorators: { column: [{
|
|
22
|
-
type: Input
|
|
23
|
-
}], row: [{
|
|
24
|
-
type: Input
|
|
25
|
-
}] } });
|
|
26
|
-
|
|
27
|
-
export { CellSelectValueComponent };
|
|
28
|
-
//# sourceMappingURL=eherve-angular-material-datatable-cell-select-value.component-DW9CGEAB.mjs.map
|
package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-DW9CGEAB.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eherve-angular-material-datatable-cell-select-value.component-DW9CGEAB.mjs","sources":["../../../projects/datatable/src/lib/components/cell-select-value/cell-select-value.component.ts","../../../projects/datatable/src/lib/components/cell-select-value/cell-select-value.component.html"],"sourcesContent":["/** @format */\n\nimport { CommonModule } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport { MatLabel } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { GetPipe } from '../../pipes/get.pipe';\nimport { SelectOptionPipe } from '../../pipes/select-option.pipe';\nimport { DatatableSelectColumn } from '../../types/datatable-column.type';\n\n@Component({\n selector: 'lib-cell-select-value',\n imports: [CommonModule, SelectOptionPipe, GetPipe, MatIconModule, MatLabel],\n templateUrl: './cell-select-value.component.html',\n styleUrl: './cell-select-value.component.scss',\n})\nexport class CellSelectValueComponent {\n @Input()\n column!: DatatableSelectColumn;\n\n @Input()\n row: any;\n}\n","<!-- @format -->\n\n@let options = $any(column.options | async);\n@let value = row | get: column.property;\n@let option = row | get: column.property | selectOption: options;\n\n@if (option) {\n <div class=\"option\">\n @if (option.icon) {\n <mat-icon [style.color]=\"option.iconColor\" [style.margin-right.px]=\"8\">\n {{ option.icon }}\n </mat-icon>\n }\n <mat-label [style.color]=\"option.color\" [innerHTML]=\"option.name\"></mat-label>\n </div>\n} @else {\n {{ value }}\n}\n"],"names":["i2"],"mappings":";;;;;;;;;;AAAA;MAgBa,wBAAwB,CAAA;AAEnC,IAAA,MAAM;AAGN,IAAA,GAAG;uGALQ,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAxB,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,GAAA,EAAA,KAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EChBrC,6fAkBA,EAAA,MAAA,EAAA,CAAA,gHAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDNY,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,OAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAE,gBAAgB,EAAA,IAAA,EAAA,cAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAE,OAAO,EAAA,IAAA,EAAA,KAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,SAAA,EAAA,SAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,QAAQ,EAAA,QAAA,EAAA,WAAA,EAAA,CAAA,EAAA,CAAA;;2FAI/D,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBANpC,SAAS;+BACE,uBAAuB,EAAA,OAAA,EACxB,CAAC,YAAY,EAAE,gBAAgB,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAA,QAAA,EAAA,6fAAA,EAAA,MAAA,EAAA,CAAA,gHAAA,CAAA,EAAA;8BAM3E,MAAM,EAAA,CAAA;sBADL;gBAID,GAAG,EAAA,CAAA;sBADF;;;;;"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe } from '@angular/core';
|
|
3
|
-
|
|
4
|
-
/** @format */
|
|
5
|
-
class ColorPipe {
|
|
6
|
-
transform(row, column) {
|
|
7
|
-
if (typeof column.color === 'string')
|
|
8
|
-
return column.color;
|
|
9
|
-
if (typeof column.color === 'function')
|
|
10
|
-
return column.color(row);
|
|
11
|
-
}
|
|
12
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: ColorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
13
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: ColorPipe, isStandalone: true, name: "color" });
|
|
14
|
-
}
|
|
15
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: ColorPipe, decorators: [{
|
|
16
|
-
type: Pipe,
|
|
17
|
-
args: [{ name: 'color' }]
|
|
18
|
-
}] });
|
|
19
|
-
|
|
20
|
-
export { ColorPipe };
|
|
21
|
-
//# sourceMappingURL=eherve-angular-material-datatable-color.pipe-CSakeiTF.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eherve-angular-material-datatable-color.pipe-CSakeiTF.mjs","sources":["../../../projects/datatable/src/lib/pipes/color.pipe.ts"],"sourcesContent":["/** @format */\n\nimport { Pipe, PipeTransform } from '@angular/core';\nimport { DatatableValueColumn } from '../types/datatable-column.type';\n\n@Pipe({ name: 'color' })\nexport class ColorPipe implements PipeTransform {\n transform(row: any, column: DatatableValueColumn): string | void {\n if (typeof column.color === 'string') return column.color;\n if (typeof column.color === 'function') return column.color(row);\n }\n}\n"],"names":[],"mappings":";;;AAAA;MAMa,SAAS,CAAA;IACpB,SAAS,CAAC,GAAQ,EAAE,MAA4B,EAAA;AAC9C,QAAA,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ;YAAE,OAAO,MAAM,CAAC,KAAK;AACzD,QAAA,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,UAAU;AAAE,YAAA,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;;uGAHvD,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAT,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA;;2FAAT,SAAS,EAAA,UAAA,EAAA,CAAA;kBADrB,IAAI;mBAAC,EAAE,IAAI,EAAE,OAAO,EAAE;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eherve-angular-material-datatable-duration.pipe-DGcTUICF.mjs","sources":["../../../projects/datatable/src/lib/pipes/duration.pipe.ts"],"sourcesContent":["/** @format */\n\nimport { Pipe, PipeTransform } from '@angular/core';\nimport moment from 'moment';\n\n@Pipe({ name: 'duration' })\nexport class DurationPipe implements PipeTransform {\n transform(data: number | Date, options: { locale?: string }): string {\n let duration: moment.Duration;\n if (typeof data === 'number') duration = moment.duration(data);\n else duration = moment.duration(Date.now() - data.valueOf());\n return options?.locale ? duration.locale(options.locale).humanize() : duration.humanize();\n }\n}\n"],"names":[],"mappings":";;;;AAAA;MAMa,YAAY,CAAA;IACvB,SAAS,CAAC,IAAmB,EAAE,OAA4B,EAAA;AACzD,QAAA,IAAI,QAAyB;QAC7B,IAAI,OAAO,IAAI,KAAK,QAAQ;AAAE,YAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;;AACzD,YAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC5D,OAAO,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,GAAG,QAAQ,CAAC,QAAQ,EAAE;;uGALhF,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAZ,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBADxB,IAAI;mBAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;;;;"}
|