@usereactify/search 5.0.0-beta.11 → 5.0.0-beta.14

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.
Files changed (155) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +3 -21
  3. package/dist/package.json +1 -1
  4. package/dist/src/components/ClearAll/ClearAll.d.ts +8 -0
  5. package/dist/src/components/ClearAll/ClearAll.js +29 -0
  6. package/dist/src/components/ClearAll/ClearAll.js.map +1 -0
  7. package/dist/src/components/ClearAll/index.d.ts +1 -0
  8. package/dist/src/components/{ReactifySearchBase → ClearAll}/index.js +1 -1
  9. package/dist/src/components/ClearAll/index.js.map +1 -0
  10. package/dist/src/components/CustomComponent/CustomComponent.d.ts +4 -0
  11. package/dist/src/components/CustomComponent/CustomComponent.js +13 -0
  12. package/dist/src/components/CustomComponent/CustomComponent.js.map +1 -0
  13. package/dist/src/components/CustomComponent/index.d.ts +1 -0
  14. package/dist/src/components/CustomComponent/index.js +14 -0
  15. package/dist/src/components/CustomComponent/index.js.map +1 -0
  16. package/dist/src/components/Example/ExampleClearAll.d.ts +4 -0
  17. package/dist/src/components/Example/ExampleClearAll.js +12 -0
  18. package/dist/src/components/Example/ExampleClearAll.js.map +1 -0
  19. package/dist/src/components/Example/ExampleFilterList.d.ts +5 -0
  20. package/dist/src/components/Example/ExampleFilterList.js +80 -9
  21. package/dist/src/components/Example/ExampleFilterList.js.map +1 -1
  22. package/dist/src/components/Example/ExampleFilterRange.js +6 -11
  23. package/dist/src/components/Example/ExampleFilterRange.js.map +1 -1
  24. package/dist/src/components/Example/ExampleFilterSlider.js +8 -9
  25. package/dist/src/components/Example/ExampleFilterSlider.js.map +1 -1
  26. package/dist/src/components/Example/ExampleFilters.d.ts +4 -0
  27. package/dist/src/components/Example/{ExampleFilterStack.js → ExampleFilters.js} +6 -5
  28. package/dist/src/components/Example/ExampleFilters.js.map +1 -0
  29. package/dist/src/components/Example/ExampleFiltersActive.d.ts +4 -0
  30. package/dist/src/components/Example/ExampleFiltersActive.js +23 -0
  31. package/dist/src/components/Example/ExampleFiltersActive.js.map +1 -0
  32. package/dist/src/components/Example/ExampleSortBy.d.ts +4 -0
  33. package/dist/src/components/Example/{ExampleSortby.js → ExampleSortBy.js} +4 -4
  34. package/dist/src/components/Example/{ExampleSortby.js.map → ExampleSortBy.js.map} +1 -1
  35. package/dist/src/components/Example/ExampleStats.d.ts +4 -0
  36. package/dist/src/components/Example/ExampleStats.js +15 -0
  37. package/dist/src/components/Example/ExampleStats.js.map +1 -0
  38. package/dist/src/components/Example/index.d.ts +5 -2
  39. package/dist/src/components/Example/index.js +5 -2
  40. package/dist/src/components/Example/index.js.map +1 -1
  41. package/dist/src/components/Filter/Filter.d.ts +3 -3
  42. package/dist/src/components/Filter/Filter.js +22 -10
  43. package/dist/src/components/Filter/Filter.js.map +1 -1
  44. package/dist/src/components/Filter/{FilterStack.d.ts → Filters.d.ts} +2 -2
  45. package/dist/src/components/Filter/{FilterStack.js → Filters.js} +7 -7
  46. package/dist/src/components/Filter/Filters.js.map +1 -0
  47. package/dist/src/components/Filter/FiltersActive.d.ts +16 -0
  48. package/dist/src/components/Filter/FiltersActive.js +36 -0
  49. package/dist/src/components/Filter/FiltersActive.js.map +1 -0
  50. package/dist/src/components/Filter/index.d.ts +2 -1
  51. package/dist/src/components/Filter/index.js +2 -1
  52. package/dist/src/components/Filter/index.js.map +1 -1
  53. package/dist/src/components/{ReactifySearchBase/ReactifySearchBase.d.ts → ReactifySearchProvider/ReactifySearchProvider.d.ts} +5 -9
  54. package/dist/src/components/{ReactifySearchBase/ReactifySearchBase.js → ReactifySearchProvider/ReactifySearchProvider.js} +12 -11
  55. package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js.map +1 -0
  56. package/dist/src/components/ReactifySearchProvider/index.d.ts +1 -0
  57. package/dist/src/components/ReactifySearchProvider/index.js +14 -0
  58. package/dist/src/components/ReactifySearchProvider/index.js.map +1 -0
  59. package/dist/src/components/Result/{ResultStack.d.ts → Results.d.ts} +2 -2
  60. package/dist/src/components/Result/{ResultStack.js → Results.js} +43 -26
  61. package/dist/src/components/Result/Results.js.map +1 -0
  62. package/dist/src/components/Result/index.d.ts +1 -1
  63. package/dist/src/components/Result/index.js +1 -1
  64. package/dist/src/components/Result/index.js.map +1 -1
  65. package/dist/src/components/Sensor/SensorCollection.js +2 -2
  66. package/dist/src/components/Sensor/SensorCollection.js.map +1 -1
  67. package/dist/src/components/Sensor/SensorInventoryAvailable.js +1 -1
  68. package/dist/src/components/Sensor/SensorInventoryAvailable.js.map +1 -1
  69. package/dist/src/components/Sensor/SensorSort.js +13 -13
  70. package/dist/src/components/Sensor/SensorSort.js.map +1 -1
  71. package/dist/src/components/Sensor/Sensors.d.ts +3 -0
  72. package/dist/src/components/Sensor/{SensorStack.js → Sensors.js} +4 -4
  73. package/dist/src/components/Sensor/Sensors.js.map +1 -0
  74. package/dist/src/components/Sensor/index.d.ts +1 -1
  75. package/dist/src/components/Sensor/index.js +1 -1
  76. package/dist/src/components/Sensor/index.js.map +1 -1
  77. package/dist/src/components/SortBy/SortBy.d.ts +7 -0
  78. package/dist/src/components/{Sortby/Sortby.js → SortBy/SortBy.js} +7 -7
  79. package/dist/src/components/SortBy/SortBy.js.map +1 -0
  80. package/dist/src/components/SortBy/index.d.ts +1 -0
  81. package/dist/src/components/{Sortby → SortBy}/index.js +1 -1
  82. package/dist/src/components/{Sortby → SortBy}/index.js.map +1 -1
  83. package/dist/src/components/Stats/Stats.d.ts +7 -0
  84. package/dist/src/components/Stats/Stats.js +15 -0
  85. package/dist/src/components/Stats/Stats.js.map +1 -0
  86. package/dist/src/components/Stats/index.d.ts +1 -0
  87. package/dist/src/components/Stats/index.js +14 -0
  88. package/dist/src/components/Stats/index.js.map +1 -0
  89. package/dist/src/components/index.d.ts +5 -2
  90. package/dist/src/components/index.js +5 -2
  91. package/dist/src/components/index.js.map +1 -1
  92. package/dist/src/hooks/index.d.ts +4 -3
  93. package/dist/src/hooks/index.js +4 -3
  94. package/dist/src/hooks/index.js.map +1 -1
  95. package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.d.ts +6 -1
  96. package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.js +12 -1
  97. package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.js.map +1 -1
  98. package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.d.ts +5 -0
  99. package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.js +9 -2
  100. package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.js.map +1 -1
  101. package/dist/src/hooks/reactivesearch/useReactiveReactProp.js +4 -4
  102. package/dist/src/hooks/reactivesearch/useReactiveReactProp.js.map +1 -1
  103. package/dist/src/hooks/reactivesearch/useReactiveReactiveListProps.js +1 -1
  104. package/dist/src/hooks/reactivesearch/useReactiveReactiveListProps.js.map +1 -1
  105. package/dist/src/hooks/useConfig.js +1 -1
  106. package/dist/src/hooks/useConfig.js.map +1 -1
  107. package/dist/src/hooks/useCuration.js +2 -6
  108. package/dist/src/hooks/useCuration.js.map +1 -1
  109. package/dist/src/hooks/useFilterListProps.d.ts +2 -2
  110. package/dist/src/hooks/useFilterListProps.js +32 -2
  111. package/dist/src/hooks/useFilterListProps.js.map +1 -1
  112. package/dist/src/hooks/useFilterRangeProps.d.ts +10 -0
  113. package/dist/src/hooks/useFilterRangeProps.js +52 -0
  114. package/dist/src/hooks/useFilterRangeProps.js.map +1 -0
  115. package/dist/src/hooks/useFilterSliderProps.d.ts +12 -0
  116. package/dist/src/hooks/useFilterSliderProps.js +49 -0
  117. package/dist/src/hooks/useFilterSliderProps.js.map +1 -0
  118. package/dist/src/hooks/useFilters.d.ts +3 -2
  119. package/dist/src/hooks/useFilters.js +45 -11
  120. package/dist/src/hooks/useFilters.js.map +1 -1
  121. package/dist/src/hooks/usePaginationLoadMore.js +1 -1
  122. package/dist/src/hooks/usePaginationLoadMore.js.map +1 -1
  123. package/dist/src/hooks/useReactifySearchContext.d.ts +4 -12
  124. package/dist/src/hooks/useReactifySearchContext.js.map +1 -1
  125. package/dist/src/hooks/useSearch.d.ts +1 -1
  126. package/dist/src/hooks/useSearch.js +25 -5
  127. package/dist/src/hooks/useSearch.js.map +1 -1
  128. package/dist/src/hooks/{useSortby.d.ts → useSortBy.d.ts} +1 -1
  129. package/dist/src/hooks/{useSortby.js → useSortBy.js} +5 -7
  130. package/dist/src/hooks/useSortBy.js.map +1 -0
  131. package/dist/src/types/firestore.d.ts +3 -0
  132. package/dist/src/types/firestore.js.map +1 -1
  133. package/dist/src/types/reactivesearch.d.ts +1 -1
  134. package/dist/src/types/reactivesearch.js.map +1 -1
  135. package/dist/src/utility/debug.d.ts +3 -1
  136. package/dist/src/utility/debug.js +6 -2
  137. package/dist/src/utility/debug.js.map +1 -1
  138. package/package.json +1 -1
  139. package/dist/src/components/Example/ExampleFilterStack.d.ts +0 -4
  140. package/dist/src/components/Example/ExampleFilterStack.js.map +0 -1
  141. package/dist/src/components/Example/ExampleSortby.d.ts +0 -4
  142. package/dist/src/components/Filter/FilterStack.js.map +0 -1
  143. package/dist/src/components/ReactifySearchBase/ReactifySearchBase.js.map +0 -1
  144. package/dist/src/components/ReactifySearchBase/index.d.ts +0 -1
  145. package/dist/src/components/ReactifySearchBase/index.js.map +0 -1
  146. package/dist/src/components/Result/ResultStack.js.map +0 -1
  147. package/dist/src/components/Sensor/SensorStack.d.ts +0 -3
  148. package/dist/src/components/Sensor/SensorStack.js.map +0 -1
  149. package/dist/src/components/Sortby/Sortby.d.ts +0 -7
  150. package/dist/src/components/Sortby/Sortby.js.map +0 -1
  151. package/dist/src/components/Sortby/index.d.ts +0 -1
  152. package/dist/src/hooks/useFilterStack.d.ts +0 -4
  153. package/dist/src/hooks/useFilterStack.js +0 -52
  154. package/dist/src/hooks/useFilterStack.js.map +0 -1
  155. package/dist/src/hooks/useSortby.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,36 @@
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.14](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.13...v5.0.0-beta.14) (2022-08-04)
6
+
7
+
8
+ ### Features
9
+
10
+ * add example components for filter range, filter slider, custom, stats, clear all, filters active ([d5e56fb](https://bitbucket.org/usereactify/reactify-search-ui/commit/d5e56fb114edc3e134c3ce2e90f7f2df67c5d097))
11
+ * add example filter list unstyled, radio, checkbox, swatch and box ([a6ebcd0](https://bitbucket.org/usereactify/reactify-search-ui/commit/a6ebcd0b606f9a8381d1e082dd4935e4a4d83c2f))
12
+ * add support for filter option settingsUppercase ([99d822b](https://bitbucket.org/usereactify/reactify-search-ui/commit/99d822b611ec0302fe314cbe0b1c24653b1ae72c))
13
+ * improve sorting of filter list options ([c41eedc](https://bitbucket.org/usereactify/reactify-search-ui/commit/c41eedc900f500d3ddf9434cb14a7397c6385707))
14
+
15
+ ## [5.0.0-beta.13](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.12...v5.0.0-beta.13) (2022-08-03)
16
+
17
+
18
+ ### Features
19
+
20
+ * add breadcrumb for ES search result errors ([22ae301](https://bitbucket.org/usereactify/reactify-search-ui/commit/22ae301bbb7618aec14499970ffd2578ab569a7a))
21
+ * add breadcrumb for search query update ([6a2e442](https://bitbucket.org/usereactify/reactify-search-ui/commit/6a2e44269396353fced1d597d48502ef5b1a6bb2))
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * use correct names of components and imports ([e180a75](https://bitbucket.org/usereactify/reactify-search-ui/commit/e180a75b0c4be555a61d72e48a54434b7aa27960))
27
+
28
+ ## [5.0.0-beta.12](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.11...v5.0.0-beta.12) (2022-07-27)
29
+
30
+
31
+ ### Features
32
+
33
+ * improve performance when debugging by reusing debugger instances ([aa88917](https://bitbucket.org/usereactify/reactify-search-ui/commit/aa88917b0aedf2abe66439d430587f18dcb72aae))
34
+
5
35
  ## [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
36
 
7
37
  ## [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)
package/README.md CHANGED
@@ -4,25 +4,9 @@ This library provides React components and hooks for building UI's for the [Reac
4
4
 
5
5
  The aim of this library is not to build a search and filter interface from the ground up. The aim of this library is to abstract the complexities of Reactify Search, whilst providing the developer a wide range of approaches and escape hatches to build in the way they want to. To do this, we wrap a mature Elasticsearch UI library called [Reactivesearch](https://github.com/appbaseio/reactivesearch) (similar name, but completely unaffiliated with Reactify Search).
6
6
 
7
- ## Getting started
7
+ ## Documentation
8
8
 
9
- ```sh
10
- npm install @reactify-apps/search
11
- ```
12
-
13
- You should always begin with the `Provider` component, which you need to pass the Reactify Search config and index name, using whichever mechanism is most appropriate for your project. Within the provider, you can then begin to render components from the `@reactify-apps/search` package or ordinary [Reactivesearch](https://github.com/appbaseio/reactivesearch) components.
14
-
15
- ```tsx
16
- import { Provider } from "@reactify-apps/search";
17
-
18
- export const YourComponent: React.FC = () => {
19
- return (
20
- <Provider index="my-cool-shop" config={config}>
21
- <YourComponents />
22
- </Provider>
23
- );
24
- };
25
- ```
9
+ All end-user documentation is available at https://search.docs.reactify.com.au which is powered by GitBooks.
26
10
 
27
11
  ## Contributing
28
12
 
@@ -40,7 +24,5 @@ npm run storybook
40
24
  npm run release
41
25
 
42
26
  # release a beta version
43
- npm run release -- --prerelease beta
44
-
45
- npm publish --tag beta
27
+ npm run release:beta
46
28
  ```
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.11",
4
+ "version": "5.0.0-beta.14",
5
5
  "license": "MIT",
6
6
  "main": "dist/src/index.js",
7
7
  "types": "dist/src/index.d.ts",
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ export declare type ClearAllProps = {
3
+ /** Render method */
4
+ renderClearAll?: React.FC<{
5
+ clearAll: () => void;
6
+ }>;
7
+ };
8
+ export declare const ClearAll: React.FC<ClearAllProps>;
@@ -0,0 +1,29 @@
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.ClearAll = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const reactivesearch_1 = require("@appbaseio/reactivesearch");
9
+ const components_1 = require("../../components");
10
+ const ClearAll = (props) => {
11
+ var _a;
12
+ const RenderFiltersComponent = (_a = props.renderClearAll) !== null && _a !== void 0 ? _a : components_1.ExampleClearAll;
13
+ return (react_1.default.createElement(reactivesearch_1.SelectedFilters, { render: ({ selectedValues, clearValues }) => {
14
+ const selectedFilters = Object.values(selectedValues)
15
+ .map((value) => value)
16
+ .filter((item) => {
17
+ var _a, _b;
18
+ return (item === null || item === void 0 ? void 0 : item.URLParams) &&
19
+ (item === null || item === void 0 ? void 0 : item.showFilter) &&
20
+ (!!((_a = item === null || item === void 0 ? void 0 : item.value) === null || _a === void 0 ? void 0 : _a.length) || !!((_b = item === null || item === void 0 ? void 0 : item.value) === null || _b === void 0 ? void 0 : _b.label));
21
+ });
22
+ if (!selectedFilters.length) {
23
+ return null;
24
+ }
25
+ return react_1.default.createElement(RenderFiltersComponent, { clearAll: clearValues });
26
+ } }));
27
+ };
28
+ exports.ClearAll = ClearAll;
29
+ //# sourceMappingURL=ClearAll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClearAll.js","sourceRoot":"","sources":["../../../../src/components/ClearAll/ClearAll.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,8DAA4D;AAE5D,iDAAmD;AAS5C,MAAM,QAAQ,GAA4B,CAAC,KAAK,EAAE,EAAE;;IACzD,MAAM,sBAAsB,GAAG,MAAA,KAAK,CAAC,cAAc,mCAAI,4BAAe,CAAC;IAEvE,OAAO,CACL,8BAAC,gCAAe,IACd,MAAM,EAAE,CAAC,EAAE,cAAc,EAAE,WAAW,EAAE,EAAE,EAAE;YAC1C,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC;iBAClD,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC;iBACrB,MAAM,CACL,CAAC,IAAS,EAAE,EAAE;;gBACZ,OAAA,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,SAAS;qBACf,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,CAAA;oBAChB,CAAC,CAAC,CAAC,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,0CAAE,MAAM,CAAA,IAAI,CAAC,CAAC,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,0CAAE,KAAK,CAAA,CAAC,CAAA;aAAA,CAClD,CAAC;YAEJ,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;gBAC3B,OAAO,IAAI,CAAC;aACb;YAED,OAAO,8BAAC,sBAAsB,IAAC,QAAQ,EAAE,WAAW,GAAI,CAAC;QAC3D,CAAC,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAvBW,QAAA,QAAQ,YAuBnB","sourcesContent":["import React from \"react\";\nimport { SelectedFilters } from \"@appbaseio/reactivesearch\";\n\nimport { ExampleClearAll } from \"../../components\";\n\nexport type ClearAllProps = {\n /** Render method */\n renderClearAll?: React.FC<{\n clearAll: () => void;\n }>;\n};\n\nexport const ClearAll: React.FC<ClearAllProps> = (props) => {\n const RenderFiltersComponent = props.renderClearAll ?? ExampleClearAll;\n\n return (\n <SelectedFilters\n render={({ selectedValues, clearValues }) => {\n const selectedFilters = Object.values(selectedValues)\n .map((value) => value)\n .filter(\n (item: any) =>\n item?.URLParams &&\n item?.showFilter &&\n (!!item?.value?.length || !!item?.value?.label)\n );\n\n if (!selectedFilters.length) {\n return null;\n }\n\n return <RenderFiltersComponent clearAll={clearValues} />;\n }}\n />\n );\n};\n"]}
@@ -0,0 +1 @@
1
+ export * from "./ClearAll";
@@ -10,5 +10,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./ReactifySearchBase"), exports);
13
+ __exportStar(require("./ClearAll"), exports);
14
14
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ClearAll/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA2B","sourcesContent":["export * from \"./ClearAll\";\n"]}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { ReactiveComponent } from "@appbaseio/reactivesearch";
3
+ export declare type CustomComponentProps = React.ComponentProps<typeof ReactiveComponent>;
4
+ export declare const CustomComponent: React.FC<CustomComponentProps>;
@@ -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.CustomComponent = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const reactivesearch_1 = require("@appbaseio/reactivesearch");
9
+ const CustomComponent = (props) => {
10
+ return react_1.default.createElement(reactivesearch_1.ReactiveComponent, Object.assign({}, props));
11
+ };
12
+ exports.CustomComponent = CustomComponent;
13
+ //# sourceMappingURL=CustomComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomComponent.js","sourceRoot":"","sources":["../../../../src/components/CustomComponent/CustomComponent.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,8DAA8D;AAMvD,MAAM,eAAe,GAAmC,CAAC,KAAK,EAAE,EAAE;IACvE,OAAO,8BAAC,kCAAiB,oBAAK,KAAK,EAAI,CAAC;AAC1C,CAAC,CAAC;AAFW,QAAA,eAAe,mBAE1B","sourcesContent":["import React from \"react\";\nimport { ReactiveComponent } from \"@appbaseio/reactivesearch\";\n\nexport type CustomComponentProps = React.ComponentProps<\n typeof ReactiveComponent\n>;\n\nexport const CustomComponent: React.FC<CustomComponentProps> = (props) => {\n return <ReactiveComponent {...props} />;\n};\n"]}
@@ -0,0 +1 @@
1
+ export * from "./CustomComponent";
@@ -0,0 +1,14 @@
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("./CustomComponent"), exports);
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/CustomComponent/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAkC","sourcesContent":["export * from \"./CustomComponent\";\n"]}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { ClearAllProps } from "../../components";
3
+ export declare type ExampleClearAllProps = React.ComponentProps<NonNullable<ClearAllProps["renderClearAll"]>>;
4
+ export declare const ExampleClearAll: React.FC<ExampleClearAllProps>;
@@ -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.ExampleClearAll = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const ExampleClearAll = (props) => {
9
+ return react_1.default.createElement("a", { onClick: props.clearAll }, "Clear All");
10
+ };
11
+ exports.ExampleClearAll = ExampleClearAll;
12
+ //# sourceMappingURL=ExampleClearAll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExampleClearAll.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleClearAll.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,eAAe,GAAmC,CAAC,KAAK,EAAE,EAAE;IACvE,OAAO,qCAAG,OAAO,EAAE,KAAK,CAAC,QAAQ,IAAG,WAAW,CAAK,CAAC;AACvD,CAAC,CAAC;AAFW,QAAA,eAAe,mBAE1B","sourcesContent":["import React from \"react\";\n\nimport { Filter, ClearAllProps } from \"../../components\";\n\nexport type ExampleClearAllProps = React.ComponentProps<\n NonNullable<ClearAllProps[\"renderClearAll\"]>\n>;\n\nexport const ExampleClearAll: React.FC<ExampleClearAllProps> = (props) => {\n return <a onClick={props.clearAll}>{\"Clear All\"}</a>;\n};\n"]}
@@ -2,3 +2,8 @@ import React from "react";
2
2
  import { FilterProps } from "../../components";
3
3
  export declare type ExampleFilterListProps = React.ComponentProps<NonNullable<FilterProps["renderFilterList"]>>;
4
4
  export declare const ExampleFilterList: React.FC<ExampleFilterListProps>;
5
+ export declare const ExampleFilterListList: React.FC<ExampleFilterListProps>;
6
+ export declare const ExampleFilterListRadio: React.FC<ExampleFilterListProps>;
7
+ export declare const ExampleFilterListCheckbox: React.FC<ExampleFilterListProps>;
8
+ export declare const ExampleFilterListSwatch: React.FC<ExampleFilterListProps>;
9
+ export declare const ExampleFilterListBox: React.FC<ExampleFilterListProps>;
@@ -3,19 +3,90 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ExampleFilterList = void 0;
6
+ exports.ExampleFilterListBox = exports.ExampleFilterListSwatch = exports.ExampleFilterListCheckbox = exports.ExampleFilterListRadio = exports.ExampleFilterListList = exports.ExampleFilterList = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const ExampleFilterList = (props) => {
9
9
  return (react_1.default.createElement("div", { className: "rs__filter" },
10
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
- ")"))))))));
11
+ props.filter.displayView === "list" ? (react_1.default.createElement(exports.ExampleFilterListList, Object.assign({}, props))) : null,
12
+ props.filter.displayType === "single" &&
13
+ props.filter.displayView === "check" ? (react_1.default.createElement(exports.ExampleFilterListRadio, Object.assign({}, props))) : null,
14
+ props.filter.displayType === "multi" &&
15
+ props.filter.displayView === "check" ? (react_1.default.createElement(exports.ExampleFilterListCheckbox, Object.assign({}, props))) : null,
16
+ props.filter.displayView === "swatch" ? (react_1.default.createElement(exports.ExampleFilterListSwatch, Object.assign({}, props))) : null,
17
+ props.filter.displayView === "box" ? (react_1.default.createElement(exports.ExampleFilterListBox, Object.assign({}, props))) : null));
19
18
  };
20
19
  exports.ExampleFilterList = ExampleFilterList;
20
+ const ExampleFilterListList = (props) => {
21
+ return (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 ${option.checked ? "rs__filter__list-item-active" : ""}` },
22
+ react_1.default.createElement("label", { className: "rs__filter__list-item-label", onClick: () => props.filterListProps.handleChange(option.key) },
23
+ react_1.default.createElement("span", { className: "rs__filter__list-item-key" }, option.key),
24
+ react_1.default.createElement("span", { className: "rs__filter__list-item-count" },
25
+ "(",
26
+ option.doc_count,
27
+ ")")))))));
28
+ };
29
+ exports.ExampleFilterListList = ExampleFilterListList;
30
+ const ExampleFilterListRadio = (props) => {
31
+ return (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 ${option.checked ? "rs__filter__list-item-active" : ""}` },
32
+ react_1.default.createElement("label", { className: "rs__filter__list-item-label" },
33
+ react_1.default.createElement("input", { className: "rs__filter__list-item-input", value: option.key, type: "radio", checked: option.checked, onChange: (event) => props.filterListProps.handleChange(event.target.value) }),
34
+ react_1.default.createElement("span", { className: "rs__filter__list-item-key" }, option.key),
35
+ react_1.default.createElement("span", { className: "rs__filter__list-item-count" },
36
+ "(",
37
+ option.doc_count,
38
+ ")")))))));
39
+ };
40
+ exports.ExampleFilterListRadio = ExampleFilterListRadio;
41
+ const ExampleFilterListCheckbox = (props) => {
42
+ return (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 ${option.checked ? "rs__filter__list-item-active" : ""}` },
43
+ react_1.default.createElement("label", { className: "rs__filter__list-item-label" },
44
+ react_1.default.createElement("input", { className: "rs__filter__list-item-input", value: option.key, type: "checkbox", checked: option.checked, onChange: (event) => props.filterListProps.handleChange(event.target.value) }),
45
+ react_1.default.createElement("span", { className: "rs__filter__list-item-key" }, option.key),
46
+ react_1.default.createElement("span", { className: "rs__filter__list-item-count" },
47
+ "(",
48
+ option.doc_count,
49
+ ")")))))));
50
+ };
51
+ exports.ExampleFilterListCheckbox = ExampleFilterListCheckbox;
52
+ const ExampleFilterListSwatch = (props) => {
53
+ return (react_1.default.createElement("div", { className: "rs__filter__list", style: {
54
+ display: "flex",
55
+ flexWrap: "wrap",
56
+ } }, props.filterListProps.options.map((option) => (react_1.default.createElement("div", { key: option.key, className: `rs__filter__list-item ${option.checked ? "rs__filter__list-item-active" : ""}` },
57
+ react_1.default.createElement("div", { className: "rs__filter__list-item-label", style: {
58
+ display: "inline-block",
59
+ width: "20px",
60
+ height: "20px",
61
+ marginRight: "2px",
62
+ marginBottom: "2px",
63
+ borderRadius: "50%",
64
+ backgroundColor: option.key,
65
+ border: option.checked
66
+ ? "1px solid black"
67
+ : "1px solid transparent",
68
+ }, onClick: () => props.filterListProps.handleChange(option.key) }))))));
69
+ };
70
+ exports.ExampleFilterListSwatch = ExampleFilterListSwatch;
71
+ const ExampleFilterListBox = (props) => {
72
+ return (react_1.default.createElement("div", { className: "rs__filter__list", style: {
73
+ display: "flex",
74
+ flexWrap: "wrap",
75
+ } }, props.filterListProps.options.map((option) => (react_1.default.createElement("div", { key: option.key, className: `rs__filter__list-item ${option.checked ? "rs__filter__list-item-active" : ""}` },
76
+ react_1.default.createElement("div", { className: "rs__filter__list-item-label", style: {
77
+ display: "flex",
78
+ justifyContent: "center",
79
+ alignItems: "center",
80
+ width: "40px",
81
+ height: "40px",
82
+ marginRight: "2px",
83
+ marginBottom: "2px",
84
+ border: "1px solid black",
85
+ overflow: "hidden",
86
+ cursor: "pointer",
87
+ color: option.checked ? "white" : "black",
88
+ backgroundColor: option.checked ? "black" : "white",
89
+ }, onClick: () => props.filterListProps.handleChange(option.key) }, option.key))))));
90
+ };
91
+ exports.ExampleFilterListBox = ExampleFilterListBox;
21
92
  //# sourceMappingURL=ExampleFilterList.js.map
@@ -1 +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
+ {"version":3,"file":"ExampleFilterList.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterList.tsx"],"names":[],"mappings":"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","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 {props.filter.displayView === \"list\" ? (\n <ExampleFilterListList {...props} />\n ) : null}\n {props.filter.displayType === \"single\" &&\n props.filter.displayView === \"check\" ? (\n <ExampleFilterListRadio {...props} />\n ) : null}\n {props.filter.displayType === \"multi\" &&\n props.filter.displayView === \"check\" ? (\n <ExampleFilterListCheckbox {...props} />\n ) : null}\n {props.filter.displayView === \"swatch\" ? (\n <ExampleFilterListSwatch {...props} />\n ) : null}\n {props.filter.displayView === \"box\" ? (\n <ExampleFilterListBox {...props} />\n ) : null}\n </div>\n );\n};\n\nexport const ExampleFilterListList: React.FC<ExampleFilterListProps> = (\n props\n) => {\n return (\n <ul className=\"rs__filter__list\">\n {props.filterListProps.options.map((option) => (\n <li\n key={option.key}\n className={`rs__filter__list-item ${\n option.checked ? \"rs__filter__list-item-active\" : \"\"\n }`}\n >\n <label\n className=\"rs__filter__list-item-label\"\n onClick={() => props.filterListProps.handleChange(option.key)}\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 );\n};\n\nexport const ExampleFilterListRadio: React.FC<ExampleFilterListProps> = (\n props\n) => {\n return (\n <ul className=\"rs__filter__list\">\n {props.filterListProps.options.map((option) => (\n <li\n key={option.key}\n className={`rs__filter__list-item ${\n option.checked ? \"rs__filter__list-item-active\" : \"\"\n }`}\n >\n <label className=\"rs__filter__list-item-label\">\n <input\n className=\"rs__filter__list-item-input\"\n value={option.key}\n type=\"radio\"\n checked={option.checked}\n onChange={(event) =>\n props.filterListProps.handleChange(event.target.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 );\n};\n\nexport const ExampleFilterListCheckbox: React.FC<ExampleFilterListProps> = (\n props\n) => {\n return (\n <ul className=\"rs__filter__list\">\n {props.filterListProps.options.map((option) => (\n <li\n key={option.key}\n className={`rs__filter__list-item ${\n option.checked ? \"rs__filter__list-item-active\" : \"\"\n }`}\n >\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={(event) =>\n props.filterListProps.handleChange(event.target.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 );\n};\n\nexport const ExampleFilterListSwatch: React.FC<ExampleFilterListProps> = (\n props\n) => {\n return (\n <div\n className=\"rs__filter__list\"\n style={{\n display: \"flex\",\n flexWrap: \"wrap\",\n }}\n >\n {props.filterListProps.options.map((option) => (\n <div\n key={option.key}\n className={`rs__filter__list-item ${\n option.checked ? \"rs__filter__list-item-active\" : \"\"\n }`}\n >\n <div\n className=\"rs__filter__list-item-label\"\n style={{\n display: \"inline-block\",\n width: \"20px\",\n height: \"20px\",\n marginRight: \"2px\",\n marginBottom: \"2px\",\n borderRadius: \"50%\",\n backgroundColor: option.key,\n border: option.checked\n ? \"1px solid black\"\n : \"1px solid transparent\",\n }}\n onClick={() => props.filterListProps.handleChange(option.key)}\n />\n </div>\n ))}\n </div>\n );\n};\n\nexport const ExampleFilterListBox: React.FC<ExampleFilterListProps> = (\n props\n) => {\n return (\n <div\n className=\"rs__filter__list\"\n style={{\n display: \"flex\",\n flexWrap: \"wrap\",\n }}\n >\n {props.filterListProps.options.map((option) => (\n <div\n key={option.key}\n className={`rs__filter__list-item ${\n option.checked ? \"rs__filter__list-item-active\" : \"\"\n }`}\n >\n <div\n className=\"rs__filter__list-item-label\"\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n width: \"40px\",\n height: \"40px\",\n marginRight: \"2px\",\n marginBottom: \"2px\",\n border: \"1px solid black\",\n overflow: \"hidden\",\n cursor: \"pointer\",\n color: option.checked ? \"white\" : \"black\",\n backgroundColor: option.checked ? \"black\" : \"white\",\n }}\n onClick={() => props.filterListProps.handleChange(option.key)}\n >\n {option.key}\n </div>\n </div>\n ))}\n </div>\n );\n};\n"]}
@@ -5,18 +5,13 @@ 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 SingleRange_1 = __importDefault(require("@appbaseio/reactivesearch/lib/components/range/SingleRange"));
9
8
  const ExampleFilterRange = (props) => {
10
- if (props.filter.handle === "price") {
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
- { 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;
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.filterRangeProps.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: "radio", checked: option.checked, onChange: (event) => props.filterRangeProps.handleChange(event.target.value) }),
14
+ react_1.default.createElement("span", { className: "rs__filter__list-item-key" }, option.key))))))));
20
15
  };
