@searchspring/snap-store-mobx 0.35.0 → 0.36.0
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/dist/cjs/Autocomplete/AutocompleteStore.js +1 -1
- package/dist/cjs/Finder/FinderStore.js +1 -1
- package/dist/cjs/Search/SearchStore.js +1 -1
- package/dist/cjs/Search/Stores/SearchPaginationStore.d.ts +2 -2
- package/dist/cjs/Search/Stores/SearchPaginationStore.d.ts.map +1 -1
- package/dist/cjs/Search/Stores/SearchPaginationStore.js +3 -3
- package/dist/esm/Autocomplete/AutocompleteStore.js +1 -1
- package/dist/esm/Finder/FinderStore.js +1 -1
- package/dist/esm/Search/SearchStore.js +1 -1
- package/dist/esm/Search/Stores/SearchPaginationStore.d.ts +2 -2
- package/dist/esm/Search/Stores/SearchPaginationStore.d.ts.map +1 -1
- package/dist/esm/Search/Stores/SearchPaginationStore.js +2 -3
- package/package.json +5 -5
|
@@ -115,7 +115,7 @@ var AutocompleteStore = /** @class */ (function (_super) {
|
|
|
115
115
|
// OR if any terms are active, also reset to ensure only a single term or trending term is active
|
|
116
116
|
this.resetTrending();
|
|
117
117
|
}
|
|
118
|
-
this.pagination = new Stores_1.SearchPaginationStore(this.config, this.services, data.pagination);
|
|
118
|
+
this.pagination = new Stores_1.SearchPaginationStore(this.config, this.services, data.pagination, this.meta);
|
|
119
119
|
this.sorting = new Stores_1.SearchSortingStore(this.services, data.sorting || [], data.search || {}, this.meta);
|
|
120
120
|
};
|
|
121
121
|
return AutocompleteStore;
|
|
@@ -92,7 +92,7 @@ var FinderStore = /** @class */ (function (_super) {
|
|
|
92
92
|
this.error = undefined;
|
|
93
93
|
this.loaded = !!data.pagination;
|
|
94
94
|
this.meta = data.meta;
|
|
95
|
-
this.pagination = new Stores_1.SearchPaginationStore(this.config, this.services, data.pagination);
|
|
95
|
+
this.pagination = new Stores_1.SearchPaginationStore(this.config, this.services, data.pagination, this.meta);
|
|
96
96
|
this.selections = new Stores_2.FinderSelectionStore(this.config, this.services, {
|
|
97
97
|
state: this.state,
|
|
98
98
|
facets: data.facets || [],
|
|
@@ -69,7 +69,7 @@ var SearchStore = /** @class */ (function (_super) {
|
|
|
69
69
|
this.facets = new Stores_1.SearchFacetStore(this.config, this.services, this.storage, data.facets, (data === null || data === void 0 ? void 0 : data.pagination) || {}, this.meta, (data === null || data === void 0 ? void 0 : data.merchandising) || {});
|
|
70
70
|
this.filters = new Stores_1.SearchFilterStore(this.services, data.filters, this.meta);
|
|
71
71
|
this.results = new Stores_1.SearchResultStore(this.config, this.services, (data === null || data === void 0 ? void 0 : data.results) || [], data.pagination, data.merchandising);
|
|
72
|
-
this.pagination = new Stores_1.SearchPaginationStore(this.config, this.services, data.pagination);
|
|
72
|
+
this.pagination = new Stores_1.SearchPaginationStore(this.config, this.services, data.pagination, this.meta);
|
|
73
73
|
this.sorting = new Stores_1.SearchSortingStore(this.services, (data === null || data === void 0 ? void 0 : data.sorting) || [], (data === null || data === void 0 ? void 0 : data.search) || {}, this.meta);
|
|
74
74
|
};
|
|
75
75
|
return SearchStore;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SearchStoreConfig, StoreServices } from '../../types';
|
|
2
|
-
import type { SearchResponseModelPagination } from '@searchspring/snapi-types';
|
|
2
|
+
import type { SearchResponseModelPagination, MetaResponseModel } from '@searchspring/snapi-types';
|
|
3
3
|
import type { UrlManager } from '@searchspring/snap-url-manager';
|
|
4
4
|
export declare class SearchPaginationStore {
|
|
5
5
|
services: StoreServices;
|
|
@@ -13,7 +13,7 @@ export declare class SearchPaginationStore {
|
|
|
13
13
|
totalResults: number;
|
|
14
14
|
totalPages: number;
|
|
15
15
|
controllerConfig: SearchStoreConfig;
|
|
16
|
-
constructor(config: SearchStoreConfig, services: StoreServices, paginationData
|
|
16
|
+
constructor(config: SearchStoreConfig, services: StoreServices, paginationData: SearchResponseModelPagination | undefined, meta: MetaResponseModel);
|
|
17
17
|
get begin(): number;
|
|
18
18
|
get end(): number;
|
|
19
19
|
get multiplePages(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchPaginationStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchPaginationStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchPaginationStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchPaginationStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,KAAK,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAClG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAEjE,qBAAa,qBAAqB;IAC1B,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE;QACvB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;IACG,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,iBAAiB,CAAC;gBAG1C,MAAM,EAAE,iBAAiB,EACzB,QAAQ,EAAE,aAAa,EACvB,cAAc,2CAKb,EACD,IAAI,EAAE,iBAAiB;IA4CxB,IAAW,KAAK,IAAI,MAAM,CAKzB;IAED,IAAW,GAAG,IAAI,MAAM,CAMvB;IAED,IAAW,aAAa,IAAI,OAAO,CAElC;IAED,IAAW,OAAO,IAAI,IAAI,CAKzB;IAED,IAAW,KAAK,IAAI,IAAI,CAKvB;IAED,IAAW,IAAI,IAAI,IAAI,CAKtB;IAED,IAAW,IAAI,IAAI,IAAI,GAAG,SAAS,CAMlC;IAED,IAAW,QAAQ,IAAI,IAAI,GAAG,SAAS,CAMtC;IAEM,QAAQ,CAAC,GAAG,GAAE,MAAU,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE;IAmD/C,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;CAKrC;AAED,qBAAa,IAAI;IACT,QAAQ,EAAE,aAAa,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,UAAU,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;gBAGlB,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE;QACL,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,OAAO,CAAC;KACjB;CAQF"}
|
|
@@ -3,20 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Page = exports.SearchPaginationStore = void 0;
|
|
4
4
|
var mobx_1 = require("mobx");
|
|
5
5
|
var SearchPaginationStore = /** @class */ (function () {
|
|
6
|
-
function SearchPaginationStore(config, services, paginationData) {
|
|
6
|
+
function SearchPaginationStore(config, services, paginationData, meta) {
|
|
7
7
|
if (paginationData === void 0) { paginationData = {
|
|
8
8
|
page: undefined,
|
|
9
9
|
pageSize: undefined,
|
|
10
10
|
totalResults: undefined,
|
|
11
|
-
defaultPageSize: 24,
|
|
12
11
|
totalPages: undefined,
|
|
13
12
|
}; }
|
|
13
|
+
var _a;
|
|
14
14
|
this.services = services;
|
|
15
15
|
this.controllerConfig = config;
|
|
16
16
|
this.page = paginationData.page;
|
|
17
17
|
this.pageSize = paginationData.pageSize;
|
|
18
18
|
this.totalResults = paginationData.totalResults;
|
|
19
|
-
this.defaultPageSize =
|
|
19
|
+
this.defaultPageSize = ((_a = meta === null || meta === void 0 ? void 0 : meta.pagination) === null || _a === void 0 ? void 0 : _a.defaultPageSize) || 24;
|
|
20
20
|
this.totalPages = paginationData.totalPages;
|
|
21
21
|
this.pageSizeOptions = [
|
|
22
22
|
{
|
|
@@ -87,7 +87,7 @@ export class AutocompleteStore extends AbstractStore {
|
|
|
87
87
|
// OR if any terms are active, also reset to ensure only a single term or trending term is active
|
|
88
88
|
this.resetTrending();
|
|
89
89
|
}
|
|
90
|
-
this.pagination = new SearchPaginationStore(this.config, this.services, data.pagination);
|
|
90
|
+
this.pagination = new SearchPaginationStore(this.config, this.services, data.pagination, this.meta);
|
|
91
91
|
this.sorting = new SearchSortingStore(this.services, data.sorting || [], data.search || {}, this.meta);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
@@ -67,7 +67,7 @@ export class FinderStore extends AbstractStore {
|
|
|
67
67
|
this.error = undefined;
|
|
68
68
|
this.loaded = !!data.pagination;
|
|
69
69
|
this.meta = data.meta;
|
|
70
|
-
this.pagination = new SearchPaginationStore(this.config, this.services, data.pagination);
|
|
70
|
+
this.pagination = new SearchPaginationStore(this.config, this.services, data.pagination, this.meta);
|
|
71
71
|
this.selections = new FinderSelectionStore(this.config, this.services, {
|
|
72
72
|
state: this.state,
|
|
73
73
|
facets: data.facets || [],
|
|
@@ -46,7 +46,7 @@ export class SearchStore extends AbstractStore {
|
|
|
46
46
|
this.facets = new SearchFacetStore(this.config, this.services, this.storage, data.facets, data?.pagination || {}, this.meta, data?.merchandising || {});
|
|
47
47
|
this.filters = new SearchFilterStore(this.services, data.filters, this.meta);
|
|
48
48
|
this.results = new SearchResultStore(this.config, this.services, data?.results || [], data.pagination, data.merchandising);
|
|
49
|
-
this.pagination = new SearchPaginationStore(this.config, this.services, data.pagination);
|
|
49
|
+
this.pagination = new SearchPaginationStore(this.config, this.services, data.pagination, this.meta);
|
|
50
50
|
this.sorting = new SearchSortingStore(this.services, data?.sorting || [], data?.search || {}, this.meta);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SearchStoreConfig, StoreServices } from '../../types';
|
|
2
|
-
import type { SearchResponseModelPagination } from '@searchspring/snapi-types';
|
|
2
|
+
import type { SearchResponseModelPagination, MetaResponseModel } from '@searchspring/snapi-types';
|
|
3
3
|
import type { UrlManager } from '@searchspring/snap-url-manager';
|
|
4
4
|
export declare class SearchPaginationStore {
|
|
5
5
|
services: StoreServices;
|
|
@@ -13,7 +13,7 @@ export declare class SearchPaginationStore {
|
|
|
13
13
|
totalResults: number;
|
|
14
14
|
totalPages: number;
|
|
15
15
|
controllerConfig: SearchStoreConfig;
|
|
16
|
-
constructor(config: SearchStoreConfig, services: StoreServices, paginationData
|
|
16
|
+
constructor(config: SearchStoreConfig, services: StoreServices, paginationData: SearchResponseModelPagination | undefined, meta: MetaResponseModel);
|
|
17
17
|
get begin(): number;
|
|
18
18
|
get end(): number;
|
|
19
19
|
get multiplePages(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchPaginationStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchPaginationStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchPaginationStore.d.ts","sourceRoot":"","sources":["../../../../src/Search/Stores/SearchPaginationStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,KAAK,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAClG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAEjE,qBAAa,qBAAqB;IAC1B,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE;QACvB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;IACG,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,iBAAiB,CAAC;gBAG1C,MAAM,EAAE,iBAAiB,EACzB,QAAQ,EAAE,aAAa,EACvB,cAAc,2CAKb,EACD,IAAI,EAAE,iBAAiB;IA4CxB,IAAW,KAAK,IAAI,MAAM,CAKzB;IAED,IAAW,GAAG,IAAI,MAAM,CAMvB;IAED,IAAW,aAAa,IAAI,OAAO,CAElC;IAED,IAAW,OAAO,IAAI,IAAI,CAKzB;IAED,IAAW,KAAK,IAAI,IAAI,CAKvB;IAED,IAAW,IAAI,IAAI,IAAI,CAKtB;IAED,IAAW,IAAI,IAAI,IAAI,GAAG,SAAS,CAMlC;IAED,IAAW,QAAQ,IAAI,IAAI,GAAG,SAAS,CAMtC;IAEM,QAAQ,CAAC,GAAG,GAAE,MAAU,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE;IAmD/C,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;CAKrC;AAED,qBAAa,IAAI;IACT,QAAQ,EAAE,aAAa,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,UAAU,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;gBAGlB,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE;QACL,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,OAAO,CAAC;KACjB;CAQF"}
|
|
@@ -4,15 +4,14 @@ export class SearchPaginationStore {
|
|
|
4
4
|
page: undefined,
|
|
5
5
|
pageSize: undefined,
|
|
6
6
|
totalResults: undefined,
|
|
7
|
-
defaultPageSize: 24,
|
|
8
7
|
totalPages: undefined,
|
|
9
|
-
}) {
|
|
8
|
+
}, meta) {
|
|
10
9
|
this.services = services;
|
|
11
10
|
this.controllerConfig = config;
|
|
12
11
|
this.page = paginationData.page;
|
|
13
12
|
this.pageSize = paginationData.pageSize;
|
|
14
13
|
this.totalResults = paginationData.totalResults;
|
|
15
|
-
this.defaultPageSize =
|
|
14
|
+
this.defaultPageSize = meta?.pagination?.defaultPageSize || 24;
|
|
16
15
|
this.totalPages = paginationData.totalPages;
|
|
17
16
|
this.pageSizeOptions = [
|
|
18
17
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@searchspring/snap-store-mobx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "Snap MobX Store",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
"test:watch": "jest --watch"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@searchspring/snap-toolbox": "^0.
|
|
23
|
+
"@searchspring/snap-toolbox": "^0.36.0",
|
|
24
24
|
"mobx": "^6.6.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@searchspring/snap-client": "^0.
|
|
28
|
-
"@searchspring/snap-url-manager": "^0.
|
|
27
|
+
"@searchspring/snap-client": "^0.36.0",
|
|
28
|
+
"@searchspring/snap-url-manager": "^0.36.0"
|
|
29
29
|
},
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"files": [
|
|
32
32
|
"dist/**/*"
|
|
33
33
|
],
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "4405a6004acc3a7311198abb834d78caae7df8de"
|
|
35
35
|
}
|