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

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 (119) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/package.json +1 -1
  3. package/dist/src/components/ClearAll/ClearAll.d.ts +1 -1
  4. package/dist/src/components/ClearAll/ClearAll.js +2 -2
  5. package/dist/src/components/ClearAll/ClearAll.js.map +1 -1
  6. package/dist/src/components/Example/ExampleClearAll.d.ts +1 -1
  7. package/dist/src/components/Example/ExampleClearAll.js.map +1 -1
  8. package/dist/src/components/Example/ExampleCustomComponent.d.ts +2 -0
  9. package/dist/src/components/Example/ExampleCustomComponent.js +36 -0
  10. package/dist/src/components/Example/ExampleCustomComponent.js.map +1 -0
  11. package/dist/src/components/Example/ExampleFilterList.js +3 -3
  12. package/dist/src/components/Example/ExampleFilterList.js.map +1 -1
  13. package/dist/src/components/Example/ExampleFilterRange.js +1 -1
  14. package/dist/src/components/Example/ExampleFilterRange.js.map +1 -1
  15. package/dist/src/components/Example/ExampleFilters.d.ts +1 -1
  16. package/dist/src/components/Example/ExampleFilters.js +1 -1
  17. package/dist/src/components/Example/ExampleFilters.js.map +1 -1
  18. package/dist/src/components/Example/ExampleFiltersActive.d.ts +1 -1
  19. package/dist/src/components/Example/ExampleFiltersActive.js.map +1 -1
  20. package/dist/src/components/Example/ExampleHookUseFilters.d.ts +2 -0
  21. package/dist/src/components/Example/ExampleHookUseFilters.js +20 -0
  22. package/dist/src/components/Example/ExampleHookUseFilters.js.map +1 -0
  23. package/dist/src/components/Example/ExampleHookUseSearch.d.ts +2 -0
  24. package/dist/src/components/Example/ExampleHookUseSearch.js +22 -0
  25. package/dist/src/components/Example/ExampleHookUseSearch.js.map +1 -0
  26. package/dist/src/components/Example/ExampleHookUseSortBy.d.ts +2 -0
  27. package/dist/src/components/Example/ExampleHookUseSortBy.js +18 -0
  28. package/dist/src/components/Example/ExampleHookUseSortBy.js.map +1 -0
  29. package/dist/src/components/Example/ExampleReactiveSearchProviderCollection.d.ts +2 -0
  30. package/dist/src/components/Example/ExampleReactiveSearchProviderCollection.js +27 -0
  31. package/dist/src/components/Example/ExampleReactiveSearchProviderCollection.js.map +1 -0
  32. package/dist/src/components/Example/ExampleReactiveSearchProviderInstantSearch.d.ts +2 -0
  33. package/dist/src/components/Example/ExampleReactiveSearchProviderInstantSearch.js +27 -0
  34. package/dist/src/components/Example/ExampleReactiveSearchProviderInstantSearch.js.map +1 -0
  35. package/dist/src/components/Example/ExampleReactiveSearchProviderSearch.d.ts +2 -0
  36. package/dist/src/components/Example/ExampleReactiveSearchProviderSearch.js +27 -0
  37. package/dist/src/components/Example/ExampleReactiveSearchProviderSearch.js.map +1 -0
  38. package/dist/src/components/Example/ExampleResults.d.ts +2 -0
  39. package/dist/src/components/Example/ExampleResults.js +38 -0
  40. package/dist/src/components/Example/ExampleResults.js.map +1 -0
  41. package/dist/src/components/Example/ExampleSearch.d.ts +4 -0
  42. package/dist/src/components/Example/ExampleSearch.js +20 -0
  43. package/dist/src/components/Example/ExampleSearch.js.map +1 -0
  44. package/dist/src/components/Example/ExampleSortBy.d.ts +1 -1
  45. package/dist/src/components/Example/ExampleSortBy.js.map +1 -1
  46. package/dist/src/components/Example/ExampleStats.d.ts +1 -1
  47. package/dist/src/components/Example/ExampleStats.js.map +1 -1
  48. package/dist/src/components/Example/index.d.ts +7 -0
  49. package/dist/src/components/Example/index.js +7 -0
  50. package/dist/src/components/Example/index.js.map +1 -1
  51. package/dist/src/components/Filter/Filter.d.ts +6 -3
  52. package/dist/src/components/Filter/Filter.js.map +1 -1
  53. package/dist/src/components/Filter/Filters.d.ts +1 -1
  54. package/dist/src/components/Filter/Filters.js +2 -2
  55. package/dist/src/components/Filter/Filters.js.map +1 -1
  56. package/dist/src/components/Filter/FiltersActive.d.ts +1 -1
  57. package/dist/src/components/Filter/FiltersActive.js +2 -2
  58. package/dist/src/components/Filter/FiltersActive.js.map +1 -1
  59. package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.d.ts +2 -2
  60. package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js +11 -13
  61. package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js.map +1 -1
  62. package/dist/src/components/Result/ResultCardCallout.d.ts +2 -4
  63. package/dist/src/components/Result/ResultCardCallout.js.map +1 -1
  64. package/dist/src/components/Result/ResultCardProduct.d.ts +2 -5
  65. package/dist/src/components/Result/ResultCardProduct.js.map +1 -1
  66. package/dist/src/components/Result/ResultPaginationLoadMore.d.ts +2 -2
  67. package/dist/src/components/Result/ResultPaginationLoadMore.js +1 -1
  68. package/dist/src/components/Result/ResultPaginationLoadMore.js.map +1 -1
  69. package/dist/src/components/Result/ResultPaginationNextPrev.d.ts +2 -2
  70. package/dist/src/components/Result/ResultPaginationNextPrev.js +1 -1
  71. package/dist/src/components/Result/ResultPaginationNextPrev.js.map +1 -1
  72. package/dist/src/components/Result/ResultPaginationNumbered.d.ts +2 -2
  73. package/dist/src/components/Result/ResultPaginationNumbered.js +1 -1
  74. package/dist/src/components/Result/ResultPaginationNumbered.js.map +1 -1
  75. package/dist/src/components/Result/Results.d.ts +19 -11
  76. package/dist/src/components/Result/Results.js +4 -4
  77. package/dist/src/components/Result/Results.js.map +1 -1
  78. package/dist/src/components/Search/Search.d.ts +7 -0
  79. package/dist/src/components/Search/Search.js +17 -0
  80. package/dist/src/components/Search/Search.js.map +1 -0
  81. package/dist/src/components/Search/index.d.ts +1 -1
  82. package/dist/src/components/Search/index.js +1 -1
  83. package/dist/src/components/Search/index.js.map +1 -1
  84. package/dist/src/components/Sensor/SensorSearch.js +7 -3
  85. package/dist/src/components/Sensor/SensorSearch.js.map +1 -1
  86. package/dist/src/components/SortBy/SortBy.d.ts +1 -1
  87. package/dist/src/components/SortBy/SortBy.js +2 -2
  88. package/dist/src/components/SortBy/SortBy.js.map +1 -1
  89. package/dist/src/components/Stats/Stats.d.ts +17 -2
  90. package/dist/src/components/Stats/Stats.js +2 -2
  91. package/dist/src/components/Stats/Stats.js.map +1 -1
  92. package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.js +10 -10
  93. package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.js.map +1 -1
  94. package/dist/src/hooks/useCuration.js +3 -3
  95. package/dist/src/hooks/useCuration.js.map +1 -1
  96. package/dist/src/hooks/useFilterListProps.d.ts +1 -0
  97. package/dist/src/hooks/useFilterListProps.js +6 -6
  98. package/dist/src/hooks/useFilterListProps.js.map +1 -1
  99. package/dist/src/hooks/useFilterRangeProps.d.ts +1 -0
  100. package/dist/src/hooks/useFilterRangeProps.js +6 -5
  101. package/dist/src/hooks/useFilterRangeProps.js.map +1 -1
  102. package/dist/src/hooks/useFilters.d.ts +2 -0
  103. package/dist/src/hooks/useFilters.js.map +1 -1
  104. package/dist/src/hooks/usePagination.d.ts +10 -0
  105. package/dist/src/hooks/usePagination.js.map +1 -1
  106. package/dist/src/hooks/useReactifySearchContext.d.ts +8 -8
  107. package/dist/src/hooks/useReactifySearchContext.js.map +1 -1
  108. package/dist/src/hooks/useSearch.d.ts +8 -3
  109. package/dist/src/hooks/useSearch.js +24 -22
  110. package/dist/src/hooks/useSearch.js.map +1 -1
  111. package/dist/src/hooks/useSortBy.d.ts +4 -1
  112. package/dist/src/hooks/useSortBy.js +2 -0
  113. package/dist/src/hooks/useSortBy.js.map +1 -1
  114. package/dist/src/types/reactivesearch.d.ts +1 -1
  115. package/dist/src/types/reactivesearch.js.map +1 -1
  116. package/package.json +1 -1
  117. package/dist/src/components/Search/SearchInput.d.ts +0 -8
  118. package/dist/src/components/Search/SearchInput.js +0 -18
  119. package/dist/src/components/Search/SearchInput.js.map +0 -1
@@ -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[\"render\"]>\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,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { StatsProps } from "../../components";
3
- export declare type ExampleStatsProps = React.ComponentProps<NonNullable<StatsProps["renderStats"]>>;
3
+ export declare type ExampleStatsProps = React.ComponentProps<NonNullable<StatsProps["render"]>>;
4
4
  export declare const ExampleStats: React.FC<ExampleStatsProps>;
@@ -1 +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"]}
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[\"render\"]>\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"]}
@@ -1,13 +1,20 @@
1
1
  export * from "./ExampleClearAll";
2
+ export * from "./ExampleCustomComponent";
2
3
  export * from "./ExampleFilterList";
3
4
  export * from "./ExampleFilterRange";
4
5
  export * from "./ExampleFilterSlider";
5
6
  export * from "./ExampleFilters";
6
7
  export * from "./ExampleFiltersActive";
8
+ export * from "./ExampleReactiveSearchProviderCollection";
9
+ export * from "./ExampleReactiveSearchProviderInstantSearch";
10
+ export * from "./ExampleReactiveSearchProviderSearch";
7
11
  export * from "./ExampleResultCardCallout";
8
12
  export * from "./ExampleResultCardProduct";
9
13
  export * from "./ExampleResultPaginationNumbered";