21
16
  exports.ExampleFilterRange = ExampleFilterRange;
22
17
  //# sourceMappingURL=ExampleFilterRange.js.map
@@ -1 +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
+ {"version":3,"file":"ExampleFilterRange.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterRange.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AASnB,MAAM,kBAAkB,GAAsC,CACnE,KAAK,EACL,EAAE;IACF,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,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC9C,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,OAAO,EACZ,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAClB,KAAK,CAAC,gBAAgB,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,GAEzD;gBACF,wCAAM,SAAS,EAAC,2BAA2B,IAAE,MAAM,CAAC,GAAG,CAAQ,CACzD,CACL,CACN,CAAC,CACC,CACD,CACP,CAAC;AACJ,CAAC,CAAC;AA1BW,QAAA,kBAAkB,sBA0B7B","sourcesContent":["import React from \"react\";\n// import 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 return (\n <div className=\"rs__filter\">\n <h3 className=\"rs__filter__name\">{props.filter.name}</h3>\n <ul className=\"rs__filter__list\">\n {props.filterRangeProps.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=\"radio\"\n checked={option.checked}\n onChange={(event) =>\n props.filterRangeProps.handleChange(event.target.value)\n }\n />\n <span className=\"rs__filter__list-item-key\">{option.key}</span>\n </label>\n </li>\n ))}\n </ul>\n </div>\n );\n};\n"]}
@@ -6,16 +6,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ExampleFilterSlider = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const reactivesearch_1 = require("@appbaseio/reactivesearch");
9
+ const hooks_1 = require("../../hooks");
9
10
  const ExampleFilterSlider = (props) => {
10
- if (props.filter.handle === "price") {
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(reactivesearch_1.RangeSlider, Object.assign({ range: {
14
- start: 0,
15
- end: 500,
16
- } }, props.reactiveFilterSliderProps))));
17
- }
18
- return null;
11
+ const reactiveFilterSliderProps = (0, hooks_1.useReactiveFilterSliderProps)(props.filter);
12
+ return (react_1.default.createElement("div", { className: "rs__filter" },
13
+ react_1.default.createElement("h3", { className: "rs__filter__name" }, props.filter.name),
14
+ react_1.default.createElement(reactivesearch_1.DynamicRangeSlider, Object.assign({}, reactiveFilterSliderProps, { value: () => props.filterSliderProps.value, onChange: (value) => props.filterSliderProps.handleChange({
15
+ start: value[0],
16
+ end: value[1],
17
+ }) }))));
19
18
  };
