@usereactify/search 5.53.0 → 5.55.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/package.json +2 -2
- package/dist/src/components/ClearAll/ClearAll.d.ts +1 -1
- package/dist/src/components/ClearAll/ClearAll.js +3 -2
- package/dist/src/components/ClearAll/ClearAll.js.map +1 -1
- package/dist/src/components/ClearAll/index.js +5 -1
- package/dist/src/components/ClearAll/index.js.map +1 -1
- package/dist/src/components/CustomComponent/CustomComponent.d.ts +1 -1
- package/dist/src/components/CustomComponent/index.js +5 -1
- package/dist/src/components/CustomComponent/index.js.map +1 -1
- package/dist/src/components/Example/ExampleClearAll.d.ts +1 -1
- package/dist/src/components/Example/ExampleFilterList.d.ts +1 -1
- package/dist/src/components/Example/ExampleFilterRange.d.ts +1 -1
- package/dist/src/components/Example/ExampleFilterSlider.d.ts +1 -1
- package/dist/src/components/Example/ExampleFiltersSelected.d.ts +1 -1
- package/dist/src/components/Example/ExampleHookUseResults.js.map +1 -1
- package/dist/src/components/Example/ExampleResultCardCallout.d.ts +1 -1
- package/dist/src/components/Example/ExampleResultCardProduct.d.ts +1 -1
- package/dist/src/components/Example/ExampleResultPaginationInfiniteScroll.d.ts +1 -1
- package/dist/src/components/Example/ExampleResultPaginationInfiniteScroll.js.map +1 -1
- package/dist/src/components/Example/ExampleResultPaginationLoadMore.d.ts +1 -1
- package/dist/src/components/Example/ExampleResultPaginationNextPrev.d.ts +1 -1
- package/dist/src/components/Example/ExampleResultPaginationNumbered.d.ts +1 -1
- package/dist/src/components/Example/ExampleSearch.d.ts +1 -1
- package/dist/src/components/Example/ExampleSortBy.d.ts +1 -1
- package/dist/src/components/Example/ExampleStats.d.ts +1 -1
- package/dist/src/components/Example/ExampleSuggestions.d.ts +1 -1
- package/dist/src/components/Example/index.js +5 -1
- package/dist/src/components/Example/index.js.map +1 -1
- package/dist/src/components/Filter/Filter.d.ts +1 -1
- package/dist/src/components/Filter/Filter.js.map +1 -1
- package/dist/src/components/Filter/Filters.d.ts +1 -1
- package/dist/src/components/Filter/FiltersSelected.d.ts +1 -1
- package/dist/src/components/Filter/FiltersSelected.js +3 -2
- package/dist/src/components/Filter/FiltersSelected.js.map +1 -1
- package/dist/src/components/Filter/index.js +5 -1
- package/dist/src/components/Filter/index.js.map +1 -1
- package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.d.ts +1 -1
- package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js +5 -1
- package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js.map +1 -1
- package/dist/src/components/ReactifySearchProvider/index.js +5 -1
- package/dist/src/components/ReactifySearchProvider/index.js.map +1 -1
- package/dist/src/components/Result/ResultCardCallout.d.ts +1 -1
- package/dist/src/components/Result/ResultCardCallout.js.map +1 -1
- package/dist/src/components/Result/ResultCardProduct.d.ts +1 -1
- package/dist/src/components/Result/ResultCardProduct.js.map +1 -1
- package/dist/src/components/Result/ResultPaginationInfiniteScroll.d.ts +1 -1
- package/dist/src/components/Result/ResultPaginationLoadMore.d.ts +1 -1
- package/dist/src/components/Result/ResultPaginationNextPrev.d.ts +1 -1
- package/dist/src/components/Result/ResultPaginationNumbered.d.ts +1 -1
- package/dist/src/components/Result/ResultPaginationNumbered.js.map +1 -1
- package/dist/src/components/Result/ResultStateProvider.d.ts +1 -1
- package/dist/src/components/Result/Results.d.ts +2 -2
- package/dist/src/components/Result/Results.js.map +1 -1
- package/dist/src/components/Result/index.js +5 -1
- package/dist/src/components/Result/index.js.map +1 -1
- package/dist/src/components/Search/Search.d.ts +1 -1
- package/dist/src/components/Search/index.js +5 -1
- package/dist/src/components/Search/index.js.map +1 -1
- package/dist/src/components/Sensor/SensorCollection.js.map +1 -1
- package/dist/src/components/Sensor/SensorInventoryAvailable.js.map +1 -1
- package/dist/src/components/Sensor/SensorPublished.js.map +1 -1
- package/dist/src/components/Sensor/SensorSearchTerm.js.map +1 -1
- package/dist/src/components/Sensor/SensorSort.js.map +1 -1
- package/dist/src/components/Sensor/Sensors.d.ts +1 -1
- package/dist/src/components/Sensor/Sensors.js.map +1 -1
- package/dist/src/components/Sensor/index.js +5 -1
- package/dist/src/components/Sensor/index.js.map +1 -1
- package/dist/src/components/SortBy/SortBy.d.ts +1 -1
- package/dist/src/components/SortBy/index.js +5 -1
- package/dist/src/components/SortBy/index.js.map +1 -1
- package/dist/src/components/Stats/Stats.d.ts +1 -1
- package/dist/src/components/Stats/index.js +5 -1
- package/dist/src/components/Stats/index.js.map +1 -1
- package/dist/src/components/Suggestions/Suggestions.d.ts +1 -1
- package/dist/src/components/Suggestions/Suggestions.js.map +1 -1
- package/dist/src/components/Suggestions/index.js +5 -1
- package/dist/src/components/Suggestions/index.js.map +1 -1
- package/dist/src/components/Utility/UtilityAuthenticatedReactiveBase.d.ts +1 -1
- package/dist/src/components/Utility/index.js +5 -1
- package/dist/src/components/Utility/index.js.map +1 -1
- package/dist/src/components/index.js +5 -1
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/hooks/index.js +5 -1
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/hooks/reactivesearch/index.js +5 -1
- package/dist/src/hooks/reactivesearch/index.js.map +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js.map +1 -1
- package/dist/src/hooks/useAnalytics.d.ts +1 -1
- package/dist/src/hooks/useAnalytics.js +2 -2
- package/dist/src/hooks/useAnalytics.js.map +1 -1
- package/dist/src/hooks/useConfig.d.ts +1 -1
- package/dist/src/hooks/useConfig.js +1 -12
- package/dist/src/hooks/useConfig.js.map +1 -1
- package/dist/src/hooks/useCuration.d.ts +1 -1
- package/dist/src/hooks/useCuration.js.map +1 -1
- package/dist/src/hooks/useDebugger.d.ts +1 -0
- package/dist/src/hooks/useDebugger.js +12 -1
- package/dist/src/hooks/useDebugger.js.map +1 -1
- package/dist/src/hooks/useFilterListProps.js.map +1 -1
- package/dist/src/hooks/useFilterRangeProps.js +4 -3
- package/dist/src/hooks/useFilterRangeProps.js.map +1 -1
- package/dist/src/hooks/useFilterSliderProps.js +4 -3
- package/dist/src/hooks/useFilterSliderProps.js.map +1 -1
- package/dist/src/hooks/useFilters.d.ts +2 -2
- package/dist/src/hooks/useFilters.js +0 -3
- package/dist/src/hooks/useFilters.js.map +1 -1
- package/dist/src/hooks/useFlags.js +2 -4
- package/dist/src/hooks/useFlags.js.map +1 -1
- package/dist/src/hooks/useIndices.d.ts +1 -1
- package/dist/src/hooks/useIndices.js.map +1 -1
- package/dist/src/hooks/usePagination.d.ts +3 -3
- package/dist/src/hooks/usePagination.js.map +1 -1
- package/dist/src/hooks/usePaginationLoadable.js.map +1 -1
- package/dist/src/hooks/useProductPrice.js.map +1 -1
- package/dist/src/hooks/useReactifySearchContext.d.ts +21 -21
- package/dist/src/hooks/useResults.d.ts +1 -9
- package/dist/src/hooks/useResults.js +9 -7
- package/dist/src/hooks/useResults.js.map +1 -1
- package/dist/src/hooks/useSearch.d.ts +10 -3
- package/dist/src/hooks/useSearch.js +11 -5
- package/dist/src/hooks/useSearch.js.map +1 -1
- package/dist/src/hooks/useSortBy.d.ts +2 -2
- package/dist/src/hooks/useSortBy.js +0 -2
- package/dist/src/hooks/useSortBy.js.map +1 -1
- package/dist/src/index.js +5 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/types/config.d.ts +10 -10
- package/dist/src/types/elastic.d.ts +6 -6
- package/dist/src/types/elastic.js +2 -2
- package/dist/src/types/elastic.js.map +1 -1
- package/dist/src/types/firestore.d.ts +6 -6
- package/dist/src/types/firestore.js +15 -15
- package/dist/src/types/firestore.js.map +1 -1
- package/dist/src/types/graphql.d.ts +3204 -3204
- package/dist/src/types/graphql.js +445 -445
- package/dist/src/types/graphql.js.map +1 -1
- package/dist/src/types/index.js +5 -1
- package/dist/src/types/index.js.map +1 -1
- package/dist/src/types/shopify.d.ts +14 -14
- package/dist/src/types/shopify.js +7 -7
- package/dist/src/types/shopify.js.map +1 -1
- package/dist/src/utility/config.js.map +1 -1
- package/dist/src/utility/curation.js.map +1 -1
- package/dist/src/utility/debug.d.ts +2 -1
- package/dist/src/utility/debug.js +1 -0
- package/dist/src/utility/debug.js.map +1 -1
- package/dist/src/utility/filters.js.map +1 -1
- package/dist/src/utility/index.js +5 -1
- package/dist/src/utility/index.js.map +1 -1
- package/dist/src/utility/liquid.js +3 -3
- package/dist/src/utility/liquid.js.map +1 -1
- package/dist/src/utility/props.d.ts +7 -8
- package/dist/src/utility/props.js +6 -6
- package/dist/src/utility/props.js.map +1 -1
- package/dist/src/utility/sortOption.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ReactifySearchProvider/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ReactifySearchProvider/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC","sourcesContent":["export * from \"./ReactifySearchProvider\";\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ElasticCallout } from "../../types";
|
|
3
3
|
import { ResultsProps } from "..";
|
|
4
|
-
export
|
|
4
|
+
export type ResultCardCalloutProps = {
|
|
5
5
|
pagePosition: number;
|
|
6
6
|
document: ElasticCallout;
|
|
7
7
|
callout: ElasticCallout["callout"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultCardCallout.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultCardCallout.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,6EAAwD;AAGxD,uCAA2C;AAC3C,0BAA4D;AAUrD,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,EAA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C,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;AArCW,QAAA,iBAAiB,qBAqC5B","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 onView?: () => void;\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 props.onView?.();\n handleView();\n }\n }, [inView]);\n\n const RenderComponent = props.render ?? ExampleResultCardCallout;\n\n return <RenderComponent {...props} itemRef={ref} handleClick={handleClick} />;\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { ElasticProduct } from "../../types";
|
|
3
3
|
import { ResultsProps } from "../../components";
|
|
4
|
-
export
|
|
4
|
+
export type ResultCardProductProps = {
|
|
5
5
|
pagePosition: number;
|
|
6
6
|
product: ElasticProduct;
|
|
7
7
|
document: ElasticProduct;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultCardProduct.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultCardProduct.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,6EAAwD;AAGxD,uCAA4D;AAC5D,iDAA0E;AAUnE,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;
|
|
1
|
+
{"version":3,"file":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AAC,MAAM,qDAAI,CAAC;YACjB,UAAU,EAAE,CAAC;QACf,CAAC;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;AApDW,QAAA,iBAAiB,qBAoD5B","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 onView?: () => void;\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 props.onView?.();\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
3
|
import { ResultsProps } from "../../components";
|
|
4
|
-
export
|
|
4
|
+
export type ResultPaginationInfiniteScrollProps = ReactivesearchResultProps & {
|
|
5
5
|
render?: ResultsProps["renderPaginationInfiniteScroll"];
|
|
6
6
|
};
|
|
7
7
|
export declare const ResultPaginationInfiniteScroll: React.FC<ResultPaginationInfiniteScrollProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ReactivesearchResultProps } from "../../types";
|
|
3
3
|
import { ResultsProps } from "../../components";
|
|
4
|
-
export
|
|
4
|
+
export type ResultPaginationLoadMoreProps = ReactivesearchResultProps & {
|
|
5
5
|
render?: ResultsProps["renderPaginationLoadMore"];
|
|
6
6
|
};
|
|
7
7
|
export declare const ResultPaginationLoadMore: React.FC<ResultPaginationLoadMoreProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ReactivesearchPaginationProps } from "../../types";
|
|
3
3
|
import { ResultsProps } from "../../components";
|
|
4
|
-
export
|
|
4
|
+
export type ResultPaginationNextPrevProps = ReactivesearchPaginationProps & {
|
|
5
5
|
render?: ResultsProps["renderPaginationNextPrev"];
|
|
6
6
|
};
|
|
7
7
|
export declare const ResultPaginationNextPrev: React.FC<ResultPaginationNextPrevProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ReactivesearchPaginationProps } from "../../types";
|
|
3
3
|
import { ResultsProps } from "../../components";
|
|
4
|
-
export
|
|
4
|
+
export type ResultPaginationNumberedProps = ReactivesearchPaginationProps & {
|
|
5
5
|
render?: ResultsProps["renderPaginationNumbered"];
|
|
6
6
|
};
|
|
7
7
|
export declare const ResultPaginationNumbered: React.FC<ResultPaginationNumberedProps>;
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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,CAAC;QAC/B,OAAO,IAAI,CAAC;IACd,CAAC;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,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ReactivesearchSearchStatePage } from "../../types";
|
|
3
|
-
export
|
|
3
|
+
export type ResultStateProvidedProps = {
|
|
4
4
|
render: React.FC<ReactivesearchSearchStatePage>;
|
|
5
5
|
};
|
|
6
6
|
export declare const ResultStateProvider: React.FC<ResultStateProvidedProps>;
|
|
@@ -2,11 +2,11 @@ import React from "react";
|
|
|
2
2
|
import ReactiveList from "@usereactify/search-internals/lib/components/result/ReactiveList";
|
|
3
3
|
import { ElasticCallout, ElasticProduct, ReactivesearchError, ReactivesearchResultProps } from "../../types";
|
|
4
4
|
import { useProductPrice, usePagination, usePaginationLoadable } from "../../hooks";
|
|
5
|
-
export
|
|
5
|
+
export type ResultProps = ReactivesearchResultProps & {
|
|
6
6
|
callouts: ElasticCallout[];
|
|
7
7
|
products: ElasticProduct[];
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type ResultsProps = {
|
|
10
10
|
/** Style prop for the list wrapper */
|
|
11
11
|
listStyle?: React.HTMLAttributes<HTMLElement>["style"];
|
|
12
12
|
/** Classname prop for the list wrapper */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Results.js","sourceRoot":"","sources":["../../../../src/components/Result/Results.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,oHAA4F;AAE5F,2DAAwD;AACxD,2DAAwD;AACxD,yEAAsE;AACtE,yEAAsE;AACtE,yEAAsE;AACtE,qFAAkF;AAElF,uCASqB;AACrB,uCASqB;AACrB,+CAAsD;AACtD,qDAA8E;AA4DvE,MAAM,OAAO,GAA2B,CAAC,KAAK,EAAE,EAAE;IACvD,MAAM,qBAAqB,GAAG,IAAA,gCAAwB,GAAE,CAAC;IACzD,MAAM,WAAW,GAAG,IAAA,kBAAU,GAAE,CAAC;IACjC,MAAM,aAAa,GAAG,IAAA,uBAAe,EA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CAAC,yBAAyB,IACnC,MAAM,EAAE,KAAK,CAAC,wBAAwB,IACtC,CACH,CAAC;KACH;IAED,IAAI,iBAAiB,MAAK,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,CAAA,EAAE;QACrD,OAAO,CACL,8BAAC,+DAA8B,oBACzB,KAAK,CAAC,yBAAyB,IACnC,MAAM,EAAE,KAAK,CAAC,8BAA8B,IAC5C,CACH,CAAC;KACH;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport ReactiveList from \"@usereactify/search-internals/lib/components/result/ReactiveList\";\n\nimport { ResultCardCallout } from \"./ResultCardCallout\";\nimport { ResultCardProduct } from \"./ResultCardProduct\";\nimport { ResultPaginationNumbered } from \"./ResultPaginationNumbered\";\nimport { ResultPaginationLoadMore } from \"./ResultPaginationLoadMore\";\nimport { ResultPaginationNextPrev } from \"./ResultPaginationNextPrev\";\nimport { ResultPaginationInfiniteScroll } from \"./ResultPaginationInfiniteScroll\";\n\nimport {\n ElasticCallout,\n ElasticProduct,\n ElasticDocumentType,\n ReactivesearchError,\n ReactivesearchResultProps,\n ReactivesearchPaginationProps,\n ElasticHit,\n ElasticDocument,\n} from \"../../types\";\nimport {\n useReactifySearchContext,\n useAnalytics,\n useSearch,\n useFilters,\n useProductPrice,\n usePagination,\n usePaginationLoadable,\n useResults,\n} from \"../../hooks\";\nimport { getPropsResults } from \"../../utility/props\";\nimport { MerchandisingCalloutAutofillBehaviour } from \"../../types/firestore\";\n\nexport type ResultProps = ReactivesearchResultProps & {\n callouts: ElasticCallout[];\n products: ElasticProduct[];\n};\n\nexport type ResultsProps = {\n /** Style prop for the list wrapper */\n listStyle?: React.HTMLAttributes<HTMLElement>[\"style\"];\n /** Classname prop for the list wrapper */\n listClassName?: string;\n /** Render method called when an error occurs */\n renderError?: React.FC<{ error: ReactivesearchError }>;\n /** Render method called while loading for the first time */\n renderLoading?: React.FC;\n /** Render method called when no results are found */\n renderNoResults?: React.FC;\n /** Render method called once for each product result */\n renderResultCardProduct?: React.FC<\n ReturnType<typeof useProductPrice> & {\n pagePosition: number;\n product: ElasticProduct;\n document: ElasticProduct;\n itemRef: (node?: Element | null) => void;\n handleClick: () => void;\n }\n >;\n /** Render method called once for each callout result */\n renderResultCardCallout?: React.FC<{\n pagePosition: number;\n document: ElasticCallout;\n callout: ElasticCallout[\"callout\"];\n itemRef: (node?: Element | null) => void;\n handleClick: () => void;\n }>;\n /** Render method called for pagination type \"pagination\" */\n renderPaginationNumbered?: React.FC<ReturnType<typeof usePagination>>;\n /** Render method called for pagination type \"next_prev\" */\n renderPaginationNextPrev?: React.FC<ReturnType<typeof usePagination>>;\n /** Render method called for pagination type \"load_more\" */\n renderPaginationLoadMore?: React.FC<ReturnType<typeof usePaginationLoadable>>;\n /** Render method called for pagination type \"infinite_scroll\" */\n renderPaginationInfiniteScroll?: React.FC<\n ReturnType<typeof usePaginationLoadable>\n >;\n /** Used to determine which filler callouts to use when there is an uneven grid */\n gridColumns?: number;\n /** Advanced Usage: Override the default amount of results per page */\n pageSize?: number;\n /** Advanced Usage: Override the default scrollTarget used to determine when infinite load should be triggered (infinite scroll) */\n infiniteScrollContainer?: React.ComponentProps<\n typeof ReactiveList\n >[\"scrollTarget\"];\n /** Advanced Usage: Provide a specific result position to trigger loading more results (infinite scroll) */\n infiniteScrollPosition?: number;\n /** Advanced Usage: Shows subsequent loading states after initial results are loaded */\n showSubsequentLoadingStates?: boolean;\n};\n\nexport const Results: React.FC<ResultsProps> = (props) => {\n const reactifySearchContext = useReactifySearchContext();\n const filtersHook = useFilters();\n const reactiveProps = getPropsResults({\n provider: reactifySearchContext.options,\n config: reactifySearchContext.config,\n filterGroup: filtersHook.filterStack,\n scrollTarget: props.infiniteScrollContainer,\n pageSize: props.pageSize\n });\n\n const { track } = useAnalytics();\n const { searchTerm } = useSearch();\n\n return (\n <ReactiveList\n {...reactiveProps}\n render={(reactivesearchResultProps: ReactivesearchResultProps) => (\n <ResultsInner\n {...props}\n reactivesearchResultProps={reactivesearchResultProps}\n />\n )}\n onData={(renderProps) => {\n if (renderProps.resultStats.numberOfResults === 0) {\n let trimmedSearchTerm = searchTerm.trim();\n\n if (\n !trimmedSearchTerm ||\n (trimmedSearchTerm && trimmedSearchTerm.length < 3)\n ) {\n return;\n }\n\n track({\n eventName: \"zeroResults\",\n payload: {\n searchTerm: trimmedSearchTerm,\n },\n });\n }\n }}\n renderPagination={(\n reactivesearchPaginationProps: ReactivesearchPaginationProps\n ) => (\n <ResultsPaginationStack {...props} {...reactivesearchPaginationProps} />\n )}\n />\n );\n};\n\nconst ResultsRenderErrorComponent: ResultsProps[\"renderError\"] = (props) => {\n return (\n <div>\n {\"Error: \"}\n {props.error.statusText}\n </div>\n );\n};\n\nconst ResultsRenderLoadingComponent: ResultsProps[\"renderLoading\"] = () => {\n return <div>{\"Loading\"}</div>;\n};\n\nconst ResultsRenderNoResultsComponent: ResultsProps[\"renderNoResults\"] = () => {\n return <div>{\"No results\"}</div>;\n};\n\nconst ResultsInner: React.FC<\n ResultsProps & { reactivesearchResultProps: ReactivesearchResultProps }\n> = (props) => {\n const context = useReactifySearchContext();\n const filtersHook = useFilters();\n const resultsHook = useResults();\n const initialSearchHasRun = React.useMemo(\n () =>\n \"undefined\" !==\n typeof props.reactivesearchResultProps.resultStats.numberOfResults,\n [props.reactivesearchResultProps]\n );\n\n const listStyle = React.useMemo<React.HTMLAttributes<HTMLElement>[\"style\"]>(\n () =>\n props.listStyle ?? {\n display: \"grid\",\n gap: \"8px\",\n gridTemplateColumns: \"repeat(4, minmax(0, 1fr))\",\n },\n [props.listStyle]\n );\n\n const infiniteScrollPosition = React.useMemo<number>(() => {\n if (!props.infiniteScrollPosition) {\n return NaN;\n }\n\n const scrollPositionOffset =\n props.reactivesearchResultProps.resultStats.displayedResults -\n (props.pageSize ?? filtersHook.filterStack?.pageSize ?? 0);\n\n return scrollPositionOffset + (props.infiniteScrollPosition ?? 0);\n }, [\n props.pageSize ?? filtersHook.filterStack?.pageSize,\n props.reactivesearchResultProps.resultStats.displayedResults,\n props.infiniteScrollPosition,\n ]);\n\n React.useEffect(() => {\n resultsHook.setResults(props.reactivesearchResultProps.data);\n resultsHook.setResultStats(props.reactivesearchResultProps.resultStats);\n }, [\n props.reactivesearchResultProps.resultStats.numberOfResults,\n props.reactivesearchResultProps.data.map((item) => item._id).join(\"\"),\n ]);\n\n const calculateGridOverflow = React.useCallback((results: ReactivesearchResultProps[\"data\"]) => {\n if (!props.gridColumns) {\n return;\n\n }\n let total = results.length;\n for (const result of results) {\n if (result.type === ElasticDocumentType.Product) {\n continue;\n }\n total += ((parseInt(result.callout.displayColumns) * parseInt(result.callout.displayRows)) - 1);\n }\n\n const overflow = props.gridColumns - (total % props.gridColumns);\n\n if (overflow === props.gridColumns) {\n return;\n }\n\n return overflow === props.gridColumns ? undefined : overflow;\n }, [props.gridColumns]);\n\n const gridOverflowCallout = React.useMemo((): Omit<ElasticHit, \"_source\"> & ElasticCallout | undefined => {\n // check if there are more results\n if (props.reactivesearchResultProps.resultStats.displayedResults === props.reactivesearchResultProps.resultStats.numberOfResults) {\n // check if we should only autofill when there are more results\n if (context.config.merchandising.calloutAutofillBehaviour === MerchandisingCalloutAutofillBehaviour.MoreResults) {\n return;\n }\n }\n\n const overflow = calculateGridOverflow(props.reactivesearchResultProps.data);\n\n const callout = context.config.callouts.find((item) => item.displayColumns === `${overflow}`);\n if (!callout) {\n return;\n }\n\n return {\n _id: callout.id,\n _score: 0,\n type: ElasticDocumentType.Callout,\n key: Math.random().toString(16),\n callout: {\n ...callout,\n enabled: true,\n },\n published: true,\n curations: [],\n }\n }, [props.reactivesearchResultProps.resultStats, props.reactivesearchResultProps.data, context.config.callouts]);\n\n const results = React.useMemo(() => ([\n ...props.reactivesearchResultProps.data,\n ...gridOverflowCallout ? [gridOverflowCallout] : [],\n ]), [props.reactivesearchResultProps.data, gridOverflowCallout]);\n\n if (props.reactivesearchResultProps.error) {\n const RenderErrorComponent =\n props.renderError ?? ResultsRenderErrorComponent;\n\n return (\n <RenderErrorComponent error={props.reactivesearchResultProps.error} />\n );\n }\n\n if (!initialSearchHasRun) {\n const RenderLoadingComponent =\n props.renderLoading ?? ResultsRenderLoadingComponent;\n return <RenderLoadingComponent />;\n }\n \n if (props.showSubsequentLoadingStates === true) {\n if (props.reactivesearchResultProps.loading) {\n const RenderLoadingComponent = props.renderLoading ?? ResultsRenderLoadingComponent;\n return <RenderLoadingComponent />;\n }\n }\n\n if (\n !props.reactivesearchResultProps.loading &&\n !props.reactivesearchResultProps.resultStats.numberOfResults\n ) {\n const RenderNoResultsComponent =\n props.renderNoResults ?? ResultsRenderNoResultsComponent;\n\n return <RenderNoResultsComponent />;\n }\n\n if ([\"search\", \"instant-search\"].includes(context.options.mode)) {\n if (!context.search.searchTerm) {\n const RenderNoResultsComponent =\n props.renderNoResults ?? ResultsRenderNoResultsComponent;\n\n return <RenderNoResultsComponent />;\n }\n }\n\n return (\n <>\n <section style={listStyle} className={props.listClassName}>\n {results.map((item, key) => {\n if (ElasticDocumentType.Product === item.type) {\n return (\n <ResultCardProduct\n key={item._id}\n product={item}\n document={item}\n pagePosition={key + 1}\n render={props.renderResultCardProduct}\n {...(infiniteScrollPosition === key + 1\n ? {\n onView: () => props.reactivesearchResultProps.loadMore(),\n }\n : {})}\n />\n );\n }\n\n if (ElasticDocumentType.Callout === item.type) {\n return (\n <ResultCardCallout\n key={item._id}\n document={item}\n pagePosition={key + 1}\n callout={item.callout}\n render={props.renderResultCardCallout}\n {...(infiniteScrollPosition === key + 1\n ? {\n onView: () => props.reactivesearchResultProps.loadMore(),\n }\n : {})}\n />\n );\n }\n\n return null;\n })}\n </section>\n <ResultsPaginationStackLoadable\n {...props}\n {...props.reactivesearchResultProps}\n />\n </>\n );\n};\n\n/** Handles rendering pagination for types that use \"pagination props\" */\nconst ResultsPaginationStack: React.FC<\n ResultsProps & ReactivesearchPaginationProps\n> = (props) => {\n const { options } = useReactifySearchContext();\n const { filterStack } = useFilters();\n\n if (options.mode === \"instant-search\") {\n return null;\n }\n\n if (\"pagination\" === filterStack?.paginationType) {\n return (\n <ResultPaginationNumbered\n {...props}\n render={props.renderPaginationNumbered}\n />\n );\n }\n\n if (\"next_prev\" === filterStack?.paginationType) {\n return (\n <ResultPaginationNextPrev\n {...props}\n render={props.renderPaginationNextPrev}\n />\n );\n }\n\n return null;\n};\n\n/** Handles rendering pagination for types that use \"result props\" */\nconst ResultsPaginationStackLoadable: React.FC<\n ResultsProps & { reactivesearchResultProps: ReactivesearchResultProps }\n> = (props) => {\n const { options } = useReactifySearchContext();\n const { filterStack } = useFilters();\n\n if (options.mode === \"instant-search\") {\n return null;\n }\n\n if (\"load_more\" === filterStack?.paginationType) {\n return (\n <ResultPaginationLoadMore\n {...props.reactivesearchResultProps}\n render={props.renderPaginationLoadMore}\n />\n );\n }\n\n if (\"infinite_scroll\" === filterStack?.paginationType) {\n return (\n <ResultPaginationInfiniteScroll\n {...props.reactivesearchResultProps}\n render={props.renderPaginationInfiniteScroll}\n />\n );\n }\n\n return null;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Results.js","sourceRoot":"","sources":["../../../../src/components/Result/Results.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,oHAA4F;AAE5F,2DAAwD;AACxD,2DAAwD;AACxD,yEAAsE;AACtE,yEAAsE;AACtE,yEAAsE;AACtE,qFAAkF;AAElF,uCASqB;AACrB,uCASqB;AACrB,+CAAsD;AACtD,qDAA8E;AA4DvE,MAAM,OAAO,GAA2B,CAAC,KAAK,EAAE,EAAE;IACvD,MAAM,qBAAqB,GAAG,IAAA,gCAAwB,GAAE,CAAC;IACzD,MAAM,WAAW,GAAG,IAAA,kBAAU,GAAE,CAAC;IACjC,MAAM,aAAa,GAAG,IAAA,uBAAe,EAAC;QACpC,QAAQ,EAAE,qBAAqB,CAAC,OAAO;QACvC,MAAM,EAAE,qBAAqB,CAAC,MAAM;QACpC,WAAW,EAAE,WAAW,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AE,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,WAAW,MAAK,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,CAAA,EAAE,CAAC;QAChD,OAAO,CACL,8BAAC,mDAAwB,oBACnB,KAAK,CAAC,yBAAyB,IACnC,MAAM,EAAE,KAAK,CAAC,wBAAwB,IACtC,CACH,CAAC;IACJ,CAAC;IAED,IAAI,iBAAiB,MAAK,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,CAAA,EAAE,CAAC;QACtD,OAAO,CACL,8BAAC,+DAA8B,oBACzB,KAAK,CAAC,yBAAyB,IACnC,MAAM,EAAE,KAAK,CAAC,8BAA8B,IAC5C,CACH,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport ReactiveList from \"@usereactify/search-internals/lib/components/result/ReactiveList\";\n\nimport { ResultCardCallout } from \"./ResultCardCallout\";\nimport { ResultCardProduct } from \"./ResultCardProduct\";\nimport { ResultPaginationNumbered } from \"./ResultPaginationNumbered\";\nimport { ResultPaginationLoadMore } from \"./ResultPaginationLoadMore\";\nimport { ResultPaginationNextPrev } from \"./ResultPaginationNextPrev\";\nimport { ResultPaginationInfiniteScroll } from \"./ResultPaginationInfiniteScroll\";\n\nimport {\n ElasticCallout,\n ElasticProduct,\n ElasticDocumentType,\n ReactivesearchError,\n ReactivesearchResultProps,\n ReactivesearchPaginationProps,\n ElasticHit,\n ElasticDocument,\n} from \"../../types\";\nimport {\n useReactifySearchContext,\n useAnalytics,\n useSearch,\n useFilters,\n useProductPrice,\n usePagination,\n usePaginationLoadable,\n useResults,\n} from \"../../hooks\";\nimport { getPropsResults } from \"../../utility/props\";\nimport { MerchandisingCalloutAutofillBehaviour } from \"../../types/firestore\";\n\nexport type ResultProps = ReactivesearchResultProps & {\n callouts: ElasticCallout[];\n products: ElasticProduct[];\n};\n\nexport type ResultsProps = {\n /** Style prop for the list wrapper */\n listStyle?: React.HTMLAttributes<HTMLElement>[\"style\"];\n /** Classname prop for the list wrapper */\n listClassName?: string;\n /** Render method called when an error occurs */\n renderError?: React.FC<{ error: ReactivesearchError }>;\n /** Render method called while loading for the first time */\n renderLoading?: React.FC;\n /** Render method called when no results are found */\n renderNoResults?: React.FC;\n /** Render method called once for each product result */\n renderResultCardProduct?: React.FC<\n ReturnType<typeof useProductPrice> & {\n pagePosition: number;\n product: ElasticProduct;\n document: ElasticProduct;\n itemRef: (node?: Element | null) => void;\n handleClick: () => void;\n }\n >;\n /** Render method called once for each callout result */\n renderResultCardCallout?: React.FC<{\n pagePosition: number;\n document: ElasticCallout;\n callout: ElasticCallout[\"callout\"];\n itemRef: (node?: Element | null) => void;\n handleClick: () => void;\n }>;\n /** Render method called for pagination type \"pagination\" */\n renderPaginationNumbered?: React.FC<ReturnType<typeof usePagination>>;\n /** Render method called for pagination type \"next_prev\" */\n renderPaginationNextPrev?: React.FC<ReturnType<typeof usePagination>>;\n /** Render method called for pagination type \"load_more\" */\n renderPaginationLoadMore?: React.FC<ReturnType<typeof usePaginationLoadable>>;\n /** Render method called for pagination type \"infinite_scroll\" */\n renderPaginationInfiniteScroll?: React.FC<\n ReturnType<typeof usePaginationLoadable>\n >;\n /** Used to determine which filler callouts to use when there is an uneven grid */\n gridColumns?: number;\n /** Advanced Usage: Override the default amount of results per page */\n pageSize?: number;\n /** Advanced Usage: Override the default scrollTarget used to determine when infinite load should be triggered (infinite scroll) */\n infiniteScrollContainer?: React.ComponentProps<\n typeof ReactiveList\n >[\"scrollTarget\"];\n /** Advanced Usage: Provide a specific result position to trigger loading more results (infinite scroll) */\n infiniteScrollPosition?: number;\n /** Advanced Usage: Shows subsequent loading states after initial results are loaded */\n showSubsequentLoadingStates?: boolean;\n};\n\nexport const Results: React.FC<ResultsProps> = (props) => {\n const reactifySearchContext = useReactifySearchContext();\n const filtersHook = useFilters();\n const reactiveProps = getPropsResults({\n provider: reactifySearchContext.options,\n config: reactifySearchContext.config,\n filterGroup: filtersHook.filterStack,\n scrollTarget: props.infiniteScrollContainer,\n pageSize: props.pageSize\n });\n\n const { track } = useAnalytics();\n const { searchTerm } = useSearch();\n\n return (\n <ReactiveList\n {...reactiveProps}\n render={(reactivesearchResultProps: ReactivesearchResultProps) => (\n <ResultsInner\n {...props}\n reactivesearchResultProps={reactivesearchResultProps}\n />\n )}\n onData={(renderProps) => {\n if (renderProps.resultStats.numberOfResults === 0) {\n let trimmedSearchTerm = searchTerm.trim();\n\n if (\n !trimmedSearchTerm ||\n (trimmedSearchTerm && trimmedSearchTerm.length < 3)\n ) {\n return;\n }\n\n track({\n eventName: \"zeroResults\",\n payload: {\n searchTerm: trimmedSearchTerm,\n },\n });\n }\n }}\n renderPagination={(\n reactivesearchPaginationProps: ReactivesearchPaginationProps\n ) => (\n <ResultsPaginationStack {...props} {...reactivesearchPaginationProps} />\n )}\n />\n );\n};\n\nconst ResultsRenderErrorComponent: ResultsProps[\"renderError\"] = (props) => {\n return (\n <div>\n {\"Error: \"}\n {props.error.statusText}\n </div>\n );\n};\n\nconst ResultsRenderLoadingComponent: ResultsProps[\"renderLoading\"] = () => {\n return <div>{\"Loading\"}</div>;\n};\n\nconst ResultsRenderNoResultsComponent: ResultsProps[\"renderNoResults\"] = () => {\n return <div>{\"No results\"}</div>;\n};\n\nconst ResultsInner: React.FC<\n ResultsProps & { reactivesearchResultProps: ReactivesearchResultProps }\n> = (props) => {\n const context = useReactifySearchContext();\n const filtersHook = useFilters();\n const resultsHook = useResults();\n const initialSearchHasRun = React.useMemo(\n () =>\n \"undefined\" !==\n typeof props.reactivesearchResultProps.resultStats.numberOfResults,\n [props.reactivesearchResultProps]\n );\n\n const listStyle = React.useMemo<React.HTMLAttributes<HTMLElement>[\"style\"]>(\n () =>\n props.listStyle ?? {\n display: \"grid\",\n gap: \"8px\",\n gridTemplateColumns: \"repeat(4, minmax(0, 1fr))\",\n },\n [props.listStyle]\n );\n\n const infiniteScrollPosition = React.useMemo<number>(() => {\n if (!props.infiniteScrollPosition) {\n return NaN;\n }\n\n const scrollPositionOffset =\n props.reactivesearchResultProps.resultStats.displayedResults -\n (props.pageSize ?? filtersHook.filterStack?.pageSize ?? 0);\n\n return scrollPositionOffset + (props.infiniteScrollPosition ?? 0);\n }, [\n props.pageSize ?? filtersHook.filterStack?.pageSize,\n props.reactivesearchResultProps.resultStats.displayedResults,\n props.infiniteScrollPosition,\n ]);\n\n React.useEffect(() => {\n resultsHook.setResults(props.reactivesearchResultProps.data);\n resultsHook.setResultStats(props.reactivesearchResultProps.resultStats);\n }, [\n props.reactivesearchResultProps.resultStats.numberOfResults,\n props.reactivesearchResultProps.data.map((item) => item._id).join(\"\"),\n ]);\n\n const calculateGridOverflow = React.useCallback((results: ReactivesearchResultProps[\"data\"]) => {\n if (!props.gridColumns) {\n return;\n\n }\n let total = results.length;\n for (const result of results) {\n if (result.type === ElasticDocumentType.Product) {\n continue;\n }\n total += ((parseInt(result.callout.displayColumns) * parseInt(result.callout.displayRows)) - 1);\n }\n\n const overflow = props.gridColumns - (total % props.gridColumns);\n\n if (overflow === props.gridColumns) {\n return;\n }\n\n return overflow === props.gridColumns ? undefined : overflow;\n }, [props.gridColumns]);\n\n const gridOverflowCallout = React.useMemo((): Omit<ElasticHit, \"_source\"> & ElasticCallout | undefined => {\n // check if there are more results\n if (props.reactivesearchResultProps.resultStats.displayedResults === props.reactivesearchResultProps.resultStats.numberOfResults) {\n // check if we should only autofill when there are more results\n if (context.config.merchandising.calloutAutofillBehaviour === MerchandisingCalloutAutofillBehaviour.MoreResults) {\n return;\n }\n }\n\n const overflow = calculateGridOverflow(props.reactivesearchResultProps.data);\n\n const callout = context.config.callouts.find((item) => item.displayColumns === `${overflow}`);\n if (!callout) {\n return;\n }\n\n return {\n _id: callout.id,\n _score: 0,\n type: ElasticDocumentType.Callout,\n key: Math.random().toString(16),\n callout: {\n ...callout,\n enabled: true,\n },\n published: true,\n curations: [],\n }\n }, [props.reactivesearchResultProps.resultStats, props.reactivesearchResultProps.data, context.config.callouts]);\n\n const results = React.useMemo(() => ([\n ...props.reactivesearchResultProps.data,\n ...gridOverflowCallout ? [gridOverflowCallout] : [],\n ]), [props.reactivesearchResultProps.data, gridOverflowCallout]);\n\n if (props.reactivesearchResultProps.error) {\n const RenderErrorComponent =\n props.renderError ?? ResultsRenderErrorComponent;\n\n return (\n <RenderErrorComponent error={props.reactivesearchResultProps.error} />\n );\n }\n\n if (!initialSearchHasRun) {\n const RenderLoadingComponent =\n props.renderLoading ?? ResultsRenderLoadingComponent;\n return <RenderLoadingComponent />;\n }\n \n if (props.showSubsequentLoadingStates === true) {\n if (props.reactivesearchResultProps.loading) {\n const RenderLoadingComponent = props.renderLoading ?? ResultsRenderLoadingComponent;\n return <RenderLoadingComponent />;\n }\n }\n\n if (\n !props.reactivesearchResultProps.loading &&\n !props.reactivesearchResultProps.resultStats.numberOfResults\n ) {\n const RenderNoResultsComponent =\n props.renderNoResults ?? ResultsRenderNoResultsComponent;\n\n return <RenderNoResultsComponent />;\n }\n\n if ([\"search\", \"instant-search\"].includes(context.options.mode)) {\n if (!context.search.searchTerm) {\n const RenderNoResultsComponent =\n props.renderNoResults ?? ResultsRenderNoResultsComponent;\n\n return <RenderNoResultsComponent />;\n }\n }\n\n return (\n <>\n <section style={listStyle} className={props.listClassName}>\n {results.map((item, key) => {\n if (ElasticDocumentType.Product === item.type) {\n return (\n <ResultCardProduct\n key={item._id}\n product={item}\n document={item}\n pagePosition={key + 1}\n render={props.renderResultCardProduct}\n {...(infiniteScrollPosition === key + 1\n ? {\n onView: () => props.reactivesearchResultProps.loadMore(),\n }\n : {})}\n />\n );\n }\n\n if (ElasticDocumentType.Callout === item.type) {\n return (\n <ResultCardCallout\n key={item._id}\n document={item}\n pagePosition={key + 1}\n callout={item.callout}\n render={props.renderResultCardCallout}\n {...(infiniteScrollPosition === key + 1\n ? {\n onView: () => props.reactivesearchResultProps.loadMore(),\n }\n : {})}\n />\n );\n }\n\n return null;\n })}\n </section>\n <ResultsPaginationStackLoadable\n {...props}\n {...props.reactivesearchResultProps}\n />\n </>\n );\n};\n\n/** Handles rendering pagination for types that use \"pagination props\" */\nconst ResultsPaginationStack: React.FC<\n ResultsProps & ReactivesearchPaginationProps\n> = (props) => {\n const { options } = useReactifySearchContext();\n const { filterStack } = useFilters();\n\n if (options.mode === \"instant-search\") {\n return null;\n }\n\n if (\"pagination\" === filterStack?.paginationType) {\n return (\n <ResultPaginationNumbered\n {...props}\n render={props.renderPaginationNumbered}\n />\n );\n }\n\n if (\"next_prev\" === filterStack?.paginationType) {\n return (\n <ResultPaginationNextPrev\n {...props}\n render={props.renderPaginationNextPrev}\n />\n );\n }\n\n return null;\n};\n\n/** Handles rendering pagination for types that use \"result props\" */\nconst ResultsPaginationStackLoadable: React.FC<\n ResultsProps & { reactivesearchResultProps: ReactivesearchResultProps }\n> = (props) => {\n const { options } = useReactifySearchContext();\n const { filterStack } = useFilters();\n\n if (options.mode === \"instant-search\") {\n return null;\n }\n\n if (\"load_more\" === filterStack?.paginationType) {\n return (\n <ResultPaginationLoadMore\n {...props.reactivesearchResultProps}\n render={props.renderPaginationLoadMore}\n />\n );\n }\n\n if (\"infinite_scroll\" === filterStack?.paginationType) {\n return (\n <ResultPaginationInfiniteScroll\n {...props.reactivesearchResultProps}\n render={props.renderPaginationInfiniteScroll}\n />\n );\n }\n\n return null;\n};\n"]}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Result/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Result/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,sDAAoC;AACpC,sDAAoC;AACpC,wDAAsC;AACtC,6DAA2C;AAC3C,6DAA2C;AAC3C,mEAAiD;AACjD,6DAA2C","sourcesContent":["export * from \"./Results\";\nexport * from \"./ResultCardCallout\";\nexport * from \"./ResultCardProduct\";\nexport * from \"./ResultStateProvider\";\nexport * from \"./ResultPaginationNumbered\";\nexport * from \"./ResultPaginationLoadMore\";\nexport * from \"./ResultPaginationInfiniteScroll\";\nexport * from \"./ResultPaginationNextPrev\";\n"]}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Search/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Search/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB","sourcesContent":["export * from \"./Search\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SensorCollection.js","sourceRoot":"","sources":["../../../../src/components/Sensor/SensorCollection.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,6HAAqG;AAErG,uCAAuD;AACvD,+CAA+D;AAExD,MAAM,gBAAgB,GAAa,GAAG,EAAE;IAC7C,MAAM,qBAAqB,GAAG,IAAA,gCAAwB,GAAE,CAAC;IACzD,MAAM,aAAa,GAAG,IAAA,gCAAwB,EAAC;QAC7C,MAAM,EAAE,qBAAqB,CAAC,MAAM;QACpC,QAAQ,EAAE,qBAAqB,CAAC,OAAO;KACxC,CAAC,CAAC;IAEH,IAAI,CAAC,aAAa,EAAE;
|
|
1
|
+
{"version":3,"file":"SensorCollection.js","sourceRoot":"","sources":["../../../../src/components/Sensor/SensorCollection.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,6HAAqG;AAErG,uCAAuD;AACvD,+CAA+D;AAExD,MAAM,gBAAgB,GAAa,GAAG,EAAE;IAC7C,MAAM,qBAAqB,GAAG,IAAA,gCAAwB,GAAE,CAAC;IACzD,MAAM,aAAa,GAAG,IAAA,gCAAwB,EAAC;QAC7C,MAAM,EAAE,qBAAqB,CAAC,MAAM;QACpC,QAAQ,EAAE,qBAAqB,CAAC,OAAO;KACxC,CAAC,CAAC;IAEH,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,8BAAC,2BAAiB,oBACZ,aAAa,EACjB,CACH,CAAC;AACJ,CAAC,CAAC;AAhBW,QAAA,gBAAgB,oBAgB3B","sourcesContent":["import React from \"react\";\nimport ReactiveComponent from \"@usereactify/search-internals/lib/components/basic/ReactiveComponent\";\n\nimport { useReactifySearchContext } from \"../../hooks\";\nimport { getPropsSensorCollection } from \"../../utility/props\";\n\nexport const SensorCollection: React.FC = () => {\n const reactifySearchContext = useReactifySearchContext();\n const reactiveProps = getPropsSensorCollection({\n config: reactifySearchContext.config,\n provider: reactifySearchContext.options,\n });\n\n if (!reactiveProps) {\n return null;\n }\n\n return (\n <ReactiveComponent\n {...reactiveProps}\n />\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SensorInventoryAvailable.js","sourceRoot":"","sources":["../../../../src/components/Sensor/SensorInventoryAvailable.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,6HAAqG;AAErG,uCAAiE;AACjE,+CAAuE;AAEhE,MAAM,wBAAwB,GAAa,GAAG,EAAE;IACrD,MAAM,SAAS,GAAG,IAAA,gBAAQ,GAAE,CAAC;IAE7B,MAAM,qBAAqB,GAAG,IAAA,gCAAwB,GAAE,CAAC;IACzD,MAAM,aAAa,GAAG,IAAA,wCAAgC,EAAC;QACrD,MAAM,EAAE,qBAAqB,CAAC,MAAM;QACpC,QAAQ,EAAE,qBAAqB,CAAC,OAAO;KACxC,CAAC,CAAC;IAEH,IAAI,CAAC,aAAa,EAAE;
|
|
1
|
+
{"version":3,"file":"SensorInventoryAvailable.js","sourceRoot":"","sources":["../../../../src/components/Sensor/SensorInventoryAvailable.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,6HAAqG;AAErG,uCAAiE;AACjE,+CAAuE;AAEhE,MAAM,wBAAwB,GAAa,GAAG,EAAE;IACrD,MAAM,SAAS,GAAG,IAAA,gBAAQ,GAAE,CAAC;IAE7B,MAAM,qBAAqB,GAAG,IAAA,gCAAwB,GAAE,CAAC;IACzD,MAAM,aAAa,GAAG,IAAA,wCAAgC,EAAC;QACrD,MAAM,EAAE,qBAAqB,CAAC,MAAM;QACpC,QAAQ,EAAE,qBAAqB,CAAC,OAAO;KACxC,CAAC,CAAC;IAEH,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,gDAAgD,CAAC,EAAE,CAAC;QACvE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,8BAAC,2BAAiB,oBACZ,aAAa,EACjB,CACH,CAAC;AACJ,CAAC,CAAC;AAtBW,QAAA,wBAAwB,4BAsBnC","sourcesContent":["import React from \"react\";\nimport ReactiveComponent from \"@usereactify/search-internals/lib/components/basic/ReactiveComponent\";\n\nimport { useFlags, useReactifySearchContext } from \"../../hooks\";\nimport { getPropsSensorInventoryAvailable } from \"../../utility/props\";\n\nexport const SensorInventoryAvailable: React.FC = () => {\n const flagsHook = useFlags();\n \n const reactifySearchContext = useReactifySearchContext();\n const reactiveProps = getPropsSensorInventoryAvailable({\n config: reactifySearchContext.config,\n provider: reactifySearchContext.options,\n });\n\n if (!reactiveProps) {\n return null;\n }\n\n if (!flagsHook.flags[\"reactify-search:flag_sensor_inventoryavailable\"]) {\n return null;\n }\n\n return (\n <ReactiveComponent\n {...reactiveProps}\n />\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SensorPublished.js","sourceRoot":"","sources":["../../../../src/components/Sensor/SensorPublished.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,6HAAqG;AAErG,uCAAiE;AACjE,+CAA8D;AAEvD,MAAM,eAAe,GAAa,GAAG,EAAE;IAC5C,MAAM,SAAS,GAAG,IAAA,gBAAQ,GAAE,CAAC;IAC7B,MAAM,qBAAqB,GAAG,IAAA,gCAAwB,GAAE,CAAC;IACzD,MAAM,aAAa,GAAG,IAAA,+BAAuB,EAAC;QAC5C,MAAM,EAAE,qBAAqB,CAAC,MAAM;QACpC,QAAQ,EAAE,qBAAqB,CAAC,OAAO;KACxC,CAAC,CAAC;IAEH,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,uCAAuC,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"SensorPublished.js","sourceRoot":"","sources":["../../../../src/components/Sensor/SensorPublished.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,6HAAqG;AAErG,uCAAiE;AACjE,+CAA8D;AAEvD,MAAM,eAAe,GAAa,GAAG,EAAE;IAC5C,MAAM,SAAS,GAAG,IAAA,gBAAQ,GAAE,CAAC;IAC7B,MAAM,qBAAqB,GAAG,IAAA,gCAAwB,GAAE,CAAC;IACzD,MAAM,aAAa,GAAG,IAAA,+BAAuB,EAAC;QAC5C,MAAM,EAAE,qBAAqB,CAAC,MAAM;QACpC,QAAQ,EAAE,qBAAqB,CAAC,OAAO;KACxC,CAAC,CAAC;IAEH,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,uCAAuC,CAAC,EAAE,CAAC;QAC9D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,8BAAC,2BAAiB,oBACZ,aAAa,EACjB,CACH,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,eAAe,mBAiB1B","sourcesContent":["import React from \"react\";\nimport ReactiveComponent from \"@usereactify/search-internals/lib/components/basic/ReactiveComponent\";\n\nimport { useFlags, useReactifySearchContext } from \"../../hooks\";\nimport { getPropsSensorPublished } from \"../../utility/props\";\n\nexport const SensorPublished: React.FC = () => {\n const flagsHook = useFlags();\n const reactifySearchContext = useReactifySearchContext();\n const reactiveProps = getPropsSensorPublished({\n config: reactifySearchContext.config,\n provider: reactifySearchContext.options,\n });\n\n if (!flagsHook.flags[\"reactify-search:flag_sensor_published\"]) {\n return null;\n }\n\n return (\n <ReactiveComponent\n {...reactiveProps}\n />\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SensorSearchTerm.js","sourceRoot":"","sources":["../../../../src/components/Sensor/SensorSearchTerm.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,mCAAuC;AACvC,gHAAwF;AAExF,uCAKqB;AAEd,MAAM,gBAAgB,GAAa,GAAG,EAAE;IAC7C,MAAM,SAAS,GAAG,IAAA,gBAAQ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gBAED,MAAM,eAAe,GAAQ,KAAK,CAAC,SAAS;qBACzC,MAAM,CAAC,CAAC,KAAa,EAAE,EAAE,CACxB,CAAC,SAAS,CAAC,KAAK,CACd,4DAA4D,CAC7D;oBACC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC;oBAC5B,CAAC,CAAC,IAAI,CACT;qBACA,MAAM,CAAC,CAAC,KAAa,EAAE,EAAE;oBACxB,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;wBAC9B,OAAO,KAAK,CAAC;qBACd;oBAED,OAAO,IAAI,CAAC;gBACd,CAAC,CAAC;qBACD,GAAG,CAAC,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC;oBACvB,UAAU,EAAE;wBACV,KAAK,EAAE;4BACL,SAAS,EAAE,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,WAAW,EAAE;yBACzC;wBACD,GAAG,EAAE,CAAC;qBACP;iBACF,CAAC,CAAC,CAAC;gBACN,IACE,SAAS,CAAC,KAAK,CACb,mDAAmD,CACpD;oBACD,eAAe,CAAC,MAAM,GAAG,CAAC,EAC1B;oBACA,UAAU,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC;iBACrC;gBAED,OAAO;oBACL,KAAK,EAAE;wBACL,IAAI,EAAE;4BACJ,MAAM,EAAE,UAAU;4BAClB,oBAAoB,EAAE,GAAG;yBAC1B;qBACF;iBACF,CAAC;YACJ,CAAC,GACD,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAvPW,QAAA,gBAAgB,oBAuP3B","sourcesContent":["import React from \"react\";\nimport { useDebounceFn } from \"ahooks\";\nimport DataSearch from \"@usereactify/search-internals/lib/components/search/DataSearch\";\n\nimport {\n useAnalytics,\n useFlags,\n useReactifySearchContext,\n useSearch,\n} from \"../../hooks\";\n\nexport const SensorSearchTerm: React.FC = () => {\n const flagsHook = useFlags();\n const { options, config } = useReactifySearchContext();\n const { track } = useAnalytics();\n const { searchTerm } = useSearch();\n\n const [searchTermDebounced, setSearchTermDebounced] =\n React.useState<string>(searchTerm);\n\n // ignore search fields only set for instant search\n const searchFields = React.useMemo(() => {\n if (options.mode === \"search\") {\n return config.fields.filter((field) =>\n [\"always_search\", \"search_page\"].includes(field.searchType)\n );\n }\n\n if (options.mode === \"instant-search\") {\n return config.fields.filter((field) =>\n [\"always_search\", \"instant_search\"].includes(field.searchType)\n );\n }\n\n return [];\n }, [config.fields]);\n\n const { run: runDebouncedTriggerQuery, cancel: cancelDebouncedTriggerQuery } =\n useDebounceFn(\n (value: string) => {\n setSearchTermDebounced(value);\n\n let trimmedSearchTerm = searchTerm.trim();\n\n if (\n !trimmedSearchTerm ||\n (trimmedSearchTerm && trimmedSearchTerm.length < 3)\n ) {\n return;\n }\n\n track({\n eventName: \"search\",\n payload: {\n searchTerm: trimmedSearchTerm,\n },\n });\n },\n {\n wait: 300,\n }\n );\n\n React.useEffect(() => {\n runDebouncedTriggerQuery(searchTerm);\n }, [searchTerm]);\n\n if (searchFields.length === 0) {\n return null;\n }\n\n if (!flagsHook.flags[\"reactify-search:flag_sensor_searchterm\"]) {\n return null;\n }\n\n return (\n <>\n <DataSearch\n fuzziness={1}\n queryFormat=\"and\"\n autosuggest={false}\n value={searchTermDebounced}\n componentId=\"SensorSearchTerm\"\n style={{ display: \"none\" }}\n dataField={searchFields.map((field) => field.field)}\n fieldWeights={searchFields.map((field) => field.importance)}\n customQuery={(value, props) => {\n const valueNormal = value.toLowerCase().trim();\n const conditions: Array<unknown> = [];\n\n if (\n flagsHook.flags[\"reactify-search:flag_sensor_searchterm_value\"] &&\n valueNormal\n ) {\n if (options.market) {\n conditions.push({\n nested: {\n path: \"curations\",\n query: {\n bool: {\n must: [\n {\n term: {\n \"curations.searchTerm.keyword\": valueNormal,\n },\n },\n {\n term: {\n \"curations.markets.keyword\": options.market,\n },\n },\n ],\n },\n },\n },\n });\n } else {\n conditions.push({\n nested: {\n path: \"curations\",\n query: {\n term: {\n \"curations.searchTerm.keyword\": valueNormal,\n },\n },\n },\n });\n }\n }\n\n const fieldsPhrase = props.dataField\n .filter((field: string) =>\n !flagsHook.flags[\n \"reactify-search:flag_sensor_searchterm_phrase_synonyms\"\n ]\n ? !field.includes(\"synonym\")\n : true\n )\n .map(\n (field: string, index: number) =>\n `${field}^${props.fieldWeights[index]}`\n );\n if (\n flagsHook.flags[\"reactify-search:flag_sensor_searchterm_phrase\"] &&\n fieldsPhrase.length > 0\n ) {\n conditions.push({\n multi_match: {\n query: valueNormal,\n fields: fieldsPhrase,\n type: \"phrase\",\n operator: \"and\",\n },\n });\n }\n\n const fieldsPhrasePrefix = props.dataField\n .filter((field: string) =>\n !flagsHook.flags[\n \"reactify-search:flag_sensor_searchterm_phrase_prefix_synonyms\"\n ]\n ? !field.includes(\"synonym\")\n : true\n )\n .map(\n (field: string, index: number) =>\n `${field}^${props.fieldWeights[index]}`\n )\n .filter((field: string) => !field.includes(\".\"));\n\n if (\n flagsHook.flags[\n \"reactify-search:flag_sensor_searchterm_phrase_prefix\"\n ] &&\n fieldsPhrasePrefix.length > 0\n ) {\n conditions.push({\n multi_match: {\n query: valueNormal,\n fields: fieldsPhrasePrefix,\n type: \"phrase_prefix\",\n operator: \"and\",\n },\n });\n }\n\n const fieldsCrossFields = props.dataField\n .filter((field: string) =>\n !flagsHook.flags[\n \"reactify-search:flag_sensor_searchterm_cross_fields_synonyms\"\n ]\n ? !field.includes(\"synonym\")\n : true\n )\n .map(\n (field: string, index: number) =>\n `${field}^${props.fieldWeights[index]}`\n );\n if (\n flagsHook.flags[\n \"reactify-search:flag_sensor_searchterm_cross_fields\"\n ] &&\n fieldsCrossFields.length > 0\n ) {\n conditions.push({\n multi_match: {\n query: valueNormal,\n fields: fieldsCrossFields,\n type: \"cross_fields\",\n operator: \"and\",\n },\n });\n }\n\n const fieldsSpanFirst: any = props.dataField\n .filter((field: string) =>\n !flagsHook.flags[\n \"reactify-search:flag_sensor_searchterm_span_first_synonyms\"\n ]\n ? !field.includes(\"synonym\")\n : true\n )\n .filter((field: string) => {\n if (field.endsWith(\".keyword\")) {\n return false;\n }\n\n return true;\n })\n .map((field: string) => ({\n span_first: {\n match: {\n span_term: { [`${field}`]: valueNormal },\n },\n end: 1,\n },\n }));\n if (\n flagsHook.flags[\n \"reactify-search:flag_sensor_searchterm_span_first\"\n ] &&\n fieldsSpanFirst.length > 0\n ) {\n conditions.push(...fieldsSpanFirst);\n }\n\n return {\n query: {\n bool: {\n should: conditions,\n minimum_should_match: \"1\",\n },\n },\n };\n }}\n />\n </>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SensorSearchTerm.js","sourceRoot":"","sources":["../../../../src/components/Sensor/SensorSearchTerm.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,mCAAuC;AACvC,gHAAwF;AAExF,uCAKqB;AAEd,MAAM,gBAAgB,GAAa,GAAG,EAAE;IAC7C,MAAM,SAAS,GAAG,IAAA,gBAAQ,GAAE,CAAC;IAC7B,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IACvD,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,oBAAY,GAAE,CAAC;IACjC,MAAM,EAAE,UAAU,EAAE,GAAG,IAAA,iBAAS,GAAE,CAAC;IAEnC,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GACjD,eAAK,CAAC,QAAQ,CAAS,UAAU,CAAC,CAAC;IAErC,mDAAmD;IACnD,MAAM,YAAY,GAAG,eAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACtC,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CACpC,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAC5D,CAAC;QACJ,CAAC;QAED,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,KAAK,EAAE;4BACL,SAAS,EAAE,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,WAAW,EAAE;yBACzC;wBACD,GAAG,EAAE,CAAC;qBACP;iBACF,CAAC,CAAC,CAAC;gBACN,IACE,SAAS,CAAC,KAAK,CACb,mDAAmD,CACpD;oBACD,eAAe,CAAC,MAAM,GAAG,CAAC,EAC1B,CAAC;oBACD,UAAU,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC;gBACtC,CAAC;gBAED,OAAO;oBACL,KAAK,EAAE;wBACL,IAAI,EAAE;4BACJ,MAAM,EAAE,UAAU;4BAClB,oBAAoB,EAAE,GAAG;yBAC1B;qBACF;iBACF,CAAC;YACJ,CAAC,GACD,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAvPW,QAAA,gBAAgB,oBAuP3B","sourcesContent":["import React from \"react\";\nimport { useDebounceFn } from \"ahooks\";\nimport DataSearch from \"@usereactify/search-internals/lib/components/search/DataSearch\";\n\nimport {\n useAnalytics,\n useFlags,\n useReactifySearchContext,\n useSearch,\n} from \"../../hooks\";\n\nexport const SensorSearchTerm: React.FC = () => {\n const flagsHook = useFlags();\n const { options, config } = useReactifySearchContext();\n const { track } = useAnalytics();\n const { searchTerm } = useSearch();\n\n const [searchTermDebounced, setSearchTermDebounced] =\n React.useState<string>(searchTerm);\n\n // ignore search fields only set for instant search\n const searchFields = React.useMemo(() => {\n if (options.mode === \"search\") {\n return config.fields.filter((field) =>\n [\"always_search\", \"search_page\"].includes(field.searchType)\n );\n }\n\n if (options.mode === \"instant-search\") {\n return config.fields.filter((field) =>\n [\"always_search\", \"instant_search\"].includes(field.searchType)\n );\n }\n\n return [];\n }, [config.fields]);\n\n const { run: runDebouncedTriggerQuery, cancel: cancelDebouncedTriggerQuery } =\n useDebounceFn(\n (value: string) => {\n setSearchTermDebounced(value);\n\n let trimmedSearchTerm = searchTerm.trim();\n\n if (\n !trimmedSearchTerm ||\n (trimmedSearchTerm && trimmedSearchTerm.length < 3)\n ) {\n return;\n }\n\n track({\n eventName: \"search\",\n payload: {\n searchTerm: trimmedSearchTerm,\n },\n });\n },\n {\n wait: 300,\n }\n );\n\n React.useEffect(() => {\n runDebouncedTriggerQuery(searchTerm);\n }, [searchTerm]);\n\n if (searchFields.length === 0) {\n return null;\n }\n\n if (!flagsHook.flags[\"reactify-search:flag_sensor_searchterm\"]) {\n return null;\n }\n\n return (\n <>\n <DataSearch\n fuzziness={1}\n queryFormat=\"and\"\n autosuggest={false}\n value={searchTermDebounced}\n componentId=\"SensorSearchTerm\"\n style={{ display: \"none\" }}\n dataField={searchFields.map((field) => field.field)}\n fieldWeights={searchFields.map((field) => field.importance)}\n customQuery={(value, props) => {\n const valueNormal = value.toLowerCase().trim();\n const conditions: Array<unknown> = [];\n\n if (\n flagsHook.flags[\"reactify-search:flag_sensor_searchterm_value\"] &&\n valueNormal\n ) {\n if (options.market) {\n conditions.push({\n nested: {\n path: \"curations\",\n query: {\n bool: {\n must: [\n {\n term: {\n \"curations.searchTerm.keyword\": valueNormal,\n },\n },\n {\n term: {\n \"curations.markets.keyword\": options.market,\n },\n },\n ],\n },\n },\n },\n });\n } else {\n conditions.push({\n nested: {\n path: \"curations\",\n query: {\n term: {\n \"curations.searchTerm.keyword\": valueNormal,\n },\n },\n },\n });\n }\n }\n\n const fieldsPhrase = props.dataField\n .filter((field: string) =>\n !flagsHook.flags[\n \"reactify-search:flag_sensor_searchterm_phrase_synonyms\"\n ]\n ? !field.includes(\"synonym\")\n : true\n )\n .map(\n (field: string, index: number) =>\n `${field}^${props.fieldWeights[index]}`\n );\n if (\n flagsHook.flags[\"reactify-search:flag_sensor_searchterm_phrase\"] &&\n fieldsPhrase.length > 0\n ) {\n conditions.push({\n multi_match: {\n query: valueNormal,\n fields: fieldsPhrase,\n type: \"phrase\",\n operator: \"and\",\n },\n });\n }\n\n const fieldsPhrasePrefix = props.dataField\n .filter((field: string) =>\n !flagsHook.flags[\n \"reactify-search:flag_sensor_searchterm_phrase_prefix_synonyms\"\n ]\n ? !field.includes(\"synonym\")\n : true\n )\n .map(\n (field: string, index: number) =>\n `${field}^${props.fieldWeights[index]}`\n )\n .filter((field: string) => !field.includes(\".\"));\n\n if (\n flagsHook.flags[\n \"reactify-search:flag_sensor_searchterm_phrase_prefix\"\n ] &&\n fieldsPhrasePrefix.length > 0\n ) {\n conditions.push({\n multi_match: {\n query: valueNormal,\n fields: fieldsPhrasePrefix,\n type: \"phrase_prefix\",\n operator: \"and\",\n },\n });\n }\n\n const fieldsCrossFields = props.dataField\n .filter((field: string) =>\n !flagsHook.flags[\n \"reactify-search:flag_sensor_searchterm_cross_fields_synonyms\"\n ]\n ? !field.includes(\"synonym\")\n : true\n )\n .map(\n (field: string, index: number) =>\n `${field}^${props.fieldWeights[index]}`\n );\n if (\n flagsHook.flags[\n \"reactify-search:flag_sensor_searchterm_cross_fields\"\n ] &&\n fieldsCrossFields.length > 0\n ) {\n conditions.push({\n multi_match: {\n query: valueNormal,\n fields: fieldsCrossFields,\n type: \"cross_fields\",\n operator: \"and\",\n },\n });\n }\n\n const fieldsSpanFirst: any = props.dataField\n .filter((field: string) =>\n !flagsHook.flags[\n \"reactify-search:flag_sensor_searchterm_span_first_synonyms\"\n ]\n ? !field.includes(\"synonym\")\n : true\n )\n .filter((field: string) => {\n if (field.endsWith(\".keyword\")) {\n return false;\n }\n\n return true;\n })\n .map((field: string) => ({\n span_first: {\n match: {\n span_term: { [`${field}`]: valueNormal },\n },\n end: 1,\n },\n }));\n if (\n flagsHook.flags[\n \"reactify-search:flag_sensor_searchterm_span_first\"\n ] &&\n fieldsSpanFirst.length > 0\n ) {\n conditions.push(...fieldsSpanFirst);\n }\n\n return {\n query: {\n bool: {\n should: conditions,\n minimum_should_match: \"1\",\n },\n },\n };\n }}\n />\n </>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SensorSort.js","sourceRoot":"","sources":["../../../../src/components/Sensor/SensorSort.tsx"],"names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AAM;QAC9B,UAAU,EAAE,UAAU;KACvB,CAAC,CAAC;IAEH,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,kCAAkC,CAAC,EAAE,CAAC;QACzD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,8BAAC,2BAAiB,oBACZ,aAAa,EACjB,CACH,CAAC;AACJ,CAAC,CAAC;AAtBW,QAAA,UAAU,cAsBrB","sourcesContent":["import React from \"react\";\nimport ReactiveComponent from \"@usereactify/search-internals/lib/components/basic/ReactiveComponent\";\n\nimport {\n useReactifySearchContext,\n useSortBy,\n useFlags,\n useSearch,\n} from \"../../hooks\";\nimport { getPropsSensorSort } from \"../../utility/props\";\n\nexport const SensorSort: React.FC = () => {\n const flagsHook = useFlags();\n const reactifySearchContext = useReactifySearchContext();\n const { sortOption } = useSortBy();\n const { searchTerm } = useSearch();\n\n const reactiveProps = getPropsSensorSort({\n config: reactifySearchContext.config,\n provider: reactifySearchContext.options,\n sortOption: sortOption?.handle,\n searchTerm: searchTerm,\n });\n\n if (!flagsHook.flags[\"reactify-search:flag_sensor_sort\"]) {\n return null;\n }\n\n return (\n <ReactiveComponent\n {...reactiveProps}\n />\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sensors.js","sourceRoot":"","sources":["../../../../src/components/Sensor/Sensors.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAAuD;AAEvD,6CAA0C;AAC1C,uDAAoD;AACpD,yDAAsD;AACtD,yDAAsD;AACtD,yEAAsE;AACtE,iDAA8C;AAMvC,MAAM,OAAO,GAA2B,GAAG,EAAE;IAClD,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IAE/C,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,KAAK,gBAAgB,EAAE;
|
|
1
|
+
{"version":3,"file":"Sensors.js","sourceRoot":"","sources":["../../../../src/components/Sensor/Sensors.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAAuD;AAEvD,6CAA0C;AAC1C,uDAAoD;AACpD,yDAAsD;AACtD,yDAAsD;AACtD,yEAAsE;AACtE,iDAA8C;AAMvC,MAAM,OAAO,GAA2B,GAAG,EAAE;IAClD,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IAE/C,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;QACnE,OAAO,CACL;YACE,8BAAC,uBAAU,OAAG;YACd,8BAAC,iCAAe,OAAG;YACnB,8BAAC,mCAAgB,OAAG;YACpB,8BAAC,mDAAwB,OAAG;YAC5B,8BAAC,2BAAY,OAAG,CACf,CACJ,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QAClC,OAAO,CACL;YACE,8BAAC,uBAAU,OAAG;YACd,8BAAC,iCAAe,OAAG;YACnB,8BAAC,mCAAgB,OAAG;YACpB,8BAAC,mDAAwB,OAAG;YAC5B,8BAAC,2BAAY,OAAG,CACf,CACJ,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AA5BW,QAAA,OAAO,WA4BlB","sourcesContent":["import React from \"react\";\n\nimport { useReactifySearchContext } from \"../../hooks\";\n\nimport { SensorSort } from \"./SensorSort\";\nimport { SensorPublished } from \"./SensorPublished\";\nimport { SensorCollection } from \"./SensorCollection\";\nimport { SensorSearchTerm } from \"./SensorSearchTerm\";\nimport { SensorInventoryAvailable } from \"./SensorInventoryAvailable\";\nimport { SensorCustom } from \"./SensorCustom\";\n\nexport type SensorsProps = {\n /** This component does not support any props */\n};\n\nexport const Sensors: React.FC<SensorsProps> = () => {\n const { options } = useReactifySearchContext();\n\n if (options.mode === \"search\" || options.mode === \"instant-search\") {\n return (\n <>\n <SensorSort />\n <SensorPublished />\n <SensorSearchTerm />\n <SensorInventoryAvailable />\n <SensorCustom />\n </>\n );\n }\n\n if (options.mode === \"collection\") {\n return (\n <>\n <SensorSort />\n <SensorPublished />\n <SensorCollection />\n <SensorInventoryAvailable />\n <SensorCustom />\n </>\n );\n }\n\n return null;\n};\n"]}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Sensor/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Sensor/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,+CAA6B;AAC7B,oDAAkC;AAClC,qDAAmC;AACnC,qDAAmC;AACnC,6DAA2C;AAE3C,4CAA0B;AAE1B,2DAA2D;AACpD,MAAM,UAAU,GAAG,CAAC,IAAgD,EAAE,MAAc,EAAE,EAAE;IAC7F,MAAM,SAAS,GAAG;QAChB,YAAY;QACZ,iBAAiB;QACjB,kBAAkB;QAClB,kBAAkB;QAClB,0BAA0B;KAC3B,CAAC;IACF,MAAM,aAAa,GAAG,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;IAChG,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,SAAS,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,gBAAgB,KAAK,EAAE,CAAC,CAAC,CAAC;IACjF,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAA;AAdY,QAAA,UAAU,cActB","sourcesContent":["import { Config } from \"../../types\";\n\nexport * from \"./SensorSort\";\nexport * from \"./SensorPublished\";\nexport * from \"./SensorCollection\";\nexport * from \"./SensorSearchTerm\";\nexport * from \"./SensorInventoryAvailable\";\n\nexport * from \"./Sensors\";\n\n// this is consumed by the react prop in various components\nexport const SENSOR_IDS = (mode: \"search\" | \"collection\" | \"instant-search\", config: Config) => {\n const sensorIds = [\n \"SensorSort\",\n \"SensorPublished\",\n \"SensorCollection\",\n \"SensorSearchTerm\",\n \"SensorInventoryAvailable\",\n ];\n const customSensors = mode === \"collection\" ? config.sensors.collection : config.sensors.search;\n if (customSensors.length > 0) {\n sensorIds.push(...customSensors.map((item, index) => `SensorCustom_${index}`));\n }\n\n return sensorIds;\n}"]}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/SortBy/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/SortBy/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB","sourcesContent":["export * from \"./SortBy\";\n"]}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Stats/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Stats/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB","sourcesContent":["export * from \"./Stats\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Suggestions.js","sourceRoot":"","sources":["../../../../src/components/Suggestions/Suggestions.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAI0B;AAC1B,uCAAkE;AAa3D,MAAM,WAAW,GAA+B,CAAC,KAAK,EAAE,EAAE;;IAC/D,MAAM,eAAe,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,+BAAkB,CAAC;IAE3D,MAAM,qBAAqB,GAAG,IAAA,gCAAwB,GAAE,CAAC;IAE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,\n ExampleSuggestions,\n SENSOR_IDS,\n} from \"../../components\";\nimport { useReactifySearchContext, useSearch } from \"../../hooks\";\n\nexport type SuggestionsProps = {\n /** The field which should be used for autocompletion */\n field: \"title\";\n /** Render method */\n render?: React.FC<{\n suggestions: Array<{\n text: string;\n }>;\n }>;\n};\n\nexport const Suggestions: React.FC<SuggestionsProps> = (props) => {\n const RenderComponent = props.render ?? ExampleSuggestions;\n\n const reactifySearchContext = useReactifySearchContext();\n\n const { searchTerm } = useSearch();\n\n const sensorIds = SENSOR_IDS(reactifySearchContext.options.mode, reactifySearchContext.config);\n\n return (\n <CustomComponent\n componentId=\"SensorSuggestions\"\n defaultQuery={() => {\n return {\n suggest: {\n suggestions: {\n text: searchTerm,\n term: {\n field: props.field,\n sort: \"score\",\n suggest_mode: \"always\",\n },\n },\n },\n };\n }}\n react={{\n and: sensorIds,\n }}\n render={(renderProps) => {\n const props: React.ComponentProps<\n NonNullable<SuggestionsProps[\"render\"]>\n > = {\n suggestions: [],\n };\n\n if (renderProps.rawData?.suggest?.suggestions.length) {\n const options = renderProps.rawData.suggest.suggestions[renderProps.rawData.suggest.suggestions.length - 1]?.options;\n props.suggestions = (options as Array<{ text: string; freq: number }>).filter((option) => !(reactifySearchContext.config.suggestions.exclude ?? []).includes(option.text)).map((option) => ({\n text: option.text,\n }));\n }\n\n return <RenderComponent {...props} />;\n }}\n />\n );\n};\n"]}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Suggestions/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Suggestions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B","sourcesContent":["export * from \"./Suggestions\";\n"]}
|