react-instantsearch 7.15.8 → 7.16.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/dist/cjs/widgets/InfiniteHits.js +4 -5
- package/dist/cjs/widgets/RefinementList.js +6 -1
- package/dist/es/widgets/InfiniteHits.d.ts +1 -1
- package/dist/es/widgets/InfiniteHits.js +4 -5
- package/dist/es/widgets/RefinementList.d.ts +2 -2
- package/dist/es/widgets/RefinementList.js +6 -1
- package/dist/umd/ReactInstantSearch.js +71 -23
- package/dist/umd/ReactInstantSearch.js.map +1 -1
- package/dist/umd/ReactInstantSearch.min.js +1 -1
- package/dist/umd/ReactInstantSearch.min.js.map +1 -1
- package/package.json +4 -4
|
@@ -8,7 +8,7 @@ exports.InfiniteHits = InfiniteHits;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactInstantsearchCore = require("react-instantsearch-core");
|
|
10
10
|
var _InfiniteHits = require("../ui/InfiniteHits");
|
|
11
|
-
var _excluded = ["showPrevious", "cache", "escapeHTML", "
|
|
11
|
+
var _excluded = ["showPrevious", "cache", "escapeHTML", "transformItems", "translations", "bannerComponent"];
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -23,7 +23,6 @@ function InfiniteHits(_ref) {
|
|
|
23
23
|
shouldShowPrevious = _ref$showPrevious === void 0 ? true : _ref$showPrevious,
|
|
24
24
|
cache = _ref.cache,
|
|
25
25
|
escapeHTML = _ref.escapeHTML,
|
|
26
|
-
userShowPrevious = _ref.showPrevious,
|
|
27
26
|
transformItems = _ref.transformItems,
|
|
28
27
|
translations = _ref.translations,
|
|
29
28
|
BannerComponent = _ref.bannerComponent,
|
|
@@ -31,12 +30,12 @@ function InfiniteHits(_ref) {
|
|
|
31
30
|
var _useInfiniteHits = (0, _reactInstantsearchCore.useInfiniteHits)({
|
|
32
31
|
cache: cache,
|
|
33
32
|
escapeHTML: escapeHTML,
|
|
34
|
-
showPrevious:
|
|
33
|
+
showPrevious: shouldShowPrevious,
|
|
35
34
|
transformItems: transformItems
|
|
36
35
|
}, {
|
|
37
36
|
$$widgetType: 'ais.infiniteHits'
|
|
38
37
|
}),
|
|
39
|
-
|
|
38
|
+
items = _useInfiniteHits.items,
|
|
40
39
|
banner = _useInfiniteHits.banner,
|
|
41
40
|
sendEvent = _useInfiniteHits.sendEvent,
|
|
42
41
|
showPrevious = _useInfiniteHits.showPrevious,
|
|
@@ -47,7 +46,7 @@ function InfiniteHits(_ref) {
|
|
|
47
46
|
return null;
|
|
48
47
|
} : BannerComponent;
|
|
49
48
|
var uiProps = {
|
|
50
|
-
hits:
|
|
49
|
+
hits: items,
|
|
51
50
|
banner: banner,
|
|
52
51
|
bannerComponent: bannerComponent,
|
|
53
52
|
sendEvent: sendEvent,
|
|
@@ -9,7 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _reactInstantsearchCore = require("react-instantsearch-core");
|
|
10
10
|
var _RefinementList = require("../ui/RefinementList");
|
|
11
11
|
var _SearchBox = require("../ui/SearchBox");
|
|
12
|
-
var _excluded = ["searchable", "searchablePlaceholder", "attribute", "operator", "limit", "showMore", "showMoreLimit", "sortBy", "escapeFacetValues", "transformItems", "translations"];
|
|
12
|
+
var _excluded = ["searchable", "searchablePlaceholder", "searchableSelectOnSubmit", "attribute", "operator", "limit", "showMore", "showMoreLimit", "sortBy", "escapeFacetValues", "transformItems", "translations"];
|
|
13
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
15
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -29,6 +29,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
29
29
|
function RefinementList(_ref) {
|
|
30
30
|
var searchable = _ref.searchable,
|
|
31
31
|
searchablePlaceholder = _ref.searchablePlaceholder,
|
|
32
|
+
_ref$searchableSelect = _ref.searchableSelectOnSubmit,
|
|
33
|
+
searchableSelectOnSubmit = _ref$searchableSelect === void 0 ? true : _ref$searchableSelect,
|
|
32
34
|
attribute = _ref.attribute,
|
|
33
35
|
operator = _ref.operator,
|
|
34
36
|
limit = _ref.limit,
|
|
@@ -83,6 +85,9 @@ function RefinementList(_ref) {
|
|
|
83
85
|
setQuery('');
|
|
84
86
|
}
|
|
85
87
|
function onSubmit() {
|
|
88
|
+
if (searchableSelectOnSubmit === false) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
86
91
|
if (items.length > 0) {
|
|
87
92
|
refine(items[0].value);
|
|
88
93
|
setQuery('');
|
|
@@ -17,5 +17,5 @@ export type InfiniteHitsProps<THit extends BaseHit = BaseHit> = Omit<InfiniteHit
|
|
|
17
17
|
showPrevious?: boolean;
|
|
18
18
|
translations?: Partial<UiProps<THit>['translations']>;
|
|
19
19
|
};
|
|
20
|
-
export declare function InfiniteHits<THit extends BaseHit = BaseHit>({ showPrevious: shouldShowPrevious, cache, escapeHTML,
|
|
20
|
+
export declare function InfiniteHits<THit extends BaseHit = BaseHit>({ showPrevious: shouldShowPrevious, cache, escapeHTML, transformItems, translations, bannerComponent: BannerComponent, ...props }: InfiniteHitsProps<THit>): React.JSX.Element;
|
|
21
21
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["showPrevious", "cache", "escapeHTML", "
|
|
2
|
+
var _excluded = ["showPrevious", "cache", "escapeHTML", "transformItems", "translations", "bannerComponent"];
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -16,7 +16,6 @@ export function InfiniteHits(_ref) {
|
|
|
16
16
|
shouldShowPrevious = _ref$showPrevious === void 0 ? true : _ref$showPrevious,
|
|
17
17
|
cache = _ref.cache,
|
|
18
18
|
escapeHTML = _ref.escapeHTML,
|
|
19
|
-
userShowPrevious = _ref.showPrevious,
|
|
20
19
|
transformItems = _ref.transformItems,
|
|
21
20
|
translations = _ref.translations,
|
|
22
21
|
BannerComponent = _ref.bannerComponent,
|
|
@@ -24,12 +23,12 @@ export function InfiniteHits(_ref) {
|
|
|
24
23
|
var _useInfiniteHits = useInfiniteHits({
|
|
25
24
|
cache: cache,
|
|
26
25
|
escapeHTML: escapeHTML,
|
|
27
|
-
showPrevious:
|
|
26
|
+
showPrevious: shouldShowPrevious,
|
|
28
27
|
transformItems: transformItems
|
|
29
28
|
}, {
|
|
30
29
|
$$widgetType: 'ais.infiniteHits'
|
|
31
30
|
}),
|
|
32
|
-
|
|
31
|
+
items = _useInfiniteHits.items,
|
|
33
32
|
banner = _useInfiniteHits.banner,
|
|
34
33
|
sendEvent = _useInfiniteHits.sendEvent,
|
|
35
34
|
showPrevious = _useInfiniteHits.showPrevious,
|
|
@@ -40,7 +39,7 @@ export function InfiniteHits(_ref) {
|
|
|
40
39
|
return null;
|
|
41
40
|
} : BannerComponent;
|
|
42
41
|
var uiProps = {
|
|
43
|
-
hits:
|
|
42
|
+
hits: items,
|
|
44
43
|
banner: banner,
|
|
45
44
|
bannerComponent: bannerComponent,
|
|
46
45
|
sendEvent: sendEvent,
|
|
@@ -4,7 +4,7 @@ import type { SearchBoxTranslations } from '../ui/SearchBox';
|
|
|
4
4
|
import type { RefinementListWidgetParams } from 'instantsearch.js/es/widgets/refinement-list/refinement-list';
|
|
5
5
|
import type { UseRefinementListProps } from 'react-instantsearch-core';
|
|
6
6
|
type UiProps = Pick<RefinementListUiComponentProps, 'canRefine' | 'items' | 'onRefine' | 'query' | 'searchBox' | 'noResults' | 'canToggleShowMore' | 'onToggleShowMore' | 'isShowingMore' | 'translations'>;
|
|
7
|
-
export type RefinementListProps = Omit<RefinementListUiComponentProps, keyof UiProps> & UseRefinementListProps & Pick<RefinementListWidgetParams, 'searchable' | 'searchablePlaceholder'> & {
|
|
7
|
+
export type RefinementListProps = Omit<RefinementListUiComponentProps, keyof UiProps> & UseRefinementListProps & Pick<RefinementListWidgetParams, 'searchable' | 'searchablePlaceholder' | 'searchableSelectOnSubmit'> & {
|
|
8
8
|
translations?: Partial<UiProps['translations'] & SearchBoxTranslations & {
|
|
9
9
|
/**
|
|
10
10
|
* What to display when there are no results.
|
|
@@ -12,5 +12,5 @@ export type RefinementListProps = Omit<RefinementListUiComponentProps, keyof UiP
|
|
|
12
12
|
noResultsText: string;
|
|
13
13
|
}>;
|
|
14
14
|
};
|
|
15
|
-
export declare function RefinementList({ searchable, searchablePlaceholder, attribute, operator, limit, showMore, showMoreLimit, sortBy, escapeFacetValues, transformItems, translations, ...props }: RefinementListProps): React.JSX.Element;
|
|
15
|
+
export declare function RefinementList({ searchable, searchablePlaceholder, searchableSelectOnSubmit, attribute, operator, limit, showMore, showMoreLimit, sortBy, escapeFacetValues, transformItems, translations, ...props }: RefinementListProps): React.JSX.Element;
|
|
16
16
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["searchable", "searchablePlaceholder", "attribute", "operator", "limit", "showMore", "showMoreLimit", "sortBy", "escapeFacetValues", "transformItems", "translations"];
|
|
2
|
+
var _excluded = ["searchable", "searchablePlaceholder", "searchableSelectOnSubmit", "attribute", "operator", "limit", "showMore", "showMoreLimit", "sortBy", "escapeFacetValues", "transformItems", "translations"];
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -21,6 +21,8 @@ import { SearchBox as SearchBoxUiComponent } from "../ui/SearchBox.js";
|
|
|
21
21
|
export function RefinementList(_ref) {
|
|
22
22
|
var searchable = _ref.searchable,
|
|
23
23
|
searchablePlaceholder = _ref.searchablePlaceholder,
|
|
24
|
+
_ref$searchableSelect = _ref.searchableSelectOnSubmit,
|
|
25
|
+
searchableSelectOnSubmit = _ref$searchableSelect === void 0 ? true : _ref$searchableSelect,
|
|
24
26
|
attribute = _ref.attribute,
|
|
25
27
|
operator = _ref.operator,
|
|
26
28
|
limit = _ref.limit,
|
|
@@ -75,6 +77,9 @@ export function RefinementList(_ref) {
|
|
|
75
77
|
setQuery('');
|
|
76
78
|
}
|
|
77
79
|
function onSubmit() {
|
|
80
|
+
if (searchableSelectOnSubmit === false) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
78
83
|
if (items.length > 0) {
|
|
79
84
|
refine(items[0].value);
|
|
80
85
|
setQuery('');
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
var React__default = 'default' in React ? React['default'] : React;
|
|
9
9
|
|
|
10
|
-
var version = '7.
|
|
10
|
+
var version = '7.16.0';
|
|
11
11
|
|
|
12
12
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
13
13
|
//
|
|
@@ -4634,7 +4634,7 @@
|
|
|
4634
4634
|
|
|
4635
4635
|
var sortAndMergeRecommendations_1 = sortAndMergeRecommendations;
|
|
4636
4636
|
|
|
4637
|
-
var version$1 = '3.
|
|
4637
|
+
var version$1 = '3.26.0';
|
|
4638
4638
|
|
|
4639
4639
|
var escapeFacetValue$3 = escapeFacetValue_1.escapeFacetValue;
|
|
4640
4640
|
|
|
@@ -5070,6 +5070,16 @@
|
|
|
5070
5070
|
query: query,
|
|
5071
5071
|
});
|
|
5072
5072
|
|
|
5073
|
+
var hide =
|
|
5074
|
+
(this.lastResults &&
|
|
5075
|
+
this.lastResults.index === state.index &&
|
|
5076
|
+
this.lastResults.renderingContent &&
|
|
5077
|
+
this.lastResults.renderingContent.facetOrdering &&
|
|
5078
|
+
this.lastResults.renderingContent.facetOrdering.values &&
|
|
5079
|
+
this.lastResults.renderingContent.facetOrdering.values[facet] &&
|
|
5080
|
+
this.lastResults.renderingContent.facetOrdering.values[facet].hide) ||
|
|
5081
|
+
[];
|
|
5082
|
+
|
|
5073
5083
|
return searchForFacetValuesPromise.then(
|
|
5074
5084
|
function addIsRefined(content) {
|
|
5075
5085
|
self._currentNbQueries--;
|
|
@@ -5077,7 +5087,11 @@
|
|
|
5077
5087
|
|
|
5078
5088
|
content = Array.isArray(content) ? content[0] : content;
|
|
5079
5089
|
|
|
5080
|
-
content.facetHits.forEach(function (f) {
|
|
5090
|
+
content.facetHits.forEach(function (f, i) {
|
|
5091
|
+
if (hide.indexOf(f.value) > -1) {
|
|
5092
|
+
content.facetHits.splice(i, 1);
|
|
5093
|
+
return;
|
|
5094
|
+
}
|
|
5081
5095
|
f.escapedValue = escapeFacetValue$3(f.value);
|
|
5082
5096
|
f.isRefined = isDisjunctive
|
|
5083
5097
|
? state.isDisjunctiveFacetRefined(facet, f.escapedValue)
|
|
@@ -13437,7 +13451,7 @@
|
|
|
13437
13451
|
};
|
|
13438
13452
|
}
|
|
13439
13453
|
|
|
13440
|
-
var version$3 = '4.
|
|
13454
|
+
var version$3 = '4.79.0';
|
|
13441
13455
|
|
|
13442
13456
|
function _typeof$q(o) {
|
|
13443
13457
|
"@babel/helpers - typeof";
|
|
@@ -13637,6 +13651,8 @@
|
|
|
13637
13651
|
_defineProperty$l(_assertThisInitialized(_this), "_searchStalledTimer", void 0);
|
|
13638
13652
|
_defineProperty$l(_assertThisInitialized(_this), "_initialUiState", void 0);
|
|
13639
13653
|
_defineProperty$l(_assertThisInitialized(_this), "_initialResults", void 0);
|
|
13654
|
+
_defineProperty$l(_assertThisInitialized(_this), "_manuallyResetScheduleSearch", false);
|
|
13655
|
+
_defineProperty$l(_assertThisInitialized(_this), "_resetScheduleSearch", void 0);
|
|
13640
13656
|
_defineProperty$l(_assertThisInitialized(_this), "_createURL", void 0);
|
|
13641
13657
|
_defineProperty$l(_assertThisInitialized(_this), "_searchFunction", void 0);
|
|
13642
13658
|
_defineProperty$l(_assertThisInitialized(_this), "_mainHelperSearch", void 0);
|
|
@@ -14029,14 +14045,25 @@
|
|
|
14029
14045
|
// because we already have the results to render. This skips the initial
|
|
14030
14046
|
// network request on the browser on `start`.
|
|
14031
14047
|
this.scheduleSearch = defer(noop$1);
|
|
14032
|
-
|
|
14033
|
-
|
|
14034
|
-
|
|
14035
|
-
|
|
14036
|
-
|
|
14037
|
-
|
|
14038
|
-
|
|
14039
|
-
|
|
14048
|
+
if (this._manuallyResetScheduleSearch) {
|
|
14049
|
+
// If `_manuallyResetScheduleSearch` is passed, it means that we don't
|
|
14050
|
+
// want to rely on a single `defer` to reset the `scheduleSearch`.
|
|
14051
|
+
// Instead, the consumer will call `_resetScheduleSearch` to restore
|
|
14052
|
+
// the original `scheduleSearch` function.
|
|
14053
|
+
// This happens in the React flavour after rendering.
|
|
14054
|
+
this._resetScheduleSearch = function () {
|
|
14055
|
+
_this3.scheduleSearch = originalScheduleSearch;
|
|
14056
|
+
};
|
|
14057
|
+
} else {
|
|
14058
|
+
// We also skip the initial network request when widgets are dynamically
|
|
14059
|
+
// added in the first tick (that's the case in all the framework-based flavors).
|
|
14060
|
+
// When we add a widget to `index`, it calls `scheduleSearch`. We can rely
|
|
14061
|
+
// on our `defer` util to restore the original `scheduleSearch` value once
|
|
14062
|
+
// widgets are added to hook back to the regular lifecycle.
|
|
14063
|
+
defer(function () {
|
|
14064
|
+
_this3.scheduleSearch = originalScheduleSearch;
|
|
14065
|
+
})();
|
|
14066
|
+
}
|
|
14040
14067
|
}
|
|
14041
14068
|
// We only schedule a search when widgets have been added before `start()`
|
|
14042
14069
|
// because there are listeners that can use these results.
|
|
@@ -14315,6 +14342,10 @@
|
|
|
14315
14342
|
// an additional network request. (This is equivalent to monkey-patching
|
|
14316
14343
|
// `scheduleSearch` to a noop.)
|
|
14317
14344
|
search._initialResults = initialResults || {};
|
|
14345
|
+
// We don't rely on the `defer` to reset the schedule search, but will call
|
|
14346
|
+
// `search._resetScheduleSearch()` manually in the effect after children
|
|
14347
|
+
// mount in `InstantSearch`.
|
|
14348
|
+
search._manuallyResetScheduleSearch = true;
|
|
14318
14349
|
}
|
|
14319
14350
|
addAlgoliaAgents(props.searchClient, [].concat(defaultUserAgents, [serverContext && serverUserAgent, nextUserAgent(getNextVersion())]));
|
|
14320
14351
|
|
|
@@ -14481,7 +14512,18 @@
|
|
|
14481
14512
|
value: search
|
|
14482
14513
|
}, /*#__PURE__*/React__default.createElement(IndexContext.Provider, {
|
|
14483
14514
|
value: search.mainIndex
|
|
14484
|
-
}, children
|
|
14515
|
+
}, children, /*#__PURE__*/React__default.createElement(ResetScheduleSearch, {
|
|
14516
|
+
search: search
|
|
14517
|
+
})));
|
|
14518
|
+
}
|
|
14519
|
+
function ResetScheduleSearch(_ref2) {
|
|
14520
|
+
var search = _ref2.search;
|
|
14521
|
+
React.useEffect(function () {
|
|
14522
|
+
if (search._resetScheduleSearch) {
|
|
14523
|
+
search._resetScheduleSearch();
|
|
14524
|
+
}
|
|
14525
|
+
}, [search]);
|
|
14526
|
+
return null;
|
|
14485
14527
|
}
|
|
14486
14528
|
|
|
14487
14529
|
function _typeof$s(o) {
|
|
@@ -14774,9 +14816,7 @@
|
|
|
14774
14816
|
if (!results || state.hierarchicalFacets.length === 0) {
|
|
14775
14817
|
return [];
|
|
14776
14818
|
}
|
|
14777
|
-
var
|
|
14778
|
-
facetName = _state$hierarchicalFa[0].name;
|
|
14779
|
-
var facetValues = results.getFacetValues(facetName, {});
|
|
14819
|
+
var facetValues = results.getFacetValues(hierarchicalFacetName, {});
|
|
14780
14820
|
var facetItems = facetValues && !Array.isArray(facetValues) && facetValues.data ? facetValues.data : [];
|
|
14781
14821
|
var items = transformItems(shiftItemsValues(prepareItems(facetItems)), {
|
|
14782
14822
|
results: results
|
|
@@ -16795,9 +16835,11 @@
|
|
|
16795
16835
|
state: normalizeState(state)
|
|
16796
16836
|
}) || {};
|
|
16797
16837
|
var banner = results === null || results === void 0 ? void 0 : (_results$renderingCon = results.renderingContent) === null || _results$renderingCon === void 0 ? void 0 : (_results$renderingCon2 = _results$renderingCon.widgets) === null || _results$renderingCon2 === void 0 ? void 0 : (_results$renderingCon3 = _results$renderingCon2.banners) === null || _results$renderingCon3 === void 0 ? void 0 : _results$renderingCon3[0];
|
|
16798
|
-
if (!
|
|
16838
|
+
if (!showPrevious) {
|
|
16799
16839
|
showPrevious = getShowPrevious(helper);
|
|
16800
16840
|
showMore = getShowMore(helper);
|
|
16841
|
+
}
|
|
16842
|
+
if (!sendEvent) {
|
|
16801
16843
|
sendEvent = createSendEventForHits({
|
|
16802
16844
|
instantSearchInstance: instantSearchInstance,
|
|
16803
16845
|
helper: helper,
|
|
@@ -16808,6 +16850,8 @@
|
|
|
16808
16850
|
widgetType: this.$$type,
|
|
16809
16851
|
instantSearchInstance: instantSearchInstance
|
|
16810
16852
|
});
|
|
16853
|
+
}
|
|
16854
|
+
if (!results) {
|
|
16811
16855
|
isFirstPage = state.page === undefined || getFirstReceivedPage(state, cachedHits) === 0;
|
|
16812
16856
|
} else {
|
|
16813
16857
|
var _state$disjunctiveFac, _state$hierarchicalFa;
|
|
@@ -22426,13 +22470,12 @@
|
|
|
22426
22470
|
}, translations.showMoreButtonText));
|
|
22427
22471
|
}
|
|
22428
22472
|
|
|
22429
|
-
var _excluded$z = ["showPrevious", "cache", "escapeHTML", "
|
|
22473
|
+
var _excluded$z = ["showPrevious", "cache", "escapeHTML", "transformItems", "translations", "bannerComponent"];
|
|
22430
22474
|
function InfiniteHits$1(_ref) {
|
|
22431
22475
|
var _ref$showPrevious = _ref.showPrevious,
|
|
22432
22476
|
shouldShowPrevious = _ref$showPrevious === void 0 ? true : _ref$showPrevious,
|
|
22433
22477
|
cache = _ref.cache,
|
|
22434
22478
|
escapeHTML = _ref.escapeHTML,
|
|
22435
|
-
userShowPrevious = _ref.showPrevious,
|
|
22436
22479
|
transformItems = _ref.transformItems,
|
|
22437
22480
|
translations = _ref.translations,
|
|
22438
22481
|
BannerComponent = _ref.bannerComponent,
|
|
@@ -22440,12 +22483,12 @@
|
|
|
22440
22483
|
var _useInfiniteHits = useInfiniteHits({
|
|
22441
22484
|
cache: cache,
|
|
22442
22485
|
escapeHTML: escapeHTML,
|
|
22443
|
-
showPrevious:
|
|
22486
|
+
showPrevious: shouldShowPrevious,
|
|
22444
22487
|
transformItems: transformItems
|
|
22445
22488
|
}, {
|
|
22446
22489
|
$$widgetType: 'ais.infiniteHits'
|
|
22447
22490
|
}),
|
|
22448
|
-
|
|
22491
|
+
items = _useInfiniteHits.items,
|
|
22449
22492
|
banner = _useInfiniteHits.banner,
|
|
22450
22493
|
sendEvent = _useInfiniteHits.sendEvent,
|
|
22451
22494
|
showPrevious = _useInfiniteHits.showPrevious,
|
|
@@ -22456,7 +22499,7 @@
|
|
|
22456
22499
|
return null;
|
|
22457
22500
|
} : BannerComponent;
|
|
22458
22501
|
var uiProps = {
|
|
22459
|
-
hits:
|
|
22502
|
+
hits: items,
|
|
22460
22503
|
banner: banner,
|
|
22461
22504
|
bannerComponent: bannerComponent,
|
|
22462
22505
|
sendEvent: sendEvent,
|
|
@@ -23113,10 +23156,12 @@
|
|
|
23113
23156
|
}))));
|
|
23114
23157
|
}
|
|
23115
23158
|
|
|
23116
|
-
var _excluded$J = ["searchable", "searchablePlaceholder", "attribute", "operator", "limit", "showMore", "showMoreLimit", "sortBy", "escapeFacetValues", "transformItems", "translations"];
|
|
23159
|
+
var _excluded$J = ["searchable", "searchablePlaceholder", "searchableSelectOnSubmit", "attribute", "operator", "limit", "showMore", "showMoreLimit", "sortBy", "escapeFacetValues", "transformItems", "translations"];
|
|
23117
23160
|
function RefinementList$2(_ref) {
|
|
23118
23161
|
var searchable = _ref.searchable,
|
|
23119
23162
|
searchablePlaceholder = _ref.searchablePlaceholder,
|
|
23163
|
+
_ref$searchableSelect = _ref.searchableSelectOnSubmit,
|
|
23164
|
+
searchableSelectOnSubmit = _ref$searchableSelect === void 0 ? true : _ref$searchableSelect,
|
|
23120
23165
|
attribute = _ref.attribute,
|
|
23121
23166
|
operator = _ref.operator,
|
|
23122
23167
|
limit = _ref.limit,
|
|
@@ -23171,6 +23216,9 @@
|
|
|
23171
23216
|
setQuery('');
|
|
23172
23217
|
}
|
|
23173
23218
|
function onSubmit() {
|
|
23219
|
+
if (searchableSelectOnSubmit === false) {
|
|
23220
|
+
return;
|
|
23221
|
+
}
|
|
23174
23222
|
if (items.length > 0) {
|
|
23175
23223
|
refine(items[0].value);
|
|
23176
23224
|
setQuery('');
|