-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(grid): Grid State and Grid Presets feature * fix(grid): avoid errors by making sure the dataview exist * fix(events): avoid subscribe to run even after dispose by re-creating it * fix(state): Grid State output should have properties of it's own
- Loading branch information
1 parent
72d8d6b
commit 78c32e5
Showing
41 changed files
with
1,246 additions
and
423 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
67 changes: 61 additions & 6 deletions
67
aurelia-slickgrid/src/aurelia-slickgrid/models/backendService.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,17 +1,72 @@ | ||
import { BackendServiceOption } from './backendServiceOption.interface'; | ||
import { FilterChangedArgs } from './filterChangedArgs.interface'; | ||
import { Pagination } from './pagination.interface'; | ||
import { PaginationChangedArgs } from './paginationChangedArgs.interface'; | ||
import { SortChangedArgs } from './sortChangedArgs.interface'; | ||
import { EventAggregator, Subscription } from 'aurelia-event-aggregator'; | ||
import { | ||
BackendServiceOption, | ||
Column, | ||
ColumnFilters, | ||
CurrentFilter, | ||
CurrentPagination, | ||
CurrentSorter, | ||
FilterChangedArgs, | ||
GridOption, | ||
Pagination, | ||
PaginationChangedArgs, | ||
SortChangedArgs, | ||
SortChanged | ||
} from './../models/index'; | ||
|
||
export interface BackendService { | ||
/** Backend Service options */ | ||
options?: BackendServiceOption; | ||
|
||
/** Build and the return the backend service query string */ | ||
buildQuery: (serviceOptions?: BackendServiceOption) => string; | ||
initOptions: (serviceOptions?: BackendServiceOption, pagination?: Pagination) => void; | ||
|
||
/** initialize the backend service with certain options */ | ||
init?: (serviceOptions?: BackendServiceOption, pagination?: Pagination, grid?: any) => void; | ||
|
||
/** DEPRECATED, please use "init()" instead */ | ||
initOptions?: (serviceOptions?: BackendServiceOption, pagination?: Pagination, gridOptions?: GridOption, columnDefinitions?: Column[]) => void; | ||
|
||
/** Get the dataset name */ | ||
getDatasetName?: () => string; | ||
|
||
/** Get the Filters that are currently used by the grid */ | ||
getCurrentFilters?: () => ColumnFilters | CurrentFilter[]; | ||
|
||
/** Get the Pagination that is currently used by the grid */ | ||
getCurrentPagination?: () => CurrentPagination; | ||
|
||
/** Get the Sorters that are currently used by the grid */ | ||
getCurrentSorters?: () => ColumnFilters | CurrentFilter[]; | ||
|
||
/** Reset the pagination options */ | ||
resetPaginationOptions: () => void; | ||
|
||
/** Update the Filters options with a set of new options */ | ||
updateFilters?: (columnFilters: ColumnFilters | CurrentFilter[], isUpdatedByPreset: boolean) => void; | ||
|
||
/** Update the Pagination component with it's new page number and size */ | ||
updatePagination?: (newPage: number, pageSize: number) => void; | ||
|
||
/** Update the Sorters options with a set of new options */ | ||
updateSorters?: (sortColumns?: SortChanged[], presetSorters?: CurrentSorter[]) => void; | ||
|
||
/** Update the backend service options */ | ||
updateOptions: (serviceOptions?: BackendServiceOption) => void; | ||
|
||
// -- | ||
// Events / Methods | ||
// ----------------- | ||
|
||
/** Fired when the pagination needs to be forced refreshed (by a Preset call) */ | ||
onPaginationRefreshed?: EventAggregator; // EventEmitter<PaginationChangedArgs>; | ||
|
||
/** Execute when any of the filters changed */ | ||
onFilterChanged: (event: Event, args: FilterChangedArgs) => Promise<string>; | ||
|
||
/** Execute when the pagination changed */ | ||
onPaginationChanged: (event: Event | undefined, args: PaginationChangedArgs) => string; | ||
|
||
/** Execute when any of the sorters changed */ | ||
onSortChanged: (event: Event, args: SortChangedArgs) => string; | ||
} |
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
8 changes: 8 additions & 0 deletions
8
aurelia-slickgrid/src/aurelia-slickgrid/models/currentFilter.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,8 @@ | ||
import { OperatorString, OperatorType, SearchTerm } from './../models/index'; | ||
|
||
export interface CurrentFilter { | ||
columnId: string; | ||
operator?: OperatorType | OperatorString; | ||
searchTerm?: SearchTerm; | ||
searchTerms?: SearchTerm[]; | ||
} |
4 changes: 4 additions & 0 deletions
4
aurelia-slickgrid/src/aurelia-slickgrid/models/currentPagination.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,4 @@ | ||
export interface CurrentPagination { | ||
pageNumber: number; | ||
pageSize: number; | ||
} |
6 changes: 6 additions & 0 deletions
6
aurelia-slickgrid/src/aurelia-slickgrid/models/currentSorter.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,6 @@ | ||
import { SortDirection, SortDirectionString } from './../models/index'; | ||
|
||
export interface CurrentSorter { | ||
columnId: string; | ||
direction: SortDirection | SortDirectionString; | ||
} |
Oops, something went wrong.