@swimlane/ngx-datatable 20.1.0 → 21.0.0-alpha.1
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/CHANGELOG.md +720 -0
- package/README.md +25 -4
- package/assets/app.css +4 -3
- package/assets/icons-reference.html +5 -1
- package/assets/icons.css +3 -2
- package/{fesm2020 → fesm2022}/swimlane-ngx-datatable.mjs +3404 -2536
- package/fesm2022/swimlane-ngx-datatable.mjs.map +1 -0
- package/index.css +224 -169
- package/index.scss +13 -3
- package/lib/components/body/body-cell.component.d.ts +28 -23
- package/lib/components/body/body-group-header-template.directive.d.ts +3 -4
- package/lib/components/body/body-group-header.directive.d.ts +14 -9
- package/lib/components/body/body-row-def.component.d.ts +34 -0
- package/lib/components/body/body-row-wrapper.component.d.ts +34 -22
- package/lib/components/body/body-row.component.d.ts +28 -34
- package/lib/components/body/body.component.d.ts +88 -69
- package/lib/components/body/ghost-loader/ghost-loader.component.d.ts +12 -0
- package/lib/components/body/progress-bar.component.d.ts +1 -1
- package/lib/components/body/scroller.component.d.ts +4 -7
- package/lib/components/body/selection.component.d.ts +21 -25
- package/lib/components/body/summary/summary-row.component.d.ts +4 -3
- package/lib/components/columns/column-cell.directive.d.ts +4 -3
- package/lib/components/columns/column-ghost-cell.directive.d.ts +6 -0
- package/lib/components/columns/column-header.directive.d.ts +3 -4
- package/lib/components/columns/column.directive.d.ts +43 -18
- package/lib/components/columns/tree.directive.d.ts +1 -2
- package/lib/components/datatable.component.d.ts +142 -76
- package/lib/components/footer/footer-template.directive.d.ts +3 -4
- package/lib/components/footer/footer.component.d.ts +3 -2
- package/lib/components/footer/footer.directive.d.ts +6 -4
- package/lib/components/footer/pager.component.d.ts +6 -4
- package/lib/components/header/header-cell.component.d.ts +18 -18
- package/lib/components/header/header.component.d.ts +41 -36
- package/lib/components/row-detail/row-detail-template.directive.d.ts +3 -4
- package/lib/components/row-detail/row-detail.directive.d.ts +9 -8
- package/lib/directives/disable-row.directive.d.ts +22 -0
- package/lib/directives/draggable.directive.d.ts +11 -8
- package/lib/directives/long-press.directive.d.ts +16 -5
- package/lib/directives/orderable.directive.d.ts +21 -10
- package/lib/directives/resizeable.directive.d.ts +7 -5
- package/lib/directives/visibility.directive.d.ts +2 -3
- package/lib/ngx-datatable.module.d.ts +29 -30
- package/lib/services/scrollbar-helper.service.d.ts +0 -1
- package/lib/types/internal.types.d.ts +31 -0
- package/lib/types/public.types.d.ts +142 -0
- package/lib/types/table-column.type.d.ts +39 -66
- package/lib/utils/column-helper.d.ts +2 -2
- package/lib/utils/column-prop-getters.d.ts +1 -1
- package/lib/utils/column.d.ts +7 -14
- package/lib/utils/keys.d.ts +6 -6
- package/lib/utils/math.d.ts +4 -3
- package/lib/utils/selection.d.ts +2 -2
- package/lib/utils/sort.d.ts +5 -5
- package/lib/utils/table-token.d.ts +7 -0
- package/lib/utils/tree.d.ts +2 -2
- package/package.json +9 -17
- package/public-api.d.ts +4 -11
- package/themes/_ghost.scss +22 -0
- package/themes/_rows.scss +22 -0
- package/themes/bootstrap.css +117 -65
- package/themes/bootstrap.scss +27 -3
- package/themes/dark.css +101 -70
- package/themes/dark.scss +12 -0
- package/themes/material.css +344 -260
- package/themes/material.scss +52 -11
- package/esm2020/lib/components/body/body-cell.component.mjs +0 -432
- package/esm2020/lib/components/body/body-group-header-template.directive.mjs +0 -16
- package/esm2020/lib/components/body/body-group-header.directive.mjs +0 -62
- package/esm2020/lib/components/body/body-row-wrapper.component.mjs +0 -140
- package/esm2020/lib/components/body/body-row.component.mjs +0 -262
- package/esm2020/lib/components/body/body.component.mjs +0 -863
- package/esm2020/lib/components/body/progress-bar.component.mjs +0 -27
- package/esm2020/lib/components/body/scroller.component.mjs +0 -91
- package/esm2020/lib/components/body/selection.component.mjs +0 -150
- package/esm2020/lib/components/body/summary/summary-row.component.mjs +0 -105
- package/esm2020/lib/components/columns/column-cell.directive.mjs +0 -14
- package/esm2020/lib/components/columns/column-header.directive.mjs +0 -14
- package/esm2020/lib/components/columns/column.directive.mjs +0 -98
- package/esm2020/lib/components/columns/tree.directive.mjs +0 -14
- package/esm2020/lib/components/datatable.component.mjs +0 -1008
- package/esm2020/lib/components/footer/footer-template.directive.mjs +0 -14
- package/esm2020/lib/components/footer/footer.component.mjs +0 -128
- package/esm2020/lib/components/footer/footer.directive.mjs +0 -35
- package/esm2020/lib/components/footer/pager.component.mjs +0 -181
- package/esm2020/lib/components/header/header-cell.component.mjs +0 -243
- package/esm2020/lib/components/header/header.component.mjs +0 -376
- package/esm2020/lib/components/row-detail/row-detail-template.directive.mjs +0 -16
- package/esm2020/lib/components/row-detail/row-detail.directive.mjs +0 -63
- package/esm2020/lib/directives/draggable.directive.mjs +0 -108
- package/esm2020/lib/directives/long-press.directive.mjs +0 -117
- package/esm2020/lib/directives/orderable.directive.mjs +0 -136
- package/esm2020/lib/directives/resizeable.directive.mjs +0 -93
- package/esm2020/lib/directives/visibility.directive.mjs +0 -63
- package/esm2020/lib/events.mjs +0 -7
- package/esm2020/lib/ngx-datatable.module.mjs +0 -139
- package/esm2020/lib/services/column-changes.service.mjs +0 -24
- package/esm2020/lib/services/dimensions-helper.service.mjs +0 -17
- package/esm2020/lib/services/scrollbar-helper.service.mjs +0 -37
- package/esm2020/lib/types/click.type.mjs +0 -6
- package/esm2020/lib/types/column-mode.type.mjs +0 -7
- package/esm2020/lib/types/contextmenu.type.mjs +0 -6
- package/esm2020/lib/types/selection.type.mjs +0 -9
- package/esm2020/lib/types/sort-direction.type.mjs +0 -6
- package/esm2020/lib/types/sort-prop-dir.type.mjs +0 -2
- package/esm2020/lib/types/sort.type.mjs +0 -6
- package/esm2020/lib/types/table-column.type.mjs +0 -2
- package/esm2020/lib/utils/camel-case.mjs +0 -28
- package/esm2020/lib/utils/column-helper.mjs +0 -95
- package/esm2020/lib/utils/column-prop-getters.mjs +0 -96
- package/esm2020/lib/utils/column.mjs +0 -69
- package/esm2020/lib/utils/elm-from-point.mjs +0 -38
- package/esm2020/lib/utils/id.mjs +0 -8
- package/esm2020/lib/utils/keys.mjs +0 -10
- package/esm2020/lib/utils/math.mjs +0 -146
- package/esm2020/lib/utils/prefixes.mjs +0 -38
- package/esm2020/lib/utils/row-height-cache.mjs +0 -138
- package/esm2020/lib/utils/selection.mjs +0 -40
- package/esm2020/lib/utils/sort.mjs +0 -127
- package/esm2020/lib/utils/throttle.mjs +0 -60
- package/esm2020/lib/utils/translate.mjs +0 -25
- package/esm2020/lib/utils/tree.mjs +0 -103
- package/esm2020/public-api.mjs +0 -64
- package/esm2020/swimlane-ngx-datatable.mjs +0 -5
- package/fesm2015/swimlane-ngx-datatable.mjs +0 -5979
- package/fesm2015/swimlane-ngx-datatable.mjs.map +0 -1
- package/fesm2020/swimlane-ngx-datatable.mjs.map +0 -1
- package/lib/events.d.ts +0 -3
- package/lib/services/dimensions-helper.service.d.ts +0 -10
- package/lib/types/click.type.d.ts +0 -4
- package/lib/types/column-mode.type.d.ts +0 -5
- package/lib/types/contextmenu.type.d.ts +0 -4
- package/lib/types/selection.type.d.ts +0 -7
- package/lib/types/sort-direction.type.d.ts +0 -4
- package/lib/types/sort-prop-dir.type.d.ts +0 -6
- package/lib/types/sort.type.d.ts +0 -4
- package/lib/utils/elm-from-point.d.ts +0 -8
- package/lib/utils/prefixes.d.ts +0 -1
- package/lib/utils/translate.d.ts +0 -1
- /package/{swimlane-ngx-datatable.d.ts → index.d.ts} +0 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { TableColumn, TableColumnProp } from './table-column.type';
|
|
2
|
+
import { BehaviorSubject, Observable } from 'rxjs';
|
|
3
|
+
export interface SortPropDir {
|
|
4
|
+
dir: SortDirection | 'desc' | 'asc';
|
|
5
|
+
prop: TableColumnProp;
|
|
6
|
+
}
|
|
7
|
+
export declare enum SortDirection {
|
|
8
|
+
asc = "asc",
|
|
9
|
+
desc = "desc"
|
|
10
|
+
}
|
|
11
|
+
export interface InnerSortEvent {
|
|
12
|
+
column: TableColumn;
|
|
13
|
+
prevValue: SortDirection;
|
|
14
|
+
newValue: SortDirection;
|
|
15
|
+
}
|
|
16
|
+
export interface SortEvent extends InnerSortEvent {
|
|
17
|
+
sorts: SortPropDir[];
|
|
18
|
+
}
|
|
19
|
+
export declare enum SortType {
|
|
20
|
+
single = "single",
|
|
21
|
+
multi = "multi"
|
|
22
|
+
}
|
|
23
|
+
export declare enum ColumnMode {
|
|
24
|
+
standard = "standard",
|
|
25
|
+
flex = "flex",
|
|
26
|
+
force = "force"
|
|
27
|
+
}
|
|
28
|
+
export type TreeStatus = 'collapsed' | 'expanded' | 'loading' | 'disabled';
|
|
29
|
+
export interface ActivateEvent<TRow> {
|
|
30
|
+
type: 'checkbox' | 'click' | 'dblclick' | 'keydown' | 'mouseenter';
|
|
31
|
+
event: MouseEvent | KeyboardEvent;
|
|
32
|
+
row: TRow;
|
|
33
|
+
group?: TRow[];
|
|
34
|
+
rowHeight?: number;
|
|
35
|
+
column?: TableColumn;
|
|
36
|
+
value?: any;
|
|
37
|
+
cellElement?: HTMLElement;
|
|
38
|
+
treeStatus?: TreeStatus;
|
|
39
|
+
cellIndex?: number;
|
|
40
|
+
rowElement?: HTMLElement;
|
|
41
|
+
}
|
|
42
|
+
export interface HeaderCellContext {
|
|
43
|
+
column: TableColumn;
|
|
44
|
+
sortDir: SortDirection | 'asc' | 'desc';
|
|
45
|
+
sortFn: () => void;
|
|
46
|
+
allRowsSelected: boolean;
|
|
47
|
+
selectFn: () => void;
|
|
48
|
+
}
|
|
49
|
+
export interface GroupContext<TRow = any> {
|
|
50
|
+
group: Group<TRow>;
|
|
51
|
+
expanded: boolean;
|
|
52
|
+
rowIndex: number;
|
|
53
|
+
}
|
|
54
|
+
export interface CellContext<TRow = any> {
|
|
55
|
+
onCheckboxChangeFn: (event: Event) => void;
|
|
56
|
+
activateFn: (event: ActivateEvent<TRow>) => void;
|
|
57
|
+
row: TRow;
|
|
58
|
+
group: TRow[];
|
|
59
|
+
value: any;
|
|
60
|
+
column: TableColumn;
|
|
61
|
+
rowHeight: number;
|
|
62
|
+
isSelected: boolean;
|
|
63
|
+
rowIndex: number;
|
|
64
|
+
treeStatus: TreeStatus;
|
|
65
|
+
disable$: BehaviorSubject<boolean>;
|
|
66
|
+
onTreeAction: () => void;
|
|
67
|
+
expanded?: boolean;
|
|
68
|
+
}
|
|
69
|
+
export interface FooterContext {
|
|
70
|
+
rowCount: number;
|
|
71
|
+
pageSize: number;
|
|
72
|
+
selectedCount: number;
|
|
73
|
+
curPage: number;
|
|
74
|
+
offset: number;
|
|
75
|
+
}
|
|
76
|
+
export declare enum ContextmenuType {
|
|
77
|
+
header = "header",
|
|
78
|
+
body = "body"
|
|
79
|
+
}
|
|
80
|
+
/** A Group row */
|
|
81
|
+
export interface Group<TRow> {
|
|
82
|
+
/** The value by which to rows are grouped. */
|
|
83
|
+
key: TRow[keyof TRow];
|
|
84
|
+
/** All rows that are part of the group. */
|
|
85
|
+
value: TRow[];
|
|
86
|
+
}
|
|
87
|
+
/** Type for either a row or a group */
|
|
88
|
+
export type RowOrGroup<TRow> = TRow | Group<TRow>;
|
|
89
|
+
export interface RowDetailContext<TRow = any> {
|
|
90
|
+
row: TRow;
|
|
91
|
+
expanded: boolean;
|
|
92
|
+
rowIndex: number;
|
|
93
|
+
disableRow$?: Observable<boolean>;
|
|
94
|
+
}
|
|
95
|
+
export interface ReorderEvent {
|
|
96
|
+
column: TableColumn;
|
|
97
|
+
prevValue: number;
|
|
98
|
+
newValue: number;
|
|
99
|
+
}
|
|
100
|
+
export interface PageEvent {
|
|
101
|
+
count: number;
|
|
102
|
+
pageSize: number;
|
|
103
|
+
limit: number;
|
|
104
|
+
offset: number;
|
|
105
|
+
}
|
|
106
|
+
export interface PagerPageEvent {
|
|
107
|
+
page: number;
|
|
108
|
+
}
|
|
109
|
+
export interface ColumnResizeEvent {
|
|
110
|
+
column: TableColumn;
|
|
111
|
+
prevValue: number;
|
|
112
|
+
newValue: number;
|
|
113
|
+
}
|
|
114
|
+
export interface ScrollEvent {
|
|
115
|
+
offsetY: number;
|
|
116
|
+
offsetX: number;
|
|
117
|
+
}
|
|
118
|
+
export interface GroupToggleEvent<TRow> {
|
|
119
|
+
type: 'group';
|
|
120
|
+
value: Group<TRow>;
|
|
121
|
+
}
|
|
122
|
+
export interface AllGroupsToggleEvent {
|
|
123
|
+
type: 'all';
|
|
124
|
+
value: boolean;
|
|
125
|
+
}
|
|
126
|
+
export type GroupToggleEvents<TRow> = GroupToggleEvent<TRow> | AllGroupsToggleEvent;
|
|
127
|
+
export declare enum SelectionType {
|
|
128
|
+
single = "single",
|
|
129
|
+
multi = "multi",
|
|
130
|
+
multiClick = "multiClick",
|
|
131
|
+
cell = "cell",
|
|
132
|
+
checkbox = "checkbox"
|
|
133
|
+
}
|
|
134
|
+
export type DragEventType = 'drag' | 'dragend' | 'dragenter' | 'dragleave' | 'dragover' | 'dragstart' | 'drop';
|
|
135
|
+
export interface DragEventData {
|
|
136
|
+
event: DragEvent;
|
|
137
|
+
srcElement: HTMLElement;
|
|
138
|
+
targetElement?: HTMLElement;
|
|
139
|
+
eventType: DragEventType;
|
|
140
|
+
dragRow: any;
|
|
141
|
+
dropRow?: any;
|
|
142
|
+
}
|
|
@@ -1,49 +1,38 @@
|
|
|
1
|
-
import { PipeTransform } from '@angular/core';
|
|
1
|
+
import { PipeTransform, TemplateRef } from '@angular/core';
|
|
2
2
|
import { ValueGetter } from '../utils/column-prop-getters';
|
|
3
|
+
import { CellContext, HeaderCellContext } from './public.types';
|
|
3
4
|
/**
|
|
4
5
|
* Column property that indicates how to retrieve this column's
|
|
5
6
|
* value from a row.
|
|
6
7
|
* 'a.deep.value', 'normalprop', 0 (numeric)
|
|
7
8
|
*/
|
|
8
|
-
export
|
|
9
|
+
export type TableColumnProp = string | number;
|
|
9
10
|
/**
|
|
10
11
|
* Column Type
|
|
11
12
|
*/
|
|
12
|
-
export interface TableColumn {
|
|
13
|
+
export interface TableColumn<TRow = any> {
|
|
13
14
|
/**
|
|
14
15
|
* Internal unique id
|
|
15
|
-
*
|
|
16
|
-
* @memberOf TableColumn
|
|
17
16
|
*/
|
|
18
17
|
$$id?: string;
|
|
19
18
|
/**
|
|
20
19
|
* Internal for column width distributions
|
|
21
|
-
*
|
|
22
|
-
* @memberOf TableColumn
|
|
23
20
|
*/
|
|
24
21
|
$$oldWidth?: number;
|
|
25
22
|
/**
|
|
26
23
|
* Internal for setColumnDefaults
|
|
27
|
-
*
|
|
28
|
-
* @memberOf TableColumn
|
|
29
24
|
*/
|
|
30
25
|
$$valueGetter?: ValueGetter;
|
|
31
26
|
/**
|
|
32
27
|
* Determines if column is checkbox
|
|
33
|
-
*
|
|
34
|
-
* @memberOf TableColumn
|
|
35
28
|
*/
|
|
36
29
|
checkboxable?: boolean;
|
|
37
30
|
/**
|
|
38
31
|
* Determines if the column is frozen to the left
|
|
39
|
-
*
|
|
40
|
-
* @memberOf TableColumn
|
|
41
32
|
*/
|
|
42
33
|
frozenLeft?: boolean;
|
|
43
34
|
/**
|
|
44
35
|
* Determines if the column is frozen to the right
|
|
45
|
-
*
|
|
46
|
-
* @memberOf TableColumn
|
|
47
36
|
*/
|
|
48
37
|
frozenRight?: boolean;
|
|
49
38
|
/**
|
|
@@ -51,68 +40,52 @@ export interface TableColumn {
|
|
|
51
40
|
* API from http =//www.w3.org/TR/css3-flexbox/. Basically;
|
|
52
41
|
* take any available extra width and distribute it proportionally
|
|
53
42
|
* according to all columns' flexGrow values.
|
|
54
|
-
*
|
|
55
|
-
* @memberOf TableColumn
|
|
56
43
|
*/
|
|
57
44
|
flexGrow?: number;
|
|
58
45
|
/**
|
|
59
46
|
* Min width of the column
|
|
60
|
-
*
|
|
61
|
-
* @memberOf TableColumn
|
|
62
47
|
*/
|
|
63
48
|
minWidth?: number;
|
|
64
49
|
/**
|
|
65
50
|
* Max width of the column
|
|
66
|
-
*
|
|
67
|
-
* @memberOf TableColumn
|
|
68
51
|
*/
|
|
69
52
|
maxWidth?: number;
|
|
70
53
|
/**
|
|
71
54
|
* The default width of the column, in pixels
|
|
72
|
-
*
|
|
73
|
-
* @memberOf TableColumn
|
|
74
55
|
*/
|
|
75
56
|
width?: number;
|
|
76
57
|
/**
|
|
77
58
|
* Can the column be resized
|
|
78
|
-
*
|
|
79
|
-
* @memberOf TableColumn
|
|
80
59
|
*/
|
|
81
60
|
resizeable?: boolean;
|
|
82
61
|
/**
|
|
83
62
|
* Custom sort comparator
|
|
84
|
-
*
|
|
85
|
-
* @memberOf TableColumn
|
|
86
63
|
*/
|
|
87
64
|
comparator?: any;
|
|
88
65
|
/**
|
|
89
66
|
* Custom pipe transforms
|
|
90
|
-
*
|
|
91
|
-
* @memberOf TableColumn
|
|
92
67
|
*/
|
|
93
68
|
pipe?: PipeTransform;
|
|
94
69
|
/**
|
|
95
70
|
* Can the column be sorted
|
|
96
|
-
*
|
|
97
|
-
* @memberOf TableColumn
|
|
98
71
|
*/
|
|
99
72
|
sortable?: boolean;
|
|
100
73
|
/**
|
|
101
74
|
* Can the column be re-arranged by dragging
|
|
102
|
-
*
|
|
103
|
-
* @memberOf TableColumn
|
|
104
75
|
*/
|
|
105
76
|
draggable?: boolean;
|
|
77
|
+
/** @internal */
|
|
78
|
+
dragging?: boolean;
|
|
79
|
+
/** @internal */
|
|
80
|
+
isTarget?: boolean;
|
|
81
|
+
/** @internal */
|
|
82
|
+
targetMarkerContext?: any;
|
|
106
83
|
/**
|
|
107
84
|
* Whether the column can automatically resize to fill space in the table.
|
|
108
|
-
*
|
|
109
|
-
* @memberOf TableColumn
|
|
110
85
|
*/
|
|
111
86
|
canAutoResize?: boolean;
|
|
112
87
|
/**
|
|
113
88
|
* Column name or label
|
|
114
|
-
*
|
|
115
|
-
* @memberOf TableColumn
|
|
116
89
|
*/
|
|
117
90
|
name?: string;
|
|
118
91
|
/**
|
|
@@ -121,70 +94,70 @@ export interface TableColumn {
|
|
|
121
94
|
* `someField` or `some.field.nested`, 0 (numeric)
|
|
122
95
|
*
|
|
123
96
|
* If left blank, will use the name as camel case conversion
|
|
124
|
-
*
|
|
125
|
-
* @memberOf TableColumn
|
|
126
97
|
*/
|
|
127
98
|
prop?: TableColumnProp;
|
|
128
99
|
/**
|
|
129
|
-
*
|
|
100
|
+
* By default, the property is bound using normal data binding `<span>{{content}}</span>`.
|
|
101
|
+
* If this property is set to true, the property will be bound as `<span [innerHTML]="content" />`.
|
|
130
102
|
*
|
|
131
|
-
*
|
|
103
|
+
* **DANGER** If enabling this feature, make sure the source of the data is trusted. This can be a vector for HTML injection attacks.
|
|
132
104
|
*/
|
|
133
|
-
|
|
105
|
+
bindAsUnsafeHtml?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Cell template ref
|
|
108
|
+
*/
|
|
109
|
+
cellTemplate?: TemplateRef<CellContext<TRow>>;
|
|
110
|
+
/**
|
|
111
|
+
* Ghost Cell template ref
|
|
112
|
+
*/
|
|
113
|
+
ghostCellTemplate?: TemplateRef<any>;
|
|
134
114
|
/**
|
|
135
115
|
* Header template ref
|
|
136
|
-
*
|
|
137
|
-
* @memberOf TableColumn
|
|
138
116
|
*/
|
|
139
|
-
headerTemplate?:
|
|
117
|
+
headerTemplate?: TemplateRef<HeaderCellContext>;
|
|
140
118
|
/**
|
|
141
119
|
* Tree toggle template ref
|
|
142
|
-
*
|
|
143
|
-
* @memberOf TableColumn
|
|
144
120
|
*/
|
|
145
121
|
treeToggleTemplate?: any;
|
|
146
122
|
/**
|
|
147
123
|
* CSS Classes for the cell
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* @memberOf TableColumn
|
|
151
124
|
*/
|
|
152
|
-
cellClass?: string | ((data:
|
|
125
|
+
cellClass?: string | ((data: {
|
|
126
|
+
row: TRow;
|
|
127
|
+
group?: TRow[];
|
|
128
|
+
column: TableColumn<TRow>;
|
|
129
|
+
value: any;
|
|
130
|
+
rowHeight: number;
|
|
131
|
+
}) => string | Record<string, boolean>);
|
|
153
132
|
/**
|
|
154
133
|
* CSS classes for the header
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
* @memberOf TableColumn
|
|
158
134
|
*/
|
|
159
|
-
headerClass?: string | ((data:
|
|
135
|
+
headerClass?: string | ((data: {
|
|
136
|
+
column: TableColumn;
|
|
137
|
+
}) => string | Record<string, boolean>);
|
|
160
138
|
/**
|
|
161
139
|
* Header checkbox enabled
|
|
162
|
-
*
|
|
163
|
-
* @memberOf TableColumn
|
|
164
140
|
*/
|
|
165
141
|
headerCheckboxable?: boolean;
|
|
166
142
|
/**
|
|
167
143
|
* Is tree displayed on this column
|
|
168
|
-
*
|
|
169
|
-
* @memberOf TableColumn
|
|
170
144
|
*/
|
|
171
145
|
isTreeColumn?: boolean;
|
|
172
146
|
/**
|
|
173
147
|
* Width of the tree level indent
|
|
174
|
-
*
|
|
175
|
-
* @memberOf TableColumn
|
|
176
148
|
*/
|
|
177
149
|
treeLevelIndent?: number;
|
|
178
150
|
/**
|
|
179
151
|
* Summary function
|
|
180
|
-
*
|
|
181
|
-
* @memberOf TableColumn
|
|
182
152
|
*/
|
|
183
153
|
summaryFunc?: (cells: any[]) => any;
|
|
184
154
|
/**
|
|
185
155
|
* Summary cell template ref
|
|
186
|
-
*
|
|
187
|
-
* @memberOf TableColumn
|
|
188
156
|
*/
|
|
189
|
-
summaryTemplate?: any
|
|
157
|
+
summaryTemplate?: TemplateRef<any>;
|
|
158
|
+
}
|
|
159
|
+
export interface TableColumnGroup {
|
|
160
|
+
left: TableColumn[];
|
|
161
|
+
center: TableColumn[];
|
|
162
|
+
right: TableColumn[];
|
|
190
163
|
}
|
|
@@ -3,9 +3,9 @@ import { DataTableColumnDirective } from '../components/columns/column.directive
|
|
|
3
3
|
/**
|
|
4
4
|
* Sets the column defaults
|
|
5
5
|
*/
|
|
6
|
-
export declare function setColumnDefaults(columns: TableColumn[]): void;
|
|
6
|
+
export declare function setColumnDefaults(columns: TableColumn[], defaultColumnWidth?: number): void;
|
|
7
7
|
export declare function isNullOrUndefined<T>(value: T | null | undefined): value is null | undefined;
|
|
8
8
|
/**
|
|
9
9
|
* Translates templates definitions to objects
|
|
10
10
|
*/
|
|
11
|
-
export declare function translateTemplates(templates: DataTableColumnDirective[]):
|
|
11
|
+
export declare function translateTemplates<TRow>(templates: DataTableColumnDirective<TRow>[]): TableColumn[];
|
package/lib/utils/column.d.ts
CHANGED
|
@@ -1,26 +1,19 @@
|
|
|
1
|
+
import { TableColumn, TableColumnGroup } from '../types/table-column.type';
|
|
2
|
+
import { ColumnGroupWidth, PinnedColumns } from '../types/internal.types';
|
|
1
3
|
/**
|
|
2
4
|
* Returns the columns by pin.
|
|
3
5
|
*/
|
|
4
|
-
export declare function columnsByPin(cols:
|
|
5
|
-
left: any;
|
|
6
|
-
center: any;
|
|
7
|
-
right: any;
|
|
8
|
-
};
|
|
6
|
+
export declare function columnsByPin(cols: TableColumn[]): TableColumnGroup;
|
|
9
7
|
/**
|
|
10
8
|
* Returns the widths of all group sets of a column
|
|
11
9
|
*/
|
|
12
|
-
export declare function columnGroupWidths(groups:
|
|
13
|
-
left: number;
|
|
14
|
-
center: number;
|
|
15
|
-
right: number;
|
|
16
|
-
total: number;
|
|
17
|
-
};
|
|
10
|
+
export declare function columnGroupWidths(groups: TableColumnGroup, all: TableColumn[]): ColumnGroupWidth;
|
|
18
11
|
/**
|
|
19
12
|
* Calculates the total width of all columns and their groups
|
|
20
13
|
*/
|
|
21
|
-
export declare function columnTotalWidth(columns:
|
|
14
|
+
export declare function columnTotalWidth(columns: TableColumn[], prop?: string): number;
|
|
22
15
|
/**
|
|
23
16
|
* Calculates the total width of all columns and their groups
|
|
24
17
|
*/
|
|
25
|
-
export declare function columnsTotalWidth(columns:
|
|
26
|
-
export declare function columnsByPinArr(val:
|
|
18
|
+
export declare function columnsTotalWidth(columns: TableColumn[], prop?: keyof TableColumn): number;
|
|
19
|
+
export declare function columnsByPinArr(val: TableColumn[]): PinnedColumns[];
|
package/lib/utils/keys.d.ts
CHANGED
package/lib/utils/math.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { TableColumn } from '../types/table-column.type';
|
|
1
2
|
/**
|
|
2
3
|
* Calculates the Total Flex Grow
|
|
3
4
|
*/
|
|
4
|
-
export declare function getTotalFlexGrow(columns:
|
|
5
|
+
export declare function getTotalFlexGrow(columns: TableColumn[]): number;
|
|
5
6
|
/**
|
|
6
7
|
* Adjusts the column widths.
|
|
7
8
|
* Inspired by: https://github.com/facebook/fixed-data-table/blob/master/src/FixedDataTableWidthHelper.js
|
|
8
9
|
*/
|
|
9
|
-
export declare function adjustColumnWidths(allColumns:
|
|
10
|
+
export declare function adjustColumnWidths(allColumns: TableColumn[], expectedWidth: number): void;
|
|
10
11
|
/**
|
|
11
12
|
* Forces the width of the columns to
|
|
12
13
|
* distribute equally but overflowing when necessary
|
|
@@ -26,4 +27,4 @@ export declare function adjustColumnWidths(allColumns: any, expectedWidth: any):
|
|
|
26
27
|
* - If the grid starts off small but then becomes greater than the size ( + / - )
|
|
27
28
|
* the width should use the original width; not the newly proportioned widths.
|
|
28
29
|
*/
|
|
29
|
-
export declare function forceFillColumnWidths(allColumns:
|
|
30
|
+
export declare function forceFillColumnWidths(allColumns: TableColumn[], expectedWidth: number, startIdx: number, allowBleed: boolean, defaultColWidth?: number, verticalScrollWidth?: number): void;
|
package/lib/utils/selection.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function selectRows(selected:
|
|
2
|
-
export declare function selectRowsBetween(selected:
|
|
1
|
+
export declare function selectRows<TRow>(selected: TRow[], row: TRow, comparefn: any): TRow[];
|
|
2
|
+
export declare function selectRowsBetween<TRow>(selected: TRow[], rows: TRow[], index: number, prevIndex: number): TRow[];
|
package/lib/utils/sort.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { SortType } from '../types/
|
|
2
|
-
import {
|
|
3
|
-
import { SortPropDir } from '../types/sort-prop-dir.type';
|
|
1
|
+
import { Group, SortDirection, SortPropDir, SortType } from '../types/public.types';
|
|
2
|
+
import { TableColumn } from '../types/table-column.type';
|
|
4
3
|
/**
|
|
5
4
|
* Gets the next sort direction
|
|
6
5
|
*/
|
|
7
|
-
export declare function nextSortDir(sortType: SortType, current: SortDirection): SortDirection | undefined;
|
|
6
|
+
export declare function nextSortDir(sortType: SortType, current: SortDirection | 'desc' | 'asc'): SortDirection | undefined;
|
|
8
7
|
/**
|
|
9
8
|
* Adapted from fueld-ui on 6/216
|
|
10
9
|
* https://github.com/FuelInteractive/fuel-ui/tree/master/src/pipes/OrderBy
|
|
@@ -14,4 +13,5 @@ export declare function orderByComparator(a: any, b: any): number;
|
|
|
14
13
|
* creates a shallow copy of the `rows` input and returns the sorted copy. this function
|
|
15
14
|
* does not sort the `rows` argument in place
|
|
16
15
|
*/
|
|
17
|
-
export declare function sortRows(rows:
|
|
16
|
+
export declare function sortRows<TRow>(rows: TRow[], columns: TableColumn[], dirs: SortPropDir[]): TRow[];
|
|
17
|
+
export declare function sortGroupedRows<TRow>(groupedRows: Group<TRow>[], columns: TableColumn[], dirs: SortPropDir[], sortOnGroupHeader: SortPropDir): Group<TRow>[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import type { DatatableComponent } from '../components/datatable.component';
|
|
3
|
+
/**
|
|
4
|
+
* This token is created to break cycling import error which occurs when we import
|
|
5
|
+
* DatatableComponent in DataTableRowWrapperComponent.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DatatableComponentToken: InjectionToken<DatatableComponent<any>>;
|
package/lib/utils/tree.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TableColumnProp } from '../types/table-column.type';
|
|
2
|
-
export
|
|
2
|
+
export type OptionalValueGetter = (row: any) => any | undefined;
|
|
3
3
|
export declare function optionalGetterForProp(prop: TableColumnProp): OptionalValueGetter;
|
|
4
4
|
/**
|
|
5
5
|
* This functions rearrange items by their parents
|
|
@@ -37,4 +37,4 @@ export declare function optionalGetterForProp(prop: TableColumnProp): OptionalVa
|
|
|
37
37
|
* @param rows
|
|
38
38
|
*
|
|
39
39
|
*/
|
|
40
|
-
export declare function groupRowsByParents(rows:
|
|
40
|
+
export declare function groupRowsByParents<TRow>(rows: TRow[], from?: OptionalValueGetter, to?: OptionalValueGetter): TRow[];
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swimlane/ngx-datatable",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.0.0-alpha.1",
|
|
4
4
|
"description": "ngx-datatable is an Angular table grid component for presenting large and complex data.",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@angular/common": "
|
|
7
|
-
"@angular/core": "
|
|
8
|
-
"@angular/platform-browser": "
|
|
9
|
-
"rxjs": "
|
|
6
|
+
"@angular/common": "17.x || 18.x || 19.x",
|
|
7
|
+
"@angular/core": "17.x || 18.x || 19.x",
|
|
8
|
+
"@angular/platform-browser": "17.x || 18.x || 19.x",
|
|
9
|
+
"rxjs": "7.x"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"tslib": "^2.0.0"
|
|
@@ -29,23 +29,15 @@
|
|
|
29
29
|
"url": "https://github.com/swimlane/ngx-datatable/issues"
|
|
30
30
|
},
|
|
31
31
|
"homepage": "https://github.com/swimlane/ngx-datatable#readme",
|
|
32
|
-
"module": "
|
|
33
|
-
"
|
|
34
|
-
"esm2020": "esm2020/swimlane-ngx-datatable.mjs",
|
|
35
|
-
"fesm2020": "fesm2020/swimlane-ngx-datatable.mjs",
|
|
36
|
-
"fesm2015": "fesm2015/swimlane-ngx-datatable.mjs",
|
|
37
|
-
"typings": "swimlane-ngx-datatable.d.ts",
|
|
32
|
+
"module": "fesm2022/swimlane-ngx-datatable.mjs",
|
|
33
|
+
"typings": "index.d.ts",
|
|
38
34
|
"exports": {
|
|
39
35
|
"./package.json": {
|
|
40
36
|
"default": "./package.json"
|
|
41
37
|
},
|
|
42
38
|
".": {
|
|
43
|
-
"types": "./
|
|
44
|
-
"
|
|
45
|
-
"es2020": "./fesm2020/swimlane-ngx-datatable.mjs",
|
|
46
|
-
"es2015": "./fesm2015/swimlane-ngx-datatable.mjs",
|
|
47
|
-
"node": "./fesm2015/swimlane-ngx-datatable.mjs",
|
|
48
|
-
"default": "./fesm2020/swimlane-ngx-datatable.mjs"
|
|
39
|
+
"types": "./index.d.ts",
|
|
40
|
+
"default": "./fesm2022/swimlane-ngx-datatable.mjs"
|
|
49
41
|
}
|
|
50
42
|
},
|
|
51
43
|
"sideEffects": false
|
package/public-api.d.ts
CHANGED
|
@@ -19,37 +19,30 @@ export * from './lib/components/footer/footer-template.directive';
|
|
|
19
19
|
export * from './lib/components/columns/column.directive';
|
|
20
20
|
export * from './lib/components/columns/column-header.directive';
|
|
21
21
|
export * from './lib/components/columns/column-cell.directive';
|
|
22
|
+
export * from './lib/components/columns/column-ghost-cell.directive';
|
|
22
23
|
export * from './lib/components/columns/tree.directive';
|
|
23
24
|
export * from './lib/components/row-detail/row-detail.directive';
|
|
24
25
|
export * from './lib/components/row-detail/row-detail-template.directive';
|
|
26
|
+
export * from './lib/components/body/body-row-def.component';
|
|
25
27
|
export * from './lib/directives/draggable.directive';
|
|
26
28
|
export * from './lib/directives/long-press.directive';
|
|
27
29
|
export * from './lib/directives/orderable.directive';
|
|
28
30
|
export * from './lib/directives/resizeable.directive';
|
|
29
31
|
export * from './lib/directives/visibility.directive';
|
|
32
|
+
export * from './lib/directives/disable-row.directive';
|
|
30
33
|
export * from './lib/services/scrollbar-helper.service';
|
|
31
|
-
export * from './lib/services/dimensions-helper.service';
|
|
32
34
|
export * from './lib/services/column-changes.service';
|
|
33
|
-
export * from './lib/types/
|
|
34
|
-
export * from './lib/types/sort.type';
|
|
35
|
-
export * from './lib/types/sort-direction.type';
|
|
36
|
-
export * from './lib/types/selection.type';
|
|
37
|
-
export * from './lib/types/click.type';
|
|
35
|
+
export * from './lib/types/public.types';
|
|
38
36
|
export * from './lib/types/table-column.type';
|
|
39
|
-
export * from './lib/types/sort-prop-dir.type';
|
|
40
|
-
export * from './lib/types/contextmenu.type';
|
|
41
37
|
export * from './lib/utils/id';
|
|
42
38
|
export * from './lib/utils/column';
|
|
43
39
|
export * from './lib/utils/column-prop-getters';
|
|
44
40
|
export * from './lib/utils/camel-case';
|
|
45
41
|
export * from './lib/utils/keys';
|
|
46
42
|
export * from './lib/utils/math';
|
|
47
|
-
export * from './lib/utils/prefixes';
|
|
48
43
|
export * from './lib/utils/selection';
|
|
49
|
-
export * from './lib/utils/translate';
|
|
50
44
|
export * from './lib/utils/throttle';
|
|
51
45
|
export * from './lib/utils/sort';
|
|
52
46
|
export * from './lib/utils/row-height-cache';
|
|
53
47
|
export * from './lib/utils/column-helper';
|
|
54
|
-
export * from './lib/utils/elm-from-point';
|
|
55
48
|
export * from './lib/utils/tree';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
$datatable-ghost-cell-container-background: #fff !default;
|
|
2
|
+
$datatable-ghost-cell-strip-background: #dee2e5 !default;
|
|
3
|
+
$datatable-ghost-cell-strip-background-image: linear-gradient(
|
|
4
|
+
to right,
|
|
5
|
+
#dee2e5 0%,
|
|
6
|
+
#dee2e5 10%,
|
|
7
|
+
#f0f2f5,
|
|
8
|
+
transparent
|
|
9
|
+
) !default;
|
|
10
|
+
$datatable-ghost-cell-strip-radius: 4px !default;
|
|
11
|
+
$datatble-ghost-cell-animation-duration: 10s;
|
|
12
|
+
|
|
13
|
+
.ghost-cell-container {
|
|
14
|
+
background: $datatable-ghost-cell-container-background;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ghost-cell-strip {
|
|
18
|
+
background: $datatable-ghost-cell-strip-background;
|
|
19
|
+
background-image: $datatable-ghost-cell-strip-background-image;
|
|
20
|
+
border-radius: $datatable-ghost-cell-strip-radius;
|
|
21
|
+
animation-duration: $datatble-ghost-cell-animation-duration;
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
$disable-row-text-color: #83888e !default;
|
|
2
|
+
|
|
3
|
+
.ngx-datatable {
|
|
4
|
+
.row-disabled {
|
|
5
|
+
color: $disable-row-text-color;
|
|
6
|
+
.datatable-body-cell-label {
|
|
7
|
+
color: $disable-row-text-color;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
.datatable-row-wrapper {
|
|
11
|
+
.datatable-body-row {
|
|
12
|
+
&.row-disabled:hover {
|
|
13
|
+
background-color: inherit;
|
|
14
|
+
transition: none;
|
|
15
|
+
.datatable-row-group {
|
|
16
|
+
background-color: inherit;
|
|
17
|
+
transition: none;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|