20
19
  exports.ExampleFilterSlider = ExampleFilterSlider;
21
20
  //# sourceMappingURL=ExampleFilterSlider.js.map
@@ -1 +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
+ {"version":3,"file":"ExampleFilterSlider.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterSlider.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,8DAA+D;AAE/D,uCAA2D;AAOpD,MAAM,mBAAmB,GAAuC,CACrE,KAAK,EACL,EAAE;IACF,MAAM,yBAAyB,GAAG,IAAA,oCAA4B,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAE7E,OAAO,CACL,uCAAK,SAAS,EAAC,YAAY;QACzB,sCAAI,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAM;QACzD,8BAAC,mCAAkB,oBACb,yBAAyB,IAC7B,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,EAC1C,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAClB,KAAK,CAAC,iBAAiB,CAAC,YAAY,CAAC;gBACnC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;gBACf,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;aACd,CAAC,IAEJ,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AApBW,QAAA,mBAAmB,uBAoB9B","sourcesContent":["import React from \"react\";\nimport { DynamicRangeSlider } from \"@appbaseio/reactivesearch\";\n\nimport { useReactiveFilterSliderProps } from \"../../hooks\";\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 const reactiveFilterSliderProps = useReactiveFilterSliderProps(props.filter);\n\n return (\n <div className=\"rs__filter\">\n <h3 className=\"rs__filter__name\">{props.filter.name}</h3>\n <DynamicRangeSlider\n {...reactiveFilterSliderProps}\n value={() => props.filterSliderProps.value}\n onChange={(value) =>\n props.filterSliderProps.handleChange({\n start: value[0],\n end: value[1],\n })\n }\n />\n </div>\n );\n};\n"]}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { FiltersProps } from "../../components";
3
+ export declare type ExampleFiltersProps = React.ComponentProps<NonNullable<FiltersProps["renderFilters"]>>;
4
+ export declare const ExampleFilters: React.FC<ExampleFiltersProps>;
@@ -3,11 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ExampleFilterStack = void 0;
6
+ exports.ExampleFilters = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
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))))));
9
+ const ExampleFilters = (props) => {
10
+ var _a;
11
+ return (react_1.default.createElement(react_1.default.Fragment, null, (_a = props.filterStack) === null || _a === void 0 ? void 0 : _a.options.map((filter) => (react_1.default.createElement(components_1.Filter, Object.assign({ key: filter.id, filter: filter }, props))))));
11
12
  };
