-
-
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(perf): huge filtering speed improvements
- Loading branch information
1 parent
258da22
commit a101ed1
Showing
13 changed files
with
337 additions
and
169 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
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
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
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,5 +1,5 @@ | ||
import { ColumnFilter } from './columnFilter.interface'; | ||
import { SearchColumnFilter } from './searchColumnFilter.interface'; | ||
|
||
export interface ColumnFilters { | ||
[key: string]: ColumnFilter; | ||
[key: string]: SearchColumnFilter; | ||
} |
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,5 @@ | ||
import { SearchTerm } from '../enums/searchTerm.type'; | ||
import { FilterConditionOption } from './filterConditionOption.interface'; | ||
|
||
|
||
export type FilterCondition = (options: FilterConditionOption) => boolean; | ||
export type FilterCondition = (options: FilterConditionOption, parsedSearchTerms?: SearchTerm | SearchTerm[]) => boolean; |
21 changes: 20 additions & 1 deletion
21
packages/common/src/interfaces/filterConditionOption.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 |
---|---|---|
@@ -1,11 +1,30 @@ | ||
import { FieldType, OperatorString, SearchTerm } from '../enums/index'; | ||
|
||
export interface FilterConditionOption { | ||
/** optional object data key */ | ||
dataKey?: string; | ||
|
||
/** filter operator */ | ||
operator: OperatorString; | ||
|
||
/** cell value */ | ||
cellValue: any; | ||
cellValueLastChar?: string; | ||
|
||
/** last character of the cell value, which is helpful to know if we are dealing with "*" that would be mean startsWith */ | ||
searchInputLastChar?: string; | ||
|
||
/** column field type */ | ||
fieldType: typeof FieldType[keyof typeof FieldType]; | ||
|
||
/** filter search field type */ | ||
filterSearchType?: typeof FieldType[keyof typeof FieldType]; | ||
|
||
/** | ||
* Parsed Search Terms is similar to SearchTerms but is already parsed in the correct format, | ||
* for example on a date field the searchTerms might be in string format but their respective parsedSearchTerms will be of type Date | ||
*/ | ||
parsedSearchTerms?: SearchTerm[] | undefined; | ||
|
||
/** Search Terms provided by the user */ | ||
searchTerms?: SearchTerm[] | undefined; | ||
} |
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
Oops, something went wrong.