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
package/dist/es/ui/Breadcrumb.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
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; }
|
|
1
|
+
import { _ as _$2 } from '@swc/helpers/cjs/_object_spread.cjs';
|
|
2
|
+
import { _ as _$1 } from '@swc/helpers/cjs/_object_spread_props.cjs';
|
|
3
|
+
import { _ } from '@swc/helpers/cjs/_object_without_properties.cjs';
|
|
5
4
|
import { cx } from 'instantsearch-ui-components';
|
|
6
5
|
import React from 'react';
|
|
7
|
-
import { isModifierClick } from
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
6
|
+
import { isModifierClick } from './lib/isModifierClick.js';
|
|
7
|
+
|
|
8
|
+
function Breadcrumb(_0) {
|
|
9
|
+
var _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, _0_items = _0.items, items = _0_items === void 0 ? [] : _0_items, hasItems = _0.hasItems, createURL = _0.createURL, onNavigate = _0.onNavigate, _0_separator = _0.separator, separator = _0_separator === void 0 ? '>' : _0_separator, translations = _0.translations, props = _(_0, [
|
|
10
|
+
"classNames",
|
|
11
|
+
"items",
|
|
12
|
+
"hasItems",
|
|
13
|
+
"createURL",
|
|
14
|
+
"onNavigate",
|
|
15
|
+
"separator",
|
|
16
|
+
"translations"
|
|
17
|
+
]);
|
|
18
|
+
var handleClick = function handleClick(value) {
|
|
19
|
+
return function(event) {
|
|
20
|
+
if (!isModifierClick(event)) {
|
|
21
|
+
event.preventDefault();
|
|
22
|
+
onNavigate(value);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
26
25
|
};
|
|
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
|
-
|
|
52
|
-
|
|
26
|
+
return /*#__PURE__*/ React.createElement("div", _$1(_$2({}, props), {
|
|
27
|
+
className: cx('ais-Breadcrumb', classNames.root, !hasItems && cx('ais-Breadcrumb--noRefinement', classNames.noRefinementRoot), props.className)
|
|
28
|
+
}), /*#__PURE__*/ React.createElement("ul", {
|
|
29
|
+
className: cx('ais-Breadcrumb-list', classNames.list)
|
|
30
|
+
}, /*#__PURE__*/ React.createElement("li", {
|
|
31
|
+
className: cx('ais-Breadcrumb-item', classNames.item, !hasItems && cx('ais-Breadcrumb-item--selected', classNames.selectedItem))
|
|
32
|
+
}, /*#__PURE__*/ React.createElement("a", {
|
|
33
|
+
href: createURL(null),
|
|
34
|
+
onClick: handleClick(null),
|
|
35
|
+
className: cx('ais-Breadcrumb-link', classNames.link)
|
|
36
|
+
}, translations.rootElementText)), items.map(function(item, index) {
|
|
37
|
+
var isLast = index === items.length - 1;
|
|
38
|
+
return /*#__PURE__*/ React.createElement("li", {
|
|
39
|
+
key: index,
|
|
40
|
+
className: cx('ais-Breadcrumb-item', classNames.item, isLast && cx('ais-Breadcrumb-item--selected', classNames.selectedItem))
|
|
41
|
+
}, /*#__PURE__*/ React.createElement("span", {
|
|
42
|
+
"aria-hidden": "true",
|
|
43
|
+
className: cx('ais-Breadcrumb-separator', classNames.separator)
|
|
44
|
+
}, separator), isLast ? item.label : /*#__PURE__*/ React.createElement("a", {
|
|
45
|
+
className: cx('ais-Breadcrumb-link', classNames.link),
|
|
46
|
+
href: createURL(item.value),
|
|
47
|
+
onClick: handleClick(item.value)
|
|
48
|
+
}, item.label));
|
|
49
|
+
})));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { Breadcrumb };
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
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; }
|
|
1
|
+
import { _ as _$2 } from '@swc/helpers/cjs/_object_spread.cjs';
|
|
2
|
+
import { _ as _$1 } from '@swc/helpers/cjs/_object_spread_props.cjs';
|
|
3
|
+
import { _ } from '@swc/helpers/cjs/_object_without_properties.cjs';
|
|
5
4
|
import { cx } from 'instantsearch-ui-components';
|
|
6
5
|
import React from 'react';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
6
|
+
|
|
7
|
+
function ClearRefinements(_0) {
|
|
8
|
+
var _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, _0_disabled = _0.disabled, disabled = _0_disabled === void 0 ? false : _0_disabled, _0_onClick = _0.onClick, onClick = _0_onClick === void 0 ? function() {} : _0_onClick, translations = _0.translations, props = _(_0, [
|
|
9
|
+
"classNames",
|
|
10
|
+
"disabled",
|
|
11
|
+
"onClick",
|
|
12
|
+
"translations"
|
|
13
|
+
]);
|
|
14
|
+
return /*#__PURE__*/ React.createElement("div", _$1(_$2({}, props), {
|
|
15
|
+
className: cx('ais-ClearRefinements', classNames.root, props.className)
|
|
16
|
+
}), /*#__PURE__*/ React.createElement("button", {
|
|
17
|
+
disabled: disabled,
|
|
18
|
+
onClick: onClick,
|
|
19
|
+
className: cx('ais-ClearRefinements-button', classNames.button, disabled && cx('ais-ClearRefinements-button--disabled', classNames.disabledButton))
|
|
20
|
+
}, translations.resetButtonText));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { ClearRefinements };
|
|
@@ -1,45 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
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; }
|
|
1
|
+
import { _ as _$2 } from '@swc/helpers/cjs/_object_spread.cjs';
|
|
2
|
+
import { _ as _$1 } from '@swc/helpers/cjs/_object_spread_props.cjs';
|
|
3
|
+
import { _ } from '@swc/helpers/cjs/_object_without_properties.cjs';
|
|
5
4
|
import { cx } from 'instantsearch-ui-components';
|
|
6
5
|
import React from 'react';
|
|
7
|
-
import { capitalize
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
}
|
|
6
|
+
import { capitalize } from './lib/capitalize.js';
|
|
7
|
+
import { isModifierClick } from './lib/isModifierClick.js';
|
|
8
|
+
|
|
9
|
+
function CurrentRefinements(_0) {
|
|
10
|
+
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 = _(_0, [
|
|
11
|
+
"classNames",
|
|
12
|
+
"items",
|
|
13
|
+
"hasRefinements"
|
|
14
|
+
]);
|
|
15
|
+
return /*#__PURE__*/ React.createElement("div", _$1(_$2({}, props), {
|
|
16
|
+
className: cx('ais-CurrentRefinements', classNames.root, !hasRefinements && cx('ais-CurrentRefinements--noRefinement', classNames.noRefinementRoot), props.className)
|
|
17
|
+
}), /*#__PURE__*/ React.createElement("ul", {
|
|
18
|
+
className: cx('ais-CurrentRefinements-list', classNames.list, /* @MAJOR remove to ensure conformity with InstantSearch.css specs */ !hasRefinements && cx('ais-CurrentRefinements-list--noRefinement', classNames.noRefinementList))
|
|
19
|
+
}, items.map(function(item) {
|
|
20
|
+
return /*#__PURE__*/ React.createElement("li", {
|
|
21
|
+
key: [
|
|
22
|
+
item.indexName,
|
|
23
|
+
item.label
|
|
24
|
+
].join('/'),
|
|
25
|
+
className: cx('ais-CurrentRefinements-item', classNames.item)
|
|
26
|
+
}, /*#__PURE__*/ React.createElement("span", {
|
|
27
|
+
className: cx('ais-CurrentRefinements-label', classNames.label)
|
|
28
|
+
}, capitalize(item.label), ":", ' '), item.refinements.map(function(refinement) {
|
|
29
|
+
return /*#__PURE__*/ React.createElement("span", {
|
|
30
|
+
key: refinement.label,
|
|
31
|
+
className: cx('ais-CurrentRefinements-category', classNames.category)
|
|
32
|
+
}, /*#__PURE__*/ React.createElement("span", {
|
|
33
|
+
className: cx('ais-CurrentRefinements-categoryLabel', classNames.categoryLabel)
|
|
34
|
+
}, refinement.label), /*#__PURE__*/ React.createElement("button", {
|
|
35
|
+
type: "button",
|
|
36
|
+
onClick: function onClick(event) {
|
|
37
|
+
if (isModifierClick(event)) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
item.refine(refinement);
|
|
41
|
+
},
|
|
42
|
+
className: cx('ais-CurrentRefinements-delete', classNames.delete)
|
|
43
|
+
}, "✕"));
|
|
44
|
+
}));
|
|
45
|
+
})));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { CurrentRefinements };
|
|
@@ -1,75 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
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; }
|
|
1
|
+
import { _ as _$2 } from '@swc/helpers/cjs/_object_spread.cjs';
|
|
2
|
+
import { _ as _$1 } from '@swc/helpers/cjs/_object_spread_props.cjs';
|
|
3
|
+
import { _ } from '@swc/helpers/cjs/_object_without_properties.cjs';
|
|
5
4
|
import { cx } from 'instantsearch-ui-components';
|
|
6
5
|
import React from 'react';
|
|
7
|
-
import { isModifierClick } from
|
|
8
|
-
import { ShowMoreButton } from
|
|
9
|
-
|
|
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
|
-
items: item.data,
|
|
43
|
-
onNavigate: onNavigate,
|
|
44
|
-
createURL: createURL
|
|
6
|
+
import { isModifierClick } from './lib/isModifierClick.js';
|
|
7
|
+
import { ShowMoreButton } from './ShowMoreButton.js';
|
|
8
|
+
|
|
9
|
+
function HierarchicalList(param) {
|
|
10
|
+
var className = param.className, _param_classNames = param.classNames, classNames = _param_classNames === void 0 ? {} : _param_classNames, items = param.items, createURL = param.createURL, onNavigate = param.onNavigate;
|
|
11
|
+
if (items.length === 0) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return /*#__PURE__*/ React.createElement("ul", {
|
|
15
|
+
className: cx('ais-HierarchicalMenu-list', classNames.list, className)
|
|
16
|
+
}, items.map(function(item) {
|
|
17
|
+
return /*#__PURE__*/ React.createElement("li", {
|
|
18
|
+
key: item.value,
|
|
19
|
+
className: cx('ais-HierarchicalMenu-item', classNames.item, item.isRefined && cx('ais-HierarchicalMenu-item--selected', classNames.selectedItem), item.data && item.data.length > 0 && cx('ais-HierarchicalMenu-item--parent', classNames.parentItem))
|
|
20
|
+
}, /*#__PURE__*/ React.createElement("a", {
|
|
21
|
+
className: cx('ais-HierarchicalMenu-link', classNames.link, item.isRefined && cx('ais-HierarchicalMenu-link--selected', classNames.selectedItemLink)),
|
|
22
|
+
href: createURL(item.value),
|
|
23
|
+
onClick: function onClick(event) {
|
|
24
|
+
if (isModifierClick(event)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
onNavigate(item.value);
|
|
29
|
+
}
|
|
30
|
+
}, /*#__PURE__*/ React.createElement("span", {
|
|
31
|
+
className: cx('ais-HierarchicalMenu-label', classNames.label)
|
|
32
|
+
}, item.label), /*#__PURE__*/ React.createElement("span", {
|
|
33
|
+
className: cx('ais-HierarchicalMenu-count', classNames.count)
|
|
34
|
+
}, item.count)), item.data && /*#__PURE__*/ React.createElement(HierarchicalList, {
|
|
35
|
+
className: cx('ais-HierarchicalMenu-list--child', classNames.childList),
|
|
36
|
+
classNames: classNames,
|
|
37
|
+
items: item.data,
|
|
38
|
+
onNavigate: onNavigate,
|
|
39
|
+
createURL: createURL
|
|
40
|
+
}));
|
|
45
41
|
}));
|
|
46
|
-
}));
|
|
47
42
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
43
|
+
function HierarchicalMenu(_0) {
|
|
44
|
+
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 = _(_0, [
|
|
45
|
+
"classNames",
|
|
46
|
+
"items",
|
|
47
|
+
"hasItems",
|
|
48
|
+
"onNavigate",
|
|
49
|
+
"createURL",
|
|
50
|
+
"showMore",
|
|
51
|
+
"canToggleShowMore",
|
|
52
|
+
"onToggleShowMore",
|
|
53
|
+
"isShowingMore",
|
|
54
|
+
"translations"
|
|
55
|
+
]);
|
|
56
|
+
return /*#__PURE__*/ React.createElement("div", _$1(_$2({}, props), {
|
|
57
|
+
className: cx('ais-HierarchicalMenu', classNames.root, !hasItems && cx('ais-HierarchicalMenu--noRefinement', classNames.noRefinementRoot), props.className)
|
|
58
|
+
}), /*#__PURE__*/ React.createElement(HierarchicalList, {
|
|
59
|
+
classNames: classNames,
|
|
60
|
+
items: items,
|
|
61
|
+
onNavigate: onNavigate,
|
|
62
|
+
createURL: createURL
|
|
63
|
+
}), showMore && /*#__PURE__*/ React.createElement(ShowMoreButton, {
|
|
64
|
+
className: cx('ais-HierarchicalMenu-showMore', classNames.showMore, !canToggleShowMore && cx('ais-HierarchicalMenu-showMore--disabled', classNames.disabledShowMore)),
|
|
65
|
+
disabled: !canToggleShowMore,
|
|
66
|
+
onClick: onToggleShowMore,
|
|
67
|
+
isShowingMore: isShowingMore,
|
|
68
|
+
translations: translations
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { HierarchicalMenu };
|
package/dist/es/ui/Highlight.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
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; }
|
|
4
|
-
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; }
|
|
1
|
+
import { _ as _$1 } from '@swc/helpers/cjs/_object_spread.cjs';
|
|
2
|
+
import { _ } from '@swc/helpers/cjs/_object_without_properties.cjs';
|
|
5
3
|
import { cx } from 'instantsearch-ui-components';
|
|
6
4
|
import React from 'react';
|
|
7
|
-
import { InternalHighlight } from
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
5
|
+
import { InternalHighlight } from './InternalHighlight.js';
|
|
6
|
+
|
|
7
|
+
function Highlight(_0) {
|
|
8
|
+
var _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, props = _(_0, [
|
|
9
|
+
"classNames"
|
|
10
|
+
]);
|
|
11
|
+
return /*#__PURE__*/ React.createElement(InternalHighlight, _$1({
|
|
12
|
+
classNames: {
|
|
13
|
+
root: cx('ais-Highlight', classNames.root),
|
|
14
|
+
highlighted: cx('ais-Highlight-highlighted', classNames.highlighted),
|
|
15
|
+
nonHighlighted: cx('ais-Highlight-nonHighlighted', classNames.nonHighlighted),
|
|
16
|
+
separator: cx('ais-Highlight-separator', classNames.separator)
|
|
17
|
+
}
|
|
18
|
+
}, props));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { Highlight };
|
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
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; }
|
|
1
|
+
import { _ as _$2 } from '@swc/helpers/cjs/_object_spread.cjs';
|
|
2
|
+
import { _ as _$1 } from '@swc/helpers/cjs/_object_spread_props.cjs';
|
|
3
|
+
import { _ } from '@swc/helpers/cjs/_object_without_properties.cjs';
|
|
5
4
|
import { cx } from 'instantsearch-ui-components';
|
|
6
5
|
import React from 'react';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
6
|
+
|
|
7
|
+
function HitsPerPage(_0) {
|
|
8
|
+
var items = _0.items, onChange = _0.onChange, currentValue = _0.currentValue, _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, props = _(_0, [
|
|
9
|
+
"items",
|
|
10
|
+
"onChange",
|
|
11
|
+
"currentValue",
|
|
12
|
+
"classNames"
|
|
13
|
+
]);
|
|
14
|
+
return /*#__PURE__*/ React.createElement("div", _$1(_$2({}, props), {
|
|
15
|
+
className: cx('ais-HitsPerPage', classNames.root, props.className)
|
|
16
|
+
}), /*#__PURE__*/ React.createElement("select", {
|
|
17
|
+
className: cx('ais-HitsPerPage-select', classNames.select),
|
|
18
|
+
onChange: function onChange1(event) {
|
|
19
|
+
onChange(Number(event.target.value));
|
|
20
|
+
},
|
|
21
|
+
value: String(currentValue)
|
|
22
|
+
}, items.map(function(item) {
|
|
23
|
+
return /*#__PURE__*/ React.createElement("option", {
|
|
24
|
+
key: item.value,
|
|
25
|
+
className: cx('ais-HitsPerPage-option', classNames.option),
|
|
26
|
+
value: item.value
|
|
27
|
+
}, item.label);
|
|
28
|
+
})));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { HitsPerPage };
|