react-instantsearch 7.26.0 → 7.27.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/components/AutocompleteSearch.js +18 -11
- package/dist/cjs/components/Carousel.js +24 -17
- package/dist/cjs/components/index.js +5 -5
- package/dist/cjs/index.js +8 -88
- package/dist/cjs/lib/useStickToBottom.js +17 -11
- package/dist/cjs/types/PartialKeys.js +3 -0
- package/dist/cjs/types/Translatable.js +3 -0
- package/dist/cjs/types/index.js +6 -0
- package/dist/cjs/ui/Breadcrumb.js +31 -24
- package/dist/cjs/ui/ClearRefinements.js +19 -12
- package/dist/cjs/ui/CurrentRefinements.js +32 -26
- package/dist/cjs/ui/HierarchicalMenu.js +35 -28
- package/dist/cjs/ui/Highlight.js +20 -13
- package/dist/cjs/ui/HitsPerPage.js +21 -14
- package/dist/cjs/ui/InfiniteHits.js +38 -31
- package/dist/cjs/ui/InternalHighlight.js +14 -8
- package/dist/cjs/ui/Menu.js +32 -25
- package/dist/cjs/ui/Pagination.js +39 -32
- package/dist/cjs/ui/PoweredBy.js +23 -16
- package/dist/cjs/ui/RangeInput.js +34 -27
- package/dist/cjs/ui/RefinementList.js +40 -33
- package/dist/cjs/ui/ReverseHighlight.js +20 -13
- package/dist/cjs/ui/SearchBox.js +43 -36
- package/dist/cjs/ui/ShowMoreButton.js +13 -6
- package/dist/cjs/ui/Snippet.js +20 -13
- package/dist/cjs/ui/SortBy.js +21 -14
- package/dist/cjs/ui/Stats.js +18 -11
- package/dist/cjs/ui/ToggleRefinement.js +23 -16
- package/dist/cjs/ui/lib/capitalize.js +9 -2
- package/dist/cjs/ui/lib/index.js +6 -7
- package/dist/cjs/ui/lib/isModifierClick.js +9 -2
- package/dist/cjs/widgets/Autocomplete.js +247 -118
- package/dist/cjs/widgets/Breadcrumb.js +17 -10
- package/dist/cjs/widgets/Chat.js +69 -47
- package/dist/cjs/widgets/ClearRefinements.js +17 -10
- package/dist/cjs/widgets/CurrentRefinements.js +17 -10
- package/dist/cjs/widgets/FilterSuggestions.js +20 -13
- package/dist/cjs/widgets/FrequentlyBoughtTogether.js +23 -16
- package/dist/cjs/widgets/HierarchicalMenu.js +18 -11
- package/dist/cjs/widgets/Highlight.js +19 -12
- package/dist/cjs/widgets/Hits.js +24 -17
- package/dist/cjs/widgets/HitsPerPage.js +17 -10
- package/dist/cjs/widgets/InfiniteHits.js +17 -10
- package/dist/cjs/widgets/LookingSimilar.js +23 -16
- package/dist/cjs/widgets/Menu.js +18 -11
- package/dist/cjs/widgets/Pagination.js +18 -11
- package/dist/cjs/widgets/PoweredBy.js +16 -9
- package/dist/cjs/widgets/RangeInput.js +17 -10
- package/dist/cjs/widgets/RefinementList.js +23 -16
- package/dist/cjs/widgets/RelatedProducts.js +23 -16
- package/dist/cjs/widgets/ReverseHighlight.js +19 -12
- package/dist/cjs/widgets/SearchBox.js +20 -13
- package/dist/cjs/widgets/Snippet.js +19 -12
- package/dist/cjs/widgets/SortBy.js +17 -10
- package/dist/cjs/widgets/Stats.js +17 -10
- package/dist/cjs/widgets/ToggleRefinement.js +17 -10
- package/dist/cjs/widgets/TrendingItems.js +23 -16
- package/dist/cjs/widgets/chat/tools/SearchIndexTool.js +32 -25
- package/dist/cjs/widgets/index.js +29 -76
- package/dist/cjs/widgets/index.umd.js +58 -59
- package/dist/es/widgets/Autocomplete.d.ts +8 -4
- package/dist/es/widgets/Autocomplete.js +153 -31
- package/dist/es/widgets/Chat.js +17 -4
- package/dist/umd/ReactInstantSearch.js +1199 -1007
- package/dist/umd/ReactInstantSearch.min.js +3 -3
- package/package.json +5 -5
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "RefinementList", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return RefinementList;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
13
|
+
var _object_spread = require("@swc/helpers/_/_object_spread");
|
|
14
|
+
var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
|
|
15
|
+
var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
|
|
16
|
+
var _instantsearchuicomponents = require("instantsearch-ui-components");
|
|
17
|
+
var _utils = require("instantsearch.js/cjs/lib/utils");
|
|
18
|
+
var _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
|
19
|
+
var _Highlight = require("./Highlight");
|
|
20
|
+
var _ShowMoreButton = require("./ShowMoreButton");
|
|
12
21
|
function RefinementList(_0) {
|
|
13
22
|
_0.canRefine; var items = _0.items, onRefine = _0.onRefine, query = _0.query, searchBox = _0.searchBox, noResults = _0.noResults, showMore = _0.showMore, canToggleShowMore = _0.canToggleShowMore, onToggleShowMore = _0.onToggleShowMore, isShowingMore = _0.isShowingMore, className = _0.className, _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, translations = _0.translations, props = _object_without_properties._(_0, [
|
|
14
23
|
"canRefine",
|
|
@@ -25,44 +34,42 @@ function RefinementList(_0) {
|
|
|
25
34
|
"classNames",
|
|
26
35
|
"translations"
|
|
27
36
|
]);
|
|
28
|
-
return /*#__PURE__*/
|
|
29
|
-
className:
|
|
30
|
-
}), searchBox && /*#__PURE__*/
|
|
31
|
-
className:
|
|
32
|
-
}, searchBox), noResults ? /*#__PURE__*/
|
|
33
|
-
className:
|
|
34
|
-
}, noResults) : /*#__PURE__*/
|
|
35
|
-
className:
|
|
37
|
+
return /*#__PURE__*/ _react.default.createElement("div", _object_spread_props._(_object_spread._({}, props), {
|
|
38
|
+
className: (0, _instantsearchuicomponents.cx)('ais-RefinementList', classNames.root, items.length === 0 && (0, _instantsearchuicomponents.cx)('ais-RefinementList--noRefinement', classNames.noRefinementRoot), className)
|
|
39
|
+
}), searchBox && /*#__PURE__*/ _react.default.createElement("div", {
|
|
40
|
+
className: (0, _instantsearchuicomponents.cx)('ais-RefinementList-searchBox', classNames.searchBox)
|
|
41
|
+
}, searchBox), noResults ? /*#__PURE__*/ _react.default.createElement("div", {
|
|
42
|
+
className: (0, _instantsearchuicomponents.cx)('ais-RefinementList-noResults', classNames.noResults)
|
|
43
|
+
}, noResults) : /*#__PURE__*/ _react.default.createElement("ul", {
|
|
44
|
+
className: (0, _instantsearchuicomponents.cx)('ais-RefinementList-list', classNames.list)
|
|
36
45
|
}, items.map(function(item) {
|
|
37
|
-
return /*#__PURE__*/
|
|
46
|
+
return /*#__PURE__*/ _react.default.createElement("li", {
|
|
38
47
|
key: item.value,
|
|
39
|
-
className:
|
|
40
|
-
}, /*#__PURE__*/
|
|
41
|
-
className:
|
|
42
|
-
}, /*#__PURE__*/
|
|
48
|
+
className: (0, _instantsearchuicomponents.cx)('ais-RefinementList-item', classNames.item, item.isRefined && (0, _instantsearchuicomponents.cx)('ais-RefinementList-item--selected', classNames.selectedItem))
|
|
49
|
+
}, /*#__PURE__*/ _react.default.createElement("label", {
|
|
50
|
+
className: (0, _instantsearchuicomponents.cx)('ais-RefinementList-label', classNames.label)
|
|
51
|
+
}, /*#__PURE__*/ _react.default.createElement("input", {
|
|
43
52
|
checked: item.isRefined,
|
|
44
|
-
className:
|
|
53
|
+
className: (0, _instantsearchuicomponents.cx)('ais-RefinementList-checkbox', classNames.checkbox),
|
|
45
54
|
type: "checkbox",
|
|
46
55
|
value: item.value,
|
|
47
56
|
onChange: function onChange() {
|
|
48
57
|
onRefine(item);
|
|
49
58
|
}
|
|
50
|
-
}), /*#__PURE__*/
|
|
51
|
-
className:
|
|
52
|
-
}, query.length > 0 ? /*#__PURE__*/
|
|
59
|
+
}), /*#__PURE__*/ _react.default.createElement("span", {
|
|
60
|
+
className: (0, _instantsearchuicomponents.cx)('ais-RefinementList-labelText', classNames.labelText)
|
|
61
|
+
}, query.length > 0 ? /*#__PURE__*/ _react.default.createElement(_Highlight.Highlight, {
|
|
53
62
|
parts: [
|
|
54
|
-
|
|
63
|
+
(0, _utils.getHighlightedParts)((0, _utils.unescape)(item.highlighted || ''))
|
|
55
64
|
]
|
|
56
|
-
}) : item.label), /*#__PURE__*/
|
|
57
|
-
className:
|
|
65
|
+
}) : item.label), /*#__PURE__*/ _react.default.createElement("span", {
|
|
66
|
+
className: (0, _instantsearchuicomponents.cx)('ais-RefinementList-count', classNames.count)
|
|
58
67
|
}, item.count)));
|
|
59
|
-
})), showMore && /*#__PURE__*/
|
|
60
|
-
className:
|
|
68
|
+
})), showMore && /*#__PURE__*/ _react.default.createElement(_ShowMoreButton.ShowMoreButton, {
|
|
69
|
+
className: (0, _instantsearchuicomponents.cx)('ais-RefinementList-showMore', classNames.showMore, !canToggleShowMore && (0, _instantsearchuicomponents.cx)('ais-RefinementList-showMore--disabled', classNames.disabledShowMore)),
|
|
61
70
|
disabled: !canToggleShowMore,
|
|
62
71
|
onClick: onToggleShowMore,
|
|
63
72
|
isShowingMore: isShowingMore,
|
|
64
73
|
translations: translations
|
|
65
74
|
}));
|
|
66
75
|
}
|
|
67
|
-
|
|
68
|
-
exports.RefinementList = RefinementList;
|
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "ReverseHighlight", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return ReverseHighlight;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
13
|
+
var _object_spread = require("@swc/helpers/_/_object_spread");
|
|
14
|
+
var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
|
|
15
|
+
var _instantsearchuicomponents = require("instantsearch-ui-components");
|
|
16
|
+
var _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
|
17
|
+
var _InternalHighlight = require("./InternalHighlight");
|
|
9
18
|
function ReverseHighlight(_0) {
|
|
10
19
|
var _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, props = _object_without_properties._(_0, [
|
|
11
20
|
"classNames"
|
|
12
21
|
]);
|
|
13
|
-
return /*#__PURE__*/
|
|
22
|
+
return /*#__PURE__*/ _react.default.createElement(_InternalHighlight.InternalHighlight, _object_spread._({
|
|
14
23
|
classNames: {
|
|
15
|
-
root:
|
|
16
|
-
highlighted:
|
|
17
|
-
nonHighlighted:
|
|
18
|
-
separator:
|
|
24
|
+
root: (0, _instantsearchuicomponents.cx)('ais-ReverseHighlight', classNames.root),
|
|
25
|
+
highlighted: (0, _instantsearchuicomponents.cx)('ais-ReverseHighlight-highlighted', classNames.highlighted),
|
|
26
|
+
nonHighlighted: (0, _instantsearchuicomponents.cx)('ais-ReverseHighlight-nonHighlighted', classNames.nonHighlighted),
|
|
27
|
+
separator: (0, _instantsearchuicomponents.cx)('ais-ReverseHighlight-separator', classNames.separator)
|
|
19
28
|
}
|
|
20
29
|
}, props));
|
|
21
30
|
}
|
|
22
|
-
|
|
23
|
-
exports.ReverseHighlight = ReverseHighlight;
|
package/dist/cjs/ui/SearchBox.js
CHANGED
|
@@ -1,59 +1,68 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "SearchBox", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return SearchBox;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
13
|
+
var _object_spread = require("@swc/helpers/_/_object_spread");
|
|
14
|
+
var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
|
|
15
|
+
var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
|
|
16
|
+
var _instantsearchuicomponents = require("instantsearch-ui-components");
|
|
17
|
+
var _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
|
9
18
|
function DefaultSubmitIcon(param) {
|
|
10
19
|
var classNames = param.classNames;
|
|
11
|
-
return /*#__PURE__*/
|
|
12
|
-
className:
|
|
20
|
+
return /*#__PURE__*/ _react.default.createElement("svg", {
|
|
21
|
+
className: (0, _instantsearchuicomponents.cx)('ais-SearchBox-submitIcon', classNames.submitIcon),
|
|
13
22
|
width: "10",
|
|
14
23
|
height: "10",
|
|
15
24
|
viewBox: "0 0 40 40",
|
|
16
25
|
"aria-hidden": "true"
|
|
17
|
-
}, /*#__PURE__*/
|
|
26
|
+
}, /*#__PURE__*/ _react.default.createElement("path", {
|
|
18
27
|
d: "M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z"
|
|
19
28
|
}));
|
|
20
29
|
}
|
|
21
30
|
function DefaultResetIcon(param) {
|
|
22
31
|
var classNames = param.classNames;
|
|
23
|
-
return /*#__PURE__*/
|
|
24
|
-
className:
|
|
32
|
+
return /*#__PURE__*/ _react.default.createElement("svg", {
|
|
33
|
+
className: (0, _instantsearchuicomponents.cx)('ais-SearchBox-resetIcon', classNames.resetIcon),
|
|
25
34
|
viewBox: "0 0 20 20",
|
|
26
35
|
width: "10",
|
|
27
36
|
height: "10",
|
|
28
37
|
"aria-hidden": "true"
|
|
29
|
-
}, /*#__PURE__*/
|
|
38
|
+
}, /*#__PURE__*/ _react.default.createElement("path", {
|
|
30
39
|
d: "M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z"
|
|
31
40
|
}));
|
|
32
41
|
}
|
|
33
42
|
function DefaultLoadingIcon(param) {
|
|
34
43
|
var classNames = param.classNames;
|
|
35
|
-
return /*#__PURE__*/
|
|
44
|
+
return /*#__PURE__*/ _react.default.createElement("svg", {
|
|
36
45
|
"aria-label": "Results are loading",
|
|
37
46
|
width: "16",
|
|
38
47
|
height: "16",
|
|
39
48
|
viewBox: "0 0 38 38",
|
|
40
49
|
stroke: "#444",
|
|
41
|
-
className:
|
|
50
|
+
className: (0, _instantsearchuicomponents.cx)('ais-SearchBox-loadingIcon', classNames.loadingIcon),
|
|
42
51
|
"aria-hidden": "true"
|
|
43
|
-
}, /*#__PURE__*/
|
|
52
|
+
}, /*#__PURE__*/ _react.default.createElement("g", {
|
|
44
53
|
fill: "none",
|
|
45
54
|
fillRule: "evenodd"
|
|
46
|
-
}, /*#__PURE__*/
|
|
55
|
+
}, /*#__PURE__*/ _react.default.createElement("g", {
|
|
47
56
|
transform: "translate(1 1)",
|
|
48
57
|
strokeWidth: "2"
|
|
49
|
-
}, /*#__PURE__*/
|
|
58
|
+
}, /*#__PURE__*/ _react.default.createElement("circle", {
|
|
50
59
|
strokeOpacity: ".5",
|
|
51
60
|
cx: "18",
|
|
52
61
|
cy: "18",
|
|
53
62
|
r: "18"
|
|
54
|
-
}), /*#__PURE__*/
|
|
63
|
+
}), /*#__PURE__*/ _react.default.createElement("path", {
|
|
55
64
|
d: "M36 18c0-9.94-8.06-18-18-18"
|
|
56
|
-
}, /*#__PURE__*/
|
|
65
|
+
}, /*#__PURE__*/ _react.default.createElement("animateTransform", {
|
|
57
66
|
attributeName: "transform",
|
|
58
67
|
type: "rotate",
|
|
59
68
|
from: "0 18 18",
|
|
@@ -98,19 +107,19 @@ function SearchBox(_0) {
|
|
|
98
107
|
inputRef.current.focus();
|
|
99
108
|
}
|
|
100
109
|
}
|
|
101
|
-
return /*#__PURE__*/
|
|
102
|
-
className:
|
|
103
|
-
}), /*#__PURE__*/
|
|
110
|
+
return /*#__PURE__*/ _react.default.createElement("div", _object_spread_props._(_object_spread._({}, props), {
|
|
111
|
+
className: (0, _instantsearchuicomponents.cx)('ais-SearchBox', classNames.root, props.className)
|
|
112
|
+
}), /*#__PURE__*/ _react.default.createElement("form", {
|
|
104
113
|
ref: formRef,
|
|
105
114
|
action: "",
|
|
106
|
-
className:
|
|
115
|
+
className: (0, _instantsearchuicomponents.cx)('ais-SearchBox-form', classNames.form),
|
|
107
116
|
noValidate: true,
|
|
108
117
|
onSubmit: handleSubmit,
|
|
109
118
|
onReset: handleReset,
|
|
110
119
|
role: "search"
|
|
111
|
-
}, /*#__PURE__*/
|
|
120
|
+
}, /*#__PURE__*/ _react.default.createElement("input", _object_spread_props._(_object_spread._({}, inputProps), {
|
|
112
121
|
ref: inputRef,
|
|
113
|
-
className:
|
|
122
|
+
className: (0, _instantsearchuicomponents.cx)('ais-SearchBox-input', classNames.input, inputProps === null || inputProps === void 0 ? void 0 : inputProps.className),
|
|
114
123
|
"aria-label": "Search",
|
|
115
124
|
autoComplete: "off",
|
|
116
125
|
autoCorrect: "off",
|
|
@@ -123,25 +132,23 @@ function SearchBox(_0) {
|
|
|
123
132
|
onChange: onChange,
|
|
124
133
|
onCompositionEnd: onChange,
|
|
125
134
|
autoFocus: autoFocus
|
|
126
|
-
})), /*#__PURE__*/
|
|
127
|
-
className:
|
|
135
|
+
})), /*#__PURE__*/ _react.default.createElement("button", {
|
|
136
|
+
className: (0, _instantsearchuicomponents.cx)('ais-SearchBox-submit', classNames.submit),
|
|
128
137
|
type: "submit",
|
|
129
138
|
title: translations.submitButtonTitle
|
|
130
|
-
}, /*#__PURE__*/
|
|
139
|
+
}, /*#__PURE__*/ _react.default.createElement(SubmitIcon, {
|
|
131
140
|
classNames: classNames
|
|
132
|
-
})), /*#__PURE__*/
|
|
133
|
-
className:
|
|
141
|
+
})), /*#__PURE__*/ _react.default.createElement("button", {
|
|
142
|
+
className: (0, _instantsearchuicomponents.cx)('ais-SearchBox-reset', classNames.reset),
|
|
134
143
|
type: "reset",
|
|
135
144
|
title: translations.resetButtonTitle,
|
|
136
145
|
hidden: value.length === 0 || isSearchStalled
|
|
137
|
-
}, /*#__PURE__*/
|
|
146
|
+
}, /*#__PURE__*/ _react.default.createElement(ResetIcon, {
|
|
138
147
|
classNames: classNames
|
|
139
|
-
})), /*#__PURE__*/
|
|
140
|
-
className:
|
|
148
|
+
})), /*#__PURE__*/ _react.default.createElement("span", {
|
|
149
|
+
className: (0, _instantsearchuicomponents.cx)('ais-SearchBox-loadingIndicator', classNames.loadingIndicator),
|
|
141
150
|
hidden: !isSearchStalled
|
|
142
|
-
}, /*#__PURE__*/
|
|
151
|
+
}, /*#__PURE__*/ _react.default.createElement(LoadingIcon, {
|
|
143
152
|
classNames: classNames
|
|
144
153
|
}))));
|
|
145
154
|
}
|
|
146
|
-
|
|
147
|
-
exports.SearchBox = SearchBox;
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "ShowMoreButton", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return ShowMoreButton;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
13
|
+
var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
|
|
14
|
+
var _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
|
6
15
|
function ShowMoreButton(_0) {
|
|
7
16
|
var isShowingMore = _0.isShowingMore, translations = _0.translations, props = _object_without_properties._(_0, [
|
|
8
17
|
"isShowingMore",
|
|
9
18
|
"translations"
|
|
10
19
|
]);
|
|
11
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/ _react.default.createElement("button", props, translations.showMoreButtonText({
|
|
12
21
|
isShowingMore: isShowingMore
|
|
13
22
|
}));
|
|
14
23
|
}
|
|
15
|
-
|
|
16
|
-
exports.ShowMoreButton = ShowMoreButton;
|
package/dist/cjs/ui/Snippet.js
CHANGED
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Snippet", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return Snippet;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
13
|
+
var _object_spread = require("@swc/helpers/_/_object_spread");
|
|
14
|
+
var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
|
|
15
|
+
var _instantsearchuicomponents = require("instantsearch-ui-components");
|
|
16
|
+
var _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
|
17
|
+
var _InternalHighlight = require("./InternalHighlight");
|
|
9
18
|
function Snippet(_0) {
|
|
10
19
|
var _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, props = _object_without_properties._(_0, [
|
|
11
20
|
"classNames"
|
|
12
21
|
]);
|
|
13
|
-
return /*#__PURE__*/
|
|
22
|
+
return /*#__PURE__*/ _react.default.createElement(_InternalHighlight.InternalHighlight, _object_spread._({
|
|
14
23
|
classNames: {
|
|
15
|
-
root:
|
|
16
|
-
highlighted:
|
|
17
|
-
nonHighlighted:
|
|
18
|
-
separator:
|
|
24
|
+
root: (0, _instantsearchuicomponents.cx)('ais-Snippet', classNames.root),
|
|
25
|
+
highlighted: (0, _instantsearchuicomponents.cx)('ais-Snippet-highlighted', classNames.highlighted),
|
|
26
|
+
nonHighlighted: (0, _instantsearchuicomponents.cx)('ais-Snippet-nonHighlighted', classNames.nonHighlighted),
|
|
27
|
+
separator: (0, _instantsearchuicomponents.cx)('ais-Snippet-separator', classNames.separator)
|
|
19
28
|
}
|
|
20
29
|
}, props));
|
|
21
30
|
}
|
|
22
|
-
|
|
23
|
-
exports.Snippet = Snippet;
|
package/dist/cjs/ui/SortBy.js
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "SortBy", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return SortBy;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
13
|
+
var _object_spread = require("@swc/helpers/_/_object_spread");
|
|
14
|
+
var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
|
|
15
|
+
var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
|
|
16
|
+
var _instantsearchuicomponents = require("instantsearch-ui-components");
|
|
17
|
+
var _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
|
9
18
|
function SortBy(_0) {
|
|
10
19
|
var items = _0.items, value = _0.value, _0_onChange = _0.onChange, onChange = _0_onChange === void 0 ? function() {} : _0_onChange, _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, props = _object_without_properties._(_0, [
|
|
11
20
|
"items",
|
|
@@ -13,22 +22,20 @@ function SortBy(_0) {
|
|
|
13
22
|
"onChange",
|
|
14
23
|
"classNames"
|
|
15
24
|
]);
|
|
16
|
-
return /*#__PURE__*/
|
|
17
|
-
className:
|
|
18
|
-
}), /*#__PURE__*/
|
|
19
|
-
className:
|
|
25
|
+
return /*#__PURE__*/ _react.default.createElement("div", _object_spread_props._(_object_spread._({}, props), {
|
|
26
|
+
className: (0, _instantsearchuicomponents.cx)('ais-SortBy', classNames.root, props.className)
|
|
27
|
+
}), /*#__PURE__*/ _react.default.createElement("select", {
|
|
28
|
+
className: (0, _instantsearchuicomponents.cx)('ais-SortBy-select', classNames.select),
|
|
20
29
|
onChange: function onChange1(event) {
|
|
21
30
|
return onChange(event.target.value);
|
|
22
31
|
},
|
|
23
32
|
value: value,
|
|
24
33
|
"aria-label": "Sort results by"
|
|
25
34
|
}, items.map(function(item) {
|
|
26
|
-
return /*#__PURE__*/
|
|
27
|
-
className:
|
|
35
|
+
return /*#__PURE__*/ _react.default.createElement("option", {
|
|
36
|
+
className: (0, _instantsearchuicomponents.cx)('ais-SortBy-option', classNames.option),
|
|
28
37
|
key: item.value,
|
|
29
38
|
value: item.value
|
|
30
39
|
}, item.label);
|
|
31
40
|
})));
|
|
32
41
|
}
|
|
33
|
-
|
|
34
|
-
exports.SortBy = SortBy;
|
package/dist/cjs/ui/Stats.js
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Stats", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return Stats;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
13
|
+
var _object_spread = require("@swc/helpers/_/_object_spread");
|
|
14
|
+
var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
|
|
15
|
+
var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
|
|
16
|
+
var _instantsearchuicomponents = require("instantsearch-ui-components");
|
|
17
|
+
var _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
|
9
18
|
function Stats(_0) {
|
|
10
19
|
var _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, nbHits = _0.nbHits, processingTimeMS = _0.processingTimeMS, nbSortedHits = _0.nbSortedHits, areHitsSorted = _0.areHitsSorted, translations = _0.translations, props = _object_without_properties._(_0, [
|
|
11
20
|
"classNames",
|
|
@@ -21,11 +30,9 @@ function Stats(_0) {
|
|
|
21
30
|
nbSortedHits: nbSortedHits,
|
|
22
31
|
areHitsSorted: areHitsSorted
|
|
23
32
|
};
|
|
24
|
-
return /*#__PURE__*/
|
|
25
|
-
className:
|
|
26
|
-
}), /*#__PURE__*/
|
|
33
|
+
return /*#__PURE__*/ _react.default.createElement("div", _object_spread_props._(_object_spread._({}, props), {
|
|
34
|
+
className: (0, _instantsearchuicomponents.cx)('ais-Stats', classNames.root, props.className)
|
|
35
|
+
}), /*#__PURE__*/ _react.default.createElement("span", {
|
|
27
36
|
className: "ais-Stats-text"
|
|
28
37
|
}, translations.rootElementText(translationOptions)));
|
|
29
38
|
}
|
|
30
|
-
|
|
31
|
-
exports.Stats = Stats;
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "ToggleRefinement", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return ToggleRefinement;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
13
|
+
var _object_spread = require("@swc/helpers/_/_object_spread");
|
|
14
|
+
var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
|
|
15
|
+
var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
|
|
16
|
+
var _instantsearchuicomponents = require("instantsearch-ui-components");
|
|
17
|
+
var _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
|
9
18
|
function ToggleRefinement(_0) {
|
|
10
19
|
var _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, checked = _0.checked, onChange = _0.onChange, label = _0.label, props = _object_without_properties._(_0, [
|
|
11
20
|
"classNames",
|
|
@@ -13,20 +22,18 @@ function ToggleRefinement(_0) {
|
|
|
13
22
|
"onChange",
|
|
14
23
|
"label"
|
|
15
24
|
]);
|
|
16
|
-
return /*#__PURE__*/
|
|
17
|
-
className:
|
|
18
|
-
}), /*#__PURE__*/
|
|
19
|
-
className:
|
|
20
|
-
}, /*#__PURE__*/
|
|
21
|
-
className:
|
|
25
|
+
return /*#__PURE__*/ _react.default.createElement("div", _object_spread_props._(_object_spread._({}, props), {
|
|
26
|
+
className: (0, _instantsearchuicomponents.cx)('ais-ToggleRefinement', classNames.root, props.className)
|
|
27
|
+
}), /*#__PURE__*/ _react.default.createElement("label", {
|
|
28
|
+
className: (0, _instantsearchuicomponents.cx)('ais-ToggleRefinement-label', classNames.label)
|
|
29
|
+
}, /*#__PURE__*/ _react.default.createElement("input", {
|
|
30
|
+
className: (0, _instantsearchuicomponents.cx)('ais-ToggleRefinement-checkbox', classNames.checkbox),
|
|
22
31
|
type: "checkbox",
|
|
23
32
|
checked: checked,
|
|
24
33
|
onChange: function onChange1(event) {
|
|
25
34
|
onChange(event.target.checked);
|
|
26
35
|
}
|
|
27
|
-
}), /*#__PURE__*/
|
|
28
|
-
className:
|
|
36
|
+
}), /*#__PURE__*/ _react.default.createElement("span", {
|
|
37
|
+
className: (0, _instantsearchuicomponents.cx)('ais-ToggleRefinement-labelText', classNames.labelText)
|
|
29
38
|
}, label)));
|
|
30
39
|
}
|
|
31
|
-
|
|
32
|
-
exports.ToggleRefinement = ToggleRefinement;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "capitalize", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return capitalize;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
3
12
|
function capitalize(text) {
|
|
4
13
|
return text.toString().charAt(0).toUpperCase() + text.toString().slice(1);
|
|
5
14
|
}
|
|
6
|
-
|
|
7
|
-
exports.capitalize = capitalize;
|
package/dist/cjs/ui/lib/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports.isModifierClick = isModifierClick.isModifierClick;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _export_star = require("@swc/helpers/_/_export_star");
|
|
7
|
+
_export_star._(require("./capitalize"), exports);
|
|
8
|
+
_export_star._(require("./isModifierClick"), exports);
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "isModifierClick", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return isModifierClick;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
3
12
|
function isModifierClick(event) {
|
|
4
13
|
var isMiddleClick = event.button === 1;
|
|
5
14
|
return Boolean(isMiddleClick || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey);
|
|
6
15
|
}
|
|
7
|
-
|
|
8
|
-
exports.isModifierClick = isModifierClick;
|