-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(grouping): add missing Grouping interface properties
- Loading branch information
1 parent
57f6b8c
commit 7c83fd0
Showing
5 changed files
with
52 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,35 @@ | ||
import { Aggregator } from './aggregator.interface'; | ||
import { GroupingComparerItem } from './groupingComparerItem.interface'; | ||
import { GroupingFormatterItem } from './groupingFormatterItem.interface'; | ||
import { SortDirectionNumber } from '../enums'; | ||
|
||
type GroupingGetterFunction = (value: any) => string; | ||
|
||
export interface Grouping { | ||
getter?: string; | ||
comparer?: (a: any, b: any) => number; | ||
formatter?: (g: any) => string; | ||
/** Getter of the Column to be Grouped */ | ||
getter?: string | GroupingGetterFunction; | ||
|
||
/** Grouping Aggregators array */ | ||
aggregators?: Aggregator[]; | ||
|
||
/** Defaults to false, are the Aggregator Collapsed when grid is loaded */ | ||
aggregateCollapsed?: boolean; | ||
|
||
/** Defaults to false, is the Group Collapsed when grid is loaded */ | ||
collapsed?: boolean; | ||
|
||
/** Sort Comparer callback method */ | ||
comparer?: (a: GroupingComparerItem, b: GroupingComparerItem) => SortDirectionNumber; | ||
|
||
/** Defaults to false, do we want to display the row with Group Totals */ | ||
displayTotalsRow?: boolean; | ||
|
||
/** String Formatter of the Grouping Header */ | ||
formatter?: (g: GroupingFormatterItem) => string; | ||
|
||
/** Defaults to false, lazy load the Group Totals Calculation */ | ||
lazyTotalsCalculation?: boolean; | ||
|
||
/** Set some predefined Grouping values */ | ||
predefinedValues?: any[]; | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/common/src/interfaces/groupingComparerItem.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export interface GroupingComparerItem { | ||
/** Grouped Comparer Count */ | ||
count: number; | ||
|
||
/** Grouped Comparer Value */ | ||
value: any; | ||
} |
13 changes: 13 additions & 0 deletions
13
packages/common/src/interfaces/groupingFormatterItem.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export interface GroupingFormatterItem { | ||
/** Grouped Formatter Total Count */ | ||
count: number; | ||
|
||
/** Grouped Formatter Depth Level */ | ||
level: number; | ||
|
||
/** Grouping Formatter Key */ | ||
groupingKey: string; | ||
|
||
/** Grouped Formatter Value */ | ||
value: any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { Column } from './column.interface'; | ||
import { SortDirectionNumber } from '../enums/sortDirectionNumber.enum'; | ||
|
||
export type Sorter = (value1: any, value2: any, sortDirection: SortDirectionNumber, sortColumn?: Column) => number; | ||
export type Sorter = (value1: any, value2: any, sortDirection: SortDirectionNumber, sortColumn?: Column) => SortDirectionNumber; |