react-instantsearch 7.25.0 → 7.26.1
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/components/AutocompleteSearch.js +25 -36
- package/dist/cjs/components/Carousel.js +25 -39
- package/dist/cjs/components/index.js +6 -15
- package/dist/cjs/index.js +85 -44
- package/dist/cjs/lib/useStickToBottom.js +11 -17
- package/dist/cjs/package.json +4 -1
- package/dist/cjs/types/PartialKeys.js +2 -1
- package/dist/cjs/types/Translatable.js +2 -1
- package/dist/cjs/types/index.js +1 -26
- package/dist/cjs/ui/Breadcrumb.js +52 -57
- package/dist/cjs/ui/ClearRefinements.js +23 -28
- package/dist/cjs/ui/CurrentRefinements.js +48 -50
- package/dist/cjs/ui/HierarchicalMenu.js +71 -79
- package/dist/cjs/ui/Highlight.js +21 -25
- package/dist/cjs/ui/HitsPerPage.js +31 -34
- package/dist/cjs/ui/InfiniteHits.js +83 -88
- package/dist/cjs/ui/InternalHighlight.js +9 -10
- package/dist/cjs/ui/Menu.js +53 -56
- package/dist/cjs/ui/Pagination.js +117 -124
- package/dist/cjs/ui/PoweredBy.js +33 -37
- package/dist/cjs/ui/RangeInput.js +96 -116
- package/dist/cjs/ui/RefinementList.js +66 -67
- package/dist/cjs/ui/ReverseHighlight.js +21 -25
- package/dist/cjs/ui/SearchBox.js +141 -151
- package/dist/cjs/ui/ShowMoreButton.js +14 -17
- package/dist/cjs/ui/Snippet.js +21 -25
- package/dist/cjs/ui/SortBy.js +32 -36
- package/dist/cjs/ui/Stats.js +29 -32
- package/dist/cjs/ui/ToggleRefinement.js +30 -33
- package/dist/cjs/ui/lib/capitalize.js +5 -7
- package/dist/cjs/ui/lib/index.js +8 -26
- package/dist/cjs/ui/lib/isModifierClick.js +6 -8
- package/dist/cjs/widgets/Autocomplete.js +450 -491
- package/dist/cjs/widgets/Breadcrumb.js +34 -47
- package/dist/cjs/widgets/Chat.js +174 -221
- package/dist/cjs/widgets/ClearRefinements.js +31 -42
- package/dist/cjs/widgets/CurrentRefinements.js +27 -32
- package/dist/cjs/widgets/FilterSuggestions.js +46 -53
- package/dist/cjs/widgets/FrequentlyBoughtTogether.js +66 -74
- package/dist/cjs/widgets/HierarchicalMenu.js +53 -68
- package/dist/cjs/widgets/Highlight.js +31 -31
- package/dist/cjs/widgets/Hits.js +59 -64
- package/dist/cjs/widgets/HitsPerPage.js +32 -38
- package/dist/cjs/widgets/InfiniteHits.js +44 -61
- package/dist/cjs/widgets/LookingSimilar.js +66 -74
- package/dist/cjs/widgets/Menu.js +48 -62
- package/dist/cjs/widgets/Pagination.js +59 -74
- package/dist/cjs/widgets/PoweredBy.js +14 -17
- package/dist/cjs/widgets/RangeInput.js +38 -51
- package/dist/cjs/widgets/RefinementList.js +100 -125
- package/dist/cjs/widgets/RelatedProducts.js +66 -74
- package/dist/cjs/widgets/ReverseHighlight.js +38 -44
- package/dist/cjs/widgets/SearchBox.js +63 -86
- package/dist/cjs/widgets/Snippet.js +31 -31
- package/dist/cjs/widgets/SortBy.js +26 -32
- package/dist/cjs/widgets/Stats.js +54 -68
- package/dist/cjs/widgets/ToggleRefinement.js +33 -38
- package/dist/cjs/widgets/TrendingItems.js +70 -78
- package/dist/cjs/widgets/chat/tools/SearchIndexTool.js +92 -99
- package/dist/cjs/widgets/index.js +77 -289
- package/dist/cjs/widgets/index.umd.js +68 -322
- package/dist/es/components/AutocompleteSearch.js +22 -28
- package/dist/es/components/Carousel.js +23 -31
- package/dist/es/components/index.js +1 -1
- package/dist/es/index.js +29 -4
- package/dist/es/lib/useStickToBottom.js +10 -12
- package/dist/es/package.json +4 -0
- package/dist/es/types/PartialKeys.js +1 -1
- package/dist/es/types/Translatable.js +1 -1
- package/dist/es/types/index.js +1 -2
- package/dist/es/ui/Breadcrumb.js +49 -49
- package/dist/es/ui/ClearRefinements.js +21 -21
- package/dist/es/ui/CurrentRefinements.js +46 -43
- package/dist/es/ui/HierarchicalMenu.js +68 -71
- package/dist/es/ui/Highlight.js +19 -18
- package/dist/es/ui/HitsPerPage.js +29 -27
- package/dist/es/ui/InfiniteHits.js +80 -80
- package/dist/es/ui/InternalHighlight.js +7 -4
- package/dist/es/ui/Menu.js +51 -49
- package/dist/es/ui/Pagination.js +114 -116
- package/dist/es/ui/PoweredBy.js +31 -30
- package/dist/es/ui/RangeInput.js +93 -107
- package/dist/es/ui/RefinementList.js +64 -60
- package/dist/es/ui/ReverseHighlight.js +19 -18
- package/dist/es/ui/SearchBox.js +138 -143
- package/dist/es/ui/ShowMoreButton.js +13 -11
- package/dist/es/ui/Snippet.js +19 -18
- package/dist/es/ui/SortBy.js +30 -29
- package/dist/es/ui/Stats.js +27 -25
- package/dist/es/ui/ToggleRefinement.js +28 -26
- package/dist/es/ui/lib/capitalize.js +5 -3
- package/dist/es/ui/lib/index.js +2 -2
- package/dist/es/ui/lib/isModifierClick.js +6 -4
- package/dist/es/widgets/Autocomplete.js +438 -474
- package/dist/es/widgets/Breadcrumb.js +31 -39
- package/dist/es/widgets/Chat.js +164 -196
- package/dist/es/widgets/ClearRefinements.js +28 -34
- package/dist/es/widgets/CurrentRefinements.js +24 -24
- package/dist/es/widgets/FilterSuggestions.js +41 -42
- package/dist/es/widgets/FrequentlyBoughtTogether.js +62 -65
- package/dist/es/widgets/HierarchicalMenu.js +50 -60
- package/dist/es/widgets/Highlight.js +30 -25
- package/dist/es/widgets/Hits.js +54 -53
- package/dist/es/widgets/HitsPerPage.js +29 -30
- package/dist/es/widgets/InfiniteHits.js +41 -53
- package/dist/es/widgets/LookingSimilar.js +62 -65
- package/dist/es/widgets/Menu.js +45 -54
- package/dist/es/widgets/Pagination.js +56 -66
- package/dist/es/widgets/PoweredBy.js +12 -10
- package/dist/es/widgets/RangeInput.js +35 -43
- package/dist/es/widgets/RefinementList.js +98 -118
- package/dist/es/widgets/RelatedProducts.js +61 -64
- package/dist/es/widgets/ReverseHighlight.js +36 -37
- package/dist/es/widgets/SearchBox.js +61 -79
- package/dist/es/widgets/Snippet.js +30 -25
- package/dist/es/widgets/SortBy.js +23 -24
- package/dist/es/widgets/Stats.js +51 -60
- package/dist/es/widgets/ToggleRefinement.js +30 -30
- package/dist/es/widgets/TrendingItems.js +65 -68
- package/dist/es/widgets/chat/tools/SearchIndexTool.js +89 -91
- package/dist/es/widgets/index.js +27 -26
- package/dist/es/widgets/index.umd.js +36 -33
- package/dist/umd/ReactInstantSearch.js +23411 -30098
- package/dist/umd/ReactInstantSearch.min.js +3 -3
- package/package.json +8 -12
- package/dist/umd/ReactInstantSearch.js.map +0 -1
- package/dist/umd/ReactInstantSearch.min.js.map +0 -1
|
@@ -1,82 +1,74 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
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; }
|
|
15
|
-
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
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
17
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
20
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
21
|
-
var TrendingItemsUiComponent = (0, _instantsearchUiComponents.createTrendingItemsComponent)({
|
|
22
|
-
createElement: _react.createElement,
|
|
23
|
-
Fragment: _react.Fragment
|
|
3
|
+
var _object_spread = require('@swc/helpers/_/_object_spread');
|
|
4
|
+
var _object_spread_props = require('@swc/helpers/_/_object_spread_props');
|
|
5
|
+
var _object_without_properties = require('@swc/helpers/_/_object_without_properties');
|
|
6
|
+
var instantsearchUiComponents = require('instantsearch-ui-components');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var reactInstantsearchCore = require('react-instantsearch-core');
|
|
9
|
+
|
|
10
|
+
var TrendingItemsUiComponent = instantsearchUiComponents.createTrendingItemsComponent({
|
|
11
|
+
createElement: React.createElement,
|
|
12
|
+
Fragment: React.Fragment
|
|
24
13
|
});
|
|
25
|
-
function TrendingItems(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
facetName
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
status =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
14
|
+
function TrendingItems(_0) {
|
|
15
|
+
var facetName = _0.facetName, facetValue = _0.facetValue, limit = _0.limit, threshold = _0.threshold, fallbackParameters = _0.fallbackParameters, queryParameters = _0.queryParameters, escapeHTML = _0.escapeHTML, transformItems = _0.transformItems, itemComponent = _0.itemComponent, headerComponent = _0.headerComponent, emptyComponent = _0.emptyComponent, layoutComponent = _0.layoutComponent, props = _object_without_properties._(_0, [
|
|
16
|
+
"facetName",
|
|
17
|
+
"facetValue",
|
|
18
|
+
"limit",
|
|
19
|
+
"threshold",
|
|
20
|
+
"fallbackParameters",
|
|
21
|
+
"queryParameters",
|
|
22
|
+
"escapeHTML",
|
|
23
|
+
"transformItems",
|
|
24
|
+
"itemComponent",
|
|
25
|
+
"headerComponent",
|
|
26
|
+
"emptyComponent",
|
|
27
|
+
"layoutComponent"
|
|
28
|
+
]);
|
|
29
|
+
var facetParameters = facetName && facetValue ? {
|
|
30
|
+
facetName: facetName,
|
|
31
|
+
facetValue: facetValue
|
|
32
|
+
} : {};
|
|
33
|
+
var status = reactInstantsearchCore.useInstantSearch().status;
|
|
34
|
+
var _useTrendingItems = reactInstantsearchCore.useTrendingItems(_object_spread_props._(_object_spread._({}, facetParameters), {
|
|
35
|
+
limit: limit,
|
|
36
|
+
threshold: threshold,
|
|
37
|
+
fallbackParameters: fallbackParameters,
|
|
38
|
+
queryParameters: queryParameters,
|
|
39
|
+
escapeHTML: escapeHTML,
|
|
40
|
+
transformItems: transformItems
|
|
52
41
|
}), {
|
|
53
|
-
|
|
54
|
-
}),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
}));
|
|
64
|
-
} : undefined;
|
|
65
|
-
var _itemComponent = (0, _react.useMemo)(function () {
|
|
66
|
-
return itemComponent ? function (itemProps) {
|
|
67
|
-
return itemComponent(_objectSpread(_objectSpread({}, itemProps), {}, {
|
|
68
|
-
sendEvent: sendEvent
|
|
69
|
-
}));
|
|
42
|
+
$$widgetType: 'ais.trendingItems'
|
|
43
|
+
}), items = _useTrendingItems.items, sendEvent = _useTrendingItems.sendEvent;
|
|
44
|
+
var layout = layoutComponent ? function(layoutProps) {
|
|
45
|
+
return layoutComponent(_object_spread_props._(_object_spread._({}, layoutProps), {
|
|
46
|
+
classNames: {
|
|
47
|
+
list: layoutProps.classNames.list,
|
|
48
|
+
item: layoutProps.classNames.item
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
70
51
|
} : undefined;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
52
|
+
var _itemComponent = React.useMemo(function() {
|
|
53
|
+
return itemComponent ? function(itemProps) {
|
|
54
|
+
return itemComponent(_object_spread_props._(_object_spread._({}, itemProps), {
|
|
55
|
+
sendEvent: sendEvent
|
|
56
|
+
}));
|
|
57
|
+
} : undefined;
|
|
58
|
+
}, [
|
|
59
|
+
itemComponent,
|
|
60
|
+
sendEvent
|
|
61
|
+
]);
|
|
62
|
+
var uiProps = {
|
|
63
|
+
items: items,
|
|
64
|
+
itemComponent: _itemComponent,
|
|
65
|
+
headerComponent: headerComponent,
|
|
66
|
+
emptyComponent: emptyComponent,
|
|
67
|
+
layout: layout,
|
|
68
|
+
status: status,
|
|
69
|
+
sendEvent: sendEvent
|
|
70
|
+
};
|
|
71
|
+
return /*#__PURE__*/ React.createElement(TrendingItemsUiComponent, _object_spread._({}, props, uiProps));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
exports.TrendingItems = TrendingItems;
|
|
@@ -1,104 +1,97 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _object_spread = require('@swc/helpers/_/_object_spread');
|
|
4
|
+
var instantsearchUiComponents = require('instantsearch-ui-components');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var Carousel = require('../../../components/Carousel.js');
|
|
2
7
|
|
|
3
|
-
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); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.createCarouselTool = createCarouselTool;
|
|
8
|
-
var _instantsearchUiComponents = require("instantsearch-ui-components");
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _components = require("../../../components");
|
|
11
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
12
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
13
8
|
function createCarouselTool(showViewAll, itemComponent, getSearchPageURL) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
17
|
-
function SearchLayoutComponent(_ref) {
|
|
18
|
-
var message = _ref.message,
|
|
19
|
-
applyFilters = _ref.applyFilters,
|
|
20
|
-
onClose = _ref.onClose;
|
|
21
|
-
var input = message === null || message === void 0 ? void 0 : message.input;
|
|
22
|
-
var output = message === null || message === void 0 ? void 0 : message.output;
|
|
23
|
-
var items = (output === null || output === void 0 ? void 0 : output.hits) || [];
|
|
24
|
-
var MemoedHeaderComponent = _react.default.useMemo(function () {
|
|
25
|
-
return function (props) {
|
|
26
|
-
return /*#__PURE__*/_react.default.createElement(HeaderComponent, _extends({
|
|
27
|
-
nbHits: output === null || output === void 0 ? void 0 : output.nbHits,
|
|
28
|
-
input: input,
|
|
29
|
-
hitsPerPage: items.length,
|
|
30
|
-
onClose: onClose,
|
|
31
|
-
applyFilters: applyFilters
|
|
32
|
-
}, props));
|
|
33
|
-
};
|
|
34
|
-
}, [items.length, input, output === null || output === void 0 ? void 0 : output.nbHits, applyFilters, onClose]);
|
|
35
|
-
return /*#__PURE__*/_react.default.createElement(_components.Carousel, {
|
|
36
|
-
items: items,
|
|
37
|
-
itemComponent: itemComponent,
|
|
38
|
-
sendEvent: function sendEvent() {},
|
|
39
|
-
showNavigation: false,
|
|
40
|
-
headerComponent: MemoedHeaderComponent
|
|
9
|
+
var Button = instantsearchUiComponents.createButtonComponent({
|
|
10
|
+
createElement: React.createElement
|
|
41
11
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
12
|
+
function SearchLayoutComponent(param) {
|
|
13
|
+
var message = param.message, applyFilters = param.applyFilters, onClose = param.onClose;
|
|
14
|
+
var input = message === null || message === void 0 ? void 0 : message.input;
|
|
15
|
+
var output = message === null || message === void 0 ? void 0 : message.output;
|
|
16
|
+
var items = (output === null || output === void 0 ? void 0 : output.hits) || [];
|
|
17
|
+
var MemoedHeaderComponent = React.useMemo(function() {
|
|
18
|
+
return function(props) {
|
|
19
|
+
return /*#__PURE__*/ React.createElement(HeaderComponent, _object_spread._({
|
|
20
|
+
nbHits: output === null || output === void 0 ? void 0 : output.nbHits,
|
|
21
|
+
input: input,
|
|
22
|
+
hitsPerPage: items.length,
|
|
23
|
+
onClose: onClose,
|
|
24
|
+
applyFilters: applyFilters
|
|
25
|
+
}, props));
|
|
26
|
+
};
|
|
27
|
+
}, [
|
|
28
|
+
items.length,
|
|
29
|
+
input,
|
|
30
|
+
output === null || output === void 0 ? void 0 : output.nbHits,
|
|
31
|
+
applyFilters,
|
|
32
|
+
onClose
|
|
33
|
+
]);
|
|
34
|
+
return /*#__PURE__*/ React.createElement(Carousel.Carousel, {
|
|
35
|
+
items: items,
|
|
36
|
+
itemComponent: itemComponent,
|
|
37
|
+
sendEvent: function sendEvent() {},
|
|
38
|
+
showNavigation: false,
|
|
39
|
+
headerComponent: MemoedHeaderComponent
|
|
70
40
|
});
|
|
71
|
-
|
|
72
|
-
|
|
41
|
+
}
|
|
42
|
+
function HeaderComponent(param) {
|
|
43
|
+
var canScrollLeft = param.canScrollLeft, canScrollRight = param.canScrollRight, scrollLeft = param.scrollLeft, scrollRight = param.scrollRight, nbHits = param.nbHits, input = param.input, hitsPerPage = param.hitsPerPage, applyFilters = param.applyFilters, onClose = param.onClose;
|
|
44
|
+
if ((hitsPerPage !== null && hitsPerPage !== void 0 ? hitsPerPage : 0) < 1) {
|
|
45
|
+
return null;
|
|
73
46
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
47
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
48
|
+
className: "ais-ChatToolSearchIndexCarouselHeader"
|
|
49
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
50
|
+
className: "ais-ChatToolSearchIndexCarouselHeaderResults"
|
|
51
|
+
}, nbHits && /*#__PURE__*/ React.createElement("div", {
|
|
52
|
+
className: "ais-ChatToolSearchIndexCarouselHeaderCount"
|
|
53
|
+
}, hitsPerPage !== null && hitsPerPage !== void 0 ? hitsPerPage : 0, " of ", nbHits.toLocaleString(), " result", nbHits > 1 ? 's' : ''), showViewAll && /*#__PURE__*/ React.createElement(Button, {
|
|
54
|
+
variant: "ghost",
|
|
55
|
+
size: "sm",
|
|
56
|
+
onClick: function onClick() {
|
|
57
|
+
if (!input || !applyFilters) return;
|
|
58
|
+
var params = applyFilters({
|
|
59
|
+
query: input.query,
|
|
60
|
+
facetFilters: input.facet_filters
|
|
61
|
+
});
|
|
62
|
+
if (getSearchPageURL && new URL(getSearchPageURL(params)).pathname !== window.location.pathname) {
|
|
63
|
+
window.location.href = getSearchPageURL(params);
|
|
64
|
+
}
|
|
65
|
+
onClose();
|
|
66
|
+
},
|
|
67
|
+
className: "ais-ChatToolSearchIndexCarouselHeaderViewAll"
|
|
68
|
+
}, "View all", /*#__PURE__*/ React.createElement(instantsearchUiComponents.ArrowRightIcon, {
|
|
69
|
+
createElement: React.createElement
|
|
70
|
+
}))), (hitsPerPage !== null && hitsPerPage !== void 0 ? hitsPerPage : 0) > 2 && /*#__PURE__*/ React.createElement("div", {
|
|
71
|
+
className: "ais-ChatToolSearchIndexCarouselHeaderScrollButtons"
|
|
72
|
+
}, /*#__PURE__*/ React.createElement(Button, {
|
|
73
|
+
variant: "outline",
|
|
74
|
+
size: "sm",
|
|
75
|
+
iconOnly: true,
|
|
76
|
+
onClick: scrollLeft,
|
|
77
|
+
disabled: !canScrollLeft,
|
|
78
|
+
className: "ais-ChatToolSearchIndexCarouselHeaderScrollButton"
|
|
79
|
+
}, /*#__PURE__*/ React.createElement(instantsearchUiComponents.ChevronLeftIcon, {
|
|
80
|
+
createElement: React.createElement
|
|
81
|
+
})), /*#__PURE__*/ React.createElement(Button, {
|
|
82
|
+
variant: "outline",
|
|
83
|
+
size: "sm",
|
|
84
|
+
iconOnly: true,
|
|
85
|
+
onClick: scrollRight,
|
|
86
|
+
disabled: !canScrollRight,
|
|
87
|
+
className: "ais-ChatToolSearchIndexCarouselHeaderScrollButton"
|
|
88
|
+
}, /*#__PURE__*/ React.createElement(instantsearchUiComponents.ChevronRightIcon, {
|
|
89
|
+
createElement: React.createElement
|
|
90
|
+
}))));
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
layoutComponent: SearchLayoutComponent
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
exports.createCarouselTool = createCarouselTool;
|