10
14
  export * from "./ExampleResultPaginationLoadMore";
11
15
  export * from "./ExampleResultPaginationNextPrev";
16
+ export * from "./ExampleSearch";
12
17
  export * from "./ExampleSortBy";
13
18
  export * from "./ExampleStats";
19
+ export * from "./ExampleHookUseSearch";
20
+ export * from "./ExampleHookUseSortBy";
@@ -11,16 +11,23 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./ExampleClearAll"), exports);
14
+ __exportStar(require("./ExampleCustomComponent"), exports);
14
15
  __exportStar(require("./ExampleFilterList"), exports);
15
16
  __exportStar(require("./ExampleFilterRange"), exports);
16
17
  __exportStar(require("./ExampleFilterSlider"), exports);
17
18
  __exportStar(require("./ExampleFilters"), exports);
18
19
  __exportStar(require("./ExampleFiltersActive"), exports);
20
+ __exportStar(require("./ExampleReactiveSearchProviderCollection"), exports);
21
+ __exportStar(require("./ExampleReactiveSearchProviderInstantSearch"), exports);
22
+ __exportStar(require("./ExampleReactiveSearchProviderSearch"), exports);
19
23
  __exportStar(require("./ExampleResultCardCallout"), exports);
20
24
  __exportStar(require("./ExampleResultCardProduct"), exports);
21
25
  __exportStar(require("./ExampleResultPaginationNumbered"), exports);
22
26
  __exportStar(require("./ExampleResultPaginationLoadMore"), exports);
23
27
  __exportStar(require("./ExampleResultPaginationNextPrev"), exports);
28
+ __exportStar(require("./ExampleSearch"), exports);
24
29
  __exportStar(require("./ExampleSortBy"), exports);
25
30
  __exportStar(require("./ExampleStats"), exports);
