@datorama/core 21.3.1-rc.5 → 21.4.0-rc.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/bundle.scss +94 -2
- package/bundles/datorama-core.umd.js +314 -32
- package/bundles/datorama-core.umd.js.map +1 -1
- package/bundles/datorama-core.umd.min.js +58 -58
- package/bundles/datorama-core.umd.min.js.map +1 -1
- package/datorama-core.metadata.json +1 -1
- package/esm2015/lib/grid-v2/grid/grid-v2.component.js +5 -2
- package/esm2015/lib/grid-v2/grid/grid-v2.types.js +1 -1
- package/esm2015/lib/grid-v2/grid-column-header/grid-column-header.component.js +8 -7
- package/esm2015/lib/grid-v2/grid-controller/grid-controller.component.js +14 -1
- package/esm2015/lib/grid-v2/grid-filter/filter-validator.js +21 -3
- package/esm2015/lib/grid-v2/grid-filter/grid-filter.component.js +37 -7
- package/esm2015/lib/grid-v2/grid-filter/grid-filter.types.js +1 -1
- package/esm2015/lib/grid-v2/grid-pagination/grid-pagination.component.js +16 -3
- package/esm2015/lib/grid-v2/grid-store/grid.query.js +48 -4
- package/esm2015/lib/grid-v2/grid-store/grid.service.js +102 -6
- package/esm2015/lib/grid-v2/grid-store/grid.store.types.js +1 -1
- package/esm2015/lib/grid-v2/grid-store/public_api.js +2 -0
- package/esm2015/lib/grid-v2/grid-store/util.js +20 -1
- package/esm2015/lib/grid-v2/public_api.js +2 -2
- package/esm2015/lib/icon/icon.types.js +1 -1
- package/esm2015/lib/utils/array.js +10 -1
- package/esm5/lib/grid-v2/grid/grid-v2.component.js +9 -2
- package/esm5/lib/grid-v2/grid/grid-v2.types.js +1 -1
- package/esm5/lib/grid-v2/grid-column-header/grid-column-header.component.js +8 -11
- package/esm5/lib/grid-v2/grid-controller/grid-controller.component.js +14 -1
- package/esm5/lib/grid-v2/grid-filter/filter-validator.js +23 -4
- package/esm5/lib/grid-v2/grid-filter/grid-filter.component.js +43 -7
- package/esm5/lib/grid-v2/grid-filter/grid-filter.types.js +1 -1
- package/esm5/lib/grid-v2/grid-pagination/grid-pagination.component.js +16 -3
- package/esm5/lib/grid-v2/grid-store/grid.query.js +48 -4
- package/esm5/lib/grid-v2/grid-store/grid.service.js +139 -12
- package/esm5/lib/grid-v2/grid-store/grid.store.types.js +1 -1
- package/esm5/lib/grid-v2/grid-store/public_api.js +2 -0
- package/esm5/lib/grid-v2/grid-store/util.js +20 -1
- package/esm5/lib/grid-v2/public_api.js +2 -2
- package/esm5/lib/icon/icon.types.js +1 -1
- package/esm5/lib/utils/array.js +12 -1
- package/fesm2015/datorama-core.js +263 -23
- package/fesm2015/datorama-core.js.map +1 -1
- package/fesm5/datorama-core.js +313 -33
- package/fesm5/datorama-core.js.map +1 -1
- package/i18n/locale-en_US.json +2 -1
- package/lib/grid-v2/grid/grid-v2.component.d.ts +1 -0
- package/lib/grid-v2/grid/grid-v2.types.d.ts +2 -0
- package/lib/grid-v2/grid-column-header/grid-column-header.component.d.ts +0 -2
- package/lib/grid-v2/grid-controller/grid-controller.component.d.ts +6 -1
- package/lib/grid-v2/grid-filter/grid-filter.component.d.ts +6 -0
- package/lib/grid-v2/grid-filter/grid-filter.types.d.ts +9 -0
- package/lib/grid-v2/grid-pagination/grid-pagination.component.d.ts +4 -0
- package/lib/grid-v2/grid-store/grid.query.d.ts +8 -2
- package/lib/grid-v2/grid-store/grid.service.d.ts +13 -3
- package/lib/grid-v2/grid-store/grid.store.types.d.ts +4 -0
- package/lib/grid-v2/grid-store/public_api.d.ts +2 -0
- package/lib/grid-v2/grid-store/util.d.ts +9 -1
- package/lib/grid-v2/public_api.d.ts +1 -2
- package/lib/utils/array.d.ts +5 -0
- package/package.json +2 -2
package/i18n/locale-en_US.json
CHANGED
|
@@ -115,6 +115,7 @@
|
|
|
115
115
|
"try-to-refresh-or-contact": "Try to refresh or contact support",
|
|
116
116
|
"something-went-wrong": "Something went wrong",
|
|
117
117
|
"try-again-later": "Try again later",
|
|
118
|
-
"apply-filters": "Apply filters"
|
|
118
|
+
"apply-filters": "Apply filters",
|
|
119
|
+
"total": "Total"
|
|
119
120
|
}
|
|
120
121
|
}
|
|
@@ -87,6 +87,7 @@ export interface DatoGridOptions extends GridOptions {
|
|
|
87
87
|
enableAllPagesSelection?: boolean;
|
|
88
88
|
idColumnKey?: string;
|
|
89
89
|
enableBackground?: boolean;
|
|
90
|
+
showBottomControls?: boolean;
|
|
90
91
|
}
|
|
91
92
|
export declare type ContextMenuItem = string | MenuItemDef;
|
|
92
93
|
export interface ActionConverterParams {
|
|
@@ -103,6 +104,7 @@ export declare type DatoGridSortDirection = 'asc' | 'desc';
|
|
|
103
104
|
export declare type DatoGridSort = {
|
|
104
105
|
colId: string;
|
|
105
106
|
sort: DatoGridSortDirection;
|
|
107
|
+
pivotColIndex?: number;
|
|
106
108
|
};
|
|
107
109
|
export declare type DatoGridServerSortDirection = 'ASC' | 'DESC';
|
|
108
110
|
export declare type DatoGridServerSort = {
|
|
@@ -19,7 +19,6 @@ export declare class DatoGridColumnHeaderComponent implements OnDestroy, IHeader
|
|
|
19
19
|
headerName: string;
|
|
20
20
|
params: DatoColumnHeaderParams;
|
|
21
21
|
column: Column;
|
|
22
|
-
aggColumn: boolean;
|
|
23
22
|
customTemplates: {
|
|
24
23
|
customHeader?: TemplateRef<any>;
|
|
25
24
|
moreMenu?: TemplateRef<any>;
|
|
@@ -48,5 +47,4 @@ export declare class DatoGridColumnHeaderComponent implements OnDestroy, IHeader
|
|
|
48
47
|
openFilters(origin: any): void;
|
|
49
48
|
openMoreMenu(origin: any): void;
|
|
50
49
|
ngOnDestroy(): void;
|
|
51
|
-
private get groupField();
|
|
52
50
|
}
|
|
@@ -10,13 +10,14 @@ import { Observable } from 'rxjs';
|
|
|
10
10
|
import { AgGridNg2 } from 'ag-grid-angular';
|
|
11
11
|
import { GridQuery } from '../grid-store/grid.query';
|
|
12
12
|
import { GridService } from '../grid-store/grid.service';
|
|
13
|
-
import { DatoGridOptions } from '../grid/grid-v2.types';
|
|
13
|
+
import { DatoGridOptions, DatoGridSort } from '../grid/grid-v2.types';
|
|
14
14
|
import { IconRegistry } from '../../services/icon-registry';
|
|
15
15
|
import { DatoCustomHeaderTemplateComponent } from '../grid-custom-header/custom-header-template.component';
|
|
16
16
|
import { GridAction, RowAction } from '../grid-toolbar/grid-toolbar.types';
|
|
17
17
|
import { DatoTranslateService } from '../../services/translate.service';
|
|
18
18
|
import { GridStorageAPI } from '../grid-settings';
|
|
19
19
|
import { DatoHotkeys } from '../../hotkeys/hotkeys.service';
|
|
20
|
+
import { DatoGridExternalFilter } from '../grid-filter/grid-filter.types';
|
|
20
21
|
export declare class DatoGridControllerComponent implements OnDestroy, AfterContentInit {
|
|
21
22
|
gridService: GridService;
|
|
22
23
|
gridQuery: GridQuery;
|
|
@@ -48,6 +49,10 @@ export declare class DatoGridControllerComponent implements OnDestroy, AfterCont
|
|
|
48
49
|
ngAfterContentInit(): void;
|
|
49
50
|
_initializeGrid(agGrid: AgGridNg2, agGridEl: HTMLElement): void;
|
|
50
51
|
private normalizeOptions;
|
|
52
|
+
setGridRows<T>(data: T[]): void;
|
|
53
|
+
setGridFilters(filters: DatoGridExternalFilter[]): void;
|
|
54
|
+
onFilterChanged(): Observable<DatoGridExternalFilter[]>;
|
|
55
|
+
onSortChanged(): Observable<DatoGridSort>;
|
|
51
56
|
private getGridIcons;
|
|
52
57
|
private registerSettingsListeners;
|
|
53
58
|
private listenToColumnResize;
|
|
@@ -53,6 +53,7 @@ export declare class DatoGridFilterComponent implements OnDestroy {
|
|
|
53
53
|
private colField;
|
|
54
54
|
private excludedValues;
|
|
55
55
|
private byValueSubscription;
|
|
56
|
+
private pivotColumn;
|
|
56
57
|
constructor(host: ElementRef, popover: PopoverRef<DatoColumnMenuData>, fb: FormBuilder, translate: DatoTranslateService, cdr: ChangeDetectorRef);
|
|
57
58
|
get byValueControl(): AbstractControl;
|
|
58
59
|
get conditionsControls(): AbstractControl[];
|
|
@@ -65,6 +66,7 @@ export declare class DatoGridFilterComponent implements OnDestroy {
|
|
|
65
66
|
private get conditions();
|
|
66
67
|
private get colFilter();
|
|
67
68
|
private get colDef();
|
|
69
|
+
private get pivotKeys();
|
|
68
70
|
ngOnInit(): void;
|
|
69
71
|
closePopUp(): void;
|
|
70
72
|
applyFilters(): void;
|
|
@@ -119,5 +121,9 @@ export declare class DatoGridFilterComponent implements OnDestroy {
|
|
|
119
121
|
private patchAndReRegister;
|
|
120
122
|
private registerByValueListener;
|
|
121
123
|
private getNonExcludedValues;
|
|
124
|
+
/**
|
|
125
|
+
* Get pivot dimensions as defined in the parent group column header class.
|
|
126
|
+
*/
|
|
127
|
+
private getPivotFields;
|
|
122
128
|
}
|
|
123
129
|
export {};
|
|
@@ -55,17 +55,26 @@ export declare type DatoGridFilterCondition = {
|
|
|
55
55
|
value: StringOrNumber;
|
|
56
56
|
};
|
|
57
57
|
export declare type DatoGridFilter = {
|
|
58
|
+
colId?: string;
|
|
58
59
|
byValue?: {
|
|
59
60
|
condition: DatoFilterConditions.IN_LIST | DatoFilterConditions.NOT_IN_LIST;
|
|
60
61
|
values: StringOrNumber[];
|
|
61
62
|
};
|
|
62
63
|
conditional?: DatoGridConditionalFilter;
|
|
64
|
+
pivotKeys?: string[];
|
|
65
|
+
pivotFieldsMap?: HashMap<string>;
|
|
63
66
|
};
|
|
64
67
|
export declare type DatoGridConditionalFilter = {
|
|
65
68
|
type: DatoGridFilterTypes;
|
|
66
69
|
operator: OperatorTypes;
|
|
67
70
|
conditions: (DatoGridFilterCondition | DatoGridRangeFilterCondition)[];
|
|
68
71
|
};
|
|
72
|
+
export declare type DatoGridExternalFilter = {
|
|
73
|
+
colId: string;
|
|
74
|
+
field: string;
|
|
75
|
+
filter: DatoGridFilter;
|
|
76
|
+
pivotFieldsMap?: HashMap<string>;
|
|
77
|
+
};
|
|
69
78
|
export declare type DatoGridFiltersMap = HashMap<DatoGridFilter>;
|
|
70
79
|
export declare type ServerSidePaginationRangeCondition = {
|
|
71
80
|
condition: DatoFilterConditions.IN_RANGE;
|
|
@@ -36,6 +36,8 @@ export declare class DatoGridPaginationV2Component implements OnInit {
|
|
|
36
36
|
showFirstEllipsis: boolean;
|
|
37
37
|
showLastPage: boolean;
|
|
38
38
|
};
|
|
39
|
+
showBottomControls: boolean;
|
|
40
|
+
isExpanded: boolean;
|
|
39
41
|
private _pagesInView;
|
|
40
42
|
private pagesOnSides;
|
|
41
43
|
private pagesFitView;
|
|
@@ -87,6 +89,8 @@ export declare class DatoGridPaginationV2Component implements OnInit {
|
|
|
87
89
|
* @return {number}
|
|
88
90
|
*/
|
|
89
91
|
trackByPage(index: number, page: number): number;
|
|
92
|
+
toggleGroupsState(): void;
|
|
93
|
+
autoFitGrid(type: 'container' | 'content'): void;
|
|
90
94
|
ngOnDestroy(): void;
|
|
91
95
|
/**
|
|
92
96
|
* Sets the rows display string
|
|
@@ -6,8 +6,8 @@ import { Column, RowNode } from 'ag-grid-community';
|
|
|
6
6
|
import { DatoGridApi } from '../grid-controller/grid-controller.types';
|
|
7
7
|
import { AgGridNg2 } from 'ag-grid-angular';
|
|
8
8
|
import { BehaviorSubject, Observable, Subject } from 'rxjs';
|
|
9
|
-
import { DatoGridAlignment, DatoGridDataChangedEvent, DatoGridOptions, GridRowsSelectionData } from '../grid/grid-v2.types';
|
|
10
|
-
import { DatoGridFiltersMap } from '../grid-filter/grid-filter.types';
|
|
9
|
+
import { DatoGridAlignment, DatoGridDataChangedEvent, DatoGridOptions, DatoGridSort, GridRowsSelectionData } from '../grid/grid-v2.types';
|
|
10
|
+
import { DatoGridExternalFilter, DatoGridFiltersMap } from '../grid-filter/grid-filter.types';
|
|
11
11
|
import { HashMap } from '../../utils/types';
|
|
12
12
|
export declare class GridQuery extends Query<GridStoreState> implements OnDestroy {
|
|
13
13
|
protected store: GridStore;
|
|
@@ -29,6 +29,8 @@ export declare class GridQuery extends Query<GridStoreState> implements OnDestro
|
|
|
29
29
|
get gridAlignment(): DatoGridAlignment;
|
|
30
30
|
getColumnSizes(): HashMap<number>;
|
|
31
31
|
getCurrentGridSettings(): DatoGridSettings;
|
|
32
|
+
getSort(): DatoGridSort;
|
|
33
|
+
selectSort(): Observable<DatoGridSort>;
|
|
32
34
|
_setApi(api: DatoGridApi, gridRef: AgGridNg2): void;
|
|
33
35
|
/** Returns just the rows data */
|
|
34
36
|
getSelectedRows<T>(): T[];
|
|
@@ -39,6 +41,8 @@ export declare class GridQuery extends Query<GridStoreState> implements OnDestro
|
|
|
39
41
|
getSelectedRowNodes(onlyFirstRow: true): RowNode | undefined;
|
|
40
42
|
getSelectedRowNodes(onlyFirstRow: false): RowNode[];
|
|
41
43
|
getFilter(): DatoGridFiltersMap;
|
|
44
|
+
selectFilter(): Observable<DatoGridFiltersMap>;
|
|
45
|
+
filterChanged(): Observable<DatoGridExternalFilter[]>;
|
|
42
46
|
getSearchTerm(): string;
|
|
43
47
|
selectSearchTerm(): Observable<string>;
|
|
44
48
|
waitForGrid(): Observable<boolean>;
|
|
@@ -50,6 +54,8 @@ export declare class GridQuery extends Query<GridStoreState> implements OnDestro
|
|
|
50
54
|
getCurrentPageRows(): RowNode[];
|
|
51
55
|
getAllColumns(): Column[];
|
|
52
56
|
getAllDisplayedColumns(): Column[];
|
|
57
|
+
getAllPivotColumns(): Column[];
|
|
53
58
|
selectIsSelectAllRowsEnabled(): Observable<boolean>;
|
|
59
|
+
getSecondaryColumn(colId: string): Column;
|
|
54
60
|
private filterCheckboxSelectionColumn;
|
|
55
61
|
}
|
|
@@ -3,7 +3,7 @@ import { DatoGridApi } from '../grid-controller/grid-controller.types';
|
|
|
3
3
|
import { Column, RowNode, RowNodeTransaction } from 'ag-grid-community';
|
|
4
4
|
import { GridQuery } from './grid.query';
|
|
5
5
|
import { DatoTranslateService } from '../../services/translate.service';
|
|
6
|
-
import { DatoGridFilter, ServerSidePaginationFilter } from '../grid-filter/grid-filter.types';
|
|
6
|
+
import { DatoGridExternalFilter, DatoGridFilter, ServerSidePaginationFilter } from '../grid-filter/grid-filter.types';
|
|
7
7
|
import { AgGridNg2 } from 'ag-grid-angular';
|
|
8
8
|
import { IconRegistry, SvgRegistry } from '../../services/icon-registry';
|
|
9
9
|
import { DatoGridSettings, NormalizeOptionsParams, ServerSidePaginationConfig } from './grid.store.types';
|
|
@@ -21,6 +21,8 @@ export declare class GridService implements OnDestroy {
|
|
|
21
21
|
private storageAPI;
|
|
22
22
|
private logger;
|
|
23
23
|
api: DatoGridApi;
|
|
24
|
+
treeConfig: DatoGridTreeConfig;
|
|
25
|
+
isPivotMode: boolean;
|
|
24
26
|
/** @internal - used for server side by value filter */
|
|
25
27
|
_originalGetRows: (params: DatoGridGetRowsParams) => void;
|
|
26
28
|
private initialSettings;
|
|
@@ -30,7 +32,6 @@ export declare class GridService implements OnDestroy {
|
|
|
30
32
|
private isTreeData;
|
|
31
33
|
private pageNumberToReturnAfterRefresh;
|
|
32
34
|
private lastTotalRows;
|
|
33
|
-
treeConfig: DatoGridTreeConfig;
|
|
34
35
|
private readonly CHECKBOX_SELECTION_COL_ID;
|
|
35
36
|
set treeData(isTreeData: boolean);
|
|
36
37
|
get treeData(): boolean;
|
|
@@ -79,7 +80,9 @@ export declare class GridService implements OnDestroy {
|
|
|
79
80
|
};
|
|
80
81
|
clearAllFilters(): void;
|
|
81
82
|
clearColumnFilter(columnField: string): void;
|
|
82
|
-
setColumnFilter(column: Column, filter: DatoGridFilter): void;
|
|
83
|
+
setColumnFilter(column: Column, filter: DatoGridFilter, notifyGrid?: boolean): void;
|
|
84
|
+
setGridFilters(filters: DatoGridExternalFilter[]): void;
|
|
85
|
+
private updateFilter;
|
|
83
86
|
setSearchTerm(searchTerm: string): void;
|
|
84
87
|
setServerSidePagination(config: Partial<ServerSidePaginationConfig>): void;
|
|
85
88
|
setLoading(show: boolean): void;
|
|
@@ -116,4 +119,11 @@ export declare class GridService implements OnDestroy {
|
|
|
116
119
|
private getEditableClassArray;
|
|
117
120
|
selectAllCurrentPageRows(isSelected?: boolean, considerExcluded?: boolean): void;
|
|
118
121
|
deselectAllRows(): void;
|
|
122
|
+
/**
|
|
123
|
+
* When pivoting,
|
|
124
|
+
* we add the field name to the column header class in order to access it through the auto generated pivot column.
|
|
125
|
+
* @private
|
|
126
|
+
*/
|
|
127
|
+
private initPivotSecondaryColsProcess;
|
|
128
|
+
private setPivotModeRows;
|
|
119
129
|
}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
import { Column } from 'ag-grid-community';
|
|
1
|
+
import { ColDef, Column } from 'ag-grid-community';
|
|
2
2
|
import { HashMap } from '../../utils/types';
|
|
3
|
+
import { PivotColumnData } from './grid.store.types';
|
|
3
4
|
export declare function getColumnsSizes(columns: Column[], original?: boolean): HashMap<number>;
|
|
5
|
+
/**
|
|
6
|
+
* Take pivoted value field if pivot column,
|
|
7
|
+
* or field of the colDef,
|
|
8
|
+
* or group field form showRowGroup if its agg column
|
|
9
|
+
*/
|
|
10
|
+
export declare function getColField(colDef: ColDef): string;
|
|
11
|
+
export declare function tryParsePivotValue(str: string): PivotColumnData | undefined;
|
|
@@ -3,7 +3,6 @@ export * from './grid-on-hover/grid-on-hover.component';
|
|
|
3
3
|
export * from './grid-loader/grid-v2-loader.component';
|
|
4
4
|
export * from './grid-columns-display-menu/grid-columns-display-menu.component';
|
|
5
5
|
export * from './grid-groups-menu/grid-groups-menu.component';
|
|
6
|
-
export * from './grid/public_api';
|
|
7
6
|
export * from './grid-controller/public_api';
|
|
8
7
|
export * from './grid-column-header/public_api';
|
|
9
8
|
export * from './grid-column-header-more-menu/public_api';
|
|
@@ -14,7 +13,7 @@ export * from './grid-header/public_api';
|
|
|
14
13
|
export * from './grid-pagination/public_api';
|
|
15
14
|
export * from './grid-toolbar/public_api';
|
|
16
15
|
export * from './grid-settings';
|
|
17
|
-
export * from './grid-store/
|
|
16
|
+
export * from './grid-store/public_api';
|
|
18
17
|
export * from './grid-no-data-overlay/public_api';
|
|
19
18
|
export * from './grid-v2.module';
|
|
20
19
|
export * from './grid-column-cell-components/public_api';
|
package/lib/utils/array.d.ts
CHANGED
|
@@ -59,3 +59,8 @@ export declare function uniqBy(array: any, iterator: any): any;
|
|
|
59
59
|
*/
|
|
60
60
|
export declare function drop<T>(array: T[], n?: number): T[];
|
|
61
61
|
export declare function a<T>(array: T[], n?: number): T[];
|
|
62
|
+
/**
|
|
63
|
+
* Compares 2 array and return whether their inner values are the same,
|
|
64
|
+
* without considering their order
|
|
65
|
+
*/
|
|
66
|
+
export declare function isArrayValuesEqual(arrA?: any[], arrB?: any[]): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datorama/core",
|
|
3
|
-
"version": "21.
|
|
3
|
+
"version": "21.4.0-rc.11",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "8.2.14",
|
|
6
6
|
"@angular/core": "8.2.14",
|
|
@@ -61,4 +61,4 @@
|
|
|
61
61
|
"typings": "datorama-core.d.ts",
|
|
62
62
|
"metadata": "datorama-core.metadata.json",
|
|
63
63
|
"sideEffects": false
|
|
64
|
-
}
|
|
64
|
+
}
|