Skip to content

Commit e093515

Browse files
author
Andrew Perlitch
committed
fixed wrongly named pagingScheme -> pagingStrategy, updated types
1 parent 51f2d34 commit e093515

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

angular-mesa.d.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ declare namespace angular.apMesa {
7979
}
8080

8181
interface ITableStorage {
82-
setItem: (key: string, value: any) => ng.IPromise<any> | any;
83-
getItem: (key: string) => ng.IPromise<any> | any;
82+
setItem: (key: string, value: string | ITableStorageState) => ng.IPromise<any> | any;
83+
getItem: (key: string) => ng.IPromise<string | ITableStorageState> | string | ITableStorageState;
8484
removeItem: (key: string) => ng.IPromise<any> | any;
8585
}
8686

@@ -111,6 +111,9 @@ declare namespace angular.apMesa {
111111
storageHash?: string;
112112
// Used as the key to store and retrieve items from storage, if it is specified.
113113
storageKey?: string;
114+
// If true, will use JSON.stringify to serialize the state of the table before passing to storage.setItem.
115+
// Also means that it will use JSON.parse to deserialize state in storage.getItem
116+
stringifyStorage?: boolean;
114117
// Array of objects defining an initial sort order. Each object must have id and dir, can be "+" for ascending, "-" for descending.
115118
initialSorts?: IInitialSort[];
116119
// String to show when data is loading
@@ -146,7 +149,7 @@ declare namespace angular.apMesa {
146149
// undefined A template reference to be used for the expandable row feature. See Expandable Rows below.
147150
expandableTemplateUrl?: string;
148151
expandableTemplate?: string;
149-
// SCROLL
152+
// SCROLL
150153
pagingStrategy?: PAGING_STRATEGY;
151154
rowsPerPage?: number;
152155
rowsPerPageChoices?: number[];
@@ -182,4 +185,14 @@ declare namespace angular.apMesa {
182185
column: ITableColumn;
183186
options: ITableOptions;
184187
}
188+
interface ITableStorageState {
189+
sortOrder: IInitialSort[];
190+
searchTerms: { [columnId: string]: string };
191+
enabledColumns: string[];
192+
options: {
193+
rowLimit: number;
194+
pagingStrategy: PAGING_STRATEGY;
195+
storageHash?: string;
196+
};
197+
}
185198
}

dist/ap-mesa.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ angular.module('apMesa.controllers.ApMesaController', [
366366
state.options = {};
367367
[
368368
'rowLimit',
369-
'pagingScheme',
369+
'pagingStrategy',
370370
'storageHash'
371371
].forEach(function (prop) {
372372
state.options[prop] = $scope.options[prop];
@@ -415,7 +415,7 @@ angular.module('apMesa.controllers.ApMesaController', [
415415
// load options
416416
[
417417
'rowLimit',
418-
'pagingScheme',
418+
'pagingStrategy',
419419
'storageHash'
420420
].forEach(function (prop) {
421421
$scope.options[prop] = state.options[prop];

dist/ap-mesa.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controllers/ApMesaController.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ angular.module('apMesa.controllers.ApMesaController', [
382382

383383
// save non-transient options
384384
state.options = {};
385-
['rowLimit', 'pagingScheme', 'storageHash'].forEach(function(prop){
385+
['rowLimit', 'pagingStrategy', 'storageHash'].forEach(function(prop){
386386
state.options[prop] = $scope.options[prop];
387387
});
388388

@@ -437,7 +437,7 @@ angular.module('apMesa.controllers.ApMesaController', [
437437
$scope.enabledColumns = state.enabledColumns;
438438

439439
// load options
440-
['rowLimit', 'pagingScheme', 'storageHash'].forEach(function(prop) {
440+
['rowLimit', 'pagingStrategy', 'storageHash'].forEach(function(prop) {
441441
$scope.options[prop] = state.options[prop];
442442
});
443443

0 commit comments

Comments
 (0)