12
- exports.ExampleFilterStack = ExampleFilterStack;
13
- //# sourceMappingURL=ExampleFilterStack.js.map
13
+ exports.ExampleFilters = ExampleFilters;
14
+ //# sourceMappingURL=ExampleFilters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExampleFilters.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilters.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAAwD;AAMjD,MAAM,cAAc,GAAkC,CAAC,KAAK,EAAE,EAAE;;IACrE,OAAO,CACL,8DACG,MAAA,KAAK,CAAC,WAAW,0CAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC1C,8BAAC,mBAAM,kBAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,IAAM,KAAK,EAAI,CACtD,CAAC,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,cAAc,kBAQzB","sourcesContent":["import React from \"react\";\n\nimport { Filter, FiltersProps } from \"../../components\";\n\nexport type ExampleFiltersProps = React.ComponentProps<\n NonNullable<FiltersProps[\"renderFilters\"]>\n>;\n\nexport const ExampleFilters: React.FC<ExampleFiltersProps> = (props) => {\n return (\n <>\n {props.filterStack?.options.map((filter) => (\n <Filter key={filter.id} filter={filter} {...props} />\n ))}\n </>\n );\n};\n"]}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { FiltersActiveProps } from "../../components";
3
+ export declare type ExampleFiltersActiveProps = React.ComponentProps<NonNullable<FiltersActiveProps["renderFiltersActive"]>>;
4
+ export declare const ExampleFiltersActive: React.FC<ExampleFiltersActiveProps>;
@@ -0,0 +1,23 @@
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.ExampleFiltersActive = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const ExampleFiltersActive = (props) => {
9
+ return (react_1.default.createElement("div", { className: "rs__filter-active" },
10
+ react_1.default.createElement("h3", { className: "rs__filter-active__name" }, "Filters Active"),
11
+ react_1.default.createElement("ul", { className: "rs__filter-active__list" }, props.selectedFilters.map((selectedFilter) => (react_1.default.createElement("li", { key: selectedFilter.key, className: "rs__filter-active__list-item" },
12
+ react_1.default.createElement("label", { className: "rs__filter-active__list-item-label", onClick: () => props.handleRemove(selectedFilter.key) },
13
+ react_1.default.createElement("span", { className: "rs__filter-active__list-item-label" },
14
+ selectedFilter.label,
15
+ ": "),
16
+ react_1.default.createElement("span", { className: "rs__filter-active__list-item-value" }, Array.isArray(selectedFilter.value)
17
+ ? selectedFilter.value.join(", ")
18
+ : typeof selectedFilter.value !== "string"
19
+ ? `${selectedFilter.value.start}-${selectedFilter.value.end}`
20
+ : selectedFilter.value))))))));
21
+ };
22
+ exports.ExampleFiltersActive = ExampleFiltersActive;
23
+ //# sourceMappingURL=ExampleFiltersActive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExampleFiltersActive.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFiltersActive.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,oBAAoB,GAAwC,CACvE,KAAK,EACL,EAAE;IACF,OAAO,CACL,uCAAK,SAAS,EAAC,mBAAmB;QAChC,sCAAI,SAAS,EAAC,yBAAyB,IAAE,gBAAgB,CAAM;QAC/D,sCAAI,SAAS,EAAC,yBAAyB,IACpC,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC,CAC7C,sCAAI,GAAG,EAAE,cAAc,CAAC,GAAG,EAAE,SAAS,EAAC,8BAA8B;YACnE,yCACE,SAAS,EAAC,oCAAoC,EAC9C,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,GAAG,CAAC;gBAErD,wCAAM,SAAS,EAAC,oCAAoC;oBACjD,cAAc,CAAC,KAAK;oBACpB,IAAI,CACA;gBACP,wCAAM,SAAS,EAAC,oCAAoC,IACjD,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC;oBAClC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;oBACjC,CAAC,CAAC,OAAO,cAAc,CAAC,KAAK,KAAK,QAAQ;wBAC1C,CAAC,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,KAAK,IAAI,cAAc,CAAC,KAAK,CAAC,GAAG,EAAE;wBAC7D,CAAC,CAAC,cAAc,CAAC,KAAK,CACnB,CACD,CACL,CACN,CAAC,CACC,CACD,CACP,CAAC;AACJ,CAAC,CAAC;AA9BW,QAAA,oBAAoB,wBA8B/B","sourcesContent":["import React from \"react\";\n\nimport { FiltersActiveProps } from \"../../components\";\n\nexport type ExampleFiltersActiveProps = React.ComponentProps<\n NonNullable<FiltersActiveProps[\"renderFiltersActive\"]>\n>;\n\nexport const ExampleFiltersActive: React.FC<ExampleFiltersActiveProps> = (\n props\n) => {\n return (\n <div className=\"rs__filter-active\">\n <h3 className=\"rs__filter-active__name\">{\"Filters Active\"}</h3>\n <ul className=\"rs__filter-active__list\">\n {props.selectedFilters.map((selectedFilter) => (\n <li key={selectedFilter.key} className=\"rs__filter-active__list-item\">\n <label\n className=\"rs__filter-active__list-item-label\"\n onClick={() => props.handleRemove(selectedFilter.key)}\n >\n <span className=\"rs__filter-active__list-item-label\">\n {selectedFilter.label}\n {\": \"}\n </span>\n <span className=\"rs__filter-active__list-item-value\">\n {Array.isArray(selectedFilter.value)\n ? selectedFilter.value.join(\", \")\n : typeof selectedFilter.value !== \"string\"\n ? `${selectedFilter.value.start}-${selectedFilter.value.end}`\n : selectedFilter.value}\n </span>\n </label>\n </li>\n ))}\n </ul>\n </div>\n );\n};\n"]}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { SortByProps } from "../../components";
3
+ export declare type ExampleSortByProps = React.ComponentProps<NonNullable<SortByProps["renderSortOptions"]>>;
4
+ export declare const ExampleSortBy: React.FC<ExampleSortByProps>;
@@ -3,11 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ExampleSortby = void 0;
6
+ exports.ExampleSortBy = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
- const ExampleSortby = (props) => {
8
+ const ExampleSortBy = (props) => {
9
9
  var _a;
10
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
11
  };
12
- exports.ExampleSortby = ExampleSortby;
13
- //# sourceMappingURL=ExampleSortby.js.map
12
+ exports.ExampleSortBy = ExampleSortBy;
13
+ //# sourceMappingURL=ExampleSortBy.js.map
@@ -1 +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"]}
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"]}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { StatsProps } from "../../components";
3
+ export declare type ExampleStatsProps = React.ComponentProps<NonNullable<StatsProps["renderStats"]>>;
4
+ export declare const ExampleStats: React.FC<ExampleStatsProps>;
@@ -0,0 +1,15 @@
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.ExampleStats = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const ExampleStats = (props) => {
9
+ return (react_1.default.createElement("div", null,
10
+ "Found ",
11
+ props.resultStats.numberOfResults,
12
+ " products"));
13
+ };
14
+ exports.ExampleStats = ExampleStats;
15
+ //# sourceMappingURL=ExampleStats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExampleStats.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleStats.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,YAAY,GAAgC,CAAC,KAAK,EAAE,EAAE;IACjE,OAAO,CACL;QACG,QAAQ;QACR,KAAK,CAAC,WAAW,CAAC,eAAe;QACjC,WAAW,CACR,CACP,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,YAAY,gBAQvB","sourcesContent":["import React from \"react\";\n\nimport { StatsProps } from \"../../components\";\n\nexport type ExampleStatsProps = React.ComponentProps<\n NonNullable<StatsProps[\"renderStats\"]>\n>;\n\nexport const ExampleStats: React.FC<ExampleStatsProps> = (props) => {\n return (\n <div>\n {\"Found \"}\n {props.resultStats.numberOfResults}\n {\" products\"}\n </div>\n );\n};\n"]}