@usereactify/search 5.47.0 → 5.48.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 +21 -0
- package/dist/package.json +1 -1
- package/dist/src/components/Filter/Filter.js +45 -10
- package/dist/src/components/Filter/Filter.js.map +1 -1
- package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.d.ts +1 -1
- package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js.map +1 -1
- package/dist/src/components/Result/Results.d.ts +0 -2
- package/dist/src/components/Result/Results.js +9 -21
- package/dist/src/components/Result/Results.js.map +1 -1
- package/dist/src/components/Sensor/SensorCollection.js +8 -80
- package/dist/src/components/Sensor/SensorCollection.js.map +1 -1
- package/dist/src/components/Sensor/SensorCustom.js +6 -2
- package/dist/src/components/Sensor/SensorCustom.js.map +1 -1
- package/dist/src/components/Sensor/SensorInventoryAvailable.js +8 -44
- package/dist/src/components/Sensor/SensorInventoryAvailable.js.map +1 -1
- package/dist/src/components/Sensor/SensorPublished.js +7 -27
- package/dist/src/components/Sensor/SensorPublished.js.map +1 -1
- package/dist/src/components/Sensor/SensorSort.js +10 -203
- package/dist/src/components/Sensor/SensorSort.js.map +1 -1
- package/dist/src/hooks/reactivesearch/index.d.ts +0 -6
- package/dist/src/hooks/reactivesearch/index.js +0 -6
- package/dist/src/hooks/reactivesearch/index.js.map +1 -1
- package/dist/src/hooks/usePagination.js +1 -1
- package/dist/src/hooks/usePagination.js.map +1 -1
- package/dist/src/hooks/useSortBy.js +14 -17
- package/dist/src/hooks/useSortBy.js.map +1 -1
- package/dist/src/utility/curation.d.ts +7 -0
- package/dist/src/utility/curation.js +85 -0
- package/dist/src/utility/curation.js.map +1 -0
- package/dist/src/utility/filters.d.ts +6 -0
- package/dist/src/utility/filters.js +36 -0
- package/dist/src/utility/filters.js.map +1 -0
- package/dist/src/utility/props.d.ts +143 -10
- package/dist/src/utility/props.js +241 -25
- package/dist/src/utility/props.js.map +1 -1
- package/dist/src/utility/server.js +1 -1
- package/dist/src/utility/server.js.map +1 -1
- package/dist/src/utility/sortOption.d.ts +22 -0
- package/dist/src/utility/sortOption.js +198 -0
- package/dist/src/utility/sortOption.js.map +1 -0
- package/package.json +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.d.ts +0 -84
- package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.js +0 -21
- package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.js.map +0 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.d.ts +0 -86
- package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.js +0 -32
- package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.js.map +0 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.d.ts +0 -77
- package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.js +0 -124
- package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.js.map +0 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.d.ts +0 -83
- package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.js +0 -28
- package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.js.map +0 -1
- package/dist/src/hooks/reactivesearch/useReactiveReactProp.d.ts +0 -4
- package/dist/src/hooks/reactivesearch/useReactiveReactProp.js +0 -32
- package/dist/src/hooks/reactivesearch/useReactiveReactProp.js.map +0 -1
- package/dist/src/hooks/reactivesearch/useReactiveReactiveListProps.d.ts +0 -6
- package/dist/src/hooks/reactivesearch/useReactiveReactiveListProps.js +0 -38
- package/dist/src/hooks/reactivesearch/useReactiveReactiveListProps.js.map +0 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCuration = void 0;
|
|
4
|
+
const getCuration = (options) => {
|
|
5
|
+
var _a;
|
|
6
|
+
const handleOrSearchTerm = options.provider.mode === "collection" ? options.provider.collectionHandle : (_a = options.searchTerm) !== null && _a !== void 0 ? _a : "";
|
|
7
|
+
const normalisedHandleOrSearchTerm = handleOrSearchTerm
|
|
8
|
+
.toLowerCase()
|
|
9
|
+
.trim();
|
|
10
|
+
const globalCuration = options.config.curations.find((curation) => {
|
|
11
|
+
if (options.provider.mode === "search") {
|
|
12
|
+
if (options.provider.market) {
|
|
13
|
+
return curation.id === `global_${options.provider.market}_search`;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
return curation.id === "global_search";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if (options.provider.mode === "instant-search") {
|
|
20
|
+
if (options.provider.market) {
|
|
21
|
+
return curation.id === `global_${options.provider.market}_search`;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return curation.id === "global_search";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (options.provider.mode === "collection") {
|
|
28
|
+
if (options.provider.market) {
|
|
29
|
+
return curation.id === `global_${options.provider.market}_collection`;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
return curation.id === "global_collection";
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return false;
|
|
36
|
+
});
|
|
37
|
+
const curation = options.config.curations.find((curation) => {
|
|
38
|
+
var _a, _b;
|
|
39
|
+
if (options.provider.market) {
|
|
40
|
+
if (curation.markets && !curation.markets.includes(options.provider.market)) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const normalisedSearchTerm = (_a = curation.searchTerm) === null || _a === void 0 ? void 0 : _a.toLowerCase().trim();
|
|
45
|
+
const normalisedCollectionHandle = (_b = curation.collectionHandle) === null || _b === void 0 ? void 0 : _b.toLowerCase().trim();
|
|
46
|
+
if ("instant-search" === options.provider.mode) {
|
|
47
|
+
return ("search" === curation.type &&
|
|
48
|
+
normalisedHandleOrSearchTerm === normalisedSearchTerm);
|
|
49
|
+
}
|
|
50
|
+
if ("search" === options.provider.mode) {
|
|
51
|
+
return ("search" === curation.type &&
|
|
52
|
+
normalisedHandleOrSearchTerm === normalisedSearchTerm);
|
|
53
|
+
}
|
|
54
|
+
if ("collection" === options.provider.mode) {
|
|
55
|
+
return ("collection" === curation.type &&
|
|
56
|
+
normalisedHandleOrSearchTerm === normalisedCollectionHandle);
|
|
57
|
+
}
|
|
58
|
+
return false;
|
|
59
|
+
});
|
|
60
|
+
const addGlobalBoosting = (curation) => {
|
|
61
|
+
if (!globalCuration) {
|
|
62
|
+
return curation;
|
|
63
|
+
}
|
|
64
|
+
const curationIsCollection = curation.type === "collection";
|
|
65
|
+
if (!curationIsCollection) {
|
|
66
|
+
return curation;
|
|
67
|
+
}
|
|
68
|
+
const curationHasRules = !!curation.boosting.groupings.length ||
|
|
69
|
+
!!curation.boosting.sortings.length;
|
|
70
|
+
if (curationHasRules) {
|
|
71
|
+
return curation;
|
|
72
|
+
}
|
|
73
|
+
const curationWithGlobalBoosting = Object.assign(Object.assign({}, curation), { boosting: globalCuration.boosting });
|
|
74
|
+
return curationWithGlobalBoosting;
|
|
75
|
+
};
|
|
76
|
+
if (curation) {
|
|
77
|
+
return addGlobalBoosting(curation);
|
|
78
|
+
}
|
|
79
|
+
if (globalCuration) {
|
|
80
|
+
return globalCuration;
|
|
81
|
+
}
|
|
82
|
+
return undefined;
|
|
83
|
+
};
|
|
84
|
+
exports.getCuration = getCuration;
|
|
85
|
+
//# sourceMappingURL=curation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"curation.js","sourceRoot":"","sources":["../../../src/utility/curation.ts"],"names":[],"mappings":";;;AAGO,MAAM,WAAW,GAAG,CAAC,OAI3B,EAAE,EAAE;;IACH,MAAM,kBAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,U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AAC,MAAM,CAAC;QAEtC,IAAI,gBAAgB,EAAE;YACpB,OAAO,QAAQ,CAAC;SACjB;QAED,MAAM,0BAA0B,GAAG,gCAC9B,QAAQ,KACX,QAAQ,EAAE,cAAc,CAAC,QAAQ,GAChB,CAAC;QAEpB,OAAO,0BAA0B,CAAC;IACpC,CAAC,CAAC;IAEF,IAAI,QAAQ,EAAE;QACZ,OAAO,iBAAiB,CAAC,QAAQ,CAAC,CAAC;KACpC;IAED,IAAI,cAAc,EAAE;QAClB,OAAO,cAAc,CAAC;KACvB;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAA;AA3GY,QAAA,WAAW,eA2GvB","sourcesContent":["import { ReactifySearchProviderProps } from \"../components\";\nimport { Config, ConfigCuration } from \"../types\";\n\nexport const getCuration = (options: {\n provider: ReactifySearchProviderProps;\n config: Config;\n searchTerm?: string;\n}) => {\n const handleOrSearchTerm = options.provider.mode === \"collection\" ? options.provider.collectionHandle : options.searchTerm ?? \"\";\n\n const normalisedHandleOrSearchTerm = handleOrSearchTerm\n .toLowerCase()\n .trim();\n\n const globalCuration = options.config.curations.find((curation) => {\n if (options.provider.mode === \"search\") {\n if (options.provider.market) {\n return curation.id === `global_${options.provider.market}_search`;\n } else {\n return curation.id === \"global_search\";\n }\n }\n if (options.provider.mode === \"instant-search\") {\n if (options.provider.market) {\n return curation.id === `global_${options.provider.market}_search`;\n } else {\n return curation.id === \"global_search\";\n }\n }\n if (options.provider.mode === \"collection\") {\n if (options.provider.market) {\n return curation.id === `global_${options.provider.market}_collection`;\n } else {\n return curation.id === \"global_collection\";\n }\n }\n return false;\n });\n\n const curation = options.config.curations.find((curation) => {\n if (options.provider.market) {\n if (curation.markets && !curation.markets.includes(options.provider.market)) {\n return false;\n }\n }\n\n const normalisedSearchTerm = curation.searchTerm?.toLowerCase().trim();\n const normalisedCollectionHandle = curation.collectionHandle\n ?.toLowerCase()\n .trim();\n\n if (\"instant-search\" === options.provider.mode) {\n return (\n \"search\" === curation.type &&\n normalisedHandleOrSearchTerm === normalisedSearchTerm\n );\n }\n\n if (\"search\" === options.provider.mode) {\n return (\n \"search\" === curation.type &&\n normalisedHandleOrSearchTerm === normalisedSearchTerm\n );\n }\n\n if (\"collection\" === options.provider.mode) {\n return (\n \"collection\" === curation.type &&\n normalisedHandleOrSearchTerm === normalisedCollectionHandle\n );\n }\n\n return false;\n });\n\n const addGlobalBoosting = (curation: ConfigCuration) => {\n if (!globalCuration) {\n return curation;\n }\n\n const curationIsCollection = curation.type === \"collection\";\n if (!curationIsCollection) {\n return curation;\n }\n\n const curationHasRules =\n !!curation.boosting.groupings.length ||\n !!curation.boosting.sortings.length;\n\n if (curationHasRules) {\n return curation;\n }\n\n const curationWithGlobalBoosting = {\n ...curation,\n boosting: globalCuration.boosting,\n } as ConfigCuration;\n\n return curationWithGlobalBoosting;\n };\n\n if (curation) {\n return addGlobalBoosting(curation);\n }\n\n if (globalCuration) {\n return globalCuration;\n }\n\n return undefined;\n}"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFilterStack = void 0;
|
|
4
|
+
const getFilterStack = (options) => {
|
|
5
|
+
// select filters by type
|
|
6
|
+
const matchingFilterss = options.config.filters.filter((filter) => filter.type === options.provider.mode);
|
|
7
|
+
// select filter stack by handle if provided
|
|
8
|
+
if (options.provider.filtersHandle) {
|
|
9
|
+
const matchingFilters = matchingFilterss.find((filterStack) => options.provider.filtersHandle === filterStack.handle);
|
|
10
|
+
if (matchingFilters) {
|
|
11
|
+
return matchingFilters;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
// select filter stack by collection if provided
|
|
15
|
+
if (options.provider.mode === "collection" && options.provider.collectionHandle) {
|
|
16
|
+
const matchingFilters = matchingFilterss.find((filterStack) => { var _a; return (_a = filterStack.collections) === null || _a === void 0 ? void 0 : _a.includes(options.provider.mode === "collection" ? options.provider.collectionHandle : ""); });
|
|
17
|
+
if (matchingFilters) {
|
|
18
|
+
return matchingFilters;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
// select filter with "default" handle
|
|
22
|
+
let matchingFilters = matchingFilterss.find((filterStack) => filterStack.handle === "default");
|
|
23
|
+
if (matchingFilters) {
|
|
24
|
+
return matchingFilters;
|
|
25
|
+
}
|
|
26
|
+
// select any filter with "default" handle
|
|
27
|
+
matchingFilters = options.config.filters.find((filterStack) => filterStack.handle === "default");
|
|
28
|
+
if (matchingFilters) {
|
|
29
|
+
return matchingFilters;
|
|
30
|
+
}
|
|
31
|
+
// select any available filter as a last resort
|
|
32
|
+
matchingFilters = options.config.filters[0];
|
|
33
|
+
return matchingFilters;
|
|
34
|
+
};
|
|
35
|
+
exports.getFilterStack = getFilterStack;
|
|
36
|
+
//# sourceMappingURL=filters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../src/utility/filters.ts"],"names":[],"mappings":";;;AAGO,MAAM,cAAc,GAAG,CAAC,OAG9B,EAAE,EAAE;IACH,yBAAyB;IACzB,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CACpD,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,OAAO,CAAC,QAAQ,CAAC,IAAI,CAClD,CAAC;IAEF,4CAA4C;IAC5C,IAAI,OAAO,CAAC,QAAQ,CAAC,aAAa,EAAE;QAClC,MAAM,eAAe,GAAG,gBAAgB,CAAC,IAAI,CAC3C,CAAC,WAAW,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,aAAa,KAAK,WAAW,CAAC,MAAM,CACvE,CAAC;QACF,IAAI,eAAe,EAAE;YACnB,OAAO,eAAe,CAAC;SACxB;KACF;IAED,gDAAgD;IAChD,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY,IAAI,OAAO,CAAC,QAAQ,CAAC,gBAAgB,EAAE;QAC/E,MAAM,eAAe,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,WAC5D,OAAA,MAAA,WAAW,CAAC,WAAW,0CAAE,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA,EAAA,CACnH,CAAC;QACF,IAAI,eAAe,EAAE;YACnB,OAAO,eAAe,CAAC;SACxB;KACF;IAED,sCAAsC;IACtC,IAAI,eAAe,GAAG,gBAAgB,CAAC,IAAI,CACzC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,SAAS,CAClD,CAAC;IACF,IAAI,eAAe,EAAE;QACnB,OAAO,eAAe,CAAC;KACxB;IAED,0CAA0C;IAC1C,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAC3C,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,SAAS,CAClD,CAAC;IACF,IAAI,eAAe,EAAE;QACnB,OAAO,eAAe,CAAC;KACxB;IAED,+CAA+C;IAC/C,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAE5C,OAAO,eAAe,CAAC;AACzB,CAAC,CAAA;AAjDY,QAAA,cAAc,kBAiD1B","sourcesContent":["import { ReactifySearchProviderProps } from \"../components\";\nimport { Config } from \"../types\";\n\nexport const getFilterStack = (options: {\n provider: ReactifySearchProviderProps;\n config: Config;\n}) => {\n // select filters by type\n const matchingFilterss = options.config.filters.filter(\n (filter) => filter.type === options.provider.mode\n );\n\n // select filter stack by handle if provided\n if (options.provider.filtersHandle) {\n const matchingFilters = matchingFilterss.find(\n (filterStack) => options.provider.filtersHandle === filterStack.handle\n );\n if (matchingFilters) {\n return matchingFilters;\n }\n }\n\n // select filter stack by collection if provided\n if (options.provider.mode === \"collection\" && options.provider.collectionHandle) {\n const matchingFilters = matchingFilterss.find((filterStack) =>\n filterStack.collections?.includes(options.provider.mode === \"collection\" ? options.provider.collectionHandle : \"\")\n );\n if (matchingFilters) {\n return matchingFilters;\n }\n }\n\n // select filter with \"default\" handle\n let matchingFilters = matchingFilterss.find(\n (filterStack) => filterStack.handle === \"default\"\n );\n if (matchingFilters) {\n return matchingFilters;\n }\n\n // select any filter with \"default\" handle\n matchingFilters = options.config.filters.find(\n (filterStack) => filterStack.handle === \"default\"\n );\n if (matchingFilters) {\n return matchingFilters;\n }\n\n // select any available filter as a last resort\n matchingFilters = options.config.filters[0];\n\n return matchingFilters;\n}"]}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ReactiveList } from "@appbaseio/reactivesearch";
|
|
3
|
+
import { ReactifySearchProviderProps } from "../components";
|
|
3
4
|
import { Config, ConfigFilter, ConfigFilterOption } from "../types";
|
|
4
5
|
export declare type GeneratePropsFilterGroupOptions = {
|
|
5
|
-
|
|
6
|
+
provider: ReactifySearchProviderProps;
|
|
7
|
+
config: Config;
|
|
8
|
+
filterGroup?: ConfigFilter;
|
|
9
|
+
};
|
|
10
|
+
export declare type GeneratePropsSensorOptions = {
|
|
11
|
+
provider: ReactifySearchProviderProps;
|
|
6
12
|
config: Config;
|
|
7
|
-
filterGroup: ConfigFilter;
|
|
8
|
-
additionalComponentIds?: Array<string>;
|
|
9
|
-
includeFields?: Array<string>;
|
|
10
|
-
excludeFields?: Array<string>;
|
|
11
13
|
};
|
|
12
14
|
export declare const getPropsFilterGroup: (options: GeneratePropsFilterGroupOptions) => ({
|
|
13
15
|
URLParams: boolean;
|
|
@@ -78,10 +80,14 @@ export declare const getPropsFilterGroup: (options: GeneratePropsFilterGroupOpti
|
|
|
78
80
|
};
|
|
79
81
|
};
|
|
80
82
|
}) | undefined;
|
|
81
|
-
source: import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any> | import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/
|
|
83
|
+
source: import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any> | import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/range/SingleRange").SingleRangeProps, any> | import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/list/SingleList").SingleList, any> | import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/range/MultiRange").MultiRangeProps, any> | import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/list/MultiList").MultiList, any> | undefined;
|
|
82
84
|
react: {
|
|
83
85
|
and: string[];
|
|
84
86
|
};
|
|
87
|
+
} | {
|
|
88
|
+
componentId: string;
|
|
89
|
+
customQuery: () => unknown;
|
|
90
|
+
source: import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
|
|
85
91
|
} | {
|
|
86
92
|
size: number;
|
|
87
93
|
URLParams: boolean;
|
|
@@ -93,13 +99,14 @@ export declare const getPropsFilterGroup: (options: GeneratePropsFilterGroupOpti
|
|
|
93
99
|
};
|
|
94
100
|
includeFields: string[];
|
|
95
101
|
excludeFields: string[];
|
|
102
|
+
scrollTarget: string | Element | HTMLDocument | undefined;
|
|
96
103
|
componentId: string;
|
|
97
104
|
scrollOnChange: boolean;
|
|
98
105
|
pagination: boolean;
|
|
99
106
|
infiniteScroll: boolean;
|
|
100
107
|
renderNoResults: () => null;
|
|
101
108
|
source: typeof ReactiveList;
|
|
102
|
-
})[];
|
|
109
|
+
} | null)[];
|
|
103
110
|
export declare const getPropsFilterGroupOption: (options: GeneratePropsFilterGroupOptions, filterGroupOption: ConfigFilterOption) => {
|
|
104
111
|
URLParams: boolean;
|
|
105
112
|
componentId: string;
|
|
@@ -169,12 +176,137 @@ export declare const getPropsFilterGroupOption: (options: GeneratePropsFilterGro
|
|
|
169
176
|
};
|
|
170
177
|
};
|
|
171
178
|
}) | undefined;
|
|
172
|
-
source: import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any> | import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/
|
|
179
|
+
source: import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any> | import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/range/SingleRange").SingleRangeProps, any> | import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/list/SingleList").SingleList, any> | import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/range/MultiRange").MultiRangeProps, any> | import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/list/MultiList").MultiList, any> | undefined;
|
|
173
180
|
react: {
|
|
174
181
|
and: string[];
|
|
175
182
|
};
|
|
176
183
|
};
|
|
177
|
-
export declare const
|
|
184
|
+
export declare const getPropsSensors: (options: GeneratePropsSensorOptions) => ({
|
|
185
|
+
componentId: string;
|
|
186
|
+
customQuery: () => unknown;
|
|
187
|
+
source: import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
|
|
188
|
+
} | null)[];
|
|
189
|
+
export declare const getPropsSensorCustom: (options: GeneratePropsSensorOptions) => {
|
|
190
|
+
componentId: string;
|
|
191
|
+
customQuery: () => unknown;
|
|
192
|
+
source: import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
|
|
193
|
+
}[];
|
|
194
|
+
export declare const getPropsSensorCollection: (options: GeneratePropsSensorOptions) => {
|
|
195
|
+
componentId: string;
|
|
196
|
+
customQuery: () => {
|
|
197
|
+
query: {
|
|
198
|
+
bool: {
|
|
199
|
+
should: ({
|
|
200
|
+
nested: {
|
|
201
|
+
path: string;
|
|
202
|
+
query: {
|
|
203
|
+
term: {
|
|
204
|
+
"collections.handle.keyword": string;
|
|
205
|
+
"curations.collectionHandle.keyword"?: undefined;
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
} | {
|
|
210
|
+
nested: {
|
|
211
|
+
path: string;
|
|
212
|
+
query: {
|
|
213
|
+
term: {
|
|
214
|
+
"curations.collectionHandle.keyword": string;
|
|
215
|
+
"collections.handle.keyword"?: undefined;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
})[];
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
} | null;
|
|
223
|
+
source: import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
|
|
224
|
+
} | null;
|
|
225
|
+
export declare const getPropsSensorPublished: (options: GeneratePropsSensorOptions) => {
|
|
226
|
+
componentId: string;
|
|
227
|
+
customQuery: () => {
|
|
228
|
+
query: {
|
|
229
|
+
bool: {
|
|
230
|
+
must: ({
|
|
231
|
+
match: {
|
|
232
|
+
markets: string;
|
|
233
|
+
published?: undefined;
|
|
234
|
+
};
|
|
235
|
+
} | {
|
|
236
|
+
match: {
|
|
237
|
+
published: boolean;
|
|
238
|
+
markets?: undefined;
|
|
239
|
+
};
|
|
240
|
+
})[];
|
|
241
|
+
};
|
|
242
|
+
match?: undefined;
|
|
243
|
+
};
|
|
244
|
+
} | {
|
|
245
|
+
query: {
|
|
246
|
+
match: {
|
|
247
|
+
published: boolean;
|
|
248
|
+
};
|
|
249
|
+
bool?: undefined;
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
source: import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
|
|
253
|
+
};
|
|
254
|
+
export declare const getPropsSensorInventoryAvailable: (options: GeneratePropsSensorOptions) => {
|
|
255
|
+
componentId: string;
|
|
256
|
+
customQuery: () => {
|
|
257
|
+
query: {
|
|
258
|
+
bool: {
|
|
259
|
+
should: ({
|
|
260
|
+
bool: {
|
|
261
|
+
must: ({
|
|
262
|
+
term: {
|
|
263
|
+
type: {
|
|
264
|
+
value: string;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
nested?: undefined;
|
|
268
|
+
} | {
|
|
269
|
+
nested: {
|
|
270
|
+
path: string;
|
|
271
|
+
query: {
|
|
272
|
+
match: {
|
|
273
|
+
"variants.available": boolean;
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
term?: undefined;
|
|
278
|
+
})[];
|
|
279
|
+
};
|
|
280
|
+
term?: undefined;
|
|
281
|
+
} | {
|
|
282
|
+
term: {
|
|
283
|
+
type: {
|
|
284
|
+
value: string;
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
bool?: undefined;
|
|
288
|
+
})[];
|
|
289
|
+
minimum_should_match: string;
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
source: import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
|
|
294
|
+
} | null;
|
|
295
|
+
export declare const getPropsSensorSort: (options: GeneratePropsSensorOptions & {
|
|
296
|
+
searchTerm?: string;
|
|
297
|
+
sortOption?: string;
|
|
298
|
+
}) => {
|
|
299
|
+
componentId: string;
|
|
300
|
+
customQuery: () => {
|
|
301
|
+
sort: any[];
|
|
302
|
+
query: Record<string, any> | undefined;
|
|
303
|
+
};
|
|
304
|
+
source: import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
|
|
305
|
+
};
|
|
306
|
+
export declare const getPropsResults: (options: GeneratePropsFilterGroupOptions & {
|
|
307
|
+
scrollTarget?: string | Element | HTMLDocument;
|
|
308
|
+
pageSize?: number;
|
|
309
|
+
}) => {
|
|
178
310
|
size: number;
|
|
179
311
|
URLParams: boolean;
|
|
180
312
|
showLoader: boolean;
|
|
@@ -185,6 +317,7 @@ export declare const getPropsResults: (options: GeneratePropsFilterGroupOptions)
|
|
|
185
317
|
};
|
|
186
318
|
includeFields: string[];
|
|
187
319
|
excludeFields: string[];
|
|
320
|
+
scrollTarget: string | Element | HTMLDocument | undefined;
|
|
188
321
|
componentId: string;
|
|
189
322
|
scrollOnChange: boolean;
|
|
190
323
|
pagination: boolean;
|
|
@@ -264,7 +397,7 @@ export declare const getPropsShared: (options: GeneratePropsFilterGroupOptions,
|
|
|
264
397
|
};
|
|
265
398
|
};
|
|
266
399
|
}) | undefined;
|
|
267
|
-
source: import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any> | import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/
|
|
400
|
+
source: import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any> | import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/range/SingleRange").SingleRangeProps, any> | import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/list/SingleList").SingleList, any> | import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/range/MultiRange").MultiRangeProps, any> | import("react").ComponentClass<import("@appbaseio/reactivesearch/lib/components/list/MultiList").MultiList, any> | undefined;
|
|
268
401
|
react: {
|
|
269
402
|
and: string[];
|
|
270
403
|
};
|