@usereactify/search 5.0.0-beta.0 → 5.0.0-beta.11
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 +67 -0
- package/dist/package.json +8 -3
- package/dist/src/components/{example → Example}/ExampleFilterList.d.ts +1 -1
- package/dist/src/components/Example/ExampleFilterList.js +21 -0
- package/dist/src/components/Example/ExampleFilterList.js.map +1 -0
- package/dist/src/components/{example → Example}/ExampleFilterRange.d.ts +1 -1
- package/dist/src/components/{example → Example}/ExampleFilterRange.js +5 -4
- package/dist/src/components/Example/ExampleFilterRange.js.map +1 -0
- package/dist/src/components/{example → Example}/ExampleFilterSlider.d.ts +1 -1
- package/dist/src/components/{example → Example}/ExampleFilterSlider.js +4 -3
- package/dist/src/components/Example/ExampleFilterSlider.js.map +1 -0
- package/dist/src/components/{example → Example}/ExampleFilterStack.d.ts +1 -1
- package/dist/src/components/{example → Example}/ExampleFilterStack.js +1 -0
- package/dist/src/components/Example/ExampleFilterStack.js.map +1 -0
- package/dist/src/components/{example → Example}/ExampleResultCardCallout.d.ts +1 -1
- package/dist/src/components/{example → Example}/ExampleResultCardCallout.js +5 -4
- package/dist/src/components/Example/ExampleResultCardCallout.js.map +1 -0
- package/dist/src/components/{example → Example}/ExampleResultCardProduct.d.ts +1 -1
- package/dist/src/components/Example/ExampleResultCardProduct.js +19 -0
- package/dist/src/components/Example/ExampleResultCardProduct.js.map +1 -0
- package/dist/src/components/{example → Example}/ExampleResultPaginationLoadMore.d.ts +1 -1
- package/dist/src/components/{example → Example}/ExampleResultPaginationLoadMore.js +2 -1
- package/dist/src/components/Example/ExampleResultPaginationLoadMore.js.map +1 -0
- package/dist/src/components/{example → Example}/ExampleResultPaginationNextPrev.d.ts +1 -1
- package/dist/src/components/{example → Example}/ExampleResultPaginationNextPrev.js +4 -3
- package/dist/src/components/Example/ExampleResultPaginationNextPrev.js.map +1 -0
- package/dist/src/components/{example → Example}/ExampleResultPaginationNumbered.d.ts +1 -1
- package/dist/src/components/Example/ExampleResultPaginationNumbered.js +27 -0
- package/dist/src/components/Example/ExampleResultPaginationNumbered.js.map +1 -0
- package/dist/src/components/{example → Example}/ExampleSortby.d.ts +1 -1
- package/dist/src/components/Example/ExampleSortby.js +13 -0
- package/dist/src/components/Example/ExampleSortby.js.map +1 -0
- package/dist/src/components/{example → Example}/index.d.ts +0 -0
- package/dist/src/components/{example → Example}/index.js +1 -0
- package/dist/src/components/Example/index.js.map +1 -0
- package/dist/src/components/{filter → Filter}/Filter.d.ts +0 -0
- package/dist/src/components/{filter → Filter}/Filter.js +8 -19
- package/dist/src/components/Filter/Filter.js.map +1 -0
- package/dist/src/components/{filter → Filter}/FilterStack.d.ts +0 -0
- package/dist/src/components/{filter → Filter}/FilterStack.js +1 -0
- package/dist/src/components/Filter/FilterStack.js.map +1 -0
- package/dist/src/components/{filter → Filter}/index.d.ts +0 -0
- package/dist/src/components/{filter → Filter}/index.js +1 -0
- package/dist/src/components/Filter/index.js.map +1 -0
- package/dist/src/components/{context → ReactifySearchBase}/ReactifySearchBase.d.ts +0 -0
- package/dist/src/components/{context → ReactifySearchBase}/ReactifySearchBase.js +28 -37
- package/dist/src/components/ReactifySearchBase/ReactifySearchBase.js.map +1 -0
- package/dist/src/components/{context → ReactifySearchBase}/index.d.ts +0 -0
- package/dist/src/components/{context → ReactifySearchBase}/index.js +1 -0
- package/dist/src/components/ReactifySearchBase/index.js.map +1 -0
- package/dist/src/components/{result → Result}/ResultCardCallout.d.ts +0 -0
- package/dist/src/components/{result → Result}/ResultCardCallout.js +4 -5
- package/dist/src/components/Result/ResultCardCallout.js.map +1 -0
- package/dist/src/components/{result → Result}/ResultCardProduct.d.ts +0 -0
- package/dist/src/components/{result → Result}/ResultCardProduct.js +5 -18
- package/dist/src/components/Result/ResultCardProduct.js.map +1 -0
- package/dist/src/components/{result → Result}/ResultPaginationLoadMore.d.ts +0 -0
- package/dist/src/components/{result → Result}/ResultPaginationLoadMore.js +1 -0
- package/dist/src/components/Result/ResultPaginationLoadMore.js.map +1 -0
- package/dist/src/components/{result → Result}/ResultPaginationNextPrev.d.ts +0 -0
- package/dist/src/components/{result → Result}/ResultPaginationNextPrev.js +1 -0
- package/dist/src/components/Result/ResultPaginationNextPrev.js.map +1 -0
- package/dist/src/components/{result → Result}/ResultPaginationNumbered.d.ts +0 -0
- package/dist/src/components/{result → Result}/ResultPaginationNumbered.js +1 -0
- package/dist/src/components/Result/ResultPaginationNumbered.js.map +1 -0
- package/dist/src/components/{result → Result}/ResultStack.d.ts +0 -0
- package/dist/src/components/{result → Result}/ResultStack.js +9 -8
- package/dist/src/components/Result/ResultStack.js.map +1 -0
- package/dist/src/components/{result → Result}/ResultStateProvider.d.ts +1 -1
- package/dist/src/components/{result → Result}/ResultStateProvider.js +5 -1
- package/dist/src/components/Result/ResultStateProvider.js.map +1 -0
- package/dist/src/components/{result → Result}/index.d.ts +0 -0
- package/dist/src/components/{result → Result}/index.js +1 -0
- package/dist/src/components/Result/index.js.map +1 -0
- package/dist/src/components/{search → Search}/SearchInput.d.ts +0 -0
- package/dist/src/components/{search → Search}/SearchInput.js +1 -0
- package/dist/src/components/Search/SearchInput.js.map +1 -0
- package/dist/src/components/{search → Search}/index.d.ts +0 -0
- package/dist/src/components/{search → Search}/index.js +1 -0
- package/dist/src/components/Search/index.js.map +1 -0
- package/dist/src/components/{sensor → Sensor}/SensorCollection.d.ts +0 -0
- package/dist/src/components/{sensor → Sensor}/SensorCollection.js +1 -0
- package/dist/src/components/Sensor/SensorCollection.js.map +1 -0
- package/dist/src/components/{sensor → Sensor}/SensorInventoryAvailable.d.ts +0 -0
- package/dist/src/components/{sensor → Sensor}/SensorInventoryAvailable.js +2 -1
- package/dist/src/components/Sensor/SensorInventoryAvailable.js.map +1 -0
- package/dist/src/components/{sensor → Sensor}/SensorPublished.d.ts +0 -0
- package/dist/src/components/{sensor → Sensor}/SensorPublished.js +1 -0
- package/dist/src/components/Sensor/SensorPublished.js.map +1 -0
- package/dist/src/components/{sensor → Sensor}/SensorSearch.d.ts +0 -0
- package/dist/src/components/{sensor → Sensor}/SensorSearch.js +1 -0
- package/dist/src/components/Sensor/SensorSearch.js.map +1 -0
- package/dist/src/components/{sensor → Sensor}/SensorSort.d.ts +0 -0
- package/dist/src/components/{sensor → Sensor}/SensorSort.js +2 -19
- package/dist/src/components/Sensor/SensorSort.js.map +1 -0
- package/dist/src/components/{sensor → Sensor}/SensorSortScore.d.ts +0 -0
- package/dist/src/components/{sensor → Sensor}/SensorSortScore.js +1 -0
- package/dist/src/components/Sensor/SensorSortScore.js.map +1 -0
- package/dist/src/components/{sensor → Sensor}/SensorStack.d.ts +0 -0
- package/dist/src/components/{sensor → Sensor}/SensorStack.js +1 -0
- package/dist/src/components/Sensor/SensorStack.js.map +1 -0
- package/dist/src/components/{sensor → Sensor}/index.d.ts +0 -0
- package/dist/src/components/{sensor → Sensor}/index.js +1 -0
- package/dist/src/components/Sensor/index.js.map +1 -0
- package/dist/src/components/{sortby → Sortby}/Sortby.d.ts +0 -0
- package/dist/src/components/{sortby → Sortby}/Sortby.js +1 -0
- package/dist/src/components/Sortby/Sortby.js.map +1 -0
- package/dist/src/components/{sortby → Sortby}/index.d.ts +0 -0
- package/dist/src/components/{sortby → Sortby}/index.js +1 -0
- package/dist/src/components/Sortby/index.js.map +1 -0
- package/dist/src/components/{utility → Utility}/UtilityAuthenticatedReactiveBase.d.ts +0 -0
- package/dist/src/components/{utility → Utility}/UtilityAuthenticatedReactiveBase.js +4 -3
- package/dist/src/components/Utility/UtilityAuthenticatedReactiveBase.js.map +1 -0
- package/dist/src/components/{utility → Utility}/index.d.ts +0 -0
- package/dist/src/components/{utility → Utility}/index.js +1 -0
- package/dist/src/components/Utility/index.js.map +1 -0
- package/dist/src/components/index.d.ts +8 -8
- package/dist/src/components/index.js +9 -8
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/index.js +2 -0
- package/dist/src/hooks/index.js.map +1 -0
- package/dist/src/hooks/reactivesearch/index.d.ts +3 -3
- package/dist/src/hooks/reactivesearch/index.js +4 -3
- package/dist/src/hooks/reactivesearch/index.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js +3 -1
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.js +3 -2
- package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.js +3 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.js +3 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.js +3 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.js +3 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveReactProp.js +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveReactProp.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveReactiveListProps.d.ts +5 -0
- package/dist/src/hooks/reactivesearch/{useReactiveResultStackProps.js → useReactiveReactiveListProps.js} +7 -5
- package/dist/src/hooks/reactivesearch/useReactiveReactiveListProps.js.map +1 -0
- package/dist/src/hooks/useAnalytics.js +3 -0
- package/dist/src/hooks/useAnalytics.js.map +1 -0
- package/dist/src/hooks/useConfig.js +10 -8
- package/dist/src/hooks/useConfig.js.map +1 -0
- package/dist/src/hooks/useCuration.js +17 -3
- package/dist/src/hooks/useCuration.js.map +1 -0
- package/dist/src/hooks/useDebugger.d.ts +1 -0
- package/dist/src/hooks/useDebugger.js +15 -0
- package/dist/src/hooks/useDebugger.js.map +1 -0
- package/dist/src/hooks/useFilterCollapsedState.js +1 -0
- package/dist/src/hooks/useFilterCollapsedState.js.map +1 -0
- package/dist/src/hooks/useFilterListProps.js +37 -9
- package/dist/src/hooks/useFilterListProps.js.map +1 -0
- package/dist/src/hooks/useFilterStack.d.ts +3 -1
- package/dist/src/hooks/useFilterStack.js +7 -1
- package/dist/src/hooks/useFilterStack.js.map +1 -0
- package/dist/src/hooks/useFilters.js +8 -3
- package/dist/src/hooks/useFilters.js.map +1 -0
- package/dist/src/hooks/usePagination.d.ts +2 -2
- package/dist/src/hooks/usePagination.js +29 -17
- package/dist/src/hooks/usePagination.js.map +1 -0
- package/dist/src/hooks/usePaginationLoadMore.d.ts +3 -2
- package/dist/src/hooks/usePaginationLoadMore.js +15 -12
- package/dist/src/hooks/usePaginationLoadMore.js.map +1 -0
- package/dist/src/hooks/useProductPrice.js +1 -0
- package/dist/src/hooks/useProductPrice.js.map +1 -0
- package/dist/src/hooks/useReactifySearchContext.js +1 -0
- package/dist/src/hooks/useReactifySearchContext.js.map +1 -0
- package/dist/src/hooks/useSearch.d.ts +1 -1
- package/dist/src/hooks/useSearch.js +20 -6
- package/dist/src/hooks/useSearch.js.map +1 -0
- package/dist/src/hooks/useSortby.js +22 -5
- package/dist/src/hooks/useSortby.js.map +1 -0
- package/dist/src/index.js +46 -3
- package/dist/src/index.js.map +1 -0
- package/dist/src/types/config.js +1 -0
- package/dist/src/types/config.js.map +1 -0
- package/dist/src/types/elastic.js +1 -0
- package/dist/src/types/elastic.js.map +1 -0
- package/dist/src/types/firestore.js +1 -0
- package/dist/src/types/firestore.js.map +1 -0
- package/dist/src/types/graphql.js +1 -0
- package/dist/src/types/graphql.js.map +1 -0
- package/dist/src/types/index.js +1 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/types/reactivesearch.js +1 -0
- package/dist/src/types/reactivesearch.js.map +1 -0
- package/dist/src/types/shopify.js +1 -0
- package/dist/src/types/shopify.js.map +1 -0
- package/dist/src/utility/debug.d.ts +10 -0
- package/dist/src/utility/debug.js +39 -0
- package/dist/src/utility/debug.js.map +1 -0
- package/dist/src/utility/index.d.ts +1 -0
- package/dist/src/utility/index.js +14 -0
- package/dist/src/utility/index.js.map +1 -0
- package/package.json +8 -3
- package/dist/src/components/example/ExampleFilterList.js +0 -19
- package/dist/src/components/example/ExampleResultCardProduct.js +0 -18
- package/dist/src/components/example/ExampleResultPaginationNumbered.js +0 -26
- package/dist/src/components/example/ExampleSortby.js +0 -12
- package/dist/src/hooks/reactivesearch/useReactiveResultStackProps.d.ts +0 -17
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,73 @@
|
|
|
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.11](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.10...v5.0.0-beta.11) (2022-07-27)
|
|
6
|
+
|
|
7
|
+
## [5.0.0-beta.10](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.9...v5.0.0-beta.10) (2022-07-27)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* improve classnames ([19fcfa1](https://bitbucket.org/usereactify/reactify-search-ui/commit/19fcfa152c555cb2e78ec62371f1758e2d244557))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* check that window is defined before accessing ([e1ec0aa](https://bitbucket.org/usereactify/reactify-search-ui/commit/e1ec0aae22cab7eb86363ed09d47e422d08ff5c1))
|
|
18
|
+
|
|
19
|
+
## [5.0.0-beta.9](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.8...v5.0.0-beta.9) (2022-07-27)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* add classnames for styling to default components ([75997e2](https://bitbucket.org/usereactify/reactify-search-ui/commit/75997e25756595401401de42e9aa29b235581645))
|
|
25
|
+
|
|
26
|
+
## [5.0.0-beta.8](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.7...v5.0.0-beta.8) (2022-07-27)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* improve default components ([81bb427](https://bitbucket.org/usereactify/reactify-search-ui/commit/81bb427367987125eeea352189dd9f411cb4850f))
|
|
32
|
+
|
|
33
|
+
## [5.0.0-beta.7](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.6...v5.0.0-beta.7) (2022-07-27)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
* improve sentry stacktraces and logging ([7f34b30](https://bitbucket.org/usereactify/reactify-search-ui/commit/7f34b3064f41ad9a0e5a3ddc3fa071e5981d0141))
|
|
39
|
+
|
|
40
|
+
## [5.0.0-beta.6](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.5...v5.0.0-beta.6) (2022-07-26)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Bug Fixes
|
|
44
|
+
|
|
45
|
+
* enable typescript inlinesources ([6998e8e](https://bitbucket.org/usereactify/reactify-search-ui/commit/6998e8e3e884d62cf08b08c43ae7dbc73db7f471))
|
|
46
|
+
|
|
47
|
+
## [5.0.0-beta.5](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.4...v5.0.0-beta.5) (2022-07-26)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### Bug Fixes
|
|
51
|
+
|
|
52
|
+
* switch to reactify sentry org dsn ([cae3cf0](https://bitbucket.org/usereactify/reactify-search-ui/commit/cae3cf02721ee8b40ddf13854e7aa3cea88034f4))
|
|
53
|
+
|
|
54
|
+
## [5.0.0-beta.4](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.3...v5.0.0-beta.4) (2022-07-26)
|
|
55
|
+
|
|
56
|
+
## [5.0.0-beta.3](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.2...v5.0.0-beta.3) (2022-07-26)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### Features
|
|
60
|
+
|
|
61
|
+
* improve sentry release process ([4237771](https://bitbucket.org/usereactify/reactify-search-ui/commit/423777120041228dcb6f819f71a00abd08d43987))
|
|
62
|
+
|
|
63
|
+
## [5.0.0-beta.2](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.1...v5.0.0-beta.2) (2022-07-26)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Bug Fixes
|
|
67
|
+
|
|
68
|
+
* use correct glob pattern for artifacts ([9f35c7c](https://bitbucket.org/usereactify/reactify-search-ui/commit/9f35c7ccea4f957a94b172fe7ac62b53faf73b32))
|
|
69
|
+
|
|
70
|
+
## [5.0.0-beta.1](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.0...v5.0.0-beta.1) (2022-07-26)
|
|
71
|
+
|
|
5
72
|
## [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
73
|
|
|
7
74
|
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usereactify/search",
|
|
3
3
|
"description": "React UI library for Reactify Search",
|
|
4
|
-
"version": "5.0.0-beta.
|
|
4
|
+
"version": "5.0.0-beta.11",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"types": "dist/src/index.d.ts",
|
|
@@ -14,9 +14,13 @@
|
|
|
14
14
|
"watch": "tsc --watch",
|
|
15
15
|
"release": "standard-version --prerelease rc",
|
|
16
16
|
"release:beta": "standard-version --prerelease beta",
|
|
17
|
-
"
|
|
17
|
+
"prebuild": "rimraf dist",
|
|
18
|
+
"build": "tsc",
|
|
18
19
|
"prettier": "prettier --write .",
|
|
19
|
-
"storybook": "start-storybook -p 6006"
|
|
20
|
+
"storybook": "start-storybook -p 6006",
|
|
21
|
+
"sentry:release:new": "sentry-cli releases new $npm_package_version",
|
|
22
|
+
"sentry:release:upload": "sentry-cli releases files $npm_package_version upload-sourcemaps dist",
|
|
23
|
+
"sentry:release:finalize": "sentry-cli releases finalize $npm_package_version"
|
|
20
24
|
},
|
|
21
25
|
"husky": {
|
|
22
26
|
"hooks": {
|
|
@@ -46,6 +50,7 @@
|
|
|
46
50
|
"@appbaseio/reactivesearch": "^3.14.0",
|
|
47
51
|
"@commitlint/cli": "13.2.0",
|
|
48
52
|
"@commitlint/config-conventional": "13.2.0",
|
|
53
|
+
"@sentry/cli": "2.5.0",
|
|
49
54
|
"@storybook/addon-actions": "6.3.10",
|
|
50
55
|
"@storybook/addon-essentials": "6.3.10",
|
|
51
56
|
"@storybook/addon-links": "6.3.10",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FilterProps } from "../../components";
|
|
3
|
-
export declare type ExampleFilterListProps =
|
|
3
|
+
export declare type ExampleFilterListProps = React.ComponentProps<NonNullable<FilterProps["renderFilterList"]>>;
|
|
4
4
|
export declare const ExampleFilterList: React.FC<ExampleFilterListProps>;
|
|
@@ -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.ExampleFilterList = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const ExampleFilterList = (props) => {
|
|
9
|
+
return (react_1.default.createElement("div", { className: "rs__filter" },
|
|
10
|
+
react_1.default.createElement("h3", { className: "rs__filter__name" }, props.filter.name),
|
|
11
|
+
react_1.default.createElement("ul", { className: "rs__filter__list" }, props.filterListProps.options.map((option) => (react_1.default.createElement("li", { key: option.key, className: "rs__filter__list-item" },
|
|
12
|
+
react_1.default.createElement("label", { className: "rs__filter__list-item-label" },
|
|
13
|
+
react_1.default.createElement("input", { className: "rs__filter__list-item-input", value: option.key, type: "checkbox", checked: option.checked, onChange: ({ target: { value } }) => props.filterListProps.handleChange(value) }),
|
|
14
|
+
react_1.default.createElement("span", { className: "rs__filter__list-item-key" }, option.key),
|
|
15
|
+
react_1.default.createElement("span", { className: "rs__filter__list-item-count" },
|
|
16
|
+
"(",
|
|
17
|
+
option.doc_count,
|
|
18
|
+
")"))))))));
|
|
19
|
+
};
|
|
20
|
+
exports.ExampleFilterList = ExampleFilterList;
|
|
21
|
+
//# sourceMappingURL=ExampleFilterList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleFilterList.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterList.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,iBAAiB,GAAqC,CAAC,KAAK,EAAE,EAAE;IAC3E,OAAO,CACL,uCAAK,SAAS,EAAC,YAAY;QACzB,sCAAI,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAM;QACzD,sCAAI,SAAS,EAAC,kBAAkB,IAC7B,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC7C,sCAAI,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,SAAS,EAAC,uBAAuB;YACpD,yCAAO,SAAS,EAAC,6BAA6B;gBAC5C,yCACE,SAAS,EAAC,6BAA6B,EACvC,KAAK,EAAE,MAAM,CAAC,GAAG,EACjB,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAClC,KAAK,CAAC,eAAe,CAAC,YAAY,CAAC,KAAK,CAAC,GAE3C;gBACF,wCAAM,SAAS,EAAC,2BAA2B,IAAE,MAAM,CAAC,GAAG,CAAQ;gBAC/D,wCAAM,SAAS,EAAC,6BAA6B;;oBACzC,MAAM,CAAC,SAAS;wBACb,CACD,CACL,CACN,CAAC,CACC,CACD,CACP,CAAC;AACJ,CAAC,CAAC;AA3BW,QAAA,iBAAiB,qBA2B5B","sourcesContent":["import React from \"react\";\n\nimport { FilterProps } from \"../../components\";\n\nexport type ExampleFilterListProps = React.ComponentProps<\n NonNullable<FilterProps[\"renderFilterList\"]>\n>;\n\nexport const ExampleFilterList: React.FC<ExampleFilterListProps> = (props) => {\n return (\n <div className=\"rs__filter\">\n <h3 className=\"rs__filter__name\">{props.filter.name}</h3>\n <ul className=\"rs__filter__list\">\n {props.filterListProps.options.map((option) => (\n <li key={option.key} className=\"rs__filter__list-item\">\n <label className=\"rs__filter__list-item-label\">\n <input\n className=\"rs__filter__list-item-input\"\n value={option.key}\n type=\"checkbox\"\n checked={option.checked}\n onChange={({ target: { value } }) =>\n props.filterListProps.handleChange(value)\n }\n />\n <span className=\"rs__filter__list-item-key\">{option.key}</span>\n <span className=\"rs__filter__list-item-count\">\n ({option.doc_count})\n </span>\n </label>\n </li>\n ))}\n </ul>\n </div>\n );\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FilterProps } from "../../components";
|
|
3
|
-
export declare type ExampleFilterRangeProps =
|
|
3
|
+
export declare type ExampleFilterRangeProps = React.ComponentProps<NonNullable<FilterProps["renderFilterRange"]>>;
|
|
4
4
|
export declare const ExampleFilterRange: React.FC<ExampleFilterRangeProps>;
|
|
@@ -5,12 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ExampleFilterRange = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const
|
|
8
|
+
const SingleRange_1 = __importDefault(require("@appbaseio/reactivesearch/lib/components/range/SingleRange"));
|
|
9
9
|
const ExampleFilterRange = (props) => {
|
|
10
10
|
if (props.filter.handle === "price") {
|
|
11
|
-
return (react_1.default.createElement(
|
|
12
|
-
react_1.default.createElement("
|
|
13
|
-
react_1.default.createElement(
|
|
11
|
+
return (react_1.default.createElement("div", { className: "rs__filter" },
|
|
12
|
+
react_1.default.createElement("h3", { className: "rs__filter__name" }, props.filter.name),
|
|
13
|
+
react_1.default.createElement(SingleRange_1.default, Object.assign({ data: [
|
|
14
14
|
{ start: "0", label: "All prices" },
|
|
15
15
|
{ start: "0", end: "99", label: "Under $100" },
|
|
16
16
|
{ start: "0", end: "49", label: "Under $50" },
|
|
@@ -19,3 +19,4 @@ const ExampleFilterRange = (props) => {
|
|
|
19
19
|
return null;
|
|
20
20
|
};
|
|
21
21
|
exports.ExampleFilterRange = ExampleFilterRange;
|
|
22
|
+
//# sourceMappingURL=ExampleFilterRange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleFilterRange.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterRange.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,6GAAqF;AAQ9E,MAAM,kBAAkB,GAAsC,CACnE,KAAK,EACL,EAAE;IACF,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,OAAO,EAAE;QACnC,OAAO,CACL,uCAAK,SAAS,EAAC,YAAY;YACzB,sCAAI,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAM;YACzD,8BAAC,qBAAW,kBACV,IAAI,EAAE;oBACJ,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE;oBACnC,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE;oBAC9C,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE;iBAC9C,IACG,KAAK,CAAC,wBAAwB,EAClC,CACE,CACP,CAAC;KACH;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AApBW,QAAA,kBAAkB,sBAoB7B","sourcesContent":["import React from \"react\";\nimport SingleRange from \"@appbaseio/reactivesearch/lib/components/range/SingleRange\";\n\nimport { FilterProps } from \"../../components\";\n\nexport type ExampleFilterRangeProps = React.ComponentProps<\n NonNullable<FilterProps[\"renderFilterRange\"]>\n>;\n\nexport const ExampleFilterRange: React.FC<ExampleFilterRangeProps> = (\n props\n) => {\n if (props.filter.handle === \"price\") {\n return (\n <div className=\"rs__filter\">\n <h3 className=\"rs__filter__name\">{props.filter.name}</h3>\n <SingleRange\n data={[\n { start: \"0\", label: \"All prices\" },\n { start: \"0\", end: \"99\", label: \"Under $100\" },\n { start: \"0\", end: \"49\", label: \"Under $50\" },\n ]}\n {...props.reactiveFilterRangeProps}\n />\n </div>\n );\n }\n\n return null;\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FilterProps } from "../../components";
|
|
3
|
-
export declare type ExampleFilterSliderProps =
|
|
3
|
+
export declare type ExampleFilterSliderProps = React.ComponentProps<NonNullable<FilterProps["renderFilterSlider"]>>;
|
|
4
4
|
export declare const ExampleFilterSlider: React.FC<ExampleFilterSliderProps>;
|
|
@@ -8,13 +8,14 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const reactivesearch_1 = require("@appbaseio/reactivesearch");
|
|
9
9
|
const ExampleFilterSlider = (props) => {
|
|
10
10
|
if (props.filter.handle === "price") {
|
|
11
|
-
return (react_1.default.createElement(
|
|
12
|
-
react_1.default.createElement("
|
|
11
|
+
return (react_1.default.createElement("div", { className: "rs__filter" },
|
|
12
|
+
react_1.default.createElement("h3", { className: "rs__filter__name" }, props.filter.name),
|
|
13
13
|
react_1.default.createElement(reactivesearch_1.RangeSlider, Object.assign({ range: {
|
|
14
14
|
start: 0,
|
|
15
|
-
end: 500
|
|
15
|
+
end: 500,
|
|
16
16
|
} }, props.reactiveFilterSliderProps))));
|
|
17
17
|
}
|
|
18
18
|
return null;
|
|
19
19
|
};
|
|
20
20
|
exports.ExampleFilterSlider = ExampleFilterSlider;
|
|
21
|
+
//# sourceMappingURL=ExampleFilterSlider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleFilterSlider.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterSlider.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,8DAAwD;AAQjD,MAAM,mBAAmB,GAAuC,CACrE,KAAK,EACL,EAAE;IACF,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,OAAO,EAAE;QACnC,OAAO,CACL,uCAAK,SAAS,EAAC,YAAY;YACzB,sCAAI,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAM;YACzD,8BAAC,4BAAW,kBACV,KAAK,EAAE;oBACL,KAAK,EAAE,CAAC;oBACR,GAAG,EAAE,GAAG;iBACT,IACG,KAAK,CAAC,yBAAyB,EACnC,CACE,CACP,CAAC;KACH;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAnBW,QAAA,mBAAmB,uBAmB9B","sourcesContent":["import React from \"react\";\nimport { RangeSlider } from \"@appbaseio/reactivesearch\";\n\nimport { FilterProps } from \"../../components\";\n\nexport type ExampleFilterSliderProps = React.ComponentProps<\n NonNullable<FilterProps[\"renderFilterSlider\"]>\n>;\n\nexport const ExampleFilterSlider: React.FC<ExampleFilterSliderProps> = (\n props\n) => {\n if (props.filter.handle === \"price\") {\n return (\n <div className=\"rs__filter\">\n <h3 className=\"rs__filter__name\">{props.filter.name}</h3>\n <RangeSlider\n range={{\n start: 0,\n end: 500,\n }}\n {...props.reactiveFilterSliderProps}\n />\n </div>\n );\n }\n\n return null;\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FilterStackProps } from "../../components";
|
|
3
|
-
export declare type ExampleFilterStackProps =
|
|
3
|
+
export declare type ExampleFilterStackProps = React.ComponentProps<NonNullable<FilterStackProps["renderFilters"]>>;
|
|
4
4
|
export declare const ExampleFilterStack: React.FC<ExampleFilterStackProps>;
|
|
@@ -10,3 +10,4 @@ const ExampleFilterStack = (props) => {
|
|
|
10
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
11
|
};
|
|
12
12
|
exports.ExampleFilterStack = ExampleFilterStack;
|
|
13
|
+
//# sourceMappingURL=ExampleFilterStack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleFilterStack.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterStack.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA4D;AAMrD,MAAM,kBAAkB,GAAsC,CACnE,KAAK,EACL,EAAE;IACF,OAAO,CACL,8DACG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC7B,8BAAC,mBAAM,kBAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,IAAM,KAAK,EAAI,CACtD,CAAC,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,kBAAkB,sBAU7B","sourcesContent":["import React from \"react\";\n\nimport { Filter, FilterStackProps } from \"../../components\";\n\nexport type ExampleFilterStackProps = React.ComponentProps<\n NonNullable<FilterStackProps[\"renderFilters\"]>\n>;\n\nexport const ExampleFilterStack: React.FC<ExampleFilterStackProps> = (\n props\n) => {\n return (\n <>\n {props.filters.map((filter) => (\n <Filter key={filter.id} filter={filter} {...props} />\n ))}\n </>\n );\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ResultCardCalloutProps } from "../../components";
|
|
3
|
-
export declare type ExampleResultCardCalloutProps =
|
|
3
|
+
export declare type ExampleResultCardCalloutProps = React.ComponentProps<NonNullable<ResultCardCalloutProps["render"]>>;
|
|
4
4
|
export declare const ExampleResultCardCallout: React.FC<ExampleResultCardCalloutProps>;
|
|
@@ -13,9 +13,10 @@ const ExampleResultCardCallout = (props) => {
|
|
|
13
13
|
gridColumn: `span ${(_b = props.callout.displayColumns) !== null && _b !== void 0 ? _b : 1}`,
|
|
14
14
|
});
|
|
15
15
|
}, [props.callout]);
|
|
16
|
-
return (react_1.default.createElement("
|
|
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)));
|
|
16
|
+
return (react_1.default.createElement("div", { className: "rs__result-card-callout", ref: props.itemRef, style: styleProp },
|
|
17
|
+
react_1.default.createElement("a", { className: "rs__result-card-callout__link", href: props.callout.link, onClick: props.handleClick },
|
|
18
|
+
props.callout.desktopImage && (react_1.default.createElement("img", { className: "rs__result-card-callout__image", src: props.callout.desktopImage, width: "100%" })),
|
|
19
|
+
react_1.default.createElement("span", { className: "rs__result-card-callout__title" }, props.callout.title))));
|
|
20
20
|
};
|
|
21
21
|
exports.ExampleResultCardCallout = ExampleResultCardCallout;
|
|
22
|
+
//# sourceMappingURL=ExampleResultCardCallout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleResultCardCallout.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultCardCallout.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,wBAAwB,GACnC,CAAC,KAAK,EAAE,EAAE;IACR,MAAM,SAAS,GAAG,eAAK,CAAC,OAAO,CAC7B,GAAG,EAAE;;QAAC,OAAA,CAAC;YACL,OAAO,EAAE,QAAQ,MAAA,KAAK,CAAC,OAAO,CAAC,WAAW,mCAAI,CAAC,EAAE;YACjD,UAAU,EAAE,QAAQ,MAAA,KAAK,CAAC,OAAO,CAAC,cAAc,mCAAI,CAAC,EAAE;SACxD,CAAC,CAAA;KAAA,EACF,CAAC,KAAK,CAAC,OAAO,CAAC,CAChB,CAAC;IAEF,OAAO,CACL,uCACE,SAAS,EAAC,yBAAyB,EACnC,GAAG,EAAE,KAAK,CAAC,OAAO,EAClB,KAAK,EAAE,SAAS;QAEhB,qCACE,SAAS,EAAC,+BAA+B,EACzC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,EACxB,OAAO,EAAE,KAAK,CAAC,WAAW;YAEzB,KAAK,CAAC,OAAO,CAAC,YAAY,IAAI,CAC7B,uCACE,SAAS,EAAC,gCAAgC,EAC1C,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY,EAC/B,KAAK,EAAC,MAAM,GACZ,CACH;YACD,wCAAM,SAAS,EAAC,gCAAgC,IAC7C,KAAK,CAAC,OAAO,CAAC,KAAK,CACf,CACL,CACA,CACP,CAAC;AACJ,CAAC,CAAC;AAlCS,QAAA,wBAAwB,4BAkCjC","sourcesContent":["import React from \"react\";\n\nimport { ResultCardCalloutProps } from \"../../components\";\n\nexport type ExampleResultCardCalloutProps = React.ComponentProps<\n NonNullable<ResultCardCalloutProps[\"render\"]>\n>;\n\nexport const ExampleResultCardCallout: React.FC<ExampleResultCardCalloutProps> =\n (props) => {\n const styleProp = React.useMemo<React.HTMLAttributes<HTMLElement>[\"style\"]>(\n () => ({\n gridRow: `span ${props.callout.displayRows ?? 1}`,\n gridColumn: `span ${props.callout.displayColumns ?? 1}`,\n }),\n [props.callout]\n );\n\n return (\n <div\n className=\"rs__result-card-callout\"\n ref={props.itemRef}\n style={styleProp}\n >\n <a\n className=\"rs__result-card-callout__link\"\n href={props.callout.link}\n onClick={props.handleClick}\n >\n {props.callout.desktopImage && (\n <img\n className=\"rs__result-card-callout__image\"\n src={props.callout.desktopImage}\n width=\"100%\"\n />\n )}\n <span className=\"rs__result-card-callout__title\">\n {props.callout.title}\n </span>\n </a>\n </div>\n );\n };\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ResultCardProductProps } from "../../components";
|
|
3
|
-
export declare type ExampleResultCardProductProps =
|
|
3
|
+
export declare type ExampleResultCardProductProps = React.ComponentProps<NonNullable<ResultCardProductProps["render"]>>;
|
|
4
4
|
export declare const ExampleResultCardProduct: React.FC<ExampleResultCardProductProps>;
|
|
@@ -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.ExampleResultCardProduct = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const ExampleResultCardProduct = (props) => {
|
|
9
|
+
return (react_1.default.createElement("div", { ref: props.itemRef, className: "rs__result-card-product" },
|
|
10
|
+
react_1.default.createElement("a", { className: "rs__result-card-product__link", onClick: props.handleClick, href: `/products/${props.product.handle}` },
|
|
11
|
+
props.product.image && (react_1.default.createElement("img", { className: "rs__result-card-product__image", src: props.product.image, width: "100%" })),
|
|
12
|
+
react_1.default.createElement("span", { className: "rs__result-card-product__title" }, props.product.title)),
|
|
13
|
+
react_1.default.createElement("span", { className: "rs__result-card-product__price" }, props.formattedPrice),
|
|
14
|
+
props.onSale && (react_1.default.createElement("span", { className: "rs__result-card-product__price-sale", style: {
|
|
15
|
+
textDecoration: "line-through",
|
|
16
|
+
} }, props.formattedCompareAtPrice))));
|
|
17
|
+
};
|
|
18
|
+
exports.ExampleResultCardProduct = ExampleResultCardProduct;
|
|
19
|
+
//# sourceMappingURL=ExampleResultCardProduct.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleResultCardProduct.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultCardProduct.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,wBAAwB,GACnC,CAAC,KAAK,EAAE,EAAE;IACR,OAAO,CACL,uCAAK,GAAG,EAAE,KAAK,CAAC,OAAO,EAAE,SAAS,EAAC,yBAAyB;QAC1D,qCACE,SAAS,EAAC,+BAA+B,EACzC,OAAO,EAAE,KAAK,CAAC,WAAW,EAC1B,IAAI,EAAE,aAAa,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE;YAExC,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,CACtB,uCACE,SAAS,EAAC,gCAAgC,EAC1C,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EACxB,KAAK,EAAC,MAAM,GACZ,CACH;YACD,wCAAM,SAAS,EAAC,gCAAgC,IAC7C,KAAK,CAAC,OAAO,CAAC,KAAK,CACf,CACL;QACJ,wCAAM,SAAS,EAAC,gCAAgC,IAC7C,KAAK,CAAC,cAAc,CAChB;QACN,KAAK,CAAC,MAAM,IAAI,CACf,wCACE,SAAS,EAAC,qCAAqC,EAC/C,KAAK,EAAE;gBACL,cAAc,EAAE,cAAc;aAC/B,IAEA,KAAK,CAAC,uBAAuB,CACzB,CACR,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAnCS,QAAA,wBAAwB,4BAmCjC","sourcesContent":["import React from \"react\";\n\nimport { ResultCardProductProps } from \"../../components\";\n\nexport type ExampleResultCardProductProps = React.ComponentProps<\n NonNullable<ResultCardProductProps[\"render\"]>\n>;\n\nexport const ExampleResultCardProduct: React.FC<ExampleResultCardProductProps> =\n (props) => {\n return (\n <div ref={props.itemRef} className=\"rs__result-card-product\">\n <a\n className=\"rs__result-card-product__link\"\n onClick={props.handleClick}\n href={`/products/${props.product.handle}`}\n >\n {props.product.image && (\n <img\n className=\"rs__result-card-product__image\"\n src={props.product.image}\n width=\"100%\"\n />\n )}\n <span className=\"rs__result-card-product__title\">\n {props.product.title}\n </span>\n </a>\n <span className=\"rs__result-card-product__price\">\n {props.formattedPrice}\n </span>\n {props.onSale && (\n <span\n className=\"rs__result-card-product__price-sale\"\n style={{\n textDecoration: \"line-through\",\n }}\n >\n {props.formattedCompareAtPrice}\n </span>\n )}\n </div>\n );\n };\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ResultPaginationLoadMoreProps } from "../../components";
|
|
3
|
-
export declare type ExampleResultPaginationLoadMoreProps =
|
|
3
|
+
export declare type ExampleResultPaginationLoadMoreProps = React.ComponentProps<NonNullable<ResultPaginationLoadMoreProps["render"]>>;
|
|
4
4
|
export declare const ExampleResultPaginationLoadMore: React.FC<ExampleResultPaginationLoadMoreProps>;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.ExampleResultPaginationLoadMore = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const ExampleResultPaginationLoadMore = (props) => {
|
|
9
|
-
return (react_1.default.createElement("button", { onClick: () => props.handleLoadMore() }, "Load more"));
|
|
9
|
+
return (react_1.default.createElement("button", { className: "rs__pagination__loadmore-button", onClick: () => props.handleLoadMore() }, "Load more"));
|
|
10
10
|
};
|
|
11
11
|
exports.ExampleResultPaginationLoadMore = ExampleResultPaginationLoadMore;
|
|
12
|
+
//# sourceMappingURL=ExampleResultPaginationLoadMore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleResultPaginationLoadMore.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultPaginationLoadMore.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,+BAA+B,GAC1C,CAAC,KAAK,EAAE,EAAE;IACR,OAAO,CACL,0CACE,SAAS,EAAC,iCAAiC,EAC3C,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,IAEpC,WAAW,CACL,CACV,CAAC;AACJ,CAAC,CAAC;AAVS,QAAA,+BAA+B,mCAUxC","sourcesContent":["import React from \"react\";\n\nimport { ResultPaginationLoadMoreProps } from \"../../components\";\n\nexport type ExampleResultPaginationLoadMoreProps = React.ComponentProps<\n NonNullable<ResultPaginationLoadMoreProps[\"render\"]>\n>;\n\nexport const ExampleResultPaginationLoadMore: React.FC<ExampleResultPaginationLoadMoreProps> =\n (props) => {\n return (\n <button\n className=\"rs__pagination__loadmore-button\"\n onClick={() => props.handleLoadMore()}\n >\n {\"Load more\"}\n </button>\n );\n };\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ResultPaginationNextPrevProps } from "../../components";
|
|
3
|
-
export declare type ExampleResultPaginationNextPrevProps =
|
|
3
|
+
export declare type ExampleResultPaginationNextPrevProps = React.ComponentProps<NonNullable<ResultPaginationNextPrevProps["render"]>>;
|
|
4
4
|
export declare const ExampleResultPaginationNextPrev: React.FC<ExampleResultPaginationNextPrevProps>;
|
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.ExampleResultPaginationNextPrev = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const ExampleResultPaginationNextPrev = (props) => {
|
|
9
|
-
return (react_1.default.createElement("nav",
|
|
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"))));
|
|
9
|
+
return (react_1.default.createElement("nav", { className: "rs__pagination__nav" },
|
|
10
|
+
props.hasPreviousPage && (react_1.default.createElement("a", { className: "rs__pagination__prev-link", rel: "prev", onClick: props.handlePreviousPage, href: props.buildPagePath(props.actualCurrentPage - 1) }, "Prev")),
|
|
11
|
+
props.hasNextPage && (react_1.default.createElement("a", { className: "rs__pagination__next-link", rel: "next", onClick: props.handleNextPage, href: props.buildPagePath(props.actualCurrentPage + 1) }, "Next"))));
|
|
12
12
|
};
|
|
13
13
|
exports.ExampleResultPaginationNextPrev = ExampleResultPaginationNextPrev;
|
|
14
|
+
//# sourceMappingURL=ExampleResultPaginationNextPrev.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleResultPaginationNextPrev.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultPaginationNextPrev.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,+BAA+B,GAC1C,CAAC,KAAK,EAAE,EAAE;IACR,OAAO,CACL,uCAAK,SAAS,EAAC,qBAAqB;QACjC,KAAK,CAAC,eAAe,IAAI,CACxB,qCACE,SAAS,EAAC,2BAA2B,EACrC,GAAG,EAAC,MAAM,EACV,OAAO,EAAE,KAAK,CAAC,kBAAkB,EACjC,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,iBAAiB,GAAG,CAAC,CAAC,IAErD,MAAM,CACL,CACL;QACA,KAAK,CAAC,WAAW,IAAI,CACpB,qCACE,SAAS,EAAC,2BAA2B,EACrC,GAAG,EAAC,MAAM,EACV,OAAO,EAAE,KAAK,CAAC,cAAc,EAC7B,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,iBAAiB,GAAG,CAAC,CAAC,IAErD,MAAM,CACL,CACL,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AA1BS,QAAA,+BAA+B,mCA0BxC","sourcesContent":["import React from \"react\";\n\nimport { ResultPaginationNextPrevProps } from \"../../components\";\n\nexport type ExampleResultPaginationNextPrevProps = React.ComponentProps<\n NonNullable<ResultPaginationNextPrevProps[\"render\"]>\n>;\n\nexport const ExampleResultPaginationNextPrev: React.FC<ExampleResultPaginationNextPrevProps> =\n (props) => {\n return (\n <nav className=\"rs__pagination__nav\">\n {props.hasPreviousPage && (\n <a\n className=\"rs__pagination__prev-link\"\n rel=\"prev\"\n onClick={props.handlePreviousPage}\n href={props.buildPagePath(props.actualCurrentPage - 1)}\n >\n {\"Prev\"}\n </a>\n )}\n {props.hasNextPage && (\n <a\n className=\"rs__pagination__next-link\"\n rel=\"next\"\n onClick={props.handleNextPage}\n href={props.buildPagePath(props.actualCurrentPage + 1)}\n >\n {\"Next\"}\n </a>\n )}\n </nav>\n );\n };\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ResultPaginationNumberedProps } from "../../components";
|
|
3
|
-
export declare type ExampleResultPaginationNumberedProps =
|
|
3
|
+
export declare type ExampleResultPaginationNumberedProps = React.ComponentProps<NonNullable<ResultPaginationNumberedProps["render"]>>;
|
|
4
4
|
export declare const ExampleResultPaginationNumbered: React.FC<ExampleResultPaginationNumberedProps>;
|
|
@@ -0,0 +1,27 @@
|
|
|
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", { className: "rs__pagination__nav" },
|
|
10
|
+
props.currentPage > 0 && (react_1.default.createElement("a", { className: "rs__pagination__prev-link", rel: "prev", href: props.buildPagePath(props.currentPage), onClick: (event) => props.handlePreviousPage(event) }, "Prev")),
|
|
11
|
+
!props.pagesToShow.includes(0) && (react_1.default.createElement("a", { className: "rs__pagination__pagenumber-link", 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", { className: "rs__pagination__pagenumber-active", key: page + 1 }, page + 1)) : (react_1.default.createElement("a", { className: "rs__pagination__pagenumber-link", 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", { className: "rs__pagination__pagenumber-link", 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", { className: "rs__pagination__next-link", rel: "next", href: props.buildPagePath(props.currentPage + 2), onClick: (event) => props.handleNextPage(event) }, "Next"))));
|
|
25
|
+
};
|
|
26
|
+
exports.ExampleResultPaginationNumbered = ExampleResultPaginationNumbered;
|
|
27
|
+
//# sourceMappingURL=ExampleResultPaginationNumbered.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleResultPaginationNumbered.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultPaginationNumbered.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,+BAA+B,GAC1C,CAAC,KAAK,EAAE,EAAE;IACR,OA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AAM,CACL,CACL,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AA/ES,QAAA,+BAA+B,mCA+ExC","sourcesContent":["import React from \"react\";\n\nimport { ResultPaginationNumberedProps } from \"../../components\";\n\nexport type ExampleResultPaginationNumberedProps = React.ComponentProps<\n NonNullable<ResultPaginationNumberedProps[\"render\"]>\n>;\n\nexport const ExampleResultPaginationNumbered: React.FC<ExampleResultPaginationNumberedProps> =\n (props) => {\n return (\n <nav className=\"rs__pagination__nav\">\n {props.currentPage > 0 && (\n <a\n className=\"rs__pagination__prev-link\"\n rel=\"prev\"\n href={props.buildPagePath(props.currentPage)}\n onClick={(event) => props.handlePreviousPage(event)}\n >\n {\"Prev\"}\n </a>\n )}\n {!props.pagesToShow.includes(0) && (\n <a\n className=\"rs__pagination__pagenumber-link\"\n href={props.buildPagePath(1)}\n onClick={(event) => props.handlePageChange(0, event)}\n rel={0 === props.currentPage - 1 ? `prev` : undefined}\n >\n {\"1\"}\n </a>\n )}\n {!props.pagesToShow.includes(1) && <span>...</span>}\n {props.pagesToShow.map((page) =>\n page === props.currentPage ? (\n <span className=\"rs__pagination__pagenumber-active\" key={page + 1}>\n {page + 1}\n </span>\n ) : (\n <a\n className=\"rs__pagination__pagenumber-link\"\n key={page + 1}\n href={props.buildPagePath(page + 1)}\n onClick={(event) => props.handlePageChange(page, event)}\n rel={\n page === props.currentPage + 1\n ? `next`\n : page === props.currentPage - 1\n ? `prev`\n : undefined\n }\n >\n {page + 1}\n </a>\n )\n )}\n {!props.pagesToShow.includes(props.totalPages - 2) && <span>...</span>}\n {!props.pagesToShow.includes(props.totalPages - 1) && (\n <a\n className=\"rs__pagination__pagenumber-link\"\n href={props.buildPagePath(props.totalPages)}\n onClick={(event) =>\n props.handlePageChange(props.totalPages - 1, event)\n }\n rel={\n props.totalPages - 1 === props.currentPage + 1\n ? `next`\n : props.totalPages - 1 === props.currentPage - 1\n ? `prev`\n : undefined\n }\n >\n {props.totalPages}\n </a>\n )}\n {props.currentPage + 1 < props.totalPages && (\n <a\n className=\"rs__pagination__next-link\"\n rel=\"next\"\n href={props.buildPagePath(props.currentPage + 2)}\n onClick={(event) => props.handleNextPage(event)}\n >\n {\"Next\"}\n </a>\n )}\n </nav>\n );\n };\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SortbyProps } from "../../components";
|
|
3
|
-
export declare type ExampleSortbyProps =
|
|
3
|
+
export declare type ExampleSortbyProps = React.ComponentProps<NonNullable<SortbyProps["renderSortOptions"]>>;
|
|
4
4
|
export declare const ExampleSortby: React.FC<ExampleSortbyProps>;
|
|
@@ -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.ExampleSortby = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const ExampleSortby = (props) => {
|
|
9
|
+
var _a;
|
|
10
|
+
return (react_1.default.createElement("select", { className: "rs__sortby__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, className: "rs__sortby__option", value: sortOption.handle }, sortOption.name)))));
|
|
11
|
+
};
|
|
12
|
+
exports.ExampleSortby = ExampleSortby;
|
|
13
|
+
//# sourceMappingURL=ExampleSortby.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleSortby.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleSortby.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,aAAa,GAAiC,CAAC,KAAK,EAAE,EAAE;;IACnE,OAAO,CACL,0CACE,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAE,MAAA,KAAK,CAAC,UAAU,0CAAE,MAAM,EAC/B,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAE3D,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CACrC,0CACE,GAAG,EAAE,UAAU,CAAC,MAAM,EACtB,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAE,UAAU,CAAC,MAAM,IAEvB,UAAU,CAAC,IAAI,CACT,CACV,CAAC,CACK,CACV,CAAC;AACJ,CAAC,CAAC;AAlBW,QAAA,aAAa,iBAkBxB","sourcesContent":["import React from \"react\";\n\nimport { SortbyProps } from \"../../components\";\n\nexport type ExampleSortbyProps = React.ComponentProps<\n NonNullable<SortbyProps[\"renderSortOptions\"]>\n>;\n\nexport const ExampleSortby: React.FC<ExampleSortbyProps> = (props) => {\n return (\n <select\n className=\"rs__sortby__select\"\n value={props.sortOption?.handle}\n onChange={(event) => props.setSortOption(event.target.value)}\n >\n {props.sortOptions.map((sortOption) => (\n <option\n key={sortOption.handle}\n className=\"rs__sortby__option\"\n value={sortOption.handle}\n >\n {sortOption.name}\n </option>\n ))}\n </select>\n );\n};\n"]}
|
|
File without changes
|
|
@@ -20,3 +20,4 @@ __exportStar(require("./ExampleResultPaginationNumbered"), exports);
|
|
|
20
20
|
__exportStar(require("./ExampleResultPaginationLoadMore"), exports);
|
|
21
21
|
__exportStar(require("./ExampleResultPaginationNextPrev"), exports);
|
|
22
22
|
__exportStar(require("./ExampleSortby"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Example/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sDAAoC;AACpC,uDAAqC;AACrC,wDAAsC;AACtC,uDAAqC;AACrC,6DAA0C;AAC1C,6DAA2C;AAC3C,oEAAkD;AAClD,oEAAkD;AAClD,oEAAkD;AAClD,kDAAgC","sourcesContent":["export * from \"./ExampleFilterList\";\nexport * from \"./ExampleFilterRange\";\nexport * from \"./ExampleFilterSlider\";\nexport * from \"./ExampleFilterStack\";\nexport * from \"./ExampleResultCardCallout\"\nexport * from \"./ExampleResultCardProduct\";\nexport * from \"./ExampleResultPaginationNumbered\";\nexport * from \"./ExampleResultPaginationLoadMore\";\nexport * from \"./ExampleResultPaginationNextPrev\";\nexport * from \"./ExampleSortby\";"]}
|
|
File without changes
|
|
@@ -22,16 +22,16 @@ const hooks_1 = require("../../hooks");
|
|
|
22
22
|
const components_1 = require("../../components");
|
|
23
23
|
const Filter = (props) => {
|
|
24
24
|
if ("single" === props.filter.displayType) {
|
|
25
|
-
return
|
|
25
|
+
return react_1.default.createElement(FilterSingleList, Object.assign({}, props));
|
|
26
26
|
}
|
|
27
27
|
if ("multi" === props.filter.displayType) {
|
|
28
|
-
return
|
|
28
|
+
return react_1.default.createElement(FilterMultiList, Object.assign({}, props));
|
|
29
29
|
}
|
|
30
30
|
if ("range" === props.filter.displayType) {
|
|
31
|
-
return
|
|
31
|
+
return react_1.default.createElement(FilterRange, Object.assign({}, props));
|
|
32
32
|
}
|
|
33
33
|
if ("slider" === props.filter.displayType) {
|
|
34
|
-
return
|
|
34
|
+
return react_1.default.createElement(FilterSlider, Object.assign({}, props));
|
|
35
35
|
}
|
|
36
36
|
console.log(`filter with display type "${props.filter.displayType}" not yet supported`);
|
|
37
37
|
return null;
|
|
@@ -64,26 +64,15 @@ const FilterSlider = (props) => {
|
|
|
64
64
|
// inner component exists only so we can use memos in reactivesearch render functions
|
|
65
65
|
const FilterListInner = (props) => {
|
|
66
66
|
const { filter, renderFilterList, reactivesearchFilterProps } = props, otherProps = __rest(props, ["filter", "renderFilterList", "reactivesearchFilterProps"]);
|
|
67
|
-
const
|
|
68
|
-
const _a = (0, hooks_1.useFilterListProps)(filter, reactivesearchFilterProps), { handleChange } = _a, filterListProps = __rest(_a, ["handleChange"]);
|
|
69
|
-
const handleFilterChange = react_1.default.useCallback((value) => {
|
|
70
|
-
handleChange(value);
|
|
71
|
-
track({
|
|
72
|
-
eventName: "filterChange",
|
|
73
|
-
payload: {
|
|
74
|
-
name: filter.name,
|
|
75
|
-
value: value,
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
}, [filterListProps]);
|
|
79
|
-
const updatedFilterListProps = Object.assign(Object.assign({}, filterListProps), { handleChange: handleFilterChange });
|
|
67
|
+
const filterListProps = (0, hooks_1.useFilterListProps)(filter, reactivesearchFilterProps);
|
|
80
68
|
// hide entire filter when no options available
|
|
81
69
|
if (0 === filterListProps.options.length) {
|
|
82
70
|
return null;
|
|
83
71
|
}
|
|
84
72
|
if (renderFilterList) {
|
|
85
73
|
const Component = renderFilterList;
|
|
86
|
-
return (react_1.default.createElement(Component, Object.assign({ filterListProps:
|
|
74
|
+
return (react_1.default.createElement(Component, Object.assign({ filterListProps: filterListProps, filter: filter }, otherProps)));
|
|
87
75
|
}
|
|
88
|
-
return (react_1.default.createElement(components_1.ExampleFilterList, Object.assign({ filterListProps:
|
|
76
|
+
return (react_1.default.createElement(components_1.ExampleFilterList, Object.assign({ filterListProps: filterListProps, filter: filter }, otherProps)));
|
|
89
77
|
};
|
|
78
|
+
//# sourceMappingURL=Filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Filter.js","sourceRoot":"","sources":["../../../../src/components/Filter/Filter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,wGAAgF;AAChF,0GAAkF;AAMlF,uCAMqB;AACrB,iDAAqD;AA4B9C,MAAM,MAAM,GAA0B,CAAC,KAAK,EAAE,EAAE;IACrD,IAAI,QAAQ,KAAK,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE;QACzC,OAAO,8BAAC,gBAAgB,oBAAK,KAAK,EAAI,CAAC;KACxC;IAED,I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AAE,MAAM,IACV,UAAU,EACd,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport MultiList from \"@appbaseio/reactivesearch/lib/components/list/MultiList\";\nimport SingleList from \"@appbaseio/reactivesearch/lib/components/list/SingleList\";\n\nimport type {\n ConfigFilterOption,\n ReactivesearchFilterProps,\n} from \"../../types\";\nimport {\n useAnalytics,\n useFilterListProps,\n useReactiveFilterListProps,\n useReactiveFilterRangeProps,\n useReactiveFilterSliderProps,\n} from \"../../hooks\";\nimport { ExampleFilterList } from \"../../components\";\nimport { debug } from \"../../utility\";\n\nexport type FilterProps = {\n /** The filter option being rendered */\n filter: ConfigFilterOption;\n /** Render method for List filters */\n renderFilterList?: React.FC<\n Omit<FilterProps, \"renderFilterList\"> & {\n filterListProps: ReturnType<typeof useFilterListProps>;\n }\n >;\n /** Render method for Range filters */\n renderFilterRange?: React.FC<\n Omit<FilterProps, \"renderFilterRange\"> & {\n reactiveFilterRangeProps: ReturnType<typeof useReactiveFilterRangeProps>;\n }\n >;\n /** Render method for Slider filters */\n renderFilterSlider?: React.FC<\n Omit<FilterProps, \"renderFilterSlider\"> & {\n reactiveFilterSliderProps: ReturnType<\n typeof useReactiveFilterSliderProps\n >;\n }\n >;\n};\n\nexport const Filter: React.FC<FilterProps> = (props) => {\n if (\"single\" === props.filter.displayType) {\n return <FilterSingleList {...props} />;\n }\n\n if (\"multi\" === props.filter.displayType) {\n return <FilterMultiList {...props} />;\n }\n\n if (\"range\" === props.filter.displayType) {\n return <FilterRange {...props} />;\n }\n\n if (\"slider\" === props.filter.displayType) {\n return <FilterSlider {...props} />;\n }\n\n console.log(\n `filter with display type \"${props.filter.displayType}\" not yet supported`\n );\n\n return null;\n};\n\nconst FilterSingleList: React.FC<FilterProps> = (props) => {\n const reactiveFilterListProps = useReactiveFilterListProps(props.filter);\n\n return (\n <SingleList\n {...reactiveFilterListProps}\n render={(reactivesearchFilterProps: ReactivesearchFilterProps) => (\n <FilterListInner\n {...props}\n reactivesearchFilterProps={reactivesearchFilterProps}\n />\n )}\n />\n );\n};\n\nconst FilterMultiList: React.FC<FilterProps> = (props) => {\n const reactiveFilterListProps = useReactiveFilterListProps(props.filter);\n\n return (\n <MultiList\n {...reactiveFilterListProps}\n render={(reactivesearchFilterProps: ReactivesearchFilterProps) => (\n <FilterListInner\n {...props}\n reactivesearchFilterProps={reactivesearchFilterProps}\n />\n )}\n />\n );\n};\n\nconst FilterRange: React.FC<FilterProps> = (props) => {\n const reactiveFilterRangeProps = useReactiveFilterRangeProps(props.filter);\n\n if (props.renderFilterRange) {\n const Component = props.renderFilterRange;\n\n return (\n <Component\n {...props}\n reactiveFilterRangeProps={reactiveFilterRangeProps}\n />\n );\n }\n\n return null;\n};\n\nconst FilterSlider: React.FC<FilterProps> = (props) => {\n const reactiveFilterSliderProps = useReactiveFilterSliderProps(props.filter);\n\n if (props.renderFilterSlider) {\n const Component = props.renderFilterSlider;\n\n return (\n <Component\n {...props}\n reactiveFilterSliderProps={reactiveFilterSliderProps}\n />\n );\n }\n\n return null;\n};\n\n// inner component exists only so we can use memos in reactivesearch render functions\nconst FilterListInner: React.FC<\n FilterProps & { reactivesearchFilterProps: ReactivesearchFilterProps }\n> = (props) => {\n const { filter, renderFilterList, reactivesearchFilterProps, ...otherProps } =\n props;\n\n const filterListProps = useFilterListProps(filter, reactivesearchFilterProps);\n\n // hide entire filter when no options available\n if (0 === filterListProps.options.length) {\n return null;\n }\n\n if (renderFilterList) {\n const Component = renderFilterList;\n return (\n <Component\n filterListProps={filterListProps}\n filter={filter}\n {...otherProps}\n />\n );\n }\n\n return (\n <ExampleFilterList\n filterListProps={filterListProps}\n filter={filter}\n {...otherProps}\n />\n );\n};\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterStack.js","sourceRoot":"","sources":["../../../../src/components/Filter/FilterStack.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAAyC;AACzC,iDAAsD;AAO/C,MAAM,WAAW,GAA+B,CAAC,KAAK,EAAE,EAAE;;IAC/D,MAAM,WAAW,GAAG,IAAA,kBAAU,GAAE,CAAC;IAEjC,MAAM,sBAAsB,GAAG,MAAA,KAAK,CAAC,aAAa,mCAAI,+BAAkB,CAAC;IAEzE,OAAO,CACL,8BAAC,sBAAsB,oBACjB,WAAW,EACf,CACH,CAAA;AACH,CAAC,CAAC;AAVW,QAAA,WAAW,eAUtB","sourcesContent":["import React from \"react\";\n\nimport { useFilters } from \"../../hooks\";\nimport { ExampleFilterStack } from \"../../components\";\n\nexport type FilterStackProps = {\n /** Render method called once for all filters */\n renderFilters?: React.FC<ReturnType<typeof useFilters>>\n};\n\nexport const FilterStack: React.FC<FilterStackProps> = (props) => {\n const filtersHook = useFilters();\n\n const RenderFiltersComponent = props.renderFilters ?? ExampleFilterStack;\n\n return (\n <RenderFiltersComponent\n {...filtersHook}\n />\n )\n};\n"]}
|
|
File without changes
|
|
@@ -12,3 +12,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./Filter"), exports);
|
|
14
14
|
__exportStar(require("./FilterStack"), exports);
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Filter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB;AACzB,gDAA8B","sourcesContent":["export * from \"./Filter\";\nexport * from \"./FilterStack\";\n"]}
|
|
File without changes
|