@usereactify/search 5.58.0 → 5.59.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/package.json +1 -1
  3. package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.d.ts +14 -3
  4. package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js +5 -6
  5. package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js.map +1 -1
  6. package/dist/src/components/Result/Results.d.ts +3 -1
  7. package/dist/src/components/Result/Results.js +33 -34
  8. package/dist/src/components/Result/Results.js.map +1 -1
  9. package/dist/src/components/Sensor/SensorCollection.js +2 -1
  10. package/dist/src/components/Sensor/SensorCollection.js.map +1 -1
  11. package/dist/src/components/Sensor/SensorCuratedPageCollection.d.ts +1 -0
  12. package/dist/src/components/Sensor/SensorCuratedPageCollection.js +22 -0
  13. package/dist/src/components/Sensor/SensorCuratedPageCollection.js.map +1 -0
  14. package/dist/src/components/Sensor/SensorCuratedPageSearch.d.ts +1 -0
  15. package/dist/src/components/Sensor/SensorCuratedPageSearch.js +21 -0
  16. package/dist/src/components/Sensor/SensorCuratedPageSearch.js.map +1 -0
  17. package/dist/src/components/Sensor/Sensors.js +18 -0
  18. package/dist/src/components/Sensor/Sensors.js.map +1 -1
  19. package/dist/src/components/Sensor/index.d.ts +4 -1
  20. package/dist/src/components/Sensor/index.js +5 -1
  21. package/dist/src/components/Sensor/index.js.map +1 -1
  22. package/dist/src/hooks/useReactifySearchContext.d.ts +17 -1
  23. package/dist/src/hooks/useReactifySearchContext.js +30 -4
  24. package/dist/src/hooks/useReactifySearchContext.js.map +1 -1
  25. package/dist/src/types/config.d.ts +7 -5
  26. package/dist/src/types/config.js.map +1 -1
  27. package/dist/src/types/firestore.d.ts +84 -392
  28. package/dist/src/types/firestore.js +53 -84
  29. package/dist/src/types/firestore.js.map +1 -1
  30. package/dist/src/types/reactivesearch.d.ts +2 -0
  31. package/dist/src/types/reactivesearch.js.map +1 -1
  32. package/dist/src/utility/liquid.d.ts +8 -1
  33. package/dist/src/utility/liquid.js +32 -11
  34. package/dist/src/utility/liquid.js.map +1 -1
  35. package/dist/src/utility/props.d.ts +210 -8
  36. package/dist/src/utility/props.js +90 -80
  37. package/dist/src/utility/props.js.map +1 -1
  38. package/dist/src/utility/queries.d.ts +391 -0
  39. package/dist/src/utility/queries.js +225 -0
  40. package/dist/src/utility/queries.js.map +1 -0
  41. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { ReactiveList } from "@usereactify/search-internals";
2
2
  import { ReactifySearchProviderProps } from "../components";
