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,52 +1,50 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
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 capitalize = require('./lib/capitalize.js');
|
|
9
|
+
var isModifierClick = require('./lib/isModifierClick.js');
|
|
10
|
+
|
|
11
|
+
function CurrentRefinements(_0) {
|
|
12
|
+
var _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, _0_items = _0.items, items = _0_items === void 0 ? [] : _0_items, _0_hasRefinements = _0.hasRefinements, hasRefinements = _0_hasRefinements === void 0 ? false : _0_hasRefinements, props = _object_without_properties._(_0, [
|
|
13
|
+
"classNames",
|
|
14
|
+
"items",
|
|
15
|
+
"hasRefinements"
|
|
16
|
+
]);
|
|
17
|
+
return /*#__PURE__*/ React.createElement("div", _object_spread_props._(_object_spread._({}, props), {
|
|
18
|
+
className: instantsearchUiComponents.cx('ais-CurrentRefinements', classNames.root, !hasRefinements && instantsearchUiComponents.cx('ais-CurrentRefinements--noRefinement', classNames.noRefinementRoot), props.className)
|
|
19
|
+
}), /*#__PURE__*/ React.createElement("ul", {
|
|
20
|
+
className: instantsearchUiComponents.cx('ais-CurrentRefinements-list', classNames.list, /* @MAJOR remove to ensure conformity with InstantSearch.css specs */ !hasRefinements && instantsearchUiComponents.cx('ais-CurrentRefinements-list--noRefinement', classNames.noRefinementList))
|
|
21
|
+
}, items.map(function(item) {
|
|
22
|
+
return /*#__PURE__*/ React.createElement("li", {
|
|
23
|
+
key: [
|
|
24
|
+
item.indexName,
|
|
25
|
+
item.label
|
|
26
|
+
].join('/'),
|
|
27
|
+
className: instantsearchUiComponents.cx('ais-CurrentRefinements-item', classNames.item)
|
|
28
|
+
}, /*#__PURE__*/ React.createElement("span", {
|
|
29
|
+
className: instantsearchUiComponents.cx('ais-CurrentRefinements-label', classNames.label)
|
|
30
|
+
}, capitalize.capitalize(item.label), ":", ' '), item.refinements.map(function(refinement) {
|
|
31
|
+
return /*#__PURE__*/ React.createElement("span", {
|
|
32
|
+
key: refinement.label,
|
|
33
|
+
className: instantsearchUiComponents.cx('ais-CurrentRefinements-category', classNames.category)
|
|
34
|
+
}, /*#__PURE__*/ React.createElement("span", {
|
|
35
|
+
className: instantsearchUiComponents.cx('ais-CurrentRefinements-categoryLabel', classNames.categoryLabel)
|
|
36
|
+
}, refinement.label), /*#__PURE__*/ React.createElement("button", {
|
|
37
|
+
type: "button",
|
|
38
|
+
onClick: function onClick(event) {
|
|
39
|
+
if (isModifierClick.isModifierClick(event)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
item.refine(refinement);
|
|
43
|
+
},
|
|
44
|
+
className: instantsearchUiComponents.cx('ais-CurrentRefinements-delete', classNames.delete)
|
|
45
|
+
}, "✕"));
|
|
46
|
+
}));
|
|
47
|
+
})));
|
|
48
|
+
}
|
|
2
49
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
50
|
exports.CurrentRefinements = CurrentRefinements;
|
|
7
|
-
var _instantsearchUiComponents = require("instantsearch-ui-components");
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _lib = require("./lib");
|
|
10
|
-
var _excluded = ["classNames", "items", "hasRefinements"];
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
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
|
-
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; }
|
|
14
|
-
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; }
|
|
15
|
-
function CurrentRefinements(_ref) {
|
|
16
|
-
var _ref$classNames = _ref.classNames,
|
|
17
|
-
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
18
|
-
_ref$items = _ref.items,
|
|
19
|
-
items = _ref$items === void 0 ? [] : _ref$items,
|
|
20
|
-
_ref$hasRefinements = _ref.hasRefinements,
|
|
21
|
-
hasRefinements = _ref$hasRefinements === void 0 ? false : _ref$hasRefinements,
|
|
22
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
-
return /*#__PURE__*/_react.default.createElement("div", _extends({}, props, {
|
|
24
|
-
className: (0, _instantsearchUiComponents.cx)('ais-CurrentRefinements', classNames.root, !hasRefinements && (0, _instantsearchUiComponents.cx)('ais-CurrentRefinements--noRefinement', classNames.noRefinementRoot), props.className)
|
|
25
|
-
}), /*#__PURE__*/_react.default.createElement("ul", {
|
|
26
|
-
className: (0, _instantsearchUiComponents.cx)('ais-CurrentRefinements-list', classNames.list, /* @MAJOR remove to ensure conformity with InstantSearch.css specs */
|
|
27
|
-
!hasRefinements && (0, _instantsearchUiComponents.cx)('ais-CurrentRefinements-list--noRefinement', classNames.noRefinementList))
|
|
28
|
-
}, items.map(function (item) {
|
|
29
|
-
return /*#__PURE__*/_react.default.createElement("li", {
|
|
30
|
-
key: [item.indexName, item.label].join('/'),
|
|
31
|
-
className: (0, _instantsearchUiComponents.cx)('ais-CurrentRefinements-item', classNames.item)
|
|
32
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
33
|
-
className: (0, _instantsearchUiComponents.cx)('ais-CurrentRefinements-label', classNames.label)
|
|
34
|
-
}, (0, _lib.capitalize)(item.label), ":", ' '), item.refinements.map(function (refinement) {
|
|
35
|
-
return /*#__PURE__*/_react.default.createElement("span", {
|
|
36
|
-
key: refinement.label,
|
|
37
|
-
className: (0, _instantsearchUiComponents.cx)('ais-CurrentRefinements-category', classNames.category)
|
|
38
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
39
|
-
className: (0, _instantsearchUiComponents.cx)('ais-CurrentRefinements-categoryLabel', classNames.categoryLabel)
|
|
40
|
-
}, refinement.label), /*#__PURE__*/_react.default.createElement("button", {
|
|
41
|
-
type: "button",
|
|
42
|
-
onClick: function onClick(event) {
|
|
43
|
-
if ((0, _lib.isModifierClick)(event)) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
item.refine(refinement);
|
|
47
|
-
},
|
|
48
|
-
className: (0, _instantsearchUiComponents.cx)('ais-CurrentRefinements-delete', classNames.delete)
|
|
49
|
-
}, "\u2715"));
|
|
50
|
-
}));
|
|
51
|
-
})));
|
|
52
|
-
}
|
|
@@ -1,82 +1,74 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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 isModifierClick = require('./lib/isModifierClick.js');
|
|
9
|
+
var ShowMoreButton = require('./ShowMoreButton.js');
|
|
10
|
+
|
|
11
|
+
function HierarchicalList(param) {
|
|
12
|
+
var className = param.className, _param_classNames = param.classNames, classNames = _param_classNames === void 0 ? {} : _param_classNames, items = param.items, createURL = param.createURL, onNavigate = param.onNavigate;
|
|
13
|
+
if (items.length === 0) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return /*#__PURE__*/ React.createElement("ul", {
|
|
17
|
+
className: instantsearchUiComponents.cx('ais-HierarchicalMenu-list', classNames.list, className)
|
|
18
|
+
}, items.map(function(item) {
|
|
19
|
+
return /*#__PURE__*/ React.createElement("li", {
|
|
20
|
+
key: item.value,
|
|
21
|
+
className: instantsearchUiComponents.cx('ais-HierarchicalMenu-item', classNames.item, item.isRefined && instantsearchUiComponents.cx('ais-HierarchicalMenu-item--selected', classNames.selectedItem), item.data && item.data.length > 0 && instantsearchUiComponents.cx('ais-HierarchicalMenu-item--parent', classNames.parentItem))
|
|
22
|
+
}, /*#__PURE__*/ React.createElement("a", {
|
|
23
|
+
className: instantsearchUiComponents.cx('ais-HierarchicalMenu-link', classNames.link, item.isRefined && instantsearchUiComponents.cx('ais-HierarchicalMenu-link--selected', classNames.selectedItemLink)),
|
|
24
|
+
href: createURL(item.value),
|
|
25
|
+
onClick: function onClick(event) {
|
|
26
|
+
if (isModifierClick.isModifierClick(event)) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
event.preventDefault();
|
|
30
|
+
onNavigate(item.value);
|
|
31
|
+
}
|
|
32
|
+
}, /*#__PURE__*/ React.createElement("span", {
|
|
33
|
+
className: instantsearchUiComponents.cx('ais-HierarchicalMenu-label', classNames.label)
|
|
34
|
+
}, item.label), /*#__PURE__*/ React.createElement("span", {
|
|
35
|
+
className: instantsearchUiComponents.cx('ais-HierarchicalMenu-count', classNames.count)
|
|
36
|
+
}, item.count)), item.data && /*#__PURE__*/ React.createElement(HierarchicalList, {
|
|
37
|
+
className: instantsearchUiComponents.cx('ais-HierarchicalMenu-list--child', classNames.childList),
|
|
38
|
+
classNames: classNames,
|
|
39
|
+
items: item.data,
|
|
40
|
+
onNavigate: onNavigate,
|
|
41
|
+
createURL: createURL
|
|
42
|
+
}));
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
function HierarchicalMenu(_0) {
|
|
46
|
+
var _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, items = _0.items, hasItems = _0.hasItems, onNavigate = _0.onNavigate, createURL = _0.createURL, showMore = _0.showMore, canToggleShowMore = _0.canToggleShowMore, onToggleShowMore = _0.onToggleShowMore, isShowingMore = _0.isShowingMore, translations = _0.translations, props = _object_without_properties._(_0, [
|
|
47
|
+
"classNames",
|
|
48
|
+
"items",
|
|
49
|
+
"hasItems",
|
|
50
|
+
"onNavigate",
|
|
51
|
+
"createURL",
|
|
52
|
+
"showMore",
|
|
53
|
+
"canToggleShowMore",
|
|
54
|
+
"onToggleShowMore",
|
|
55
|
+
"isShowingMore",
|
|
56
|
+
"translations"
|
|
57
|
+
]);
|
|
58
|
+
return /*#__PURE__*/ React.createElement("div", _object_spread_props._(_object_spread._({}, props), {
|
|
59
|
+
className: instantsearchUiComponents.cx('ais-HierarchicalMenu', classNames.root, !hasItems && instantsearchUiComponents.cx('ais-HierarchicalMenu--noRefinement', classNames.noRefinementRoot), props.className)
|
|
60
|
+
}), /*#__PURE__*/ React.createElement(HierarchicalList, {
|
|
61
|
+
classNames: classNames,
|
|
62
|
+
items: items,
|
|
63
|
+
onNavigate: onNavigate,
|
|
64
|
+
createURL: createURL
|
|
65
|
+
}), showMore && /*#__PURE__*/ React.createElement(ShowMoreButton.ShowMoreButton, {
|
|
66
|
+
className: instantsearchUiComponents.cx('ais-HierarchicalMenu-showMore', classNames.showMore, !canToggleShowMore && instantsearchUiComponents.cx('ais-HierarchicalMenu-showMore--disabled', classNames.disabledShowMore)),
|
|
67
|
+
disabled: !canToggleShowMore,
|
|
68
|
+
onClick: onToggleShowMore,
|
|
69
|
+
isShowingMore: isShowingMore,
|
|
70
|
+
translations: translations
|
|
52
71
|
}));
|
|
53
|
-
}));
|
|
54
72
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
classNames = _ref2$classNames === void 0 ? {} : _ref2$classNames,
|
|
58
|
-
items = _ref2.items,
|
|
59
|
-
hasItems = _ref2.hasItems,
|
|
60
|
-
onNavigate = _ref2.onNavigate,
|
|
61
|
-
createURL = _ref2.createURL,
|
|
62
|
-
showMore = _ref2.showMore,
|
|
63
|
-
canToggleShowMore = _ref2.canToggleShowMore,
|
|
64
|
-
onToggleShowMore = _ref2.onToggleShowMore,
|
|
65
|
-
isShowingMore = _ref2.isShowingMore,
|
|
66
|
-
translations = _ref2.translations,
|
|
67
|
-
props = _objectWithoutProperties(_ref2, _excluded);
|
|
68
|
-
return /*#__PURE__*/_react.default.createElement("div", _extends({}, props, {
|
|
69
|
-
className: (0, _instantsearchUiComponents.cx)('ais-HierarchicalMenu', classNames.root, !hasItems && (0, _instantsearchUiComponents.cx)('ais-HierarchicalMenu--noRefinement', classNames.noRefinementRoot), props.className)
|
|
70
|
-
}), /*#__PURE__*/_react.default.createElement(HierarchicalList, {
|
|
71
|
-
classNames: classNames,
|
|
72
|
-
items: items,
|
|
73
|
-
onNavigate: onNavigate,
|
|
74
|
-
createURL: createURL
|
|
75
|
-
}), showMore && /*#__PURE__*/_react.default.createElement(_ShowMoreButton.ShowMoreButton, {
|
|
76
|
-
className: (0, _instantsearchUiComponents.cx)('ais-HierarchicalMenu-showMore', classNames.showMore, !canToggleShowMore && (0, _instantsearchUiComponents.cx)('ais-HierarchicalMenu-showMore--disabled', classNames.disabledShowMore)),
|
|
77
|
-
disabled: !canToggleShowMore,
|
|
78
|
-
onClick: onToggleShowMore,
|
|
79
|
-
isShowingMore: isShowingMore,
|
|
80
|
-
translations: translations
|
|
81
|
-
}));
|
|
82
|
-
}
|
|
73
|
+
|
|
74
|
+
exports.HierarchicalMenu = HierarchicalMenu;
|
package/dist/cjs/ui/Highlight.js
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _object_spread = require('@swc/helpers/_/_object_spread');
|
|
4
|
+
var _object_without_properties = require('@swc/helpers/_/_object_without_properties');
|
|
5
|
+
var instantsearchUiComponents = require('instantsearch-ui-components');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var InternalHighlight = require('./InternalHighlight.js');
|
|
8
|
+
|
|
9
|
+
function Highlight(_0) {
|
|
10
|
+
var _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, props = _object_without_properties._(_0, [
|
|
11
|
+
"classNames"
|
|
12
|
+
]);
|
|
13
|
+
return /*#__PURE__*/ React.createElement(InternalHighlight.InternalHighlight, _object_spread._({
|
|
14
|
+
classNames: {
|
|
15
|
+
root: instantsearchUiComponents.cx('ais-Highlight', classNames.root),
|
|
16
|
+
highlighted: instantsearchUiComponents.cx('ais-Highlight-highlighted', classNames.highlighted),
|
|
17
|
+
nonHighlighted: instantsearchUiComponents.cx('ais-Highlight-nonHighlighted', classNames.nonHighlighted),
|
|
18
|
+
separator: instantsearchUiComponents.cx('ais-Highlight-separator', classNames.separator)
|
|
19
|
+
}
|
|
20
|
+
}, props));
|
|
21
|
+
}
|
|
2
22
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
23
|
exports.Highlight = Highlight;
|
|
7
|
-
var _instantsearchUiComponents = require("instantsearch-ui-components");
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _InternalHighlight = require("./InternalHighlight");
|
|
10
|
-
var _excluded = ["classNames"];
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
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
|
-
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; }
|
|
14
|
-
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; }
|
|
15
|
-
function Highlight(_ref) {
|
|
16
|
-
var _ref$classNames = _ref.classNames,
|
|
17
|
-
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
18
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
-
return /*#__PURE__*/_react.default.createElement(_InternalHighlight.InternalHighlight, _extends({
|
|
20
|
-
classNames: {
|
|
21
|
-
root: (0, _instantsearchUiComponents.cx)('ais-Highlight', classNames.root),
|
|
22
|
-
highlighted: (0, _instantsearchUiComponents.cx)('ais-Highlight-highlighted', classNames.highlighted),
|
|
23
|
-
nonHighlighted: (0, _instantsearchUiComponents.cx)('ais-Highlight-nonHighlighted', classNames.nonHighlighted),
|
|
24
|
-
separator: (0, _instantsearchUiComponents.cx)('ais-Highlight-separator', classNames.separator)
|
|
25
|
-
}
|
|
26
|
-
}, props));
|
|
27
|
-
}
|
|
@@ -1,36 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
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
|
+
|
|
9
|
+
function HitsPerPage(_0) {
|
|
10
|
+
var items = _0.items, onChange = _0.onChange, currentValue = _0.currentValue, _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, props = _object_without_properties._(_0, [
|
|
11
|
+
"items",
|
|
12
|
+
"onChange",
|
|
13
|
+
"currentValue",
|
|
14
|
+
"classNames"
|
|
15
|
+
]);
|
|
16
|
+
return /*#__PURE__*/ React.createElement("div", _object_spread_props._(_object_spread._({}, props), {
|
|
17
|
+
className: instantsearchUiComponents.cx('ais-HitsPerPage', classNames.root, props.className)
|
|
18
|
+
}), /*#__PURE__*/ React.createElement("select", {
|
|
19
|
+
className: instantsearchUiComponents.cx('ais-HitsPerPage-select', classNames.select),
|
|
20
|
+
onChange: function onChange1(event) {
|
|
21
|
+
onChange(Number(event.target.value));
|
|
22
|
+
},
|
|
23
|
+
value: String(currentValue)
|
|
24
|
+
}, items.map(function(item) {
|
|
25
|
+
return /*#__PURE__*/ React.createElement("option", {
|
|
26
|
+
key: item.value,
|
|
27
|
+
className: instantsearchUiComponents.cx('ais-HitsPerPage-option', classNames.option),
|
|
28
|
+
value: item.value
|
|
29
|
+
}, item.label);
|
|
30
|
+
})));
|
|
31
|
+
}
|
|
2
32
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
33
|
exports.HitsPerPage = HitsPerPage;
|
|
7
|
-
var _instantsearchUiComponents = require("instantsearch-ui-components");
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _excluded = ["items", "onChange", "currentValue", "classNames"];
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
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); }
|
|
12
|
-
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; }
|
|
13
|
-
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; }
|
|
14
|
-
function HitsPerPage(_ref) {
|
|
15
|
-
var items = _ref.items,
|
|
16
|
-
_onChange = _ref.onChange,
|
|
17
|
-
currentValue = _ref.currentValue,
|
|
18
|
-
_ref$classNames = _ref.classNames,
|
|
19
|
-
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
20
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
-
return /*#__PURE__*/_react.default.createElement("div", _extends({}, props, {
|
|
22
|
-
className: (0, _instantsearchUiComponents.cx)('ais-HitsPerPage', classNames.root, props.className)
|
|
23
|
-
}), /*#__PURE__*/_react.default.createElement("select", {
|
|
24
|
-
className: (0, _instantsearchUiComponents.cx)('ais-HitsPerPage-select', classNames.select),
|
|
25
|
-
onChange: function onChange(event) {
|
|
26
|
-
_onChange(Number(event.target.value));
|
|
27
|
-
},
|
|
28
|
-
value: String(currentValue)
|
|
29
|
-
}, items.map(function (item) {
|
|
30
|
-
return /*#__PURE__*/_react.default.createElement("option", {
|
|
31
|
-
key: item.value,
|
|
32
|
-
className: (0, _instantsearchUiComponents.cx)('ais-HitsPerPage-option', classNames.option),
|
|
33
|
-
value: item.value
|
|
34
|
-
}, item.label);
|
|
35
|
-
})));
|
|
36
|
-
}
|
|
@@ -1,92 +1,87 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
+
|
|
9
|
+
function DefaultHitComponent(param) {
|
|
10
|
+
var hit = param.hit;
|
|
11
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
12
|
+
style: {
|
|
13
|
+
wordBreak: 'break-all'
|
|
14
|
+
}
|
|
15
|
+
}, JSON.stringify(hit).slice(0, 100), "…");
|
|
16
|
+
}
|
|
17
|
+
function DefaultBanner(param) {
|
|
18
|
+
var classNames = param.classNames, banner = param.banner;
|
|
19
|
+
if (!banner.image.urls[0].url) {
|
|
20
|
+
return null;
|
|
19
21
|
}
|
|
20
|
-
|
|
22
|
+
return /*#__PURE__*/ React.createElement("aside", {
|
|
23
|
+
className: instantsearchUiComponents.cx('ais-InfiniteHits-banner', classNames.bannerRoot)
|
|
24
|
+
}, banner.link ? /*#__PURE__*/ React.createElement("a", {
|
|
25
|
+
className: instantsearchUiComponents.cx('ais-InfiniteHits-banner-link', classNames.bannerLink),
|
|
26
|
+
href: banner.link.url,
|
|
27
|
+
target: banner.link.target
|
|
28
|
+
}, /*#__PURE__*/ React.createElement("img", {
|
|
29
|
+
className: instantsearchUiComponents.cx('ais-InfiniteHits-banner-image', classNames.bannerImage),
|
|
30
|
+
src: banner.image.urls[0].url,
|
|
31
|
+
alt: banner.image.title
|
|
32
|
+
})) : /*#__PURE__*/ React.createElement("img", {
|
|
33
|
+
className: instantsearchUiComponents.cx('ais-InfiniteHits-banner-image', classNames.bannerImage),
|
|
34
|
+
src: banner.image.urls[0].url,
|
|
35
|
+
alt: banner.image.title
|
|
36
|
+
}));
|
|
21
37
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
function InfiniteHits(_0) {
|
|
39
|
+
var tmp = _0.hitComponent, HitComponent = tmp === void 0 ? DefaultHitComponent : tmp, hits = _0.hits, BannerComponent = _0.bannerComponent, banner = _0.banner, sendEvent = _0.sendEvent, isFirstPage = _0.isFirstPage, isLastPage = _0.isLastPage, onShowPrevious = _0.onShowPrevious, onShowMore = _0.onShowMore, _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, translations = _0.translations, props = _object_without_properties._(_0, [
|
|
40
|
+
"hitComponent",
|
|
41
|
+
"hits",
|
|
42
|
+
"bannerComponent",
|
|
43
|
+
"banner",
|
|
44
|
+
"sendEvent",
|
|
45
|
+
"isFirstPage",
|
|
46
|
+
"isLastPage",
|
|
47
|
+
"onShowPrevious",
|
|
48
|
+
"onShowMore",
|
|
49
|
+
"classNames",
|
|
50
|
+
"translations"
|
|
51
|
+
]);
|
|
52
|
+
return /*#__PURE__*/ React.createElement("div", _object_spread_props._(_object_spread._({}, props), {
|
|
53
|
+
className: instantsearchUiComponents.cx('ais-InfiniteHits', classNames.root, hits.length === 0 && instantsearchUiComponents.cx('ais-InfiniteHits--empty', classNames.emptyRoot), props.className)
|
|
54
|
+
}), onShowPrevious && /*#__PURE__*/ React.createElement("button", {
|
|
55
|
+
className: instantsearchUiComponents.cx('ais-InfiniteHits-loadPrevious', classNames.loadPrevious, isFirstPage && instantsearchUiComponents.cx('ais-InfiniteHits-loadPrevious--disabled', classNames.disabledLoadPrevious)),
|
|
56
|
+
onClick: onShowPrevious,
|
|
57
|
+
disabled: isFirstPage
|
|
58
|
+
}, translations.showPreviousButtonText), banner && (BannerComponent ? /*#__PURE__*/ React.createElement(BannerComponent, {
|
|
59
|
+
className: instantsearchUiComponents.cx('ais-InfiniteHits-banner', classNames.bannerRoot),
|
|
60
|
+
banner: banner
|
|
61
|
+
}) : /*#__PURE__*/ React.createElement(DefaultBanner, {
|
|
62
|
+
classNames: classNames,
|
|
63
|
+
banner: banner
|
|
64
|
+
})), /*#__PURE__*/ React.createElement("ol", {
|
|
65
|
+
className: instantsearchUiComponents.cx('ais-InfiniteHits-list', classNames.list)
|
|
66
|
+
}, hits.map(function(hit) {
|
|
67
|
+
return /*#__PURE__*/ React.createElement("li", {
|
|
68
|
+
key: hit.objectID,
|
|
69
|
+
className: instantsearchUiComponents.cx('ais-InfiniteHits-item', classNames.item),
|
|
70
|
+
onClick: function onClick() {
|
|
71
|
+
sendEvent('click:internal', hit, 'Hit Clicked');
|
|
72
|
+
},
|
|
73
|
+
onAuxClick: function onAuxClick() {
|
|
74
|
+
sendEvent('click:internal', hit, 'Hit Clicked');
|
|
75
|
+
}
|
|
76
|
+
}, /*#__PURE__*/ React.createElement(HitComponent, {
|
|
77
|
+
hit: hit,
|
|
78
|
+
sendEvent: sendEvent
|
|
79
|
+
}));
|
|
80
|
+
})), /*#__PURE__*/ React.createElement("button", {
|
|
81
|
+
className: instantsearchUiComponents.cx('ais-InfiniteHits-loadMore', classNames.loadMore, isLastPage && instantsearchUiComponents.cx('ais-InfiniteHits-loadMore--disabled', classNames.disabledLoadMore)),
|
|
82
|
+
onClick: onShowMore,
|
|
83
|
+
disabled: isLastPage
|
|
84
|
+
}, translations.showMoreButtonText));
|
|
43
85
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
HitComponent = _ref3$hitComponent === void 0 ? DefaultHitComponent : _ref3$hitComponent,
|
|
47
|
-
hits = _ref3.hits,
|
|
48
|
-
BannerComponent = _ref3.bannerComponent,
|
|
49
|
-
banner = _ref3.banner,
|
|
50
|
-
sendEvent = _ref3.sendEvent,
|
|
51
|
-
isFirstPage = _ref3.isFirstPage,
|
|
52
|
-
isLastPage = _ref3.isLastPage,
|
|
53
|
-
onShowPrevious = _ref3.onShowPrevious,
|
|
54
|
-
onShowMore = _ref3.onShowMore,
|
|
55
|
-
_ref3$classNames = _ref3.classNames,
|
|
56
|
-
classNames = _ref3$classNames === void 0 ? {} : _ref3$classNames,
|
|
57
|
-
translations = _ref3.translations,
|
|
58
|
-
props = _objectWithoutProperties(_ref3, _excluded);
|
|
59
|
-
return /*#__PURE__*/_react.default.createElement("div", _extends({}, props, {
|
|
60
|
-
className: (0, _instantsearchUiComponents.cx)('ais-InfiniteHits', classNames.root, hits.length === 0 && (0, _instantsearchUiComponents.cx)('ais-InfiniteHits--empty', classNames.emptyRoot), props.className)
|
|
61
|
-
}), onShowPrevious && /*#__PURE__*/_react.default.createElement("button", {
|
|
62
|
-
className: (0, _instantsearchUiComponents.cx)('ais-InfiniteHits-loadPrevious', classNames.loadPrevious, isFirstPage && (0, _instantsearchUiComponents.cx)('ais-InfiniteHits-loadPrevious--disabled', classNames.disabledLoadPrevious)),
|
|
63
|
-
onClick: onShowPrevious,
|
|
64
|
-
disabled: isFirstPage
|
|
65
|
-
}, translations.showPreviousButtonText), banner && (BannerComponent ? /*#__PURE__*/_react.default.createElement(BannerComponent, {
|
|
66
|
-
className: (0, _instantsearchUiComponents.cx)('ais-InfiniteHits-banner', classNames.bannerRoot),
|
|
67
|
-
banner: banner
|
|
68
|
-
}) : /*#__PURE__*/_react.default.createElement(DefaultBanner, {
|
|
69
|
-
classNames: classNames,
|
|
70
|
-
banner: banner
|
|
71
|
-
})), /*#__PURE__*/_react.default.createElement("ol", {
|
|
72
|
-
className: (0, _instantsearchUiComponents.cx)('ais-InfiniteHits-list', classNames.list)
|
|
73
|
-
}, hits.map(function (hit) {
|
|
74
|
-
return /*#__PURE__*/_react.default.createElement("li", {
|
|
75
|
-
key: hit.objectID,
|
|
76
|
-
className: (0, _instantsearchUiComponents.cx)('ais-InfiniteHits-item', classNames.item),
|
|
77
|
-
onClick: function onClick() {
|
|
78
|
-
sendEvent('click:internal', hit, 'Hit Clicked');
|
|
79
|
-
},
|
|
80
|
-
onAuxClick: function onAuxClick() {
|
|
81
|
-
sendEvent('click:internal', hit, 'Hit Clicked');
|
|
82
|
-
}
|
|
83
|
-
}, /*#__PURE__*/_react.default.createElement(HitComponent, {
|
|
84
|
-
hit: hit,
|
|
85
|
-
sendEvent: sendEvent
|
|
86
|
-
}));
|
|
87
|
-
})), /*#__PURE__*/_react.default.createElement("button", {
|
|
88
|
-
className: (0, _instantsearchUiComponents.cx)('ais-InfiniteHits-loadMore', classNames.loadMore, isLastPage && (0, _instantsearchUiComponents.cx)('ais-InfiniteHits-loadMore--disabled', classNames.disabledLoadMore)),
|
|
89
|
-
onClick: onShowMore,
|
|
90
|
-
disabled: isLastPage
|
|
91
|
-
}, translations.showMoreButtonText));
|
|
92
|
-
}
|
|
86
|
+
|
|
87
|
+
exports.InfiniteHits = InfiniteHits;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
var instantsearchUiComponents = require('instantsearch-ui-components');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
var InternalHighlight = instantsearchUiComponents.createHighlightComponent({
|
|
7
|
+
createElement: React.createElement,
|
|
8
|
+
Fragment: React.Fragment
|
|
5
9
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var InternalHighlight = exports.InternalHighlight = (0, _instantsearchUiComponents.createHighlightComponent)({
|
|
10
|
-
createElement: _react.createElement,
|
|
11
|
-
Fragment: _react.Fragment
|
|
12
|
-
});
|
|
10
|
+
|
|
11
|
+
exports.InternalHighlight = InternalHighlight;
|