31
+ __exportStar(require("./ExampleHookUseSearch"), exports);
32
+ __exportStar(require("./ExampleHookUseSortBy"), exports);
26
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Example/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAkC;AAClC,sDAAoC;AACpC,uDAAqC;AACrC,wDAAsC;AACtC,mDAAiC;AACjC,yDAAuC;AACvC,6DAA2C;AAC3C,6DAA2C;AAC3C,oEAAkD;AAClD,oEAAkD;AAClD,oEAAkD;AAClD,kDAAgC;AAChC,iDAA+B","sourcesContent":["export * from \"./ExampleClearAll\";\nexport * from \"./ExampleFilterList\";\nexport * from \"./ExampleFilterRange\";\nexport * from \"./ExampleFilterSlider\";\nexport * from \"./ExampleFilters\";\nexport * from \"./ExampleFiltersActive\";\nexport * from \"./ExampleResultCardCallout\";\nexport * from \"./ExampleResultCardProduct\";\nexport * from \"./ExampleResultPaginationNumbered\";\nexport * from \"./ExampleResultPaginationLoadMore\";\nexport * from \"./ExampleResultPaginationNextPrev\";\nexport * from \"./ExampleSortBy\";\nexport * from \"./ExampleStats\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Example/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAkC;AAClC,2DAAyC;AACzC,sDAAoC;AACpC,uDAAqC;AACrC,wDAAsC;AACtC,mDAAiC;AACjC,yDAAuC;AACvC,4EAA0D;AAC1D,+EAA6D;AAC7D,wEAAsD;AACtD,6DAA2C;AAC3C,6DAA2C;AAC3C,oEAAkD;AAClD,oEAAkD;AAClD,oEAAkD;AAClD,kDAAgC;AAChC,kDAAgC;AAChC,iDAA+B;AAE/B,yDAAuC;AACvC,yDAAuC","sourcesContent":["export * from \"./ExampleClearAll\";\nexport * from \"./ExampleCustomComponent\";\nexport * from \"./ExampleFilterList\";\nexport * from \"./ExampleFilterRange\";\nexport * from \"./ExampleFilterSlider\";\nexport * from \"./ExampleFilters\";\nexport * from \"./ExampleFiltersActive\";\nexport * from \"./ExampleReactiveSearchProviderCollection\";\nexport * from \"./ExampleReactiveSearchProviderInstantSearch\";\nexport * from \"./ExampleReactiveSearchProviderSearch\";\nexport * from \"./ExampleResultCardCallout\";\nexport * from \"./ExampleResultCardProduct\";\nexport * from \"./ExampleResultPaginationNumbered\";\nexport * from \"./ExampleResultPaginationLoadMore\";\nexport * from \"./ExampleResultPaginationNextPrev\";\nexport * from \"./ExampleSearch\";\nexport * from \"./ExampleSortBy\";\nexport * from \"./ExampleStats\";\n\nexport * from \"./ExampleHookUseSearch\";\nexport * from \"./ExampleHookUseSortBy\";\n"]}
@@ -5,15 +5,18 @@ export declare type FilterProps = {
5
5
  /** The filter option being rendered */
6
6
  filter: ConfigFilterOption;
7
7
  /** Render method for List filters */
8
- renderFilterList?: React.FC<Omit<FilterProps, "renderFilterList"> & {
8
+ renderFilterList?: React.FC<{
9
+ filter: ConfigFilterOption;
9
10
  filterListProps: ReturnType<typeof useFilterListProps>;
10
11
  }>;
11
12
  /** Render method for Range filters */
12
- renderFilterRange?: React.FC<Omit<FilterProps, "renderFilterRange"> & {
13
+ renderFilterRange?: React.FC<{
14
+ filter: ConfigFilterOption;
13
15
  filterRangeProps: ReturnType<typeof useFilterRangeProps>;
14
16
  }>;
15
17
  /** Render method for Slider filters */
16
- renderFilterSlider?: React.FC<Omit<FilterProps, "renderFilterSlider"> & {
18
+ renderFilterSlider?: React.FC<{
19
+ filter: ConfigFilterOption;
17
20
  filterSliderProps: ReturnType<typeof useFilterSliderProps>;
18
21
  }>;
19
22
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Filter.js","sourceRoot":"","sources":["../../../../src/components/Filter/Filter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,wGAAgF;AAChF,0GAAkF;AAMlF,uCAOqB;AACrB,iDAI0B;AAC1B,8DAA4E;AAyBrE,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,IAAI,OAAO,KAAK,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE;QACxC,OAAO,8BAAC,eAAe,oBAAK,KAAK,EAAI,CAAC;KACvC;IAED,IAAI,OAAO,KAAK,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE;QACxC,OAAO,8BAAC,WAAW,oBAAK,KAAK,EAAI,CAAC;KACnC;IAED,IAAI,QAAQ,KAAK,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE;QACzC,OAAO,8B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rE,CAAC;IAER,MAAM,eAAe,GAAG,IAAA,0BAAkB,EAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;IAE9E,+CAA+C;IAC/C,IAAI,CAAC,KAAK,eAAe,CAAC,OAAO,CAAC,MAAM,EAAE;QACxC,OAAO,IAAI,CAAC;KACb;IAED,IAAI,gBAAgB,EAAE;QACpB,MAAM,SAAS,GAAG,gBAAgB,CAAC;QACnC,OAAO,CACL,8BAAC,SAAS,kBACR,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,MAAM,IACV,UAAU,EACd,CACH,CAAC;KACH;IAED,OAAO,CACL,8BAAC,8BAAiB,kBAChB,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,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 ReactivesearchFilterListProps,\n} from \"../../types\";\nimport {\n useFilterListProps,\n useFilterRangeProps,\n useFilterSliderProps,\n useReactiveFilterListProps,\n useReactiveFilterRangeProps,\n useReactiveFilterSliderProps,\n} from \"../../hooks\";\nimport {\n ExampleFilterList,\n ExampleFilterRange,\n ExampleFilterSlider,\n} from \"../../components\";\nimport { DynamicRangeSlider, SingleRange } from \"@appbaseio/reactivesearch\";\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 filterRangeProps: ReturnType<typeof useFilterRangeProps>;\n }\n >;\n /** Render method for Slider filters */\n renderFilterSlider?: React.FC<\n Omit<FilterProps, \"renderFilterSlider\"> & {\n filterSliderProps: ReturnType<typeof useFilterSliderProps>;\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: ReactivesearchFilterListProps) => (\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: ReactivesearchFilterListProps) => (\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 const filterRangeProps = useFilterRangeProps(props.filter);\n\n const RenderRangeComponent = props.renderFilterRange ?? ExampleFilterRange;\n\n return (\n <>\n <div\n style={{\n display: \"none\",\n }}\n >\n <SingleRange\n {...reactiveFilterRangeProps}\n value={filterRangeProps.value}\n onChange={filterRangeProps.handleChange}\n />\n </div>\n <RenderRangeComponent\n filterRangeProps={filterRangeProps}\n filter={props.filter}\n />\n </>\n );\n};\n\nconst FilterSlider: React.FC<FilterProps> = (props) => {\n const reactiveFilterSliderProps = useReactiveFilterSliderProps(props.filter);\n\n const filterSliderProps = useFilterSliderProps(props.filter);\n\n const RenderSliderComponent = props.renderFilterSlider ?? ExampleFilterSlider;\n\n return (\n <>\n {props.renderFilterSlider ? (\n <div\n style={{\n display: \"none\",\n }}\n >\n <DynamicRangeSlider\n {...reactiveFilterSliderProps}\n value={() => filterSliderProps.value}\n onChange={(value) =>\n filterSliderProps.handleChange({\n start: value[0],\n end: value[1],\n })\n }\n />\n </div>\n ) : null}\n <RenderSliderComponent\n filterSliderProps={filterSliderProps}\n filter={props.filter}\n />\n </>\n );\n};\n\n// inner component exists only so we can use memos in reactivesearch render functions\nconst FilterListInner: React.FC<\n FilterProps & { reactivesearchFilterProps: ReactivesearchFilterListProps }\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"]}
1
+ {"version":3,"file":"Filter.js","sourceRoot":"","sources":["../../../../src/components/Filter/Filter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,wGAAgF;AAChF,0GAAkF;AAMlF,uCAOqB;AACrB,iDAI0B;AAC1B,8DAA4E;AAsBrE,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,IAAI,OAAO,KAAK,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE;QACxC,OAAO,8BAAC,eAAe,oBAAK,KAAK,EAAI,CAAC;KACvC;IAED,IAAI,OAAO,KAAK,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE;QACxC,O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,KAAK,EAAE,EAAE;IACZ,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,yBAAyB,KACzD,KAAK,EADyD,UAAU,UACxE,KAAK,EADD,2DAAsE,CACrE,CAAC;IAER,MAAM,eAAe,GAAG,IAAA,0BAAkB,EAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;IAE9E,+CAA+C;IAC/C,IAAI,CAAC,KAAK,eAAe,CAAC,OAAO,CAAC,MAAM,EAAE;QACxC,OAAO,IAAI,CAAC;KACb;IAED,IAAI,gBAAgB,EAAE;QACpB,MAAM,SAAS,GAAG,gBAAgB,CAAC;QACnC,OAAO,CACL,8BAAC,SAAS,kBACR,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,MAAM,IACV,UAAU,EACd,CACH,CAAC;KACH;IAED,OAAO,CACL,8BAAC,8BAAiB,kBAChB,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,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 ReactivesearchFilterListProps,\n} from \"../../types\";\nimport {\n useFilterListProps,\n useFilterRangeProps,\n useFilterSliderProps,\n useReactiveFilterListProps,\n useReactiveFilterRangeProps,\n useReactiveFilterSliderProps,\n} from \"../../hooks\";\nimport {\n ExampleFilterList,\n ExampleFilterRange,\n ExampleFilterSlider,\n} from \"../../components\";\nimport { DynamicRangeSlider, SingleRange } from \"@appbaseio/reactivesearch\";\n\nexport type FilterProps = {\n /** The filter option being rendered */\n filter: ConfigFilterOption;\n /** Render method for List filters */\n renderFilterList?: React.FC<{\n filter: ConfigFilterOption;\n filterListProps: ReturnType<typeof useFilterListProps>;\n }>;\n /** Render method for Range filters */\n renderFilterRange?: React.FC<{\n filter: ConfigFilterOption;\n filterRangeProps: ReturnType<typeof useFilterRangeProps>;\n }>;\n /** Render method for Slider filters */\n renderFilterSlider?: React.FC<{\n filter: ConfigFilterOption;\n filterSliderProps: ReturnType<typeof useFilterSliderProps>;\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: ReactivesearchFilterListProps) => (\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: ReactivesearchFilterListProps) => (\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 const filterRangeProps = useFilterRangeProps(props.filter);\n\n const RenderRangeComponent = props.renderFilterRange ?? ExampleFilterRange;\n\n return (\n <>\n <div\n style={{\n display: \"none\",\n }}\n >\n <SingleRange\n {...reactiveFilterRangeProps}\n value={filterRangeProps.value}\n onChange={filterRangeProps.handleChange}\n />\n </div>\n <RenderRangeComponent\n filterRangeProps={filterRangeProps}\n filter={props.filter}\n />\n </>\n );\n};\n\nconst FilterSlider: React.FC<FilterProps> = (props) => {\n const reactiveFilterSliderProps = useReactiveFilterSliderProps(props.filter);\n\n const filterSliderProps = useFilterSliderProps(props.filter);\n\n const RenderSliderComponent = props.renderFilterSlider ?? ExampleFilterSlider;\n\n return (\n <>\n {props.renderFilterSlider ? (\n <div\n style={{\n display: \"none\",\n }}\n >\n <DynamicRangeSlider\n {...reactiveFilterSliderProps}\n value={() => filterSliderProps.value}\n onChange={(value) =>\n filterSliderProps.handleChange({\n start: value[0],\n end: value[1],\n })\n }\n />\n </div>\n ) : null}\n <RenderSliderComponent\n filterSliderProps={filterSliderProps}\n filter={props.filter}\n />\n </>\n );\n};\n\n// inner component exists only so we can use memos in reactivesearch render functions\nconst FilterListInner: React.FC<\n FilterProps & { reactivesearchFilterProps: ReactivesearchFilterListProps }\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"]}
@@ -2,6 +2,6 @@ import React from "react";
2
2
  import { useFilters } from "../../hooks";
3
3
  export declare type FiltersProps = {
4
4
  /** Render method called once for all filters */
5
- renderFilters?: React.FC<ReturnType<typeof useFilters>>;
5
+ render?: React.FC<ReturnType<typeof useFilters>>;
6
6
  };
7
7
  export declare const Filters: React.FC<FiltersProps>;
@@ -10,8 +10,8 @@ const components_1 = require("../../components");
10
10
  const Filters = (props) => {
11
11
  var _a;
12
12
  const filterStackHook = (0, hooks_1.useFilters)();
13
- const RenderFiltersComponent = (_a = props.renderFilters) !== null && _a !== void 0 ? _a : components_1.ExampleFilters;
14
- return react_1.default.createElement(RenderFiltersComponent, Object.assign({}, filterStackHook));
13
+ const RenderComponent = (_a = props.render) !== null && _a !== void 0 ? _a : components_1.ExampleFilters;
14
+ return react_1.default.createElement(RenderComponent, Object.assign({}, filterStackHook));
15
15
  };
16
16
  exports.Filters = Filters;
17
17
  //# sourceMappingURL=Filters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Filters.js","sourceRoot":"","sources":["../../../../src/components/Filter/Filters.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAAyC;AACzC,iDAAkD;AAO3C,MAAM,OAAO,GAA2B,CAAC,KAAK,EAAE,EAAE;;IACvD,MAAM,eAAe,GAAG,IAAA,kBAAU,GAAE,CAAC;IAErC,MAAM,sBAAsB,GAAG,MAAA,KAAK,CAAC,aAAa,mCAAI,2BAAc,CAAC;IAErE,OAAO,8BAAC,sBAAsB,oBAAK,eAAe,EAAI,CAAC;AACzD,CAAC,CAAC;AANW,QAAA,OAAO,WAMlB","sourcesContent":["import React from \"react\";\n\nimport { useFilters } from \"../../hooks\";\nimport { ExampleFilters } from \"../../components\";\n\nexport type FiltersProps = {\n /** Render method called once for all filters */\n renderFilters?: React.FC<ReturnType<typeof useFilters>>;\n};\n\nexport const Filters: React.FC<FiltersProps> = (props) => {\n const filterStackHook = useFilters();\n\n const RenderFiltersComponent = props.renderFilters ?? ExampleFilters;\n\n return <RenderFiltersComponent {...filterStackHook} />;\n};\n"]}
1
+ {"version":3,"file":"Filters.js","sourceRoot":"","sources":["../../../../src/components/Filter/Filters.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAAyC;AACzC,iDAAkD;AAO3C,MAAM,OAAO,GAA2B,CAAC,KAAK,EAAE,EAAE;;IACvD,MAAM,eAAe,GAAG,IAAA,kBAAU,GAAE,CAAC;IAErC,MAAM,eAAe,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,2BAAc,CAAC;IAEvD,OAAO,8BAAC,eAAe,oBAAK,eAAe,EAAI,CAAC;AAClD,CAAC,CAAC;AANW,QAAA,OAAO,WAMlB","sourcesContent":["import React from \"react\";\n\nimport { useFilters } from \"../../hooks\";\nimport { ExampleFilters } from \"../../components\";\n\nexport type FiltersProps = {\n /** Render method called once for all filters */\n render?: React.FC<ReturnType<typeof useFilters>>;\n};\n\nexport const Filters: React.FC<FiltersProps> = (props) => {\n const filterStackHook = useFilters();\n\n const RenderComponent = props.render ?? ExampleFilters;\n\n return <RenderComponent {...filterStackHook} />;\n};\n"]}
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  export declare type FiltersActiveProps = {
3
3
  /** Render method called once for all active filters */
4
- renderFiltersActive?: React.FC<{
4
+ render?: React.FC<{
5
5
  selectedFilters: Array<{
6
6
  key: string;
7
7
  label: string;
@@ -9,7 +9,7 @@ const react_1 = __importDefault(require("react"));
9
9
  const components_1 = require("../../components");
10
10
  const FiltersActive = (props) => {
11
11
  var _a;
12
- const RenderFiltersActiveComponent = (_a = props.renderFiltersActive) !== null && _a !== void 0 ? _a : components_1.ExampleFiltersActive;
12
+ const RenderComponent = (_a = props.render) !== null && _a !== void 0 ? _a : components_1.ExampleFiltersActive;
13
13
  return (react_1.default.createElement(reactivesearch_1.SelectedFilters, { render: ({ selectedValues, setValue }) => {
14
14
  const selectedFilters = Object.entries(selectedValues)
15
15
  .filter(([key, item]) => {
@@ -29,7 +29,7 @@ const FiltersActive = (props) => {
29
29
  if (!selectedFilters.length) {
30
30
  return null;
31
31
  }
32
- return (react_1.default.createElement(RenderFiltersActiveComponent, { selectedFilters: selectedFilters, handleRemove: handleRemove }));
32
+ return (react_1.default.createElement(RenderComponent, { selectedFilters: selectedFilters, handleRemove: handleRemove }));
33
33
  } }));
34
34
  };
35
35
  exports.FiltersActive = FiltersActive;
@@ -1 +1 @@
1
- {"version":3,"file":"FiltersActive.js","sourceRoot":"","sources":["../../../../src/components/Filter/FiltersActive.tsx"],"names":[],"mappings":";;;;;;AAAA,8DAA4D;AAC5D,kDAA0B;AAE1B,iDAAwD;AAcjD,MAAM,aAAa,GAAiC,CAAC,KAAK,EAAE,EAAE;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ilters } from \"@appbaseio/reactivesearch\";\nimport React from \"react\";\n\nimport { ExampleFiltersActive } from \"../../components\";\n\nexport type FiltersActiveProps = {\n /** Render method called once for all active filters */\n renderFiltersActive?: React.FC<{\n selectedFilters: Array<{\n key: string;\n label: string;\n value: Array<string> | string | { start: number; end: number };\n }>;\n handleRemove: (filterKey: string) => void;\n }>;\n};\n\nexport const FiltersActive: React.FC<FiltersActiveProps> = (props) => {\n const RenderFiltersActiveComponent =\n props.renderFiltersActive ?? ExampleFiltersActive;\n\n return (\n <SelectedFilters\n render={({ selectedValues, setValue }) => {\n const selectedFilters = (\n Object.entries(selectedValues) as Array<[string, any]>\n )\n .filter(\n ([key, item]) =>\n item?.URLParams &&\n item?.showFilter &&\n (!!item?.value?.length || !!item?.value?.label)\n )\n .map(([key, item]) => ({\n key: key,\n label: item.label,\n value: item.value,\n }));\n\n const handleRemove = (selectedFilterKey: string) => {\n setValue(selectedFilterKey, null);\n };\n\n if (!selectedFilters.length) {\n return null;\n }\n\n return (\n <RenderFiltersActiveComponent\n selectedFilters={selectedFilters}\n handleRemove={handleRemove}\n />\n );\n }}\n />\n );\n};\n"]}
1
+ {"version":3,"file":"FiltersActive.js","sourceRoot":"","sources":["../../../../src/components/Filter/FiltersActive.tsx"],"names":[],"mappings":";;;;;;AAAA,8DAA4D;AAC5D,kDAA0B;AAE1B,iDAAwD;AAcjD,MAAM,aAAa,GAAiC,CAAC,KAAK,EAAE,EAAE;;IACnE,MAAM,eAAe,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,iCAAoB,CAAC;IAE7D,OAAO,CACL,8BAAC,gCAAe,IACd,MAAM,EAAE,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE,EAAE;YACvC,MAAM,eAAe,GACnB,MAAM,CAAC,OAAO,CAAC,cAAc,CAC9B;iBACE,MAAM,CACL,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;;gBACd,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;iBACA,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;gBACrB,GAAG,EAAE,GAAG;gBACR,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,KAAK,EAAE,IAAI,CAAC,KAAK;aAClB,CAAC,CAAC,CAAC;YAEN,MAAM,YAAY,GAAG,CAAC,iBAAyB,EAAE,EAAE;gBACjD,QAAQ,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;YACpC,CAAC,CAAC;YAEF,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;gBAC3B,OAAO,IAAI,CAAC;aACb;YAED,OAAO,CACL,8BAAC,eAAe,IACd,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;QACJ,CAAC,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAtCW,QAAA,aAAa,iBAsCxB","sourcesContent":["import { SelectedFilters } from \"@appbaseio/reactivesearch\";\nimport React from \"react\";\n\nimport { ExampleFiltersActive } from \"../../components\";\n\nexport type FiltersActiveProps = {\n /** Render method called once for all active filters */\n render?: React.FC<{\n selectedFilters: Array<{\n key: string;\n label: string;\n value: Array<string> | string | { start: number; end: number };\n }>;\n handleRemove: (filterKey: string) => void;\n }>;\n};\n\nexport const FiltersActive: React.FC<FiltersActiveProps> = (props) => {\n const RenderComponent = props.render ?? ExampleFiltersActive;\n\n return (\n <SelectedFilters\n render={({ selectedValues, setValue }) => {\n const selectedFilters = (\n Object.entries(selectedValues) as Array<[string, any]>\n )\n .filter(\n ([key, item]) =>\n item?.URLParams &&\n item?.showFilter &&\n (!!item?.value?.length || !!item?.value?.label)\n )\n .map(([key, item]) => ({\n key: key,\n label: item.label,\n value: item.value,\n }));\n\n const handleRemove = (selectedFilterKey: string) => {\n setValue(selectedFilterKey, null);\n };\n\n if (!selectedFilters.length) {\n return null;\n }\n\n return (\n <RenderComponent\n selectedFilters={selectedFilters}\n handleRemove={handleRemove}\n />\n );\n }}\n />\n );\n};\n"]}
@@ -4,12 +4,12 @@ export declare type ReactifySearchProviderProps = {
4
4
  mode: "search" | "collection" | "instant-search";
5
5
  /** Shopify store domain used to resolve the site configuration */
6
6
  shopifyPermanentDomain: string;
7
- /** Specific filter group handle, used to override automated logic */
8
- filtersHandle?: string;
9
7
  /** Callback function for redirects, suitable for headless sites to avoid full page refresh */
10
8
  onRedirect?: (type: "redirect" | "search", url: string) => void;
11
9
  /** Render method to display a component when the config is loading */
12
10
  renderBooting?: () => JSX.Element | null;
11
+ /** Advanced usage: Override the default Filters selection logic */
12
+ filtersHandle?: string;
13
13
  /** Advanced usage: Allows you to wrap the ReactifySearchProvider in your own ReactiveBase component */
14
14
  noReactiveBase?: boolean;
15
15
  /** Advanced usage: Array of additional component IDs managed outside of Reactify Search */
@@ -46,8 +46,8 @@ exports.ReactifySearchProvider = ReactifySearchProvider;
46
46
  const ReactifySearchInner = (props) => {
47
47
  var _a, _b;
48
48
  const { config } = (0, hooks_1.useConfig)(props.shopifyPermanentDomain, props.configId);
49
- const [searchQuery, setSearchQuery] = react_1.default.useState("");
50
- const [instantSearchVisible, setInstantSearchVisible] = react_1.default.useState(false);
49
+ const [searchTerm, setSearchTerm] = react_1.default.useState("");
50
+ const [showInstantSearchResults, setShowInstantSearchResults] = react_1.default.useState(false);
51
51
  const [sortOption, setSortOption] = react_1.default.useState("");
52
52
  const credentials = (_a = props.credentials) !== null && _a !== void 0 ? _a : {
53
53
  username: "guest",
@@ -60,7 +60,7 @@ const ReactifySearchInner = (props) => {
60
60
  fontSize: "inherit",
61
61
  },
62
62
  };
63
- const searchQueryFromURL = react_1.default.useMemo(() => {
63
+ const searchTermFromURL = react_1.default.useMemo(() => {
64
64
  var _a;
65
65
  if (typeof window === "undefined") {
66
66
  return;
@@ -77,10 +77,10 @@ const ReactifySearchInner = (props) => {
77
77
  return (_a = urlParams.get("sort")) !== null && _a !== void 0 ? _a : undefined;
78
78
  }, [typeof window !== "undefined" && window.location.search]);
79
79
  react_1.default.useEffect(() => {
80
- if (searchQueryFromURL && searchQuery !== searchQueryFromURL) {
81
- setSearchQuery(searchQueryFromURL);
80
+ if (searchTermFromURL && searchTerm !== searchTermFromURL) {
81
+ setSearchTerm(searchTermFromURL);
82
82
  }
83
- }, [searchQueryFromURL]);
83
+ }, [searchTermFromURL]);
84
84
  react_1.default.useEffect(() => {
85
85
  if (searchSortFromURL && sortOption !== searchSortFromURL) {
86
86
  setSortOption(searchSortFromURL);
@@ -103,20 +103,18 @@ const ReactifySearchInner = (props) => {
103
103
  config: config,
104
104
  options: Object.assign(Object.assign({}, props), { index: (_a = props.index) !== null && _a !== void 0 ? _a : config.index, filtersHandle: props.filtersHandle, credentials: credentials, theme: theme }),
105
105
  search: {
106
- searchQuery: searchQuery,
107
- setSearchQuery: setSearchQuery,
108
- instantSearchVisible: instantSearchVisible,
109
- setInstantSearchVisible: setInstantSearchVisible,
106
+ searchTerm: searchTerm,
107
+ setSearchTerm: setSearchTerm,
108
+ showInstantSearchResults: showInstantSearchResults,
109
+ setShowInstantSearchResults: setShowInstantSearchResults,
110
110
  },
111
111
  sortby: {
112
112
  sortOption: sortOption,
113
113
  setSortOption: setSortOption,
114
114
  },
115
115
  };
116
- }, [config, props, searchQuery, instantSearchVisible, sortOption]);
116
+ }, [config, props, searchTerm, showInstantSearchResults, sortOption]);
117
117
  utility_1.debug.hook("ReactifySearchProvider", "context", contextValue);
118
- utility_1.debug.hook("ReactifySearchProvider", "searchQuery", searchQuery);
119
- utility_1.debug.hook("ReactifySearchProvider", "sortOption", sortOption);
120
118
  if (!contextValue) {
121
119
  if (props.renderBooting) {
122
120
  return props.renderBooting();
@@ -1 +1 @@
1
- {"version":3,"file":"ReactifySearchProvider.js","sourceRoot":"","sources":["../../../../src/components/ReactifySearchProvider/ReactifySearchProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,sDAAwC;AAExC,uCAA+D;AAC/D,iDAAoE;AACpE,2CAAsC;AA2C/B,MAAM,sBAAsB,GAA0C,CAC3E,KAAK,EACL,EAAE;IACF,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,eAAK,CAAC,GAAG,CAAC,wBAAwB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QAEpD,MAAM,CAAC,OAAO,CAAC;YACb,sBAAsB,EAAE,KAAK,CAAC,KAAK;YACnC,qBAAqB,EAAE,KAAK,CAAC,sBAAsB;YACnD,qBAAqB,EAAE,KAAK,CAAC,IAAI;YACjC,2BAA2B,EACzB,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS;YAClE,uBAAuB,EAAE,KAAK,CAAC,aAAa;SAC7C,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,CACL,8BAAC,MAAM,CAAC,aAAa,IAAC,QAAQ,EAAE,iEAA4B;QAC1D,8BAAC,mBAAmB,oBAAK,KAAK,EAAI,CACb,CACxB,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,sBAAsB,0BAqBjC;AAEF,MAAM,mBAAmB,GAA0C,CAAC,KAAK,EAAE,EAAE;;IAC3E,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,iBAAS,EAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAE3E,MAAM,CAAC,WAAW,EAAE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ACjD;YACD,MAAM,EAAE;gBACN,UAAU,EAAE,UAAU;gBACtB,aAAa,EAAE,aAAa;aAC7B;SACF,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE,UAAU,CAAC,CAAC,CAAC;IAEnE,eAAK,CAAC,IAAI,CAAC,wBAAwB,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;IAC9D,eAAK,CAAC,IAAI,CAAC,wBAAwB,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;IACjE,eAAK,CAAC,IAAI,CAAC,wBAAwB,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;IAE/D,IAAI,CAAC,YAAY,EAAE;QACjB,IAAI,KAAK,CAAC,aAAa,EAAE;YACvB,OAAO,KAAK,CAAC,aAAa,EAAE,CAAC;SAC9B;QACD,OAAO,IAAI,CAAC;KACb;IAED,IAAI,KAAK,CAAC,cAAc,EAAE;QACxB,OAAO,CACL,8BAAC,6BAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IAChD,KAAK,CAAC,QAAQ,CACgB,CAClC,CAAC;KACH;IAED,OAAO,CACL,8BAAC,6BAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY;QACjD,8BAAC,6CAAgC,QAC9B,KAAK,CAAC,QAAQ,CACkB,CACJ,CAClC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport * as Sentry from \"@sentry/react\";\n\nimport { ReactifySearchContext, useConfig } from \"../../hooks\";\nimport { UtilityAuthenticatedReactiveBase } from \"../../components\";\nimport { debug } from \"../../utility\";\n\nexport type ReactifySearchProviderProps = {\n /** The search area the provider will be used in */\n mode: \"search\" | \"collection\" | \"instant-search\";\n /** Shopify store domain used to resolve the site configuration */\n shopifyPermanentDomain: string;\n /** Specific filter group handle, used to override automated logic */\n filtersHandle?: string;\n /** Callback function for redirects, suitable for headless sites to avoid full page refresh */\n onRedirect?: (type: \"redirect\" | \"search\", url: string) => void;\n /** Render method to display a component when the config is loading */\n renderBooting?: () => JSX.Element | null;\n /** Advanced usage: Allows you to wrap the ReactifySearchProvider in your own ReactiveBase component */\n noReactiveBase?: boolean;\n /** Advanced usage: Array of additional component IDs managed outside of Reactify Search */\n additionalComponentHandles?: string[];\n /** Advanced usage: Override the default Elasticsearch index */\n index?: string;\n /** Advanced usage: Override the default Reactify Search config (for multi-instance stores) */\n configId?: string;\n /** Advanced usage: Override the default Elasticsearch credentials */\n credentials?: {\n username: string;\n password: string;\n endpoint: string;\n };\n /** Advanced usage: Override the default ReactiveBase theme */\n theme?: Record<string, unknown>;\n} & (\n | {\n mode: \"search\";\n }\n | {\n mode: \"collection\";\n /** Collection object that includes the handle, used to find curations */\n collectionHandle: string;\n }\n | {\n mode: \"instant-search\";\n }\n);\n\nexport const ReactifySearchProvider: React.FC<ReactifySearchProviderProps> = (\n props\n) => {\n React.useEffect(() => {\n debug.log(\"ReactifySearchProvider\", \"props\", props);\n\n Sentry.setTags({\n \"reactifysearch.index\": props.index,\n \"reactifysearch.shop\": props.shopifyPermanentDomain,\n \"reactifysearch.mode\": props.mode,\n \"reactifysearch.collection\":\n props.mode === \"collection\" ? props.collectionHandle : undefined,\n \"reactifysearch.filter\": props.filtersHandle,\n });\n }, [props]);\n\n return (\n <Sentry.ErrorBoundary fallback={<p>An error has occurred</p>}>\n <ReactifySearchInner {...props} />\n </Sentry.ErrorBoundary>\n );\n};\n\nconst ReactifySearchInner: React.FC<ReactifySearchProviderProps> = (props) => {\n const { config } = useConfig(props.shopifyPermanentDomain, props.configId);\n\n const [searchQuery, setSearchQuery] = React.useState<string>(\"\");\n const [instantSearchVisible, setInstantSearchVisible] =\n React.useState<boolean>(false);\n const [sortOption, setSortOption] = React.useState<string>(\"\");\n\n const credentials = props.credentials ?? {\n username: \"guest\",\n password: \"password\",\n endpoint: \"https://api.search.reactify.app\",\n };\n\n const theme = props.theme ?? {\n typography: {\n fontFamily: \"inherit\",\n fontSize: \"inherit\",\n },\n };\n\n const searchQueryFromURL = React.useMemo(() => {\n if (typeof window === \"undefined\") {\n return;\n }\n const urlParams = new URLSearchParams(window.location.search);\n return urlParams.get(\"q\") ?? undefined;\n }, [typeof window !== \"undefined\" && window.location.search]);\n\n const searchSortFromURL = React.useMemo(() => {\n if (typeof window === \"undefined\") {\n return;\n }\n const urlParams = new URLSearchParams(window.location.search);\n return urlParams.get(\"sort\") ?? undefined;\n }, [typeof window !== \"undefined\" && window.location.search]);\n\n React.useEffect(() => {\n if (searchQueryFromURL && searchQuery !== searchQueryFromURL) {\n setSearchQuery(searchQueryFromURL);\n }\n }, [searchQueryFromURL]);\n\n React.useEffect(() => {\n if (searchSortFromURL && sortOption !== searchSortFromURL) {\n setSortOption(searchSortFromURL);\n }\n }, [searchSortFromURL]);\n\n React.useEffect(() => {\n if (typeof window == \"undefined\") {\n return;\n }\n\n if (window.location.search === \"\" && sortOption) {\n setSortOption(sortOption);\n }\n }, [typeof window !== \"undefined\" && window.location.search]);\n\n const contextValue = React.useMemo(() => {\n if (!config) {\n return;\n }\n\n return {\n config: config,\n options: {\n ...props,\n index: props.index ?? config.index,\n filtersHandle: props.filtersHandle,\n credentials: credentials,\n theme: theme,\n },\n search: {\n searchQuery: searchQuery,\n setSearchQuery: setSearchQuery,\n instantSearchVisible: instantSearchVisible,\n setInstantSearchVisible: setInstantSearchVisible,\n },\n sortby: {\n sortOption: sortOption,\n setSortOption: setSortOption,\n },\n };\n }, [config, props, searchQuery, instantSearchVisible, sortOption]);\n\n debug.hook(\"ReactifySearchProvider\", \"context\", contextValue);\n debug.hook(\"ReactifySearchProvider\", \"searchQuery\", searchQuery);\n debug.hook(\"ReactifySearchProvider\", \"sortOption\", sortOption);\n\n if (!contextValue) {\n if (props.renderBooting) {\n return props.renderBooting();\n }\n return null;\n }\n\n if (props.noReactiveBase) {\n return (\n <ReactifySearchContext.Provider value={contextValue}>\n {props.children}\n </ReactifySearchContext.Provider>\n );\n }\n\n return (\n <ReactifySearchContext.Provider value={contextValue}>\n <UtilityAuthenticatedReactiveBase>\n {props.children}\n </UtilityAuthenticatedReactiveBase>\n </ReactifySearchContext.Provider>\n );\n};\n"]}
1
+ {"version":3,"file":"ReactifySearchProvider.js","sourceRoot":"","sources":["../../../../src/components/ReactifySearchProvider/ReactifySearchProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,sDAAwC;AAExC,uCAA+D;AAC/D,iDAAoE;AACpE,2CAAsC;AA2C/B,MAAM,sBAAsB,GAA0C,CAC3E,KAAK,EACL,EAAE;IACF,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,eAAK,CAAC,GAAG,CAAC,wBAAwB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QAEpD,MAAM,CAAC,OAAO,CAAC;YACb,sBAAsB,EAAE,KAAK,CAAC,KAAK;YACnC,qBAAqB,EAAE,KAAK,CAAC,sBAAsB;YACnD,qBAAqB,EAAE,KAAK,CAAC,IAAI;YACjC,2BAA2B,EACzB,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS;YAClE,uBAAuB,EAAE,KAAK,CAAC,aAAa;SAC7C,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,CACL,8BAAC,MAAM,CAAC,aAAa,IAAC,QAAQ,EAAE,iEAA4B;QAC1D,8BAAC,mBAAmB,oBAAK,KAAK,EAAI,CACb,CACxB,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,sBAAsB,0BAqBjC;AAEF,MAAM,mBAAmB,GAA0C,CAAC,KAAK,EAAE,EAAE;;IAC3E,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,iBAAS,EAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAE3E,MAAM,CAAC,UAAU,EAAE,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D;YACD,MAAM,EAAE;gBACN,UAAU,EAAE,UAAU;gBACtB,aAAa,EAAE,aAAa;aAC7B;SACF,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,wBAAwB,EAAE,UAAU,CAAC,CAAC,CAAC;IAEtE,eAAK,CAAC,IAAI,CAAC,wBAAwB,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;IAE9D,IAAI,CAAC,YAAY,EAAE;QACjB,IAAI,KAAK,CAAC,aAAa,EAAE;YACvB,OAAO,KAAK,CAAC,aAAa,EAAE,CAAC;SAC9B;QACD,OAAO,IAAI,CAAC;KACb;IAED,IAAI,KAAK,CAAC,cAAc,EAAE;QACxB,OAAO,CACL,8BAAC,6BAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IAChD,KAAK,CAAC,QAAQ,CACgB,CAClC,CAAC;KACH;IAED,OAAO,CACL,8BAAC,6BAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY;QACjD,8BAAC,6CAAgC,QAC9B,KAAK,CAAC,QAAQ,CACkB,CACJ,CAClC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport * as Sentry from \"@sentry/react\";\n\nimport { ReactifySearchContext, useConfig } from \"../../hooks\";\nimport { UtilityAuthenticatedReactiveBase } from \"../../components\";\nimport { debug } from \"../../utility\";\n\nexport type ReactifySearchProviderProps = {\n /** The search area the provider will be used in */\n mode: \"search\" | \"collection\" | \"instant-search\";\n /** Shopify store domain used to resolve the site configuration */\n shopifyPermanentDomain: string;\n /** Callback function for redirects, suitable for headless sites to avoid full page refresh */\n onRedirect?: (type: \"redirect\" | \"search\", url: string) => void;\n /** Render method to display a component when the config is loading */\n renderBooting?: () => JSX.Element | null;\n /** Advanced usage: Override the default Filters selection logic */\n filtersHandle?: string;\n /** Advanced usage: Allows you to wrap the ReactifySearchProvider in your own ReactiveBase component */\n noReactiveBase?: boolean;\n /** Advanced usage: Array of additional component IDs managed outside of Reactify Search */\n additionalComponentHandles?: string[];\n /** Advanced usage: Override the default Elasticsearch index */\n index?: string;\n /** Advanced usage: Override the default Reactify Search config (for multi-instance stores) */\n configId?: string;\n /** Advanced usage: Override the default Elasticsearch credentials */\n credentials?: {\n username: string;\n password: string;\n endpoint: string;\n };\n /** Advanced usage: Override the default ReactiveBase theme */\n theme?: Record<string, unknown>;\n} & (\n | {\n mode: \"search\";\n }\n | {\n mode: \"collection\";\n /** Collection object that includes the handle, used to find curations */\n collectionHandle: string;\n }\n | {\n mode: \"instant-search\";\n }\n);\n\nexport const ReactifySearchProvider: React.FC<ReactifySearchProviderProps> = (\n props\n) => {\n React.useEffect(() => {\n debug.log(\"ReactifySearchProvider\", \"props\", props);\n\n Sentry.setTags({\n \"reactifysearch.index\": props.index,\n \"reactifysearch.shop\": props.shopifyPermanentDomain,\n \"reactifysearch.mode\": props.mode,\n \"reactifysearch.collection\":\n props.mode === \"collection\" ? props.collectionHandle : undefined,\n \"reactifysearch.filter\": props.filtersHandle,\n });\n }, [props]);\n\n return (\n <Sentry.ErrorBoundary fallback={<p>An error has occurred</p>}>\n <ReactifySearchInner {...props} />\n </Sentry.ErrorBoundary>\n );\n};\n\nconst ReactifySearchInner: React.FC<ReactifySearchProviderProps> = (props) => {\n const { config } = useConfig(props.shopifyPermanentDomain, props.configId);\n\n const [searchTerm, setSearchTerm] = React.useState<string>(\"\");\n const [showInstantSearchResults, setShowInstantSearchResults] =\n React.useState<boolean>(false);\n const [sortOption, setSortOption] = React.useState<string>(\"\");\n\n const credentials = props.credentials ?? {\n username: \"guest\",\n password: \"password\",\n endpoint: \"https://api.search.reactify.app\",\n };\n\n const theme = props.theme ?? {\n typography: {\n fontFamily: \"inherit\",\n fontSize: \"inherit\",\n },\n };\n\n const searchTermFromURL = React.useMemo(() => {\n if (typeof window === \"undefined\") {\n return;\n }\n const urlParams = new URLSearchParams(window.location.search);\n return urlParams.get(\"q\") ?? undefined;\n }, [typeof window !== \"undefined\" && window.location.search]);\n\n const searchSortFromURL = React.useMemo(() => {\n if (typeof window === \"undefined\") {\n return;\n }\n const urlParams = new URLSearchParams(window.location.search);\n return urlParams.get(\"sort\") ?? undefined;\n }, [typeof window !== \"undefined\" && window.location.search]);\n\n React.useEffect(() => {\n if (searchTermFromURL && searchTerm !== searchTermFromURL) {\n setSearchTerm(searchTermFromURL);\n }\n }, [searchTermFromURL]);\n\n React.useEffect(() => {\n if (searchSortFromURL && sortOption !== searchSortFromURL) {\n setSortOption(searchSortFromURL);\n }\n }, [searchSortFromURL]);\n\n React.useEffect(() => {\n if (typeof window == \"undefined\") {\n return;\n }\n\n if (window.location.search === \"\" && sortOption) {\n setSortOption(sortOption);\n }\n }, [typeof window !== \"undefined\" && window.location.search]);\n\n const contextValue = React.useMemo(() => {\n if (!config) {\n return;\n }\n\n return {\n config: config,\n options: {\n ...props,\n index: props.index ?? config.index,\n filtersHandle: props.filtersHandle,\n credentials: credentials,\n theme: theme,\n },\n search: {\n searchTerm: searchTerm,\n setSearchTerm: setSearchTerm,\n showInstantSearchResults: showInstantSearchResults,\n setShowInstantSearchResults: setShowInstantSearchResults,\n },\n sortby: {\n sortOption: sortOption,\n setSortOption: setSortOption,\n },\n };\n }, [config, props, searchTerm, showInstantSearchResults, sortOption]);\n\n debug.hook(\"ReactifySearchProvider\", \"context\", contextValue);\n\n if (!contextValue) {\n if (props.renderBooting) {\n return props.renderBooting();\n }\n return null;\n }\n\n if (props.noReactiveBase) {\n return (\n <ReactifySearchContext.Provider value={contextValue}>\n {props.children}\n </ReactifySearchContext.Provider>\n );\n }\n\n return (\n <ReactifySearchContext.Provider value={contextValue}>\n <UtilityAuthenticatedReactiveBase>\n {props.children}\n </UtilityAuthenticatedReactiveBase>\n </ReactifySearchContext.Provider>\n );\n};\n"]}
@@ -1,12 +1,10 @@
1
1
  import React from "react";
2
2
  import { ElasticCallout } from "../../types";
3
+ import { ResultsProps } from "..";
3
4
  export declare type ResultCardCalloutProps = {
4
5
  pagePosition: number;
5
6
  document: ElasticCallout;
6
7
  callout: ElasticCallout["callout"];
7
- render?: React.FC<Omit<ResultCardCalloutProps, "render"> & {
8
- itemRef: (node?: Element | null) => void;
9
- handleClick: () => void;
10
- }>;
8
+ render?: ResultsProps["renderResultCardCallout"];
11
9
  };
12
10
  export declare const ResultCardCallout: React.FC<ResultCardCalloutProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"ResultCardCallout.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultCardCallout.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,6EAAwD;AAGxD,uCAA2C;AAC3C,0BAA8C;AAcvC,MAAM,iBAAiB,GAAqC,CAAC,KAAK,EAAE,EAAE;;IAC3E,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,oBAAY,GAAE,CAAC;IACjC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,IAAA,uCAAS,EAAC;QAChC,SAAS,EAAE,GAAG;QACd,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,eAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACzC,KAAK,CAAC;YACJ,SAAS,EAAE,gBAAgB;YAC3B,OAAO,EAAE;gBACP,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI;gBACxB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;aAC3B;SACF,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAE3B,MAAM,UAAU,GAAG,eAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACxC,KAAK,CAAC;YACJ,SAAS,EAAE,eAAe;YAC1B,OAAO,EAAE;gBACP,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI;gBACxB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;aAC3B;SACF,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAE3B,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,MAAM,EAAE;YACV,UAAU,EAAE,CAAC;SACd;IACH,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,MAAM,eAAe,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,4BAAwB,CAAC;IAEjE,OAAO,8BAAC,eAAe,oBAAK,KAAK,IAAE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,WAAW,IAAI,CAAC;AAChF,CAAC,CAAC;AApCW,QAAA,iBAAiB,qBAoC5B","sourcesContent":["import React from \"react\";\nimport { useInView } from \"react-intersection-observer\";\n\nimport { ElasticCallout } from \"../../types\";\nimport { useAnalytics } from \"../../hooks\";\nimport { ExampleResultCardCallout } from \"..\";\n\nexport type ResultCardCalloutProps = {\n pagePosition: number;\n document: ElasticCallout;\n callout: ElasticCallout[\"callout\"];\n render?: React.FC<\n Omit<ResultCardCalloutProps, \"render\"> & {\n itemRef: (node?: Element | null) => void;\n handleClick: () => void;\n }\n >;\n};\n\nexport const ResultCardCallout: React.FC<ResultCardCalloutProps> = (props) => {\n const { track } = useAnalytics();\n const { ref, inView } = useInView({\n threshold: 0.5,\n triggerOnce: true,\n });\n\n const handleClick = React.useCallback(() => {\n track({\n eventName: \"clickPromotion\",\n payload: {\n link: props.callout.link,\n title: props.callout.title,\n },\n });\n }, [track, props.callout]);\n\n const handleView = React.useCallback(() => {\n track({\n eventName: \"viewPromotion\",\n payload: {\n link: props.callout.link,\n title: props.callout.title,\n },\n });\n }, [track, props.callout]);\n\n React.useEffect(() => {\n if (inView) {\n handleView();\n }\n }, [inView]);\n\n const RenderComponent = props.render ?? ExampleResultCardCallout;\n\n return <RenderComponent {...props} itemRef={ref} handleClick={handleClick} />;\n};\n"]}
1
+ {"version":3,"file":"ResultCardCallout.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultCardCallout.tsx"],"names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,EAAE,WAAW,EAAE,WAAW,IAAI,CAAC;AAChF,CAAC,CAAC;AApCW,QAAA,iBAAiB,qBAoC5B","sourcesContent":["import React from \"react\";\nimport { useInView } from \"react-intersection-observer\";\n\nimport { ElasticCallout } from \"../../types\";\nimport { useAnalytics } from \"../../hooks\";\nimport { ResultsProps, ExampleResultCardCallout } from \"..\";\n\nexport type ResultCardCalloutProps = {\n pagePosition: number;\n document: ElasticCallout;\n callout: ElasticCallout[\"callout\"];\n render?: ResultsProps[\"renderResultCardCallout\"];\n};\n\nexport const ResultCardCallout: React.FC<ResultCardCalloutProps> = (props) => {\n const { track } = useAnalytics();\n const { ref, inView } = useInView({\n threshold: 0.5,\n triggerOnce: true,\n });\n\n const handleClick = React.useCallback(() => {\n track({\n eventName: \"clickPromotion\",\n payload: {\n link: props.callout.link,\n title: props.callout.title,\n },\n });\n }, [track, props.callout]);\n\n const handleView = React.useCallback(() => {\n track({\n eventName: \"viewPromotion\",\n payload: {\n link: props.callout.link,\n title: props.callout.title,\n },\n });\n }, [track, props.callout]);\n\n React.useEffect(() => {\n if (inView) {\n handleView();\n }\n }, [inView]);\n\n const RenderComponent = props.render ?? ExampleResultCardCallout;\n\n return <RenderComponent {...props} itemRef={ref} handleClick={handleClick} />;\n};\n"]}
@@ -1,13 +1,10 @@
1
1
  import React from "react";
2
2
  import type { ElasticProduct } from "../../types";
3
- import { useProductPrice } from "../../hooks";
3
+ import { ResultsProps } from "../../components";
4
4
  export declare type ResultCardProductProps = {
5
5
  pagePosition: number;
6
6
  product: ElasticProduct;
7
7
  document: ElasticProduct;
8
- render?: React.FC<Omit<ResultCardProductProps, "render"> & ReturnType<typeof useProductPrice> & {
9
- itemRef: (node?: Element | null) => void;
10
- handleClick: () => void;
11
- }>;
8
+ render?: ResultsProps["renderResultCardProduct"];
12
9
  };
13
10
  export declare const ResultCardProduct: React.FC<ResultCardProductProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"ResultCardProduct.js","sourceRoot":"","sources":["../../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AC,CAAC,CAAC;IAEb,MAAM,eAAe,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,qCAAwB,CAAC;IAEjE,OAAO,CACL,8BAAC,eAAe,oBACV,YAAY,IAChB,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,WAAW,IACxB,CACH,CAAC;AACJ,CAAC,CAAC;AAnDW,QAAA,iBAAiB,qBAmD5B","sourcesContent":["import React from \"react\";\nimport { useInView } from \"react-intersection-observer\";\n\nimport type { ElasticProduct } from \"../../types\";\nimport { useProductPrice, useAnalytics } from \"../../hooks\";\nimport { ExampleResultCardProduct } from \"../../components\";\n\nexport type ResultCardProductProps = {\n pagePosition: number;\n product: ElasticProduct;\n document: ElasticProduct;\n render?: React.FC<\n Omit<ResultCardProductProps, \"render\"> &\n ReturnType<typeof useProductPrice> & {\n itemRef: (node?: Element | null) => void;\n handleClick: () => void;\n }\n >;\n};\n\nexport const ResultCardProduct: React.FC<ResultCardProductProps> = (props) => {\n const productPrice = useProductPrice(props.product);\n\n const { track } = useAnalytics();\n const { ref, inView } = useInView({\n threshold: 0.5,\n triggerOnce: true,\n });\n\n const handleClick = React.useCallback(() => {\n track({\n eventName: \"clickProduct\",\n payload: {\n elasticProduct: {\n id: props.product.id,\n title: props.product.title,\n },\n },\n });\n }, [track, props.product]);\n\n const handleView = React.useCallback(() => {\n track({\n eventName: \"viewProduct\",\n payload: {\n elasticProduct: {\n id: props.product.id,\n title: props.product.title,\n },\n },\n });\n }, [track, props.product]);\n\n React.useEffect(() => {\n if (inView) {\n handleView();\n }\n }, [inView]);\n\n const RenderComponent = props.render ?? ExampleResultCardProduct;\n\n return (\n <RenderComponent\n {...productPrice}\n pagePosition={props.pagePosition}\n product={props.product}\n document={props.document}\n itemRef={ref}\n handleClick={handleClick}\n />\n );\n};\n"]}
1
+ {"version":3,"file":"ResultCardProduct.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultCardProduct.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,6EAAwD;AAGxD,uCAA4D;AAC5D,iDAA0E;AASnE,MAAM,iBAAiB,GAAqC,CAAC,KAAK,EAAE,EAAE;;IAC3E,MAAM,YAAY,GAAG,IAAA,uBAAe,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAEpD,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,oBAAY,GAAE,CAAC;IACjC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,IAAA,uCAAS,EAAC;QAChC,SAAS,EAAE,GAAG;QACd,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,eAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACzC,KAAK,CAAC;YACJ,SAAS,EAAE,cAAc;YACzB,OAAO,EAAE;gBACP,cAAc,EAAE;oBACd,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE;oBACpB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;iBAC3B;aACF;SACF,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAE3B,MAAM,UAAU,GAAG,eAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACxC,KAAK,CAAC;YACJ,SAAS,EAAE,aAAa;YACxB,OAAO,EAAE;gBACP,cAAc,EAAE;oBACd,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE;oBACpB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;iBAC3B;aACF;SACF,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAE3B,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,MAAM,EAAE;YACV,UAAU,EAAE,CAAC;SACd;IACH,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,MAAM,eAAe,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,qCAAwB,CAAC;IAEjE,OAAO,CACL,8BAAC,eAAe,oBACV,YAAY,IAChB,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,WAAW,IACxB,CACH,CAAC;AACJ,CAAC,CAAC;AAnDW,QAAA,iBAAiB,qBAmD5B","sourcesContent":["import React from \"react\";\nimport { useInView } from \"react-intersection-observer\";\n\nimport type { ElasticProduct } from \"../../types\";\nimport { useProductPrice, useAnalytics } from \"../../hooks\";\nimport { ResultsProps, ExampleResultCardProduct } from \"../../components\";\n\nexport type ResultCardProductProps = {\n pagePosition: number;\n product: ElasticProduct;\n document: ElasticProduct;\n render?: ResultsProps[\"renderResultCardProduct\"];\n};\n\nexport const ResultCardProduct: React.FC<ResultCardProductProps> = (props) => {\n const productPrice = useProductPrice(props.product);\n\n const { track } = useAnalytics();\n const { ref, inView } = useInView({\n threshold: 0.5,\n triggerOnce: true,\n });\n\n const handleClick = React.useCallback(() => {\n track({\n eventName: \"clickProduct\",\n payload: {\n elasticProduct: {\n id: props.product.id,\n title: props.product.title,\n },\n },\n });\n }, [track, props.product]);\n\n const handleView = React.useCallback(() => {\n track({\n eventName: \"viewProduct\",\n payload: {\n elasticProduct: {\n id: props.product.id,\n title: props.product.title,\n },\n },\n });\n }, [track, props.product]);\n\n React.useEffect(() => {\n if (inView) {\n handleView();\n }\n }, [inView]);\n\n const RenderComponent = props.render ?? ExampleResultCardProduct;\n\n return (\n <RenderComponent\n {...productPrice}\n pagePosition={props.pagePosition}\n product={props.product}\n document={props.document}\n itemRef={ref}\n handleClick={handleClick}\n />\n );\n};\n"]}
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { ReactivesearchResultProps } from "../../types";
3
- import { usePaginationLoadMore } from "../../hooks";
3
+ import { ResultsProps } from "../../components";
4
4
  export declare type ResultPaginationLoadMoreProps = ReactivesearchResultProps & {
5
- render?: React.FC<ReturnType<typeof usePaginationLoadMore>>;
5
+ render?: ResultsProps["renderPaginationLoadMore"];
6
6
  };
7
7
  export declare const ResultPaginationLoadMore: React.FC<ResultPaginationLoadMoreProps>;
@@ -11,7 +11,7 @@ const ResultPaginationLoadMore = (props) => {
11
11
  var _a;
12
12
  const paginationLoadMoreHook = (0, hooks_1.usePaginationLoadMore)(props);
13
13
  const RenderPaginationComponent = (_a = props.render) !== null && _a !== void 0 ? _a : components_1.ExampleResultPaginationLoadMore;
14
- return (react_1.default.createElement(RenderPaginationComponent, Object.assign({}, paginationLoadMoreHook)));
14
+ return react_1.default.createElement(RenderPaginationComponent, Object.assign({}, paginationLoadMoreHook));
15
15
  };
16
16
  exports.ResultPaginationLoadMore = ResultPaginationLoadMore;
17
17
  //# sourceMappingURL=ResultPaginationLoadMore.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResultPaginationLoadMore.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultPaginationLoadMore.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,uCAAoD;AACpD,iDAAmE;AAM5D,MAAM,wBAAwB,GAA4C,CAAC,KAAK,EAAE,EAAE;;IACzF,MAAM,sBAAsB,GAAG,IAAA,6BAAqB,EAAC,KAAK,CAAC,CAAC;IAE5D,MAAM,yBAAyB,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,4CAA+B,CAAC;IAElF,OAAO,CACL,8BAAC,yBAAyB,oBACpB,sBAAsB,EAC1B,CACH,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,wBAAwB,4BAUnC","sourcesContent":["import React from \"react\";\n\nimport { ReactivesearchResultProps } from \"../../types\";\nimport { usePaginationLoadMore } from \"../../hooks\";\nimport { ExampleResultPaginationLoadMore } from \"../../components\";\n\nexport type ResultPaginationLoadMoreProps = ReactivesearchResultProps & {\n render?: React.FC<ReturnType<typeof usePaginationLoadMore>>;\n};\n\nexport const ResultPaginationLoadMore: React.FC<ResultPaginationLoadMoreProps> = (props) => {\n const paginationLoadMoreHook = usePaginationLoadMore(props);\n\n const RenderPaginationComponent = props.render ?? ExampleResultPaginationLoadMore;\n\n return (\n <RenderPaginationComponent\n {...paginationLoadMoreHook}\n />\n );\n};\n"]}
1
+ {"version":3,"file":"ResultPaginationLoadMore.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultPaginationLoadMore.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,uCAAoD;AACpD,iDAG0B;AAMnB,MAAM,wBAAwB,GACnC,CAAC,KAAK,EAAE,EAAE;;IACR,MAAM,sBAAsB,GAAG,IAAA,6BAAqB,EAAC,KAAK,CAAC,CAAC;IAE5D,MAAM,yBAAyB,GAC7B,MAAA,KAAK,CAAC,MAAM,mCAAI,4CAA+B,CAAC;IAElD,OAAO,8BAAC,yBAAyB,oBAAK,sBAAsB,EAAI,CAAC;AACnE,CAAC,CAAC;AARS,QAAA,wBAAwB,4BAQjC","sourcesContent":["import React from \"react\";\n\nimport { ReactivesearchResultProps } from \"../../types\";\nimport { usePaginationLoadMore } from \"../../hooks\";\nimport {\n ResultsProps,\n ExampleResultPaginationLoadMore,\n} from \"../../components\";\n\nexport type ResultPaginationLoadMoreProps = ReactivesearchResultProps & {\n render?: ResultsProps[\"renderPaginationLoadMore\"];\n};\n\nexport const ResultPaginationLoadMore: React.FC<ResultPaginationLoadMoreProps> =\n (props) => {\n const paginationLoadMoreHook = usePaginationLoadMore(props);\n\n const RenderPaginationComponent =\n props.render ?? ExampleResultPaginationLoadMore;\n\n return <RenderPaginationComponent {...paginationLoadMoreHook} />;\n };\n"]}
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- import { usePagination } from "../../hooks";
3
2
  import { ReactivesearchPaginationProps } from "../../types";
3
+ import { ResultsProps } from "../../components";
4
4
  export declare type ResultPaginationNextPrevProps = ReactivesearchPaginationProps & {
5
- render?: React.FC<ReturnType<typeof usePagination>>;
5
+ render?: ResultsProps["renderPaginationNextPrev"];
6
6
  };
7
7
  export declare const ResultPaginationNextPrev: React.FC<ResultPaginationNextPrevProps>;
@@ -11,7 +11,7 @@ const ResultPaginationNextPrev = (props) => {
11
11
  var _a;
12
12
  const paginationHook = (0, hooks_1.usePagination)(props);
13
13
  const RenderPaginationComponent = (_a = props.render) !== null && _a !== void 0 ? _a : components_1.ExampleResultPaginationNextPrev;
14
- return (react_1.default.createElement(RenderPaginationComponent, Object.assign({}, paginationHook)));
14
+ return react_1.default.createElement(RenderPaginationComponent, Object.assign({}, paginationHook));
15
15
  };
16
16
  exports.ResultPaginationNextPrev = ResultPaginationNextPrev;
17
17
  //# sourceMappingURL=ResultPaginationNextPrev.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResultPaginationNextPrev.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultPaginationNextPrev.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAA4C;AAE5C,iDAAmE;AAM5D,MAAM,wBAAwB,GAA4C,CAAC,KAAK,EAAE,EAAE;;IACzF,MAAM,cAAc,GAAG,IAAA,qBAAa,EAAC,KAAK,CAAC,CAAC;IAE5C,MAAM,yBAAyB,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,4CAA+B,CAAC;IAElF,OAAO,CACL,8BAAC,yBAAyB,oBACpB,cAAc,EAClB,CACH,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,wBAAwB,4BAUnC","sourcesContent":["import React from \"react\";\n\nimport { usePagination } from \"../../hooks\";\nimport { ReactivesearchPaginationProps } from \"../../types\";\nimport { ExampleResultPaginationNextPrev } from \"../../components\";\n\nexport type ResultPaginationNextPrevProps = ReactivesearchPaginationProps & {\n render?: React.FC<ReturnType<typeof usePagination>>;\n};\n\nexport const ResultPaginationNextPrev: React.FC<ResultPaginationNextPrevProps> = (props) => {\n const paginationHook = usePagination(props);\n\n const RenderPaginationComponent = props.render ?? ExampleResultPaginationNextPrev;\n\n return (\n <RenderPaginationComponent\n {...paginationHook}\n />\n );\n};\n"]}
1
+ {"version":3,"file":"ResultPaginationNextPrev.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultPaginationNextPrev.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAA4C;AAE5C,iDAG0B;AAMnB,MAAM,wBAAwB,GACnC,CAAC,KAAK,EAAE,EAAE;;IACR,MAAM,cAAc,GAAG,IAAA,qBAAa,EAAC,KAAK,CAAC,CAAC;IAE5C,MAAM,yBAAyB,GAC7B,MAAA,KAAK,CAAC,MAAM,mCAAI,4CAA+B,CAAC;IAElD,OAAO,8BAAC,yBAAyB,oBAAK,cAAc,EAAI,CAAC;AAC3D,CAAC,CAAC;AARS,QAAA,wBAAwB,4BAQjC","sourcesContent":["import React from \"react\";\n\nimport { usePagination } from \"../../hooks\";\nimport { ReactivesearchPaginationProps } from \"../../types\";\nimport {\n ResultsProps,\n ExampleResultPaginationNextPrev,\n} from \"../../components\";\n\nexport type ResultPaginationNextPrevProps = ReactivesearchPaginationProps & {\n render?: ResultsProps[\"renderPaginationNextPrev\"];\n};\n\nexport const ResultPaginationNextPrev: React.FC<ResultPaginationNextPrevProps> =\n (props) => {\n const paginationHook = usePagination(props);\n\n const RenderPaginationComponent =\n props.render ?? ExampleResultPaginationNextPrev;\n\n return <RenderPaginationComponent {...paginationHook} />;\n };\n"]}
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { ReactivesearchPaginationProps } from "../../types";
3
- import { usePagination } from "../../hooks";
3
+ import { ResultsProps } from "../../components";
4
4
  export declare type ResultPaginationNumberedProps = ReactivesearchPaginationProps & {
5
- render?: React.FC<ReturnType<typeof usePagination>>;
5
+ render?: ResultsProps["renderPaginationNumbered"];
6
6
  };
7
7
  export declare const ResultPaginationNumbered: React.FC<ResultPaginationNumberedProps>;
@@ -14,7 +14,7 @@ const ResultPaginationNumbered = (props) => {
14
14
  return null;
15
15
  }
16
16
  const RenderPaginationComponent = (_a = props.render) !== null && _a !== void 0 ? _a : components_1.ExampleResultPaginationNumbered;
17
- return (react_1.default.createElement(RenderPaginationComponent, Object.assign({}, paginationHook)));
17
+ return react_1.default.createElement(RenderPaginationComponent, Object.assign({}, paginationHook));
18
18
  };
19
19
  exports.ResultPaginationNumbered = ResultPaginationNumbered;
20
20
  //# sourceMappingURL=ResultPaginationNumbered.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResultPaginationNumbered.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultPaginationNumbered.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,uCAA4C;AAC5C,iDAAmE;AAM5D,MAAM,wBAAwB,GAA4C,CAAC,KAAK,EAAE,EAAE;;IACzF,MAAM,cAAc,GAAG,IAAA,qBAAa,EAAC,KAAK,CAAC,CAAC;IAE5C,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE;QAC9B,OAAO,IAAI,CAAC;KACb;IAED,MAAM,yBAAyB,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,4CAA+B,CAAC;IAElF,OAAO,CACL,8BAAC,yBAAyB,oBACpB,cAAc,EAClB,CACH,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,wBAAwB,4BAcnC","sourcesContent":["import React from \"react\";\n\nimport { ReactivesearchPaginationProps } from \"../../types\";\nimport { usePagination } from \"../../hooks\";\nimport { ExampleResultPaginationNumbered } from \"../../components\";\n\nexport type ResultPaginationNumberedProps = ReactivesearchPaginationProps & {\n render?: React.FC<ReturnType<typeof usePagination>>;\n};\n\nexport const ResultPaginationNumbered: React.FC<ResultPaginationNumberedProps> = (props) => {\n const paginationHook = usePagination(props);\n\n if (!paginationHook.totalPages) {\n return null;\n }\n \n const RenderPaginationComponent = props.render ?? ExampleResultPaginationNumbered;\n\n return (\n <RenderPaginationComponent\n {...paginationHook}\n />\n );\n};\n"]}
1
+ {"version":3,"file":"ResultPaginationNumbered.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultPaginationNumbered.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,uCAA4C;AAC5C,iDAG0B;AAMnB,MAAM,wBAAwB,GACnC,CAAC,KAAK,EAAE,EAAE;;IACR,MAAM,cAAc,GAAG,IAAA,qBAAa,EAAC,KAAK,CAAC,CAAC;IAE5C,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE;QAC9B,OAAO,IAAI,CAAC;KACb;IAED,MAAM,yBAAyB,GAC7B,MAAA,KAAK,CAAC,MAAM,mCAAI,4CAA+B,CAAC;IAElD,OAAO,8BAAC,yBAAyB,oBAAK,cAAc,EAAI,CAAC;AAC3D,CAAC,CAAC;AAZS,QAAA,wBAAwB,4BAYjC","sourcesContent":["import React from \"react\";\n\nimport { ReactivesearchPaginationProps } from \"../../types\";\nimport { usePagination } from \"../../hooks\";\nimport {\n ResultsProps,\n ExampleResultPaginationNumbered,\n} from \"../../components\";\n\nexport type ResultPaginationNumberedProps = ReactivesearchPaginationProps & {\n render?: ResultsProps[\"renderPaginationNumbered\"];\n};\n\nexport const ResultPaginationNumbered: React.FC<ResultPaginationNumberedProps> =\n (props) => {\n const paginationHook = usePagination(props);\n\n if (!paginationHook.totalPages) {\n return null;\n }\n\n const RenderPaginationComponent =\n props.render ?? ExampleResultPaginationNumbered;\n\n return <RenderPaginationComponent {...paginationHook} />;\n };\n"]}
@@ -1,10 +1,6 @@
1
1
  import React from "react";
2
- import { ResultCardCallout } from "./ResultCardCallout";
3
- import { ResultCardProduct } from "./ResultCardProduct";
4
- import { ResultPaginationNumbered } from "./ResultPaginationNumbered";
5
- import { ResultPaginationLoadMore } from "./ResultPaginationLoadMore";
6
- import { ResultPaginationNextPrev } from "./ResultPaginationNextPrev";
7
2
  import { ElasticCallout, ElasticProduct, ReactivesearchError, ReactivesearchResultProps } from "../../types";
3
+ import { useProductPrice, usePagination, usePaginationLoadMore } from "../../hooks";
8
4
  export declare type ResultProps = ReactivesearchResultProps & {
9
5
  callouts: ElasticCallout[];
10
6
  products: ElasticProduct[];
@@ -23,17 +19,29 @@ export declare type ResultsProps = {
23
19
  /** Render method called when no results are found */
24
20
  renderNoResults?: React.FC;
25
21
  /** Render method called once for each product result */
26
- renderResultCardProduct?: React.ComponentProps<typeof ResultCardProduct>["render"];
22
+ renderResultCardProduct?: React.FC<ReturnType<typeof useProductPrice> & {
23
+ pagePosition: number;
24
+ product: ElasticProduct;
25
+ document: ElasticProduct;
26
+ itemRef: (node?: Element | null) => void;
27
+ handleClick: () => void;
28
+ }>;
27
29
  /** Render method called once for each callout result */
28
- renderResultCardCallout?: React.ComponentProps<typeof ResultCardCallout>["render"];
30
+ renderResultCardCallout?: React.FC<{
31
+ pagePosition: number;
32
+ document: ElasticCallout;
33
+ callout: ElasticCallout["callout"];
34
+ itemRef: (node?: Element | null) => void;
35
+ handleClick: () => void;
36
+ }>;
29
37
  /** Render method called for pagination type "pagination" */
30
- renderPaginationNumbered?: React.ComponentProps<typeof ResultPaginationNumbered>["render"];
38
+ renderPaginationNumbered?: React.FC<ReturnType<typeof usePagination>>;
31
39
  /** Render method called for pagination type "next_prev" */
32
- renderPaginationNextPrev?: React.ComponentProps<typeof ResultPaginationNextPrev>["render"];
40
+ renderPaginationNextPrev?: React.FC<ReturnType<typeof usePagination>>;
33
41
  /** Render method called for pagination type "load_more" */
34
- renderPaginationLoadMore?: React.ComponentProps<typeof ResultPaginationLoadMore>["render"];
42
+ renderPaginationLoadMore?: React.FC<ReturnType<typeof usePaginationLoadMore>>;
35
43
  /** Render method called for pagination type "infinite_scroll" */
36
- renderPaginationInfiniteScroll?: React.ComponentProps<typeof ResultPaginationLoadMore>["render"];
44
+ renderPaginationInfiniteScroll?: React.FC<ReturnType<typeof usePaginationLoadMore>>;
37
45
  /** Advanced Usage: Override the default amount of results per page */
38
46
  pageSize?: number;
39
47
  };