3
- import { Config, ConfigFilter, ConfigFilterFacet } from "../types";
3
+ import { Config, ConfigFilter, ConfigFilterFacet, ResultsDataListener } from "../types";
4
4
  export type GeneratePropsFilterGroupOptions = {
5
5
  provider: ReactifySearchProviderProps;
6
6
  config: Config;
@@ -35,10 +35,11 @@ export declare const getPropsFilterGroup: (options: GeneratePropsFilterGroupOpti
35
35
  infiniteScroll: boolean;
36
36
  renderNoResults: () => null;
37
37
  source: typeof ReactiveList;
38
+ onData: ResultsDataListener | undefined;
38
39
  } | {
40
+ source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
39
41
  componentId: string;
40
42
  customQuery: () => unknown;
41
- source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
42
43
  } | {
43
44
  URLParams: boolean;
44
45
  componentId: string;
@@ -188,16 +189,17 @@ export declare const getPropsFilterGroupOption: (options: GeneratePropsFilterGro
188
189
  };
189
190
  };
190
191
  export declare const getPropsSensors: (options: GeneratePropsSensorOptions) => ({
192
+ source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
191
193
  componentId: string;
192
194
  customQuery: () => unknown;
193
- source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
194
195
  } | null)[];
195
196
  export declare const getPropsSensorCustom: (options: GeneratePropsSensorOptions) => {
197
+ source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
196
198
  componentId: string;
197
199
  customQuery: () => unknown;
198
- source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
199
200
  }[];
200
201
  export declare const getPropsSensorCollection: (options: GeneratePropsSensorOptions) => {
202
+ source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
201
203
  componentId: string;
202
204
  customQuery: () => {
203
205
  query: {
@@ -226,9 +228,208 @@ export declare const getPropsSensorCollection: (options: GeneratePropsSensorOpti
226
228
  };
227
229
  };
228
230
  } | null;
231
+ } | null;
232
+ export declare const getPropsSensorCuratedPageCollection: ({ provider, config, }: GeneratePropsSensorOptions) => {
233
+ source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
234
+ componentId: string;
235
+ customQuery: () => {
236
+ query: {
237
+ function_score: {
238
+ query: {
239
+ bool: {
240
+ must: Record<string, any>[];
241
+ };
242
+ };
243
+ functions: ({
244
+ filter: {
245
+ wildcard: {
246
+ [x: string]: string;
247
+ };
248
+ bool?: undefined;
249
+ term?: undefined;
250
+ range?: undefined;
251
+ };
252
+ weight: number;
253
+ } | {
254
+ filter: {
255
+ bool: {
256
+ must_not: {
257
+ wildcard: {
258
+ [x: string]: string;
259
+ };
260
+ };
261
+ };
262
+ wildcard?: undefined;
263
+ term?: undefined;
264
+ range?: undefined;
265
+ };
266
+ weight: number;
267
+ } | {
268
+ filter: {
269
+ term: {
270
+ [x: string]: string;
271
+ };
272
+ wildcard?: undefined;
273
+ bool?: undefined;
274
+ range?: undefined;
275
+ };
276
+ weight: number;
277
+ } | {
278
+ filter: {
279
+ range: {
280
+ [x: string]: {
281
+ gt: number;
282
+ };
283
+ };
284
+ wildcard?: undefined;
285
+ bool?: undefined;
286
+ term?: undefined;
287
+ };
288
+ weight: number;
289
+ } | {
290
+ filter: {
291
+ range: {
292
+ [x: string]: {
293
+ lt: number;
294
+ };
295
+ };
296
+ wildcard?: undefined;
297
+ bool?: undefined;
298
+ term?: undefined;
299
+ };
300
+ weight: number;
301
+ })[];
302
+ score_mode: string;
303
+ boost_mode: string;
304
+ };
305
+ };
306
+ };
307
+ } | null;
308
+ export declare const getPropsSensorCuratedPageSearch: ({ provider, config, }: GeneratePropsSensorOptions) => {
229
309
  source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
310
+ componentId: string;
311
+ customQuery: () => {
312
+ query: {
313
+ function_score: {
314
+ query: {
315
+ bool: {
316
+ should: {
317
+ match: {
318
+ [x: string]: {
319
+ query: string;
320
+ fuzziness: number;
321
+ analyzer: string;
322
+ };
323
+ };
324
+ }[];
325
+ terms?: {
326
+ markets: string[];
327
+ } | undefined;
328
+ };
329
+ };
330
+ functions: ({
331
+ filter: {
332
+ wildcard: {
333
+ [x: string]: string;
334
+ };
335
+ bool?: undefined;
336
+ term?: undefined;
337
+ range?: undefined;
338
+ };
339
+ weight: number;
340
+ } | {
341
+ filter: {
342
+ bool: {
343
+ must_not: {
344
+ wildcard: {
345
+ [x: string]: string;
346
+ };
347
+ };
348
+ };
349
+ wildcard?: undefined;
350
+ term?: undefined;
351
+ range?: undefined;
352
+ };
353
+ weight: number;
354
+ } | {
355
+ filter: {
356
+ term: {
357
+ [x: string]: string;
358
+ };
359
+ wildcard?: undefined;
360
+ bool?: undefined;
361
+ range?: undefined;
362
+ };
363
+ weight: number;
364
+ } | {
365
+ filter: {
366
+ range: {
367
+ [x: string]: {
368
+ gt: number;
369
+ };
370
+ };
371
+ wildcard?: undefined;
372
+ bool?: undefined;
373
+ term?: undefined;
374
+ };
375
+ weight: number;
376
+ } | {
377
+ filter: {
378
+ range: {
379
+ [x: string]: {
380
+ lt: number;
381
+ };
382
+ };
383
+ wildcard?: undefined;
384
+ bool?: undefined;
385
+ term?: undefined;
386
+ };
387
+ weight: number;
388
+ } | {
389
+ filter: {
390
+ match: {
391
+ [x: string]: {
392
+ query: string;
393
+ fuzziness: number;
394
+ analyzer: string;
395
+ };
396
+ };
397
+ bool?: undefined;
398
+ };
399
+ weight: number;
400
+ } | {
401
+ filter: {
402
+ bool: {
403
+ must_not: {
404
+ match: {
405
+ [x: string]: {
406
+ query: string;
407
+ fuzziness: number;
408
+ analyzer: string;
409
+ };
410
+ };
411
+ };
412
+ should: {
413
+ match: {
414
+ [x: string]: {
415
+ query: string;
416
+ fuzziness: number;
417
+ };
418
+ };
419
+ };
420
+ };
421
+ match?: undefined;
422
+ };
423
+ weight: number;
424
+ })[];
425
+ score_mode: string;
426
+ boost_mode: string;
427
+ };
428
+ };
429
+ } | null;
230
430
  } | null;
231
431
  export declare const getPropsSensorPublished: (options: GeneratePropsSensorOptions) => {
432
+ source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
232
433
  componentId: string;
233
434
  customQuery: () => {
234
435
  query: {
@@ -255,9 +456,9 @@ export declare const getPropsSensorPublished: (options: GeneratePropsSensorOptio
255
456
  bool?: undefined;
256
457
  };
257
458
  };
258
- source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
259
459
  };
260
460
  export declare const getPropsSensorInventoryAvailable: (options: GeneratePropsSensorOptions) => {
461
+ source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
261
462
  componentId: string;
262
463
  customQuery: () => {
263
464
  query: {
@@ -296,18 +497,17 @@ export declare const getPropsSensorInventoryAvailable: (options: GeneratePropsSe
296
497
  };
297
498
  };
298
499
  };
299
- source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
300
500
  } | null;
301
501
  export declare const getPropsSensorSort: (options: GeneratePropsSensorOptions & {
302
502
  searchTerm?: string;
303
503
  sortOption?: string;
304
504
  }) => {
505
+ source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
305
506
  componentId: string;
306
507
  customQuery: () => {
307
508
  sort: any[];
308
509
  query: Record<string, any> | undefined;
309
510
  };
310
- source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
311
511
  };
312
512
  export declare const getPropsBase: (options: GeneratePropsBase) => {
313
513
  app: string;
@@ -320,7 +520,7 @@ export declare const getPropsBase: (options: GeneratePropsBase) => {
320
520
  transformResponse: (response: any) => Promise<any>;
321
521
  headers: {
322
522
  "x-reactify-shop": string;
323
- "x-reactify-mode": "search" | "collection" | "instant-search";
523
+ "x-reactify-mode": "search" | "collection" | "instant-search" | "curated-page";
324
524
  "x-reactify-client-id": string | undefined;
325
525
  "x-reactify-client-version": string;
326
526
  };
@@ -328,6 +528,7 @@ export declare const getPropsBase: (options: GeneratePropsBase) => {
328
528
  export declare const getPropsResults: (options: GeneratePropsFilterGroupOptions & {
329
529
  scrollTarget?: string | Element | HTMLDocument;
330
530
  pageSize?: number;
531
+ onData?: ResultsDataListener;
331
532
  }) => {
332
533
  size: number;
333
534
  URLParams: boolean;
@@ -346,6 +547,7 @@ export declare const getPropsResults: (options: GeneratePropsFilterGroupOptions
346
547
  infiniteScroll: boolean;
347
548
  renderNoResults: () => null;
348
549
  source: typeof ReactiveList;
550
+ onData: ResultsDataListener | undefined;
349
551
  };
350
552
  export declare const getPropsReact: (options: GeneratePropsFilterGroupOptions, filterGroupOption?: ConfigFilterFacet) => {
351
553
  and: string[];
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.getPropsFilterSlider = exports.getPropsFilterRange = exports.getPropsFilterList = exports.getPropsShared = exports.getPropsReact = exports.getPropsResults = exports.getPropsBase = exports.getPropsSensorSort = exports.getPropsSensorInventoryAvailable = exports.getPropsSensorPublished = exports.getPropsSensorCollection = exports.getPropsSensorCustom = exports.getPropsSensors = exports.getPropsFilterGroupOption = exports.getPropsFilterGroup = void 0;
15
+ exports.getPropsFilterSlider = exports.getPropsFilterRange = exports.getPropsFilterList = exports.getPropsShared = exports.getPropsReact = exports.getPropsResults = exports.getPropsBase = exports.getPropsSensorSort = exports.getPropsSensorInventoryAvailable = exports.getPropsSensorPublished = exports.getPropsSensorCuratedPageSearch = exports.getPropsSensorCuratedPageCollection = exports.getPropsSensorCollection = exports.getPropsSensorCustom = exports.getPropsSensors = exports.getPropsFilterGroupOption = exports.getPropsFilterGroup = void 0;
16
16
  const search_internals_1 = require("@usereactify/search-internals");
17
17
  const components_1 = require("../components");
18
18
  const curation_1 = require("./curation");
@@ -20,10 +20,11 @@ const sortOption_1 = require("./sortOption");
20
20
  const filters_1 = require("./filters");
21
21
  const hooks_1 = require("../hooks");
22
22
  const package_json_1 = __importDefault(require("../../package.json"));
23
+ const queries_1 = require("./queries");
23
24
  const getPropsFilterGroup = (options) => {
24
25
  var _a, _b;
25
26
  return [
26
- ...(_b = (_a = options.filterGroup) === null || _a === void 0 ? void 0 : _a.options.map((filterGroupOption) => (0, exports.getPropsFilterGroupOption)(options, filterGroupOption))) !== null && _b !== void 0 ? _b : [],
27
+ ...((_b = (_a = options.filterGroup) === null || _a === void 0 ? void 0 : _a.options.map((filterGroupOption) => (0, exports.getPropsFilterGroupOption)(options, filterGroupOption))) !== null && _b !== void 0 ? _b : []),
27
28
  ...(0, exports.getPropsSensors)(options),
28
29
  (0, exports.getPropsResults)(options),
29
30
  ];
@@ -62,25 +63,28 @@ const getPropsSensors = (options) => {
62
63
  };
63
64
  exports.getPropsSensors = getPropsSensors;
64
65
  const getPropsSensorCustom = (options) => {
65
- const sensors = options.provider.mode === "collection" ? options.config.sensors.collection : options.config.sensors.search;
66
+ const sensors = options.provider.mode === "collection"
67
+ ? options.config.sensors.collection
68
+ : options.config.sensors.search;
66
69
  return sensors.map((sensor, index) => ({
70
+ source: search_internals_1.ReactiveComponent,
67
71
  componentId: `SensorCustom_${index}`,
68
72
  customQuery: () => sensor,
69
- source: search_internals_1.ReactiveComponent,
70
73
  }));
71
74
  };
72
75
  exports.getPropsSensorCustom = getPropsSensorCustom;
73
76
  const getPropsSensorCollection = (options) => {
74
- if (options.provider.mode !== "collection") {
77
+ if (options.provider.mode !== "collection")
75
78
  return null;
76
- }
77
79
  return {
80
+ source: search_internals_1.ReactiveComponent,
78
81
  componentId: "SensorCollection",
79
82
  customQuery: () => {
80
- if (options.provider.mode !== "collection") {
83
+ if (options.provider.mode !== "collection")
81
84
  return null;
82
- }
83
85
  const conditions = [];
86
+ const handle = options.provider.collectionHandle;
87
+ const market = options.provider.market;
84
88
  if (options.provider.market) {
85
89
  conditions.push({
86
90
  nested: {
@@ -91,11 +95,7 @@ const getPropsSensorCollection = (options) => {
91
95
  {
92
96
  nested: {
93
97
  path: "collections",
94
- query: {
95
- term: {
96
- "collections.handle.keyword": options.provider.collectionHandle,
97
- },
98
- },
98
+ query: { term: { "collections.handle.keyword": handle } },
99
99
  },
100
100
  },
101
101
  {
@@ -103,22 +103,20 @@ const getPropsSensorCollection = (options) => {
103
103
  path: "curations",
104
104
  query: {
105
105
  term: {
106
- "curations.collectionHandle.keyword": options.provider.collectionHandle,
106
+ "curations.collectionHandle.keyword": handle,
107
107
  },
108
108
  },
109
109
  },
110
110
  },
111
111
  ],
112
- must: [{
112
+ must: [
113
+ {
113
114
  nested: {
114
115
  path: "curations",
115
- query: {
116
- term: {
117
- "curations.markets.keyword": options.provider.market,
118
- },
119
- },
116
+ query: { term: { "curations.markets.keyword": market } },
120
117
  },
121
- }]
118
+ },
119
+ ],
122
120
  },
123
121
  },
124
122
  },
@@ -131,20 +129,14 @@ const getPropsSensorCollection = (options) => {
131
129
  {
132
130
  nested: {
133
131
  path: "collections",
134
- query: {
135
- term: {
136
- "collections.handle.keyword": options.provider.collectionHandle,
137
- },
138
- },
132
+ query: { term: { "collections.handle.keyword": handle } },
139
133
  },
140
134
  },
141
135
  {
142
136
  nested: {
143
137
  path: "curations",
144
138
  query: {
145
- term: {
146
- "curations.collectionHandle.keyword": options.provider.collectionHandle,
147
- },
139
+ term: { "curations.collectionHandle.keyword": handle },
148
140
  },
149
141
  },
150
142
  },
@@ -153,40 +145,79 @@ const getPropsSensorCollection = (options) => {
153
145
  },
154
146
  };
155
147
  },
156
- source: search_internals_1.ReactiveComponent,
157
148
  };
158
149
  };
159
150
  exports.getPropsSensorCollection = getPropsSensorCollection;
151
+ const getPropsSensorCuratedPageCollection = ({ provider, config, }) => {
152
+ if (provider.mode !== "curated-page")
153
+ return null;
154
+ if (provider.variation !== "collection")
155
+ return null;
156
+ const handle = provider.handle;
157
+ return {
158
+ source: search_internals_1.ReactiveComponent,
159
+ componentId: "SensorCuratedPageCollection",
160
+ customQuery: () => {
161
+ var _a;
162
+ const curation = config.curations.find((curation) => curation.collectionHandle === handle);
163
+ const function_score = (0, queries_1.generateCollectionFunctionScore)({
164
+ collectionHandle: handle,
165
+ boostingRules: (_a = curation === null || curation === void 0 ? void 0 : curation.boostings) !== null && _a !== void 0 ? _a : [],
166
+ markets: (curation === null || curation === void 0 ? void 0 : curation.markets) || [],
167
+ market: provider.market,
168
+ });
169
+ return { query: { function_score } };
170
+ },
171
+ };
172
+ };
173
+ exports.getPropsSensorCuratedPageCollection = getPropsSensorCuratedPageCollection;
174
+ const getPropsSensorCuratedPageSearch = ({ provider, config, }) => {
175
+ if (provider.mode !== "curated-page")
176
+ return null;
177
+ if (provider.variation !== "search")
178
+ return null;
179
+ const searchTerm = provider.searchTerm;
180
+ return {
181
+ source: search_internals_1.ReactiveComponent,
182
+ componentId: "SensorCuratedPageSearch",
183
+ customQuery: () => {
184
+ var _a;
185
+ const curation = config.curations.find((curation) => curation.searchTerm === searchTerm);
186
+ if (!curation)
187
+ return null;
188
+ const function_score = (0, queries_1.generateSearchFunctionScore)({
189
+ searchTerm: searchTerm,
190
+ searchableFields: config.searchableFields,
191
+ boostingRules: (_a = curation.boostings) !== null && _a !== void 0 ? _a : [],
192
+ markets: curation.markets,
193
+ market: provider.market,
194
+ });
195
+ return { query: { function_score } };
196
+ },
197
+ };
198
+ };
199
+ exports.getPropsSensorCuratedPageSearch = getPropsSensorCuratedPageSearch;
160
200
  const getPropsSensorPublished = (options) => {
161
201
  return {
202
+ source: search_internals_1.ReactiveComponent,
162
203
  componentId: "SensorPublished",
163
204
  customQuery: () => {
164
205
  if (options.provider.market) {
165
206
  return {
166
207
  query: {
167
208
  bool: {
168
- must: [{
169
- match: {
170
- markets: options.provider.market,
171
- },
172
- }, {
173
- match: {
174
- published: true,
175
- },
176
- }]
209
+ must: [
210
+ { match: { markets: options.provider.market } },
211
+ { match: { published: true } },
212
+ ],
177
213
  },
178
214
  },
179
215
  };
180
216
  }
181
217
  return {
182
- query: {
183
- match: {
184
- published: true,
185
- },
186
- },
218
+ query: { match: { published: true } },
187
219
  };
188
220
  },
189
- source: search_internals_1.ReactiveComponent,
190
221
  };
191
222
  };
192
223
  exports.getPropsSensorPublished = getPropsSensorPublished;
@@ -196,6 +227,7 @@ const getPropsSensorInventoryAvailable = (options) => {
196
227
  return null;
197
228
  }
198
229
  return {
230
+ source: search_internals_1.ReactiveComponent,
199
231
  componentId: "SensorInventoryAvailable",
200
232
  customQuery: () => ({
201
233
  query: {
@@ -216,7 +248,9 @@ const getPropsSensorInventoryAvailable = (options) => {
216
248
  path: "variants",
217
249
  query: {
218
250
  match: {
219
- [options.provider.market ? `variants.available_market_${options.provider.market}` : "variants.available"]: true
251
+ [options.provider.market
252
+ ? `variants.available_market_${options.provider.market}`
253
+ : "variants.available"]: true,
220
254
  },
221
255
  },
222
256
  },
@@ -240,7 +274,6 @@ const getPropsSensorInventoryAvailable = (options) => {
240
274
  },
241
275
  },
242
276
  }),
243
- source: search_internals_1.ReactiveComponent,
244
277
  };
245
278
  };
246
279
  exports.getPropsSensorInventoryAvailable = getPropsSensorInventoryAvailable;
@@ -259,12 +292,12 @@ const getPropsSensorSort = (options) => {
259
292
  curation: curation,
260
293
  });
261
294
  return {
295
+ source: search_internals_1.ReactiveComponent,
262
296
  componentId: "SensorSort",
263
297
  customQuery: () => ({
264
298
  sort,
265
299
  query,
266
300
  }),
267
- source: search_internals_1.ReactiveComponent,
268
301
  };
269
302
  };
270
303
  exports.getPropsSensorSort = getPropsSensorSort;
@@ -298,8 +331,7 @@ const getPropsBase = (options) => {
298
331
  //
299
332
  // https://github.com/appbaseio/reactivesearch/issues/1530
300
333
  if ((_b = (_a = response === null || response === void 0 ? void 0 : response.aggregations) === null || _a === void 0 ? void 0 : _a.reactivesearch_nested) === null || _b === void 0 ? void 0 : _b.reactify_nested_outer) {
301
- response.aggregations.reactivesearch_nested =
302
- (0, hooks_1.replaceDocCountWithParent)((_d = (_c = response === null || response === void 0 ? void 0 : response.aggregations) === null || _c === void 0 ? void 0 : _c.reactivesearch_nested) === null || _d === void 0 ? void 0 : _d.reactify_nested_outer);
334
+ response.aggregations.reactivesearch_nested = (0, hooks_1.replaceDocCountWithParent)((_d = (_c = response === null || response === void 0 ? void 0 : response.aggregations) === null || _c === void 0 ? void 0 : _c.reactivesearch_nested) === null || _d === void 0 ? void 0 : _d.reactify_nested_outer);
303
335
  }
304
336
  return response;
305
337
  }),
@@ -349,12 +381,7 @@ const getPropsResults = (options) => {
349
381
  infiniteScroll: ((_e = options.filterGroup) === null || _e === void 0 ? void 0 : _e.paginationType) === "infinite_scroll",
350
382
  renderNoResults: () => null, // always use only render, otherwise both are shown
351
383
  source: search_internals_1.ReactiveList,
352
- // defaultQuery: () => ({
353
- // sort: ["_score"],
354
- // query: {
355
- // match_all: {}
356
- // }
357
- // })
384
+ onData: options.onData,
358
385
  };
359
386
  };
360
387
  exports.getPropsResults = getPropsResults;
@@ -479,15 +506,13 @@ const getPropsShared = (options, filterGroupOption) => {
479
506
  return search_internals_1.ReactiveComponent;
480
507
  }
481
508
  if (filterGroupOption.displayType === "single") {
482
- if (filterGroupOption.displayView === "range") {
509
+ if (filterGroupOption.displayView === "range")
483
510
  return search_internals_1.SingleRange;
484
- }
485
511
  return search_internals_1.SingleList;
486
512
  }
487
513
  if (filterGroupOption.displayType === "multi") {
488
- if (filterGroupOption.displayView === "range") {
514
+ if (filterGroupOption.displayView === "range")
489
515
  return search_internals_1.MultiRange;
490
- }
491
516
  return search_internals_1.MultiList;
492
517
  }
493
518
  return;
@@ -548,16 +573,8 @@ const getPropsFilterSlider = (filterGroupOption, query, value) => {
548
573
  const filterValue = value !== null && value !== void 0 ? value : JSON.parse((_a = new URLSearchParams(typeof window === "undefined" ? query : window.location.search).get(filterGroupOption.handle)) !== null && _a !== void 0 ? _a : "[0,0]");
549
574
  const defaultQuery = {
550
575
  aggs: {
551
- min: {
552
- min: {
553
- field: filterGroupOption.field,
554
- },
555
- },
556
- max: {
557
- max: {
558
- field: filterGroupOption.field,
559
- },
560
- },
576
+ min: { min: { field: filterGroupOption.field } },
577
+ max: { max: { field: filterGroupOption.field } },
561
578
  },
562
579
  };
563
580
  const customQuery = (() => {
@@ -571,11 +588,7 @@ const getPropsFilterSlider = (filterGroupOption, query, value) => {
571
588
  {
572
589
  bool: {
573
590
  must: [
574
- {
575
- match: {
576
- published: true,
577
- },
578
- },
591
+ { match: { published: true } },
579
592
  {
580
593
  range: {
581
594
  [filterGroupOption.field]: {
@@ -590,13 +603,10 @@ const getPropsFilterSlider = (filterGroupOption, query, value) => {
590
603
  },
591
604
  ],
592
605
  },
593
- }
606
+ },
594
607
  };
595
608
  })();
596
- return {
597
- defaultQuery,
598
- customQuery,
599
- };
609
+ return { defaultQuery, customQuery };
600
610
  };
601
611
  exports.getPropsFilterSlider = getPropsFilterSlider;
602
612
  //# sourceMappingURL=props.js.map