@usereactify/search 4.3.1 → 5.0.0-beta.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/CHANGELOG.md +54 -0
- package/dist/package.json +8 -10
- package/dist/src/components/context/ReactifySearchBase.d.ts +42 -0
- package/dist/src/components/context/ReactifySearchBase.js +140 -0
- package/dist/src/components/context/index.d.ts +1 -0
- package/dist/src/components/context/index.js +13 -0
- package/dist/src/components/example/ExampleFilterList.d.ts +4 -0
- package/dist/src/components/example/ExampleFilterList.js +19 -0
- package/dist/src/components/example/ExampleFilterRange.d.ts +4 -0
- package/dist/src/components/example/ExampleFilterRange.js +21 -0
- package/dist/src/components/example/ExampleFilterSlider.d.ts +4 -0
- package/dist/src/components/example/ExampleFilterSlider.js +20 -0
- package/dist/src/components/example/ExampleFilterStack.d.ts +4 -0
- package/dist/src/components/example/ExampleFilterStack.js +12 -0
- package/dist/src/components/example/ExampleResultCardCallout.d.ts +4 -0
- package/dist/src/components/example/ExampleResultCardCallout.js +21 -0
- package/dist/src/components/example/ExampleResultCardProduct.d.ts +4 -0
- package/dist/src/components/example/ExampleResultCardProduct.js +18 -0
- package/dist/src/components/example/ExampleResultPaginationLoadMore.d.ts +4 -0
- package/dist/src/components/example/ExampleResultPaginationLoadMore.js +11 -0
- package/dist/src/components/example/ExampleResultPaginationNextPrev.d.ts +4 -0
- package/dist/src/components/example/ExampleResultPaginationNextPrev.js +13 -0
- package/dist/src/components/example/ExampleResultPaginationNumbered.d.ts +4 -0
- package/dist/src/components/example/ExampleResultPaginationNumbered.js +26 -0
- package/dist/src/components/example/ExampleSortby.d.ts +4 -0
- package/dist/src/components/example/ExampleSortby.js +12 -0
- package/dist/src/components/example/index.d.ts +10 -0
- package/dist/src/components/example/index.js +22 -0
- package/dist/src/components/filter/Filter.d.ts +20 -0
- package/dist/src/components/filter/Filter.js +89 -0
- package/dist/src/components/filter/FilterStack.d.ts +7 -0
- package/dist/src/components/filter/FilterStack.js +16 -0
- package/dist/src/{filter → components/filter}/index.d.ts +0 -1
- package/dist/src/{filter → components/filter}/index.js +0 -1
- package/dist/src/components/index.d.ts +8 -0
- package/dist/src/components/index.js +20 -0
- package/dist/src/components/result/ResultCardCallout.d.ts +12 -0
- package/dist/src/{result → components/result}/ResultCardCallout.js +15 -22
- package/dist/src/components/result/ResultCardProduct.d.ts +13 -0
- package/dist/src/{result/ResultCard.js → components/result/ResultCardProduct.js} +19 -22
- package/dist/src/components/result/ResultPaginationLoadMore.d.ts +7 -0
- package/dist/src/components/result/ResultPaginationLoadMore.js +16 -0
- package/dist/src/components/result/ResultPaginationNextPrev.d.ts +7 -0
- package/dist/src/components/result/ResultPaginationNextPrev.js +16 -0
- package/dist/src/components/result/ResultPaginationNumbered.d.ts +7 -0
- package/dist/src/components/result/ResultPaginationNumbered.js +19 -0
- package/dist/src/components/result/ResultStack.d.ts +40 -0
- package/dist/src/components/result/ResultStack.js +107 -0
- package/dist/src/components/result/ResultStateProvider.d.ts +6 -0
- package/dist/src/{result → components/result}/ResultStateProvider.js +0 -0
- package/dist/src/components/result/index.d.ts +7 -0
- package/dist/src/{result → components/result}/index.js +5 -4
- package/dist/src/components/search/SearchInput.d.ts +8 -0
- package/dist/src/{search → components/search}/SearchInput.js +2 -2
- package/dist/src/{search → components/search}/index.d.ts +0 -0
- package/dist/src/{search → components/search}/index.js +0 -0
- package/dist/src/{sensor → components/sensor}/SensorCollection.d.ts +0 -0
- package/dist/src/{sensor → components/sensor}/SensorCollection.js +8 -5
- package/dist/src/{sensor → components/sensor}/SensorInventoryAvailable.d.ts +0 -0
- package/dist/src/{sensor → components/sensor}/SensorInventoryAvailable.js +1 -1
- package/dist/src/{sensor → components/sensor}/SensorPublished.d.ts +0 -0
- package/dist/src/{sensor → components/sensor}/SensorPublished.js +0 -0
- package/dist/src/{sensor → components/sensor}/SensorSearch.d.ts +0 -0
- package/dist/src/{sensor → components/sensor}/SensorSearch.js +3 -3
- package/dist/src/{sensor → components/sensor}/SensorSort.d.ts +0 -0
- package/dist/src/{sensor → components/sensor}/SensorSort.js +4 -5
- package/dist/src/{sensor → components/sensor}/SensorSortScore.d.ts +0 -0
- package/dist/src/{sensor → components/sensor}/SensorSortScore.js +0 -0
- package/dist/src/components/sensor/SensorStack.d.ts +3 -0
- package/dist/src/{sensor → components/sensor}/SensorStack.js +3 -3
- package/dist/src/{sensor → components/sensor}/index.d.ts +0 -0
- package/dist/src/{sensor → components/sensor}/index.js +0 -0
- package/dist/src/components/sortby/Sortby.d.ts +7 -0
- package/dist/src/components/sortby/Sortby.js +16 -0
- package/dist/src/components/sortby/index.d.ts +1 -0
- package/dist/src/components/sortby/index.js +13 -0
- package/dist/src/{utility → components/utility}/UtilityAuthenticatedReactiveBase.d.ts +0 -0
- package/dist/src/{utility → components/utility}/UtilityAuthenticatedReactiveBase.js +2 -2
- package/dist/src/components/utility/index.d.ts +1 -0
- package/dist/src/components/utility/index.js +13 -0
- package/dist/src/hooks/index.d.ts +5 -5
- package/dist/src/hooks/index.js +5 -5
- package/dist/src/hooks/reactivesearch/index.d.ts +4 -1
- package/dist/src/hooks/reactivesearch/index.js +4 -1
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.d.ts +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js +7 -7
- package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.d.ts +5 -7
- package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.js +29 -30
- package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.d.ts +9 -4
- package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.js +9 -94
- package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.d.ts +70 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.js +21 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.d.ts +67 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.js +105 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.d.ts +68 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.js +21 -0
- package/dist/src/hooks/reactivesearch/useReactiveReactProp.js +8 -8
- package/dist/src/hooks/reactivesearch/{useReactiveResultListProps.d.ts → useReactiveResultStackProps.d.ts} +2 -4
- package/dist/src/hooks/reactivesearch/{useReactiveResultListProps.js → useReactiveResultStackProps.js} +7 -8
- package/dist/src/hooks/useAnalytics.js +4 -4
- package/dist/src/hooks/useConfig.d.ts +4 -1
- package/dist/src/hooks/useConfig.js +77 -2
- package/dist/src/hooks/useCuration.d.ts +2 -1
- package/dist/src/hooks/useCuration.js +48 -2
- package/dist/src/hooks/useFilterListProps.d.ts +4 -14
- package/dist/src/hooks/useFilterStack.d.ts +2 -1
- package/dist/src/hooks/useFilterStack.js +42 -2
- package/dist/src/hooks/useFilters.d.ts +4 -1
- package/dist/src/hooks/useFilters.js +10 -5
- package/dist/src/hooks/usePagination.d.ts +14 -0
- package/dist/src/hooks/{usePages.js → usePagination.js} +30 -30
- package/dist/src/hooks/usePaginationLoadMore.d.ts +14 -0
- package/dist/src/hooks/usePaginationLoadMore.js +35 -0
- package/dist/src/hooks/useProductPrice.d.ts +3 -5
- package/dist/src/hooks/useProductPrice.js +42 -40
- package/dist/src/hooks/useReactifySearchContext.d.ts +78 -0
- package/dist/src/hooks/useReactifySearchContext.js +10 -0
- package/dist/src/hooks/useSearch.d.ts +4 -4
- package/dist/src/hooks/useSearch.js +28 -8
- package/dist/src/hooks/useSortby.d.ts +6 -0
- package/dist/src/hooks/useSortby.js +41 -0
- package/dist/src/index.d.ts +2 -8
- package/dist/src/index.js +2 -8
- package/dist/src/types/config.d.ts +1 -0
- package/dist/src/types/index.d.ts +3 -0
- package/dist/src/types/index.js +15 -0
- package/package.json +8 -10
- package/dist/src/filter/Filter.d.ts +0 -12
- package/dist/src/filter/Filter.js +0 -71
- package/dist/src/filter/FilterList.d.ts +0 -4
- package/dist/src/filter/FilterList.js +0 -15
- package/dist/src/filter/FilterStack.d.ts +0 -11
- package/dist/src/filter/FilterStack.js +0 -25
- package/dist/src/hooks/useCollection.d.ts +0 -1
- package/dist/src/hooks/useCollection.js +0 -6
- package/dist/src/hooks/useLiveConfig.d.ts +0 -4
- package/dist/src/hooks/useLiveConfig.js +0 -74
- package/dist/src/hooks/usePages.d.ts +0 -10
- package/dist/src/hooks/useSort.d.ts +0 -5
- package/dist/src/hooks/useSort.js +0 -24
- package/dist/src/provider.d.ts +0 -78
- package/dist/src/provider.js +0 -287
- package/dist/src/result/ResultCard.d.ts +0 -14
- package/dist/src/result/ResultCardCallout.d.ts +0 -13
- package/dist/src/result/ResultList.d.ts +0 -34
- package/dist/src/result/ResultList.js +0 -93
- package/dist/src/result/ResultLoadMoreButton.d.ts +0 -10
- package/dist/src/result/ResultLoadMoreButton.js +0 -61
- package/dist/src/result/ResultPagination.d.ts +0 -10
- package/dist/src/result/ResultPagination.js +0 -60
- package/dist/src/result/ResultPaginationNextPrev.d.ts +0 -8
- package/dist/src/result/ResultPaginationNextPrev.js +0 -30
- package/dist/src/result/ResultStateProvider.d.ts +0 -7
- package/dist/src/result/index.d.ts +0 -6
- package/dist/src/search/SearchInput.d.ts +0 -9
- package/dist/src/sensor/SensorStack.d.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,60 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [5.0.0-beta.0](https://bitbucket.org/usereactify/reactify-search-ui/compare/v4.4.1...v5.0.0-beta.0) (2022-07-25)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
* separate monolith provider into hooks and context
|
|
11
|
+
* align code and docs for v5
|
|
12
|
+
|
|
13
|
+
* align code and docs for v5 ([e1823a5](https://bitbucket.org/usereactify/reactify-search-ui/commit/e1823a5ab06dcea89b848bde4156f488241dea01))
|
|
14
|
+
* separate monolith provider into hooks and context ([4a85878](https://bitbucket.org/usereactify/reactify-search-ui/commit/4a858787ad547e87e10d3c3859ce41f87a4c3bbe))
|
|
15
|
+
|
|
16
|
+
## [5.0.0-beta.1](https://bitbucket.org/usereactify/reactify-search-ui/compare/v4.4.1...v5.0.0-beta.1) (2022-07-25)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### ⚠ BREAKING CHANGES
|
|
20
|
+
|
|
21
|
+
* separate monolith provider into hooks and context
|
|
22
|
+
* align code and docs for v5
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* add support for beta deployments ([e8249c1](https://bitbucket.org/usereactify/reactify-search-ui/commit/e8249c1e68647ec45a9eb90607bfc6ae8b0f17f2))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
* align code and docs for v5 ([e1823a5](https://bitbucket.org/usereactify/reactify-search-ui/commit/e1823a5ab06dcea89b848bde4156f488241dea01))
|
|
30
|
+
* separate monolith provider into hooks and context ([f29d15f](https://bitbucket.org/usereactify/reactify-search-ui/commit/f29d15f8d370403fdc72dd642bc5987868db7f15))
|
|
31
|
+
|
|
32
|
+
## [5.0.0-beta.0](https://bitbucket.org/usereactify/reactify-search-ui/compare/v4.4.1...v5.0.0-beta.0) (2022-07-25)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### ⚠ BREAKING CHANGES
|
|
36
|
+
|
|
37
|
+
* separate monolith provider into hooks and context
|
|
38
|
+
* align code and docs for v5
|
|
39
|
+
|
|
40
|
+
* align code and docs for v5 ([e1823a5](https://bitbucket.org/usereactify/reactify-search-ui/commit/e1823a5ab06dcea89b848bde4156f488241dea01))
|
|
41
|
+
* separate monolith provider into hooks and context ([f29d15f](https://bitbucket.org/usereactify/reactify-search-ui/commit/f29d15f8d370403fdc72dd642bc5987868db7f15))
|
|
42
|
+
|
|
43
|
+
### [4.4.1](https://bitbucket.org/usereactify/reactify-search-ui/compare/v4.4.0...v4.4.1) (2022-07-21)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### Bug Fixes
|
|
47
|
+
|
|
48
|
+
* correct tsconfig ([e82defa](https://bitbucket.org/usereactify/reactify-search-ui/commit/e82defac47d754df543fc276319ba759de607507))
|
|
49
|
+
|
|
50
|
+
## [4.4.0](https://bitbucket.org/usereactify/reactify-search-ui/compare/v4.4.0-beta.0...v4.4.0) (2022-07-21)
|
|
51
|
+
|
|
52
|
+
## [4.4.0-beta.0](https://bitbucket.org/usereactify/reactify-search-ui/compare/v4.3.1...v4.4.0-beta.0) (2022-07-21)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### Bug Fixes
|
|
56
|
+
|
|
57
|
+
* correct tsconfig ([01a796b](https://bitbucket.org/usereactify/reactify-search-ui/commit/01a796bfc03f4153d8fbbea86a0597ee3c665a94))
|
|
58
|
+
|
|
5
59
|
### [4.3.1](https://bitbucket.org/usereactify/reactify-search-ui/compare/v4.3.0...v4.3.1) (2022-07-21)
|
|
6
60
|
|
|
7
61
|
## [4.3.0](https://bitbucket.org/usereactify/reactify-search-ui/compare/v4.3.0-beta.0...v4.3.0) (2022-07-21)
|
package/dist/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usereactify/search",
|
|
3
3
|
"description": "React UI library for Reactify Search",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.0-beta.0",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
6
|
+
"main": "dist/src/index.js",
|
|
7
|
+
"types": "dist/src/index.d.ts",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
10
|
"README.md",
|
|
@@ -12,14 +12,11 @@
|
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
14
|
"watch": "tsc --watch",
|
|
15
|
-
"release": "standard-version",
|
|
16
|
-
"release:
|
|
17
|
-
"release:beta": "standard-version --release-as minor --prerelease beta",
|
|
18
|
-
"release:local": "yalc publish",
|
|
15
|
+
"release": "standard-version --prerelease rc",
|
|
16
|
+
"release:beta": "standard-version --prerelease beta",
|
|
19
17
|
"build": "rimraf dist && tsc",
|
|
20
18
|
"prettier": "prettier --write .",
|
|
21
|
-
"storybook": "start-storybook -p 6006"
|
|
22
|
-
"build-storybook": "build-storybook"
|
|
19
|
+
"storybook": "start-storybook -p 6006"
|
|
23
20
|
},
|
|
24
21
|
"husky": {
|
|
25
22
|
"hooks": {
|
|
@@ -33,7 +30,8 @@
|
|
|
33
30
|
]
|
|
34
31
|
},
|
|
35
32
|
"dependencies": {
|
|
36
|
-
"@sentry/react": "7.
|
|
33
|
+
"@sentry/react": "7.7.0",
|
|
34
|
+
"@sentry/tracing": "7.7.0",
|
|
37
35
|
"ahooks": "2.10.11",
|
|
38
36
|
"axios": "0.26.1",
|
|
39
37
|
"currency.js": "2.0.4",
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare type ReactifySearchBaseProps = {
|
|
3
|
+
/** The search area the provider will be used in */
|
|
4
|
+
mode: "search" | "collection" | "instant-search";
|
|
5
|
+
/** Shopify store domain used to resolve the site configuration */
|
|
6
|
+
shopifyPermanentDomain: string;
|
|
7
|
+
/** Specific filter group handle, used to override automated logic */
|
|
8
|
+
filterStackHandle?: string;
|
|
9
|
+
/** Callback function for redirects, suitable for headless sites to avoid full page refresh */
|
|
10
|
+
onRedirect?: (type: "redirect" | "search", url: string) => void;
|
|
11
|
+
/** Render method to display a component when the config is loading */
|
|
12
|
+
renderBooting?: () => JSX.Element | null;
|
|
13
|
+
/** Advanced usage: Allows you to wrap the ReactifySearchBase in your own ReactiveBase component */
|
|
14
|
+
noReactiveBase?: boolean;
|
|
15
|
+
/** Advanced usage: Array of additional component IDs managed outside of Reactify Search */
|
|
16
|
+
additionalComponentHandles?: string[];
|
|
17
|
+
/** Advanced usage: Override the default Elasticsearch index */
|
|
18
|
+
index?: string;
|
|
19
|
+
/** Advanced usage: Override the default Reactify Search config (for multi-instance stores) */
|
|
20
|
+
configId?: string;
|
|
21
|
+
/** Advanced usage: Override the default Elasticsearch credentials */
|
|
22
|
+
credentials?: {
|
|
23
|
+
username: string;
|
|
24
|
+
password: string;
|
|
25
|
+
endpoint: string;
|
|
26
|
+
};
|
|
27
|
+
/** Advanced usage: Override the default ReactiveBase theme */
|
|
28
|
+
theme?: Record<string, unknown>;
|
|
29
|
+
} & ({
|
|
30
|
+
mode: "search";
|
|
31
|
+
} | {
|
|
32
|
+
mode: "collection";
|
|
33
|
+
/** Collection object that includes the handle, used to find curations */
|
|
34
|
+
collection: {
|
|
35
|
+
id: number;
|
|
36
|
+
title: string;
|
|
37
|
+
handle: string;
|
|
38
|
+
};
|
|
39
|
+
} | {
|
|
40
|
+
mode: "instant-search";
|
|
41
|
+
});
|
|
42
|
+
export declare const ReactifySearchBase: React.FC<ReactifySearchBaseProps>;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.ReactifySearchBase = void 0;
|
|
26
|
+
const react_1 = __importDefault(require("react"));
|
|
27
|
+
const Sentry = __importStar(require("@sentry/react"));
|
|
28
|
+
const tracing_1 = require("@sentry/tracing");
|
|
29
|
+
const hooks_1 = require("../../hooks");
|
|
30
|
+
const components_1 = require("../../components");
|
|
31
|
+
const debug = require("debug")("reactify-search:ReactifySearchBase");
|
|
32
|
+
Sentry.init({
|
|
33
|
+
dsn: "https://cd8abf47496c4956bd061e461f857319@o301775.ingest.sentry.io/6600694",
|
|
34
|
+
integrations: [new tracing_1.BrowserTracing()],
|
|
35
|
+
tracesSampleRate: 1.0,
|
|
36
|
+
});
|
|
37
|
+
const ReactifySearchBase = (props) => {
|
|
38
|
+
react_1.default.useEffect(() => {
|
|
39
|
+
debug("variable[props]", props);
|
|
40
|
+
}, [props]);
|
|
41
|
+
return (react_1.default.createElement(Sentry.ErrorBoundary, { fallback: react_1.default.createElement("p", null, "An error has occurred"), beforeCapture: (scope) => {
|
|
42
|
+
scope.setTag("index", props.index);
|
|
43
|
+
scope.setTag("shop", props.shopifyPermanentDomain);
|
|
44
|
+
scope.setTag("mode", props.mode);
|
|
45
|
+
if (props.mode === "collection") {
|
|
46
|
+
scope.setTag("collection", props.collection.handle);
|
|
47
|
+
}
|
|
48
|
+
if (props.filterStackHandle) {
|
|
49
|
+
scope.setTag("filter", props.filterStackHandle);
|
|
50
|
+
}
|
|
51
|
+
debug("set sentry scope");
|
|
52
|
+
} },
|
|
53
|
+
react_1.default.createElement(ReactifySearchInner, Object.assign({}, props))));
|
|
54
|
+
};
|
|
55
|
+
exports.ReactifySearchBase = ReactifySearchBase;
|
|
56
|
+
const ReactifySearchInner = (props) => {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
const { config } = (0, hooks_1.useConfig)(props.shopifyPermanentDomain, props.configId);
|
|
59
|
+
const [searchQuery, setSearchQuery] = react_1.default.useState("");
|
|
60
|
+
const [instantSearchVisible, setInstantSearchVisible] = react_1.default.useState(false);
|
|
61
|
+
const [sortOption, setSortOption] = react_1.default.useState("");
|
|
62
|
+
const credentials = (_a = props.credentials) !== null && _a !== void 0 ? _a : {
|
|
63
|
+
username: "guest",
|
|
64
|
+
password: "password",
|
|
65
|
+
endpoint: "https://api.search.reactify.app",
|
|
66
|
+
};
|
|
67
|
+
const theme = (_b = props.theme) !== null && _b !== void 0 ? _b : {
|
|
68
|
+
typography: {
|
|
69
|
+
fontFamily: "inherit",
|
|
70
|
+
fontSize: "inherit",
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
const searchQueryFromURL = react_1.default.useMemo(() => {
|
|
74
|
+
var _a;
|
|
75
|
+
if (typeof window === "undefined")
|
|
76
|
+
return undefined;
|
|
77
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
78
|
+
return (_a = urlParams.get("q")) !== null && _a !== void 0 ? _a : undefined;
|
|
79
|
+
}, [window.location.search]);
|
|
80
|
+
const searchSortFromURL = react_1.default.useMemo(() => {
|
|
81
|
+
var _a;
|
|
82
|
+
if (typeof window === "undefined")
|
|
83
|
+
return undefined;
|
|
84
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
85
|
+
return (_a = urlParams.get("sort")) !== null && _a !== void 0 ? _a : undefined;
|
|
86
|
+
}, [window.location.search]);
|
|
87
|
+
react_1.default.useEffect(() => {
|
|
88
|
+
if (searchQueryFromURL && searchQuery !== searchQueryFromURL) {
|
|
89
|
+
setSearchQuery(searchQueryFromURL);
|
|
90
|
+
}
|
|
91
|
+
}, [searchQueryFromURL]);
|
|
92
|
+
react_1.default.useEffect(() => {
|
|
93
|
+
if (searchSortFromURL && sortOption !== searchSortFromURL) {
|
|
94
|
+
setSortOption(searchSortFromURL);
|
|
95
|
+
}
|
|
96
|
+
}, [searchSortFromURL]);
|
|
97
|
+
react_1.default.useEffect(() => {
|
|
98
|
+
if (window.location.search === "" && sortOption) {
|
|
99
|
+
setSortOption(sortOption);
|
|
100
|
+
}
|
|
101
|
+
}, [window.location.href]);
|
|
102
|
+
const contextValue = react_1.default.useMemo(() => {
|
|
103
|
+
var _a;
|
|
104
|
+
if (!config) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
;
|
|
108
|
+
return {
|
|
109
|
+
config: config,
|
|
110
|
+
options: Object.assign(Object.assign({}, props), { index: (_a = props.index) !== null && _a !== void 0 ? _a : config.index, filterStackHandle: props.filterStackHandle, credentials: credentials, theme: theme }),
|
|
111
|
+
search: {
|
|
112
|
+
searchQuery: searchQuery,
|
|
113
|
+
setSearchQuery: setSearchQuery,
|
|
114
|
+
instantSearchVisible: instantSearchVisible,
|
|
115
|
+
setInstantSearchVisible: setInstantSearchVisible,
|
|
116
|
+
},
|
|
117
|
+
sortby: {
|
|
118
|
+
sortOption: sortOption,
|
|
119
|
+
setSortOption: setSortOption,
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}, [
|
|
123
|
+
config,
|
|
124
|
+
props,
|
|
125
|
+
searchQuery,
|
|
126
|
+
instantSearchVisible,
|
|
127
|
+
sortOption,
|
|
128
|
+
]);
|
|
129
|
+
if (!contextValue) {
|
|
130
|
+
if (props.renderBooting) {
|
|
131
|
+
return props.renderBooting();
|
|
132
|
+
}
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
if (props.noReactiveBase) {
|
|
136
|
+
return (react_1.default.createElement(hooks_1.ReactifySearchContext.Provider, { value: contextValue }, props.children));
|
|
137
|
+
}
|
|
138
|
+
return (react_1.default.createElement(hooks_1.ReactifySearchContext.Provider, { value: contextValue },
|
|
139
|
+
react_1.default.createElement(components_1.UtilityAuthenticatedReactiveBase, null, props.children)));
|
|
140
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ReactifySearchBase";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./ReactifySearchBase"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExampleFilterList = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const ExampleFilterList = (props) => {
|
|
9
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
10
|
+
react_1.default.createElement("h1", null, props.filter.name),
|
|
11
|
+
react_1.default.createElement("ul", null, props.filterListProps.options.map((option) => (react_1.default.createElement("li", { key: option.key },
|
|
12
|
+
react_1.default.createElement("label", null,
|
|
13
|
+
react_1.default.createElement("input", { value: option.key, type: "checkbox", checked: option.checked, onChange: ({ target: { value } }) => props.filterListProps.handleChange(value) }),
|
|
14
|
+
option.key,
|
|
15
|
+
" (",
|
|
16
|
+
option.doc_count,
|
|
17
|
+
")")))))));
|
|
18
|
+
};
|
|
19
|
+
exports.ExampleFilterList = ExampleFilterList;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExampleFilterRange = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const reactivesearch_1 = require("@appbaseio/reactivesearch");
|
|
9
|
+
const ExampleFilterRange = (props) => {
|
|
10
|
+
if (props.filter.handle === "price") {
|
|
11
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
12
|
+
react_1.default.createElement("h1", null, props.filter.name),
|
|
13
|
+
react_1.default.createElement(reactivesearch_1.SingleRange, Object.assign({ data: [
|
|
14
|
+
{ start: "0", label: "All prices" },
|
|
15
|
+
{ start: "0", end: "99", label: "Under $100" },
|
|
16
|
+
{ start: "0", end: "49", label: "Under $50" },
|
|
17
|
+
] }, props.reactiveFilterRangeProps))));
|
|
18
|
+
}
|
|
19
|
+
return null;
|
|
20
|
+
};
|
|
21
|
+
exports.ExampleFilterRange = ExampleFilterRange;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExampleFilterSlider = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const reactivesearch_1 = require("@appbaseio/reactivesearch");
|
|
9
|
+
const ExampleFilterSlider = (props) => {
|
|
10
|
+
if (props.filter.handle === "price") {
|
|
11
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
12
|
+
react_1.default.createElement("h1", null, props.filter.name),
|
|
13
|
+
react_1.default.createElement(reactivesearch_1.RangeSlider, Object.assign({ range: {
|
|
14
|
+
start: 0,
|
|
15
|
+
end: 500
|
|
16
|
+
} }, props.reactiveFilterSliderProps))));
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
};
|
|
20
|
+
exports.ExampleFilterSlider = ExampleFilterSlider;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExampleFilterStack = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const components_1 = require("../../components");
|
|
9
|
+
const ExampleFilterStack = (props) => {
|
|
10
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, props.filters.map((filter) => (react_1.default.createElement(components_1.Filter, Object.assign({ key: filter.id, filter: filter }, props))))));
|
|
11
|
+
};
|
|
12
|
+
exports.ExampleFilterStack = ExampleFilterStack;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ResultCardCalloutProps } from "../../components";
|
|
3
|
+
export declare type ExampleResultCardCalloutProps = Parameters<Required<ResultCardCalloutProps>["render"]>[0];
|
|
4
|
+
export declare const ExampleResultCardCallout: React.FC<ExampleResultCardCalloutProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExampleResultCardCallout = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const ExampleResultCardCallout = (props) => {
|
|
9
|
+
const styleProp = react_1.default.useMemo(() => {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
return ({
|
|
12
|
+
gridRow: `span ${(_a = props.callout.displayRows) !== null && _a !== void 0 ? _a : 1}`,
|
|
13
|
+
gridColumn: `span ${(_b = props.callout.displayColumns) !== null && _b !== void 0 ? _b : 1}`,
|
|
14
|
+
});
|
|
15
|
+
}, [props.callout]);
|
|
16
|
+
return (react_1.default.createElement("article", { ref: props.itemRef, style: styleProp },
|
|
17
|
+
react_1.default.createElement("a", { href: props.callout.link, onClick: props.handleClick },
|
|
18
|
+
props.callout.desktopImage && (react_1.default.createElement("img", { src: props.callout.desktopImage, width: "100%" })),
|
|
19
|
+
props.callout.title)));
|
|
20
|
+
};
|
|
21
|
+
exports.ExampleResultCardCallout = ExampleResultCardCallout;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ResultCardProductProps } from "../../components";
|
|
3
|
+
export declare type ExampleResultCardProductProps = Parameters<Required<ResultCardProductProps>["render"]>[0];
|
|
4
|
+
export declare const ExampleResultCardProduct: React.FC<ExampleResultCardProductProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExampleResultCardProduct = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const ExampleResultCardProduct = (props) => {
|
|
9
|
+
return (react_1.default.createElement("article", { ref: props.itemRef },
|
|
10
|
+
react_1.default.createElement("a", { onClick: props.handleClick, href: `/products/${props.product.handle}` },
|
|
11
|
+
props.product.image && (react_1.default.createElement("img", { src: props.product.image, width: "100%" })),
|
|
12
|
+
props.product.title),
|
|
13
|
+
react_1.default.createElement("span", null, props.formattedPrice),
|
|
14
|
+
props.onSale && (react_1.default.createElement("span", { style: {
|
|
15
|
+
textDecoration: "line-through"
|
|
16
|
+
} }, props.formattedCompareAtPrice))));
|
|
17
|
+
};
|
|
18
|
+
exports.ExampleResultCardProduct = ExampleResultCardProduct;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ResultPaginationLoadMoreProps } from "../../components";
|
|
3
|
+
export declare type ExampleResultPaginationLoadMoreProps = Parameters<Required<ResultPaginationLoadMoreProps>["render"]>[0];
|
|
4
|
+
export declare const ExampleResultPaginationLoadMore: React.FC<ExampleResultPaginationLoadMoreProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExampleResultPaginationLoadMore = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const ExampleResultPaginationLoadMore = (props) => {
|
|
9
|
+
return (react_1.default.createElement("button", { onClick: () => props.handleLoadMore() }, "Load more"));
|
|
10
|
+
};
|
|
11
|
+
exports.ExampleResultPaginationLoadMore = ExampleResultPaginationLoadMore;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ResultPaginationNextPrevProps } from "../../components";
|
|
3
|
+
export declare type ExampleResultPaginationNextPrevProps = Parameters<Required<ResultPaginationNextPrevProps>["render"]>[0];
|
|
4
|
+
export declare const ExampleResultPaginationNextPrev: React.FC<ExampleResultPaginationNextPrevProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExampleResultPaginationNextPrev = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const ExampleResultPaginationNextPrev = (props) => {
|
|
9
|
+
return (react_1.default.createElement("nav", null,
|
|
10
|
+
props.hasPreviousPage && (react_1.default.createElement("a", { rel: "prev", onClick: props.handlePreviousPage, href: props.buildPagePath(props.actualCurrentPage - 1) }, "Prev")),
|
|
11
|
+
props.hasNextPage && (react_1.default.createElement("a", { rel: "next", onClick: props.handleNextPage, href: props.buildPagePath(props.actualCurrentPage + 1) }, "Next"))));
|
|
12
|
+
};
|
|
13
|
+
exports.ExampleResultPaginationNextPrev = ExampleResultPaginationNextPrev;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ResultPaginationNumberedProps } from "../../components";
|
|
3
|
+
export declare type ExampleResultPaginationNumberedProps = Parameters<Required<ResultPaginationNumberedProps>["render"]>[0];
|
|
4
|
+
export declare const ExampleResultPaginationNumbered: React.FC<ExampleResultPaginationNumberedProps>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExampleResultPaginationNumbered = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const ExampleResultPaginationNumbered = (props) => {
|
|
9
|
+
return (react_1.default.createElement("nav", null,
|
|
10
|
+
props.currentPage > 0 && (react_1.default.createElement("a", { rel: "prev", href: props.buildPagePath(props.currentPage), onClick: (event) => props.handlePageChange(props.currentPage - 1, event) }, "Prev")),
|
|
11
|
+
!props.pagesToShow.includes(0) && (react_1.default.createElement("a", { href: props.buildPagePath(1), onClick: (event) => props.handlePageChange(0, event), rel: 0 === props.currentPage - 1 ? `prev` : undefined }, "1")),
|
|
12
|
+
!props.pagesToShow.includes(1) && react_1.default.createElement("span", null, "..."),
|
|
13
|
+
props.pagesToShow.map((page) => page === props.currentPage ? (react_1.default.createElement("span", { key: page + 1 }, page + 1)) : (react_1.default.createElement("a", { key: page + 1, href: props.buildPagePath(page + 1), onClick: (event) => props.handlePageChange(page, event), rel: page === props.currentPage + 1
|
|
14
|
+
? `next`
|
|
15
|
+
: page === props.currentPage - 1
|
|
16
|
+
? `prev`
|
|
17
|
+
: undefined }, page + 1))),
|
|
18
|
+
!props.pagesToShow.includes(props.totalPages - 2) && react_1.default.createElement("span", null, "..."),
|
|
19
|
+
!props.pagesToShow.includes(props.totalPages - 1) && (react_1.default.createElement("a", { href: props.buildPagePath(props.totalPages), onClick: (event) => props.handlePageChange(props.totalPages - 1, event), rel: props.totalPages - 1 === props.currentPage + 1
|
|
20
|
+
? `next`
|
|
21
|
+
: props.totalPages - 1 === props.currentPage - 1
|
|
22
|
+
? `prev`
|
|
23
|
+
: undefined }, props.totalPages)),
|
|
24
|
+
props.currentPage + 1 < props.totalPages && (react_1.default.createElement("a", { rel: "next", href: props.buildPagePath(props.currentPage + 2), onClick: (event) => props.handlePageChange(props.currentPage + 1, event) }, "Next"))));
|
|
25
|
+
};
|
|
26
|
+
exports.ExampleResultPaginationNumbered = ExampleResultPaginationNumbered;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExampleSortby = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const ExampleSortby = (props) => {
|
|
9
|
+
var _a;
|
|
10
|
+
return (react_1.default.createElement("select", { value: (_a = props.sortOption) === null || _a === void 0 ? void 0 : _a.handle, onChange: (event) => props.setSortOption(event.target.value) }, props.sortOptions.map((sortOption) => (react_1.default.createElement("option", { key: sortOption.handle, value: sortOption.handle }, sortOption.name)))));
|
|
11
|
+
};
|
|
12
|
+
exports.ExampleSortby = ExampleSortby;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./ExampleFilterList";
|
|
2
|
+
export * from "./ExampleFilterRange";
|
|
3
|
+
export * from "./ExampleFilterSlider";
|
|
4
|
+
export * from "./ExampleFilterStack";
|
|
5
|
+
export * from "./ExampleResultCardCallout";
|
|
6
|
+
export * from "./ExampleResultCardProduct";
|
|
7
|
+
export * from "./ExampleResultPaginationNumbered";
|
|
8
|
+
export * from "./ExampleResultPaginationLoadMore";
|
|
9
|
+
export * from "./ExampleResultPaginationNextPrev";
|
|
10
|
+
export * from "./ExampleSortby";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./ExampleFilterList"), exports);
|
|
14
|
+
__exportStar(require("./ExampleFilterRange"), exports);
|
|
15
|
+
__exportStar(require("./ExampleFilterSlider"), exports);
|
|
16
|
+
__exportStar(require("./ExampleFilterStack"), exports);
|
|
17
|
+
__exportStar(require("./ExampleResultCardCallout"), exports);
|
|
18
|
+
__exportStar(require("./ExampleResultCardProduct"), exports);
|
|
19
|
+
__exportStar(require("./ExampleResultPaginationNumbered"), exports);
|
|
20
|
+
__exportStar(require("./ExampleResultPaginationLoadMore"), exports);
|
|
21
|
+
__exportStar(require("./ExampleResultPaginationNextPrev"), exports);
|
|
22
|
+
__exportStar(require("./ExampleSortby"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ConfigFilterOption } from "../../types";
|
|
3
|
+
import { useFilterListProps, useReactiveFilterRangeProps, useReactiveFilterSliderProps } from "../../hooks";
|
|
4
|
+
export declare type FilterProps = {
|
|
5
|
+
/** The filter option being rendered */
|
|
6
|
+
filter: ConfigFilterOption;
|
|
7
|
+
/** Render method for List filters */
|
|
8
|
+
renderFilterList?: React.FC<Omit<FilterProps, "renderFilterList"> & {
|
|
9
|
+
filterListProps: ReturnType<typeof useFilterListProps>;
|
|
10
|
+
}>;
|
|
11
|
+
/** Render method for Range filters */
|
|
12
|
+
renderFilterRange?: React.FC<Omit<FilterProps, "renderFilterRange"> & {
|
|
13
|
+
reactiveFilterRangeProps: ReturnType<typeof useReactiveFilterRangeProps>;
|
|
14
|
+
}>;
|
|
15
|
+
/** Render method for Slider filters */
|
|
16
|
+
renderFilterSlider?: React.FC<Omit<FilterProps, "renderFilterSlider"> & {
|
|
17
|
+
reactiveFilterSliderProps: ReturnType<typeof useReactiveFilterSliderProps>;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
export declare const Filter: React.FC<FilterProps>;
|