@zengenti/contensis-react-base 3.0.0-beta.52 → 3.0.0-beta.55
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/cjs/forms.js +4114 -195
- package/cjs/forms.js.map +1 -1
- package/cjs/search.js +264 -131
- package/cjs/search.js.map +1 -1
- package/esm/forms.js +4114 -198
- package/esm/forms.js.map +1 -1
- package/esm/search.js +264 -132
- package/esm/search.js.map +1 -1
- package/models/forms/index.d.ts +2 -0
- package/models/search/hooks/useFacets.hook.d.ts +3 -0
- package/models/search/index.d.ts +1 -0
- package/models/search/models/SearchProps.d.ts +23 -5
- package/models/search/redux/selectors.d.ts +7 -5
- package/package-lock.json +114 -143
- package/package.json +1 -1
package/cjs/search.js
CHANGED
|
@@ -249,22 +249,23 @@ const getImmutableOrJS = (state, stateKey, fallbackValue, returnType = globalThi
|
|
|
249
249
|
};
|
|
250
250
|
|
|
251
251
|
const getSearchContext = state => getImmutableOrJS(state, ['search', 'context'], Context$1.facets);
|
|
252
|
-
const getCurrent$
|
|
252
|
+
const getCurrent$2 = (state, context = Context$1.facets) => context === Context$1.facets ? getCurrentFacet(state) : getCurrentListing(state);
|
|
253
253
|
const getCurrentFacet = state => getImmutableOrJS(state, ['search', 'currentFacet']);
|
|
254
254
|
const getCurrentListing = state => getImmutableOrJS(state, ['search', 'currentListing']);
|
|
255
|
-
const getCurrentTab = state => getImmutableOrJS(state, ['search', Context$1.facets, getCurrentFacet(state), 'tabId'], 0);
|
|
255
|
+
const getCurrentTab$1 = state => getImmutableOrJS(state, ['search', Context$1.facets, getCurrentFacet(state), 'tabId'], 0);
|
|
256
256
|
const getFacets = (state, returnType) => getImmutableOrJS(state, ['search', Context$1.facets], {}, returnType);
|
|
257
|
-
const getTabFacets = state => Object.fromEntries(Object.entries(getFacets(state, 'js')).filter(([key]) => getImmutableOrJS(getFacets(state), [key, 'tabId'], 0) === getCurrentTab(state)));
|
|
258
|
-
const getFacetTitles = state => Object.entries(getFacets(state, 'js')).map(([key, facet = {}]) => {
|
|
257
|
+
const getTabFacets$1 = state => Object.fromEntries(Object.entries(getFacets(state, 'js')).filter(([key]) => getImmutableOrJS(getFacets(state), [key, 'tabId'], 0) === getCurrentTab$1(state)));
|
|
258
|
+
const getFacetTitles$1 = state => Object.entries(getFacets(state, 'js')).map(([key, facet = {}]) => {
|
|
259
259
|
var _facet$pagingInfo;
|
|
260
260
|
|
|
261
261
|
return {
|
|
262
|
+
isSelected: getCurrentFacet(state) === key,
|
|
262
263
|
key,
|
|
263
264
|
title: facet.title,
|
|
264
265
|
totalCount: (_facet$pagingInfo = facet.pagingInfo) === null || _facet$pagingInfo === void 0 ? void 0 : _facet$pagingInfo.totalCount
|
|
265
266
|
};
|
|
266
267
|
});
|
|
267
|
-
const getFacet = (state, facetName = '', context = Context$1.facets, returnType) => {
|
|
268
|
+
const getFacet$1 = (state, facetName = '', context = Context$1.facets, returnType) => {
|
|
268
269
|
const currentFacet = facetName || getCurrentFacet(state);
|
|
269
270
|
return getImmutableOrJS(state, ['search', context, currentFacet], {}, returnType);
|
|
270
271
|
};
|
|
@@ -273,9 +274,9 @@ const getListing$1 = (state, listing = '') => {
|
|
|
273
274
|
return getImmutableOrJS(state, ['search', Context$1.listings, currentListing], {});
|
|
274
275
|
};
|
|
275
276
|
const getFilters = (state, facet, context = Context$1.facets, returnType) => {
|
|
276
|
-
return getImmutableOrJS(state, ['search', context, facet || getCurrent$
|
|
277
|
+
return getImmutableOrJS(state, ['search', context, facet || getCurrent$2(state, context), 'filters'], {}, returnType);
|
|
277
278
|
};
|
|
278
|
-
const getRenderableFilters$
|
|
279
|
+
const getRenderableFilters$2 = (state, facet = '', context = Context$1.facets) => Object.fromEntries(Object.entries(getFilters(state, facet, context, 'js')).filter(([, f = {}]) => typeof f.renderable !== 'boolean' ? true : f.renderable));
|
|
279
280
|
const getFiltersToLoad = (state, facet, context = Context$1.facets, returnType) => {
|
|
280
281
|
const filters = getFilters(state, facet, context, returnType);
|
|
281
282
|
const loadedFilters = Object.entries(filters).map(([key, f = {}]) => [key, (f.items || []).filter(i => {
|
|
@@ -297,45 +298,45 @@ const getSelectedFilters = (state, facet = '', context = Context$1.facets, retur
|
|
|
297
298
|
return fromJS(selectedFilters);
|
|
298
299
|
};
|
|
299
300
|
const getResults = (state, current = '', context = Context$1.facets, returnType) => {
|
|
300
|
-
return getImmutableOrJS(state, ['search', context, current || getCurrent$
|
|
301
|
+
return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'results'], [], returnType);
|
|
301
302
|
};
|
|
302
303
|
const getIsInternalPaging = (state, current, context = Context$1.facets) => {
|
|
303
|
-
return getImmutableOrJS(state, ['search', context, current || getCurrent$
|
|
304
|
+
return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'queryParams', 'internalPaging'], false);
|
|
304
305
|
};
|
|
305
306
|
const getIsLoaded = (state, context = Context$1.facets, facet) => {
|
|
306
|
-
return !!getImmutableOrJS(state, ['search', context, facet || getCurrent$
|
|
307
|
+
return !!getImmutableOrJS(state, ['search', context, facet || getCurrent$2(state, context), 'queryDuration'], 0);
|
|
307
308
|
};
|
|
308
|
-
const getIsLoading$
|
|
309
|
-
return getImmutableOrJS(state, ['search', context, facet || getCurrent$
|
|
309
|
+
const getIsLoading$2 = (state, context = Context$1.facets, facet) => {
|
|
310
|
+
return getImmutableOrJS(state, ['search', context, facet || getCurrent$2(state, context), 'entries', 'isLoading']);
|
|
310
311
|
};
|
|
311
312
|
const getIsSsr = state => getImmutableOrJS(state, ['search', 'config', 'ssr'], false);
|
|
312
|
-
const getFeaturedResults$
|
|
313
|
-
return getImmutableOrJS(state, ['search', context, current || getCurrent$
|
|
313
|
+
const getFeaturedResults$2 = (state, current = '', context = Context$1.facets, returnType) => {
|
|
314
|
+
return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'featuredResults'], [], returnType);
|
|
314
315
|
};
|
|
315
316
|
const getPaging = (state, current = '', context = Context$1.facets, returnType) => {
|
|
316
|
-
return getImmutableOrJS(state, ['search', context, current || getCurrent$
|
|
317
|
+
return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'pagingInfo'], {}, returnType);
|
|
317
318
|
};
|
|
318
|
-
const getPageIndex$
|
|
319
|
-
return getImmutableOrJS(state, ['search', context, current || getCurrent$
|
|
319
|
+
const getPageIndex$2 = (state, current = '', context = Context$1.facets) => {
|
|
320
|
+
return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'pagingInfo', 'pageIndex']);
|
|
320
321
|
};
|
|
321
322
|
const getPrevPageIndex = (state, current = '', context = Context$1.facets) => {
|
|
322
|
-
return getImmutableOrJS(state, ['search', context, current || getCurrent$
|
|
323
|
+
return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'pagingInfo', 'prevPageIndex']);
|
|
323
324
|
};
|
|
324
|
-
const getPageIsLoading$
|
|
325
|
-
return getImmutableOrJS(state, ['search', context, current || getCurrent$
|
|
325
|
+
const getPageIsLoading$2 = (state, current = '', context = Context$1.facets) => {
|
|
326
|
+
return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'pagingInfo', 'isLoading']);
|
|
326
327
|
};
|
|
327
328
|
const getPagesLoaded = (state, current = '', context = Context$1.facets) => {
|
|
328
|
-
return getImmutableOrJS(state, ['search', context, current || getCurrent$
|
|
329
|
+
return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'pagingInfo', 'pagesLoaded'], [], 'js');
|
|
329
330
|
};
|
|
330
|
-
const getTotalCount = (state, current = '', context = Context$1.facets) => {
|
|
331
|
-
return getImmutableOrJS(state, ['search', context, current || getCurrent$
|
|
331
|
+
const getTotalCount$1 = (state, current = '', context = Context$1.facets) => {
|
|
332
|
+
return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'pagingInfo', 'totalCount']);
|
|
332
333
|
};
|
|
333
|
-
const getSearchTerm$
|
|
334
|
+
const getSearchTerm$2 = state => getImmutableOrJS(state, ['search', 'term']);
|
|
334
335
|
const getSearchTabs = (state, returnType) => getImmutableOrJS(state, ['search', 'tabs'], [], returnType);
|
|
335
336
|
const getQueryParams = (state, current = '', context = Context$1.facets) => {
|
|
336
|
-
return getImmutableOrJS(state, ['search', context, current || getCurrent$
|
|
337
|
+
return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'queryParams'], {}, 'js');
|
|
337
338
|
};
|
|
338
|
-
const getQueryParameter$
|
|
339
|
+
const getQueryParameter$2 = ({
|
|
339
340
|
state,
|
|
340
341
|
facet,
|
|
341
342
|
context = Context$1.facets
|
|
@@ -343,12 +344,12 @@ const getQueryParameter$1 = ({
|
|
|
343
344
|
return getImmutableOrJS(getQueryParams(state, facet, context), key, ifnull, 'js');
|
|
344
345
|
};
|
|
345
346
|
const getCustomApi = (state, current, context = Context$1.facets, returnType) => {
|
|
346
|
-
return getImmutableOrJS(state, ['search', context, current || getCurrent$
|
|
347
|
+
return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'customApi'], null, returnType);
|
|
347
348
|
};
|
|
348
349
|
const getCustomEnv = (state, current, context = Context$1.facets) => {
|
|
349
|
-
return getImmutableOrJS(state, ['search', context, current || getCurrent$
|
|
350
|
+
return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'env']);
|
|
350
351
|
};
|
|
351
|
-
const getTabsAndFacets = (state, returnType) => {
|
|
352
|
+
const getTabsAndFacets$1 = (state, returnType) => {
|
|
352
353
|
const tabs = getSearchTabs(state, 'js');
|
|
353
354
|
const facets = getFacets(state, 'js');
|
|
354
355
|
const tabsAndFacets = (tabs || []).map((tab = {}) => {
|
|
@@ -368,12 +369,12 @@ const getTabsAndFacets = (state, returnType) => {
|
|
|
368
369
|
const fromJS = makeFromJS(returnType);
|
|
369
370
|
return fromJS(tabsAndFacets);
|
|
370
371
|
};
|
|
371
|
-
const getSearchTotalCount = state => {
|
|
372
|
-
const tabsAndFacets = getTabsAndFacets(state, 'js');
|
|
372
|
+
const getSearchTotalCount$1 = state => {
|
|
373
|
+
const tabsAndFacets = getTabsAndFacets$1(state, 'js');
|
|
373
374
|
const wholeSearchTotal = tabsAndFacets.map((t = {}) => t.totalCount).reduce((a, b) => a + b, 0);
|
|
374
375
|
return wholeSearchTotal;
|
|
375
376
|
};
|
|
376
|
-
const getFacetsTotalCount = state => {
|
|
377
|
+
const getFacetsTotalCount$1 = state => {
|
|
377
378
|
const facets = getFacets(state);
|
|
378
379
|
const wholeSearchTotal = Object.entries(facets).map(([, t = {}]) => {
|
|
379
380
|
var _t$pagingInfo;
|
|
@@ -385,67 +386,67 @@ const getFacetsTotalCount = state => {
|
|
|
385
386
|
|
|
386
387
|
const selectFacets = {
|
|
387
388
|
getCurrent: getCurrentFacet,
|
|
388
|
-
getCurrentTab,
|
|
389
|
+
getCurrentTab: getCurrentTab$1,
|
|
389
390
|
getCustomApi,
|
|
390
391
|
getCustomEnv,
|
|
391
|
-
getFacet,
|
|
392
|
-
getFacetTitles,
|
|
392
|
+
getFacet: getFacet$1,
|
|
393
|
+
getFacetTitles: getFacetTitles$1,
|
|
393
394
|
getFacets,
|
|
394
|
-
getFacetsTotalCount,
|
|
395
|
-
getFeaturedResults: getFeaturedResults$
|
|
395
|
+
getFacetsTotalCount: getFacetsTotalCount$1,
|
|
396
|
+
getFeaturedResults: getFeaturedResults$2,
|
|
396
397
|
getFilters,
|
|
397
398
|
getFiltersToLoad,
|
|
398
399
|
getIsLoaded,
|
|
399
|
-
getIsLoading: getIsLoading$
|
|
400
|
-
getPageIndex: getPageIndex$
|
|
401
|
-
getPageIsLoading: getPageIsLoading$
|
|
400
|
+
getIsLoading: getIsLoading$2,
|
|
401
|
+
getPageIndex: getPageIndex$2,
|
|
402
|
+
getPageIsLoading: getPageIsLoading$2,
|
|
402
403
|
getPagesLoaded,
|
|
403
404
|
getPaging,
|
|
404
405
|
getQueryParams: (state, facet) => getQueryParams(state, facet, Context$1.facets),
|
|
405
406
|
getQueryParameter: ({
|
|
406
407
|
state,
|
|
407
408
|
facet
|
|
408
|
-
}, key, ifnull) => getQueryParameter$
|
|
409
|
+
}, key, ifnull) => getQueryParameter$2({
|
|
409
410
|
state,
|
|
410
411
|
facet,
|
|
411
412
|
context: Context$1.facets
|
|
412
413
|
}, key, ifnull),
|
|
413
|
-
getRenderableFilters: getRenderableFilters$
|
|
414
|
+
getRenderableFilters: getRenderableFilters$2,
|
|
414
415
|
getResults,
|
|
415
|
-
getTabFacets,
|
|
416
|
-
getTabsAndFacets,
|
|
417
|
-
getTotalCount,
|
|
416
|
+
getTabFacets: getTabFacets$1,
|
|
417
|
+
getTabsAndFacets: getTabsAndFacets$1,
|
|
418
|
+
getTotalCount: getTotalCount$1,
|
|
418
419
|
getSearchTabs,
|
|
419
|
-
getSearchTerm: getSearchTerm$
|
|
420
|
-
getSearchTotalCount,
|
|
420
|
+
getSearchTerm: getSearchTerm$2,
|
|
421
|
+
getSearchTotalCount: getSearchTotalCount$1,
|
|
421
422
|
getSelectedFilters
|
|
422
423
|
}; // An exported copy of the relevant selectors pre-scoped to a listing context
|
|
423
424
|
|
|
424
425
|
const selectListing = {
|
|
425
426
|
getCurrent: getCurrentListing,
|
|
426
|
-
getFeaturedResults: (state, listing = '') => getFeaturedResults$
|
|
427
|
+
getFeaturedResults: (state, listing = '') => getFeaturedResults$2(state, listing, Context$1.listings, 'js'),
|
|
427
428
|
getFilters: (state, listing = '') => getFilters(state, listing, Context$1.listings, 'js'),
|
|
428
429
|
getFiltersToLoad: (state, listing = '') => getFiltersToLoad(state, listing, Context$1.listings),
|
|
429
430
|
getListing: getListing$1,
|
|
430
431
|
getIsLoaded: state => getIsLoaded(state, Context$1.listings),
|
|
431
|
-
getIsLoading: state => getIsLoading$
|
|
432
|
-
getPageIndex: (state, listing = '') => getPageIndex$
|
|
432
|
+
getIsLoading: state => getIsLoading$2(state, Context$1.listings),
|
|
433
|
+
getPageIndex: (state, listing = '') => getPageIndex$2(state, listing, Context$1.listings),
|
|
433
434
|
getPaging: (state, listing = '') => getPaging(state, listing, Context$1.listings, 'js'),
|
|
434
|
-
getPageIsLoading: (state, listing = '') => getPageIsLoading$
|
|
435
|
+
getPageIsLoading: (state, listing = '') => getPageIsLoading$2(state, listing, Context$1.listings),
|
|
435
436
|
getPagesLoaded: (state, listing = '') => getPagesLoaded(state, listing, Context$1.listings),
|
|
436
437
|
getQueryParams: (state, listing = '') => getQueryParams(state, listing, Context$1.listings),
|
|
437
438
|
getQueryParameter: ({
|
|
438
439
|
state,
|
|
439
440
|
facet
|
|
440
|
-
}, key, ifnull) => getQueryParameter$
|
|
441
|
+
}, key, ifnull) => getQueryParameter$2({
|
|
441
442
|
state,
|
|
442
443
|
facet,
|
|
443
444
|
context: Context$1.listings
|
|
444
445
|
}, key, ifnull),
|
|
445
|
-
getRenderableFilters: (state, listing = '') => getRenderableFilters$
|
|
446
|
+
getRenderableFilters: (state, listing = '') => getRenderableFilters$2(state, listing, Context$1.listings),
|
|
446
447
|
getResults: (state, listing = '') => getResults(state, listing, Context$1.listings, 'js'),
|
|
447
|
-
getSearchTerm: getSearchTerm$
|
|
448
|
-
getTotalCount: (state, listing = '') => getTotalCount(state, listing, Context$1.listings),
|
|
448
|
+
getSearchTerm: getSearchTerm$2,
|
|
449
|
+
getTotalCount: (state, listing = '') => getTotalCount$1(state, listing, Context$1.listings),
|
|
449
450
|
getSelectedFilters: (state, listing = '') => getSelectedFilters(state, listing, Context$1.listings, 'js')
|
|
450
451
|
};
|
|
451
452
|
const selectCurrentPath = state => getImmutableOrJS(state, ['routing', 'currentPath']);
|
|
@@ -455,40 +456,40 @@ const selectVersionStatus = state => getImmutableOrJS(state, ['version', 'conten
|
|
|
455
456
|
var selectors = /*#__PURE__*/Object.freeze({
|
|
456
457
|
__proto__: null,
|
|
457
458
|
getSearchContext: getSearchContext,
|
|
458
|
-
getCurrent: getCurrent$
|
|
459
|
+
getCurrent: getCurrent$2,
|
|
459
460
|
getCurrentFacet: getCurrentFacet,
|
|
460
461
|
getCurrentListing: getCurrentListing,
|
|
461
|
-
getCurrentTab: getCurrentTab,
|
|
462
|
+
getCurrentTab: getCurrentTab$1,
|
|
462
463
|
getFacets: getFacets,
|
|
463
|
-
getTabFacets: getTabFacets,
|
|
464
|
-
getFacetTitles: getFacetTitles,
|
|
465
|
-
getFacet: getFacet,
|
|
464
|
+
getTabFacets: getTabFacets$1,
|
|
465
|
+
getFacetTitles: getFacetTitles$1,
|
|
466
|
+
getFacet: getFacet$1,
|
|
466
467
|
getListing: getListing$1,
|
|
467
468
|
getFilters: getFilters,
|
|
468
|
-
getRenderableFilters: getRenderableFilters$
|
|
469
|
+
getRenderableFilters: getRenderableFilters$2,
|
|
469
470
|
getFiltersToLoad: getFiltersToLoad,
|
|
470
471
|
getSelectedFilters: getSelectedFilters,
|
|
471
472
|
getResults: getResults,
|
|
472
473
|
getIsInternalPaging: getIsInternalPaging,
|
|
473
474
|
getIsLoaded: getIsLoaded,
|
|
474
|
-
getIsLoading: getIsLoading$
|
|
475
|
+
getIsLoading: getIsLoading$2,
|
|
475
476
|
getIsSsr: getIsSsr,
|
|
476
|
-
getFeaturedResults: getFeaturedResults$
|
|
477
|
+
getFeaturedResults: getFeaturedResults$2,
|
|
477
478
|
getPaging: getPaging,
|
|
478
|
-
getPageIndex: getPageIndex$
|
|
479
|
+
getPageIndex: getPageIndex$2,
|
|
479
480
|
getPrevPageIndex: getPrevPageIndex,
|
|
480
|
-
getPageIsLoading: getPageIsLoading$
|
|
481
|
+
getPageIsLoading: getPageIsLoading$2,
|
|
481
482
|
getPagesLoaded: getPagesLoaded,
|
|
482
|
-
getTotalCount: getTotalCount,
|
|
483
|
-
getSearchTerm: getSearchTerm$
|
|
483
|
+
getTotalCount: getTotalCount$1,
|
|
484
|
+
getSearchTerm: getSearchTerm$2,
|
|
484
485
|
getSearchTabs: getSearchTabs,
|
|
485
486
|
getQueryParams: getQueryParams,
|
|
486
|
-
getQueryParameter: getQueryParameter$
|
|
487
|
+
getQueryParameter: getQueryParameter$2,
|
|
487
488
|
getCustomApi: getCustomApi,
|
|
488
489
|
getCustomEnv: getCustomEnv,
|
|
489
|
-
getTabsAndFacets: getTabsAndFacets,
|
|
490
|
-
getSearchTotalCount: getSearchTotalCount,
|
|
491
|
-
getFacetsTotalCount: getFacetsTotalCount,
|
|
490
|
+
getTabsAndFacets: getTabsAndFacets$1,
|
|
491
|
+
getSearchTotalCount: getSearchTotalCount$1,
|
|
492
|
+
getFacetsTotalCount: getFacetsTotalCount$1,
|
|
492
493
|
selectFacets: selectFacets,
|
|
493
494
|
selectListing: selectListing,
|
|
494
495
|
selectCurrentPath: selectCurrentPath,
|
|
@@ -508,27 +509,27 @@ const withSearch = mappers => SearchComponent => {
|
|
|
508
509
|
const mapStateToProps = state => {
|
|
509
510
|
return {
|
|
510
511
|
currentFacet: getCurrentFacet(state),
|
|
511
|
-
currentPageIndex: getPageIndex$
|
|
512
|
-
currentTabIndex: getCurrentTab(state),
|
|
513
|
-
facet: getFacet(state),
|
|
514
|
-
facets: getTabFacets(state),
|
|
515
|
-
facetsTotalCount: getFacetsTotalCount(state),
|
|
516
|
-
facetTitles: getFacetTitles(state),
|
|
517
|
-
featuredResults: getFeaturedResults$
|
|
518
|
-
filters: getRenderableFilters$
|
|
519
|
-
isLoading: getIsLoading$
|
|
512
|
+
currentPageIndex: getPageIndex$2(state),
|
|
513
|
+
currentTabIndex: getCurrentTab$1(state),
|
|
514
|
+
facet: getFacet$1(state),
|
|
515
|
+
facets: getTabFacets$1(state),
|
|
516
|
+
facetsTotalCount: getFacetsTotalCount$1(state),
|
|
517
|
+
facetTitles: getFacetTitles$1(state),
|
|
518
|
+
featuredResults: getFeaturedResults$2(state),
|
|
519
|
+
filters: getRenderableFilters$2(state),
|
|
520
|
+
isLoading: getIsLoading$2(state),
|
|
520
521
|
paging: getPaging(state),
|
|
521
|
-
pageIsLoading: getPageIsLoading$
|
|
522
|
+
pageIsLoading: getPageIsLoading$2(state),
|
|
522
523
|
results: getResults(state),
|
|
523
524
|
resultsInfo: (mappers === null || mappers === void 0 ? void 0 : mappers.resultsInfo) && mappers.resultsInfo(state),
|
|
524
|
-
searchTerm: getSearchTerm$
|
|
525
|
-
searchTotalCount: getSearchTotalCount(state),
|
|
525
|
+
searchTerm: getSearchTerm$2(state),
|
|
526
|
+
searchTotalCount: getSearchTotalCount$1(state),
|
|
526
527
|
selectedFilters: getSelectedFilters(state),
|
|
527
|
-
sortOrder: getQueryParameter$
|
|
528
|
+
sortOrder: getQueryParameter$2({
|
|
528
529
|
state
|
|
529
530
|
}, 'dynamicOrderBy', []),
|
|
530
|
-
tabsAndFacets: getTabsAndFacets(state),
|
|
531
|
-
totalCount: getTotalCount(state)
|
|
531
|
+
tabsAndFacets: getTabsAndFacets$1(state),
|
|
532
|
+
totalCount: getTotalCount$1(state)
|
|
532
533
|
};
|
|
533
534
|
};
|
|
534
535
|
|
|
@@ -992,12 +993,15 @@ const equalToOrIn = (field, value, operator = 'equalTo') => {
|
|
|
992
993
|
|
|
993
994
|
if (Array.isArray(value)) {
|
|
994
995
|
if (operator === 'equalTo' || operator === 'in') return [contensisCoreApi.Op.in(field, ...value)];
|
|
995
|
-
|
|
996
|
+
const expressions = value.map(innerValue => {
|
|
997
|
+
var _between, _distanceWithin;
|
|
998
|
+
|
|
996
999
|
switch (operator) {
|
|
997
1000
|
case 'between':
|
|
1001
|
+
return (_between = between(field, innerValue)) === null || _between === void 0 ? void 0 : _between[0];
|
|
1002
|
+
|
|
998
1003
|
case 'distanceWithin':
|
|
999
|
-
|
|
1000
|
-
return contensisCoreApi.Op.equalTo(field, innerValue);
|
|
1004
|
+
return (_distanceWithin = distanceWithin(field, innerValue)) === null || _distanceWithin === void 0 ? void 0 : _distanceWithin[0];
|
|
1001
1005
|
|
|
1002
1006
|
case 'exists':
|
|
1003
1007
|
return contensisCoreApi.Op.exists(field, innerValue);
|
|
@@ -1009,18 +1013,20 @@ const equalToOrIn = (field, value, operator = 'equalTo') => {
|
|
|
1009
1013
|
default:
|
|
1010
1014
|
return contensisCoreApi.Op[operator](field, innerValue);
|
|
1011
1015
|
}
|
|
1012
|
-
})
|
|
1016
|
+
});
|
|
1017
|
+
return (expressions === null || expressions === void 0 ? void 0 : expressions.length) > 1 ? [contensisCoreApi.Op.or(...expressions)] : expressions || [];
|
|
1013
1018
|
}
|
|
1014
1019
|
|
|
1015
1020
|
switch (operator) {
|
|
1016
1021
|
case 'between':
|
|
1022
|
+
return between(field, value);
|
|
1023
|
+
|
|
1017
1024
|
case 'distanceWithin':
|
|
1018
|
-
|
|
1019
|
-
return [contensisCoreApi.Op.equalTo(field, value)];
|
|
1025
|
+
return distanceWithin(field, value);
|
|
1020
1026
|
|
|
1021
1027
|
case 'freeText':
|
|
1022
1028
|
// TODO: Potentially needs further implementation of new options
|
|
1023
|
-
return [contensisCoreApi.Op
|
|
1029
|
+
return [contensisCoreApi.Op.freeText(field, value, false, undefined)];
|
|
1024
1030
|
|
|
1025
1031
|
default:
|
|
1026
1032
|
return [contensisCoreApi.Op[operator](field, value)];
|
|
@@ -1046,6 +1052,26 @@ const between = (field, value) => {
|
|
|
1046
1052
|
const op = handle(value);
|
|
1047
1053
|
return op ? [op] : [];
|
|
1048
1054
|
};
|
|
1055
|
+
|
|
1056
|
+
const distanceWithin = (field, value) => {
|
|
1057
|
+
const handle = distanceValue => {
|
|
1058
|
+
const valArr = distanceValue.split(' ');
|
|
1059
|
+
|
|
1060
|
+
if (valArr.length > 1) {
|
|
1061
|
+
const [lat, lon] = valArr;
|
|
1062
|
+
return contensisCoreApi.Op.distanceWithin(field, Number(lat), Number(lon), (valArr === null || valArr === void 0 ? void 0 : valArr[2]) || '10mi');
|
|
1063
|
+
} else {
|
|
1064
|
+
// eslint-disable-next-line no-console
|
|
1065
|
+
console.log(`[search] You have supplied only one value to a "distanceWithin" operator which must be made up of "lat,lon,distance". Your supplied value "${valArr.length && valArr[0]}" has been discarded.`);
|
|
1066
|
+
return false;
|
|
1067
|
+
}
|
|
1068
|
+
};
|
|
1069
|
+
|
|
1070
|
+
if (value.length === 0) return [];
|
|
1071
|
+
if (Array.isArray(value)) return [contensisCoreApi.Op.or(...value.map(handle).filter(bc => bc !== false))];
|
|
1072
|
+
const op = handle(value);
|
|
1073
|
+
return op ? [op] : [];
|
|
1074
|
+
};
|
|
1049
1075
|
/**
|
|
1050
1076
|
* Accept HTTP style objects and map them to
|
|
1051
1077
|
* their equivalent JS client "Op" expressions
|
|
@@ -1086,9 +1112,7 @@ const customWhereExpressions = where => {
|
|
|
1086
1112
|
const innerField = value.field; // Map the expression when we've looped and scoped to
|
|
1087
1113
|
// the second property inside the clause
|
|
1088
1114
|
|
|
1089
|
-
if (notIdx === 1)
|
|
1090
|
-
expression = innerOperator === 'between' ? contensisCoreApi.Op.not(contensisCoreApi.Op[innerOperator](innerField, innerValue[0], innerValue[1])) : contensisCoreApi.Op.not(contensisCoreApi.Op[innerOperator](innerField, innerValue));
|
|
1091
|
-
}
|
|
1115
|
+
if (notIdx === 1) expression = contensisCoreApi.Op.not(makeJsExpression(innerOperator, innerField, innerValue));
|
|
1092
1116
|
});
|
|
1093
1117
|
}
|
|
1094
1118
|
} // Map the expression when we've looped and scoped to
|
|
@@ -1097,17 +1121,17 @@ const customWhereExpressions = where => {
|
|
|
1097
1121
|
|
|
1098
1122
|
operator = Object.keys(clause).find(clauseKey => !['field', 'weight'].includes(clauseKey));
|
|
1099
1123
|
|
|
1100
|
-
if (idx === 1
|
|
1101
|
-
|
|
1102
|
-
// operator !== 'between' &&
|
|
1103
|
-
operator !== 'distanceWithin') {
|
|
1104
|
-
expression = operator === 'freeText' || operator === 'contains' ? contensisCoreApi.Op[operator](field, value) : operator === 'in' ? contensisCoreApi.Op[operator](field, ...value) : operator === 'exists' ? contensisCoreApi.Op[operator](field, value) : operator === 'between' ? contensisCoreApi.Op[operator](field, value[0], value[1]) : contensisCoreApi.Op[operator](field, value);
|
|
1124
|
+
if (idx === 1) {
|
|
1125
|
+
expression = makeJsExpression(operator, field, value);
|
|
1105
1126
|
if (typeof weight === 'number') expression = expression.weight(weight);
|
|
1106
1127
|
}
|
|
1107
1128
|
});
|
|
1108
1129
|
return expression;
|
|
1109
1130
|
});
|
|
1110
1131
|
};
|
|
1132
|
+
|
|
1133
|
+
const makeJsExpression = (operator, field, value) => operator === 'freeText' || operator === 'contains' ? contensisCoreApi.Op[operator](field, value) : operator === 'in' ? contensisCoreApi.Op[operator](field, ...value) : operator === 'exists' ? contensisCoreApi.Op[operator](field, value) : operator === 'between' ? contensisCoreApi.Op[operator](field, value[0], value[1]) : operator === 'distanceWithin' ? contensisCoreApi.Op[operator](field, value === null || value === void 0 ? void 0 : value.lat, value === null || value === void 0 ? void 0 : value.lon, value === null || value === void 0 ? void 0 : value.distance) : contensisCoreApi.Op[operator](field, value);
|
|
1134
|
+
|
|
1111
1135
|
const termExpressions = (searchTerm, weightedSearchFields) => {
|
|
1112
1136
|
if (searchTerm && weightedSearchFields && weightedSearchFields.length > 0) {
|
|
1113
1137
|
// Extract any phrases in quotes to array
|
|
@@ -1233,7 +1257,7 @@ const searchUriTemplate = {
|
|
|
1233
1257
|
const currentSearch = !term && getImmutableOrJS(state, ['routing', 'location', 'search']);
|
|
1234
1258
|
const currentQs = removeEmptyAttributes(queryString.parse(currentSearch));
|
|
1235
1259
|
if (orderBy) currentQs.orderBy = orderBy;
|
|
1236
|
-
const searchTerm = getSearchTerm$
|
|
1260
|
+
const searchTerm = getSearchTerm$2(state); // Merge the stateFilters with any current qs to build the new qs
|
|
1237
1261
|
|
|
1238
1262
|
const mergedSearch = removeEmptyAttributes({ ...merge__default["default"](currentQs, stateFilters),
|
|
1239
1263
|
term: searchTerm
|
|
@@ -1420,10 +1444,10 @@ const mapFiltersToFilterExpression = (filters, selectedFilters) => {
|
|
|
1420
1444
|
};
|
|
1421
1445
|
|
|
1422
1446
|
const queryParamsTemplate = {
|
|
1423
|
-
assetTypes: root => getQueryParameter$
|
|
1424
|
-
contentTypeIds: root => getQueryParameter$
|
|
1425
|
-
customWhere: root => getQueryParameter$
|
|
1426
|
-
dynamicOrderBy: root => getQueryParameter$
|
|
1447
|
+
assetTypes: root => getQueryParameter$2(root, 'assetTypes', []),
|
|
1448
|
+
contentTypeIds: root => getQueryParameter$2(root, 'contentTypeIds', []),
|
|
1449
|
+
customWhere: root => getQueryParameter$2(root, 'customWhere', []),
|
|
1450
|
+
dynamicOrderBy: root => getQueryParameter$2(root, 'dynamicOrderBy', []),
|
|
1427
1451
|
env: ({
|
|
1428
1452
|
state,
|
|
1429
1453
|
facet,
|
|
@@ -1438,8 +1462,8 @@ const queryParamsTemplate = {
|
|
|
1438
1462
|
if (excludeIds) return Array.isArray(excludeIds) ? excludeIds : excludeIds.split(',').map(id => id.trim());
|
|
1439
1463
|
return null;
|
|
1440
1464
|
},
|
|
1441
|
-
featuredResults: root => getQueryParameter$
|
|
1442
|
-
fields: root => getQueryParameter$
|
|
1465
|
+
featuredResults: root => getQueryParameter$2(root, 'featuredResults', null),
|
|
1466
|
+
fields: root => getQueryParameter$2(root, 'fields', []),
|
|
1443
1467
|
filters: ({
|
|
1444
1468
|
state,
|
|
1445
1469
|
facet,
|
|
@@ -1451,28 +1475,28 @@ const queryParamsTemplate = {
|
|
|
1451
1475
|
const filterParams = mapFiltersToFilterExpression(stateFilters, selectedFilters);
|
|
1452
1476
|
return filterParams;
|
|
1453
1477
|
},
|
|
1454
|
-
includeInSearchFields: root => getQueryParameter$
|
|
1478
|
+
includeInSearchFields: root => getQueryParameter$2(root, 'includeInSearch', []),
|
|
1455
1479
|
internalPageIndex: ({
|
|
1456
1480
|
action,
|
|
1457
1481
|
state
|
|
1458
|
-
}) => getPageIndex$
|
|
1459
|
-
internalPaging: root => getQueryParameter$
|
|
1482
|
+
}) => getPageIndex$2(state, '', action.context),
|
|
1483
|
+
internalPaging: root => getQueryParameter$2(root, 'internalPaging', false),
|
|
1460
1484
|
languages: ({
|
|
1461
1485
|
action
|
|
1462
1486
|
}) => action.defaultLang ? [action.defaultLang] : [],
|
|
1463
|
-
linkDepth: root => getQueryParameter$
|
|
1464
|
-
loadMorePaging: root => getQueryParameter$
|
|
1465
|
-
orderBy: root => getQueryParameter$
|
|
1487
|
+
linkDepth: root => getQueryParameter$2(root, 'linkDepth', 0),
|
|
1488
|
+
loadMorePaging: root => getQueryParameter$2(root, 'loadMorePaging', false),
|
|
1489
|
+
orderBy: root => getQueryParameter$2(root, 'orderBy', []),
|
|
1466
1490
|
pageIndex: root => {
|
|
1467
1491
|
const {
|
|
1468
1492
|
action,
|
|
1469
1493
|
state
|
|
1470
1494
|
} = root;
|
|
1471
|
-
if (getQueryParameter$
|
|
1495
|
+
if (getQueryParameter$2(root, 'internalPaging', false)) return 0;
|
|
1472
1496
|
if (action.type === UPDATE_PAGE_INDEX) return action.params.pageIndex;
|
|
1473
|
-
return !action.preload ? getPageIndex$
|
|
1497
|
+
return !action.preload ? getPageIndex$2(state, action.facet, action.context) : 0;
|
|
1474
1498
|
},
|
|
1475
|
-
pageSize: root => getQueryParameter$
|
|
1499
|
+
pageSize: root => getQueryParameter$2(root, 'pageSize'),
|
|
1476
1500
|
pagesLoaded: ({
|
|
1477
1501
|
state,
|
|
1478
1502
|
facet,
|
|
@@ -1490,9 +1514,9 @@ const queryParamsTemplate = {
|
|
|
1490
1514
|
}) => {
|
|
1491
1515
|
var _getFacet;
|
|
1492
1516
|
|
|
1493
|
-
return ((_getFacet = getFacet(state, facet, context)) === null || _getFacet === void 0 ? void 0 : _getFacet.projectId) || selectCurrentProject(state);
|
|
1517
|
+
return ((_getFacet = getFacet$1(state, facet, context)) === null || _getFacet === void 0 ? void 0 : _getFacet.projectId) || selectCurrentProject(state);
|
|
1494
1518
|
},
|
|
1495
|
-
searchTerm: root => root.context !== Context$1.minilist || getQueryParameter$
|
|
1519
|
+
searchTerm: root => root.context !== Context$1.minilist || getQueryParameter$2(root, 'useSearchTerm', false) ? getSearchTerm$2(root.state) : '',
|
|
1496
1520
|
selectedFilters: ({
|
|
1497
1521
|
state,
|
|
1498
1522
|
facet,
|
|
@@ -1502,11 +1526,11 @@ const queryParamsTemplate = {
|
|
|
1502
1526
|
state
|
|
1503
1527
|
}) => selectVersionStatus(state),
|
|
1504
1528
|
weightedSearchFields: root => {
|
|
1505
|
-
const wsf = getQueryParameter$
|
|
1529
|
+
const wsf = getQueryParameter$2(root, 'weightedSearchFields', []);
|
|
1506
1530
|
const deduped = wsf.filter((v, i, a) => a.findIndex(t => t.fieldId === v.fieldId) === i);
|
|
1507
1531
|
return deduped; // return wsf;
|
|
1508
1532
|
},
|
|
1509
|
-
webpageTemplates: root => getQueryParameter$
|
|
1533
|
+
webpageTemplates: root => getQueryParameter$2(root, 'webpageTemplates', [])
|
|
1510
1534
|
};
|
|
1511
1535
|
|
|
1512
1536
|
const mapStateToQueryParams = sourceJson => mapJson__default["default"](sourceJson, queryParamsTemplate);
|
|
@@ -1552,8 +1576,8 @@ const runSearch = (action, state, queryParams) => {
|
|
|
1552
1576
|
const facetIsLoaded = defaultLang ? false : getIsLoaded(state, context, facet);
|
|
1553
1577
|
const stateParams = { ...getQueryParams(ogState, facet, context)
|
|
1554
1578
|
};
|
|
1555
|
-
stateParams.pageIndex = getPageIndex$
|
|
1556
|
-
stateParams.searchTerm = getSearchTerm$
|
|
1579
|
+
stateParams.pageIndex = getPageIndex$2(ogState, facet, context);
|
|
1580
|
+
stateParams.searchTerm = getSearchTerm$2(ogState);
|
|
1557
1581
|
|
|
1558
1582
|
if (context === Context$1.facets && ssr || // context === Context.minilist ||
|
|
1559
1583
|
preload || !facetIsLoaded || filterParamsChanged(action) || defaultLang) {
|
|
@@ -1605,8 +1629,8 @@ const debugExecuteSearch = (action, state) => {
|
|
|
1605
1629
|
const [queryParams, runSearch] = generateQueryParams(action, state);
|
|
1606
1630
|
console.log('runSearch', runSearch, 'action', action, 'filterParamsChanged', filterParamsChanged(action, state), 'getIsLoaded(state, context, facet)', getIsLoaded(state, action.context, action.facet));
|
|
1607
1631
|
const stateParams = { ...getQueryParams(action.ogState || state, action.facet, action.context),
|
|
1608
|
-
pageIndex: getPageIndex$
|
|
1609
|
-
searchTerm: getSearchTerm$
|
|
1632
|
+
pageIndex: getPageIndex$2(action.ogState || state, action.facet, action.context),
|
|
1633
|
+
searchTerm: getSearchTerm$2(action.ogState || state)
|
|
1610
1634
|
};
|
|
1611
1635
|
console.log(stateParams, queryParams);
|
|
1612
1636
|
console.log('getSelectedFilters', getSelectedFilters(action.ogState || state, action.facet, action.context, 'js'), 'params', action.params);
|
|
@@ -1702,7 +1726,7 @@ function* doSearch(action) {
|
|
|
1702
1726
|
facet: action.facet || ((_action$params = action.params) === null || _action$params === void 0 ? void 0 : _action$params.facet)
|
|
1703
1727
|
};
|
|
1704
1728
|
|
|
1705
|
-
if (nextAction.facet && (action.config || Object.keys(getFacet(state, nextAction.facet, action.context, 'js')).length > 0)) {
|
|
1729
|
+
if (nextAction.facet && (action.config || Object.keys(getFacet$1(state, nextAction.facet, action.context, 'js')).length > 0)) {
|
|
1706
1730
|
yield effects.put(nextAction); // keep track of this state ref for comparing changes to params later
|
|
1707
1731
|
|
|
1708
1732
|
const ogState = {
|
|
@@ -1730,7 +1754,7 @@ function* loadFilters(action) {
|
|
|
1730
1754
|
context
|
|
1731
1755
|
});
|
|
1732
1756
|
const selectedKeys = yield effects.select(getSelectedFilters, facetKey, context, 'js');
|
|
1733
|
-
const facet = yield effects.select(getFacet, facetKey, context, 'js');
|
|
1757
|
+
const facet = yield effects.select(getFacet$1, facetKey, context, 'js');
|
|
1734
1758
|
const filters = facet.filters || {};
|
|
1735
1759
|
const projectId = facet.projectId;
|
|
1736
1760
|
const filtersToLoadSagas = filters && filtersToLoad.map((filterKey = '') => {
|
|
@@ -1951,7 +1975,7 @@ function* updateCurrentFacet(action) {
|
|
|
1951
1975
|
facet,
|
|
1952
1976
|
mappers
|
|
1953
1977
|
} = action;
|
|
1954
|
-
const pageIndex = yield effects.select(getPageIndex$
|
|
1978
|
+
const pageIndex = yield effects.select(getPageIndex$2, facet);
|
|
1955
1979
|
const uri = yield buildUri({
|
|
1956
1980
|
facet,
|
|
1957
1981
|
pageIndex
|
|
@@ -2026,6 +2050,114 @@ var defaultMappers = {
|
|
|
2026
2050
|
navigate: mapStateToSearchUri
|
|
2027
2051
|
};
|
|
2028
2052
|
|
|
2053
|
+
const {
|
|
2054
|
+
getCurrent: getCurrent$1,
|
|
2055
|
+
getCurrentTab,
|
|
2056
|
+
getFacet,
|
|
2057
|
+
getFacetsTotalCount,
|
|
2058
|
+
getFacetTitles,
|
|
2059
|
+
getFeaturedResults: getFeaturedResults$1,
|
|
2060
|
+
getIsLoading: getIsLoading$1,
|
|
2061
|
+
getPageIndex: getPageIndex$1,
|
|
2062
|
+
getPageIsLoading: getPageIsLoading$1,
|
|
2063
|
+
getQueryParameter: getQueryParameter$1,
|
|
2064
|
+
getRenderableFilters: getRenderableFilters$1,
|
|
2065
|
+
getSearchTerm: getSearchTerm$1,
|
|
2066
|
+
getSearchTotalCount,
|
|
2067
|
+
getTabFacets,
|
|
2068
|
+
getTabsAndFacets,
|
|
2069
|
+
getTotalCount
|
|
2070
|
+
} = selectFacets;
|
|
2071
|
+
|
|
2072
|
+
const makeSelectFacetsProps = () => reselect.createSelector(state => state, (_, mappers) => mappers, (state, mappers) => ({
|
|
2073
|
+
currentFacet: getCurrent$1(state),
|
|
2074
|
+
currentPageIndex: getPageIndex$1(state),
|
|
2075
|
+
currentTabIndex: getCurrentTab(state),
|
|
2076
|
+
facet: getFacet(state),
|
|
2077
|
+
facetTitles: getFacetTitles(state),
|
|
2078
|
+
facets: getTabFacets(state),
|
|
2079
|
+
facetsTotalCount: getFacetsTotalCount(state),
|
|
2080
|
+
featured: getFeaturedResults$1(state),
|
|
2081
|
+
filters: getRenderableFilters$1(state),
|
|
2082
|
+
isLoading: getIsLoading$1(state),
|
|
2083
|
+
pageIsLoading: getPageIsLoading$1(state),
|
|
2084
|
+
paging: getPaging(state, '', Context$1.facets, 'js'),
|
|
2085
|
+
results: getResults(state, '', Context$1.facets, 'js'),
|
|
2086
|
+
resultsInfo: mappers && typeof mappers.resultsInfo === 'function' && mappers.resultsInfo(state),
|
|
2087
|
+
searchTerm: getSearchTerm$1(state),
|
|
2088
|
+
searchTotalCount: getSearchTotalCount(state),
|
|
2089
|
+
selectedFilters: getSelectedFilters(state, '', Context$1.facets, 'js'),
|
|
2090
|
+
sortOrder: getQueryParameter$1({
|
|
2091
|
+
state
|
|
2092
|
+
}, 'dynamicOrderBy', []),
|
|
2093
|
+
tabsAndFacets: getTabsAndFacets(state),
|
|
2094
|
+
totalCount: getTotalCount(state)
|
|
2095
|
+
}));
|
|
2096
|
+
|
|
2097
|
+
const useFacets = ({
|
|
2098
|
+
mappers
|
|
2099
|
+
} = {
|
|
2100
|
+
id: ''
|
|
2101
|
+
}) => {
|
|
2102
|
+
const dispatch = reactRedux.useDispatch();
|
|
2103
|
+
const m = mappers || defaultMappers;
|
|
2104
|
+
const selectListingProps = React.useMemo(makeSelectFacetsProps, [m]);
|
|
2105
|
+
const dispatchProps = {
|
|
2106
|
+
clearFilters: () => dispatch(withMappers(clearFilters$1(), m)),
|
|
2107
|
+
updateCurrentFacet: facet => dispatch(withMappers(updateCurrentFacet$1(facet), m)),
|
|
2108
|
+
updateCurrentTab: id => withMappers(updateCurrentTab$1(id), m),
|
|
2109
|
+
updatePageIndex: pageIndex => dispatch(withMappers(updatePageIndex$1(pageIndex), m)),
|
|
2110
|
+
updateSearchTerm: term => dispatch(withMappers(updateSearchTerm$1(term), m)),
|
|
2111
|
+
updateSelectedFilters: (filter, key, isUnknownItem = false) => dispatch(withMappers(updateSelectedFilters(filter, key, isUnknownItem), m)),
|
|
2112
|
+
updateSortOrder: orderBy => dispatch(withMappers(updateSortOrder$1(orderBy), m))
|
|
2113
|
+
};
|
|
2114
|
+
const {
|
|
2115
|
+
currentFacet,
|
|
2116
|
+
currentPageIndex,
|
|
2117
|
+
currentTabIndex,
|
|
2118
|
+
facet,
|
|
2119
|
+
facets,
|
|
2120
|
+
facetsTotalCount,
|
|
2121
|
+
facetTitles,
|
|
2122
|
+
featured,
|
|
2123
|
+
filters,
|
|
2124
|
+
isLoading,
|
|
2125
|
+
paging,
|
|
2126
|
+
pageIsLoading,
|
|
2127
|
+
results,
|
|
2128
|
+
resultsInfo,
|
|
2129
|
+
searchTerm,
|
|
2130
|
+
searchTotalCount,
|
|
2131
|
+
selectedFilters,
|
|
2132
|
+
sortOrder,
|
|
2133
|
+
tabsAndFacets,
|
|
2134
|
+
totalCount
|
|
2135
|
+
} = reactRedux.useSelector(state => selectListingProps(state, m));
|
|
2136
|
+
return {
|
|
2137
|
+
currentFacet,
|
|
2138
|
+
currentPageIndex,
|
|
2139
|
+
currentTabIndex,
|
|
2140
|
+
facet,
|
|
2141
|
+
facets,
|
|
2142
|
+
facetsTotalCount,
|
|
2143
|
+
facetTitles,
|
|
2144
|
+
featured,
|
|
2145
|
+
filters,
|
|
2146
|
+
isLoading,
|
|
2147
|
+
paging,
|
|
2148
|
+
pageIsLoading,
|
|
2149
|
+
results,
|
|
2150
|
+
resultsInfo,
|
|
2151
|
+
searchTerm,
|
|
2152
|
+
searchTotalCount,
|
|
2153
|
+
selectedFilters,
|
|
2154
|
+
sortOrder,
|
|
2155
|
+
tabsAndFacets,
|
|
2156
|
+
totalCount,
|
|
2157
|
+
...dispatchProps
|
|
2158
|
+
};
|
|
2159
|
+
};
|
|
2160
|
+
|
|
2029
2161
|
const {
|
|
2030
2162
|
getCurrent,
|
|
2031
2163
|
getFeaturedResults,
|
|
@@ -2107,12 +2239,12 @@ const useListing = ({
|
|
|
2107
2239
|
};
|
|
2108
2240
|
|
|
2109
2241
|
const makeSelectMinilistProps = () => reselect.createSelector(state => state, (_, id) => id, (state, id) => ({
|
|
2110
|
-
facet: getFacet(state, id, Context$1.minilist, 'js'),
|
|
2242
|
+
facet: getFacet$1(state, id, Context$1.minilist, 'js'),
|
|
2111
2243
|
filters: getFilters(state, id, Context$1.minilist, 'js'),
|
|
2112
|
-
isLoading: getIsLoading$
|
|
2244
|
+
isLoading: getIsLoading$2(state, Context$1.minilist, id),
|
|
2113
2245
|
pagingInfo: getPaging(state, id, Context$1.minilist, 'js'),
|
|
2114
2246
|
results: getResults(state, id, Context$1.minilist, 'js'),
|
|
2115
|
-
searchTerm: getSearchTerm$
|
|
2247
|
+
searchTerm: getSearchTerm$2(state)
|
|
2116
2248
|
}));
|
|
2117
2249
|
|
|
2118
2250
|
const useMinilist = ({
|
|
@@ -2628,6 +2760,7 @@ exports.schema = schema;
|
|
|
2628
2760
|
exports.selectors = selectors;
|
|
2629
2761
|
exports.setRouteFilters = setRouteFilters;
|
|
2630
2762
|
exports.types = types;
|
|
2763
|
+
exports.useFacets = useFacets;
|
|
2631
2764
|
exports.useListing = useListing;
|
|
2632
2765
|
exports.useMinilist = useMinilist;
|
|
2633
2766
|
exports.withListing = withListing;
|