react-instantsearch 7.26.1 → 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 +243 -119
- 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 +146 -29
- package/dist/es/widgets/Chat.js +17 -4
- package/dist/umd/ReactInstantSearch.js +1190 -1003
- package/dist/umd/ReactInstantSearch.min.js +3 -3
- package/package.json +5 -5
|
@@ -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, "HitsPerPage", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return HitsPerPage;
|
|
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 HitsPerPage(_0) {
|
|
10
19
|
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
20
|
"items",
|
|
@@ -13,21 +22,19 @@ function HitsPerPage(_0) {
|
|
|
13
22
|
"currentValue",
|
|
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-HitsPerPage', classNames.root, props.className)
|
|
27
|
+
}), /*#__PURE__*/ _react.default.createElement("select", {
|
|
28
|
+
className: (0, _instantsearchuicomponents.cx)('ais-HitsPerPage-select', classNames.select),
|
|
20
29
|
onChange: function onChange1(event) {
|
|
21
30
|
onChange(Number(event.target.value));
|
|
22
31
|
},
|
|
23
32
|
value: String(currentValue)
|
|
24
33
|
}, items.map(function(item) {
|
|
25
|
-
return /*#__PURE__*/
|
|
34
|
+
return /*#__PURE__*/ _react.default.createElement("option", {
|
|
26
35
|
key: item.value,
|
|
27
|
-
className:
|
|
36
|
+
className: (0, _instantsearchuicomponents.cx)('ais-HitsPerPage-option', classNames.option),
|
|
28
37
|
value: item.value
|
|
29
38
|
}, item.label);
|
|
30
39
|
})));
|
|
31
40
|
}
|
|
32
|
-
|
|
33
|
-
exports.HitsPerPage = HitsPerPage;
|
|
@@ -1,14 +1,23 @@
|
|
|
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, "InfiniteHits", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return InfiniteHits;
|
|
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 DefaultHitComponent(param) {
|
|
10
19
|
var hit = param.hit;
|
|
11
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/ _react.default.createElement("div", {
|
|
12
21
|
style: {
|
|
13
22
|
wordBreak: 'break-all'
|
|
14
23
|
}
|
|
@@ -19,18 +28,18 @@ function DefaultBanner(param) {
|
|
|
19
28
|
if (!banner.image.urls[0].url) {
|
|
20
29
|
return null;
|
|
21
30
|
}
|
|
22
|
-
return /*#__PURE__*/
|
|
23
|
-
className:
|
|
24
|
-
}, banner.link ? /*#__PURE__*/
|
|
25
|
-
className:
|
|
31
|
+
return /*#__PURE__*/ _react.default.createElement("aside", {
|
|
32
|
+
className: (0, _instantsearchuicomponents.cx)('ais-InfiniteHits-banner', classNames.bannerRoot)
|
|
33
|
+
}, banner.link ? /*#__PURE__*/ _react.default.createElement("a", {
|
|
34
|
+
className: (0, _instantsearchuicomponents.cx)('ais-InfiniteHits-banner-link', classNames.bannerLink),
|
|
26
35
|
href: banner.link.url,
|
|
27
36
|
target: banner.link.target
|
|
28
|
-
}, /*#__PURE__*/
|
|
29
|
-
className:
|
|
37
|
+
}, /*#__PURE__*/ _react.default.createElement("img", {
|
|
38
|
+
className: (0, _instantsearchuicomponents.cx)('ais-InfiniteHits-banner-image', classNames.bannerImage),
|
|
30
39
|
src: banner.image.urls[0].url,
|
|
31
40
|
alt: banner.image.title
|
|
32
|
-
})) : /*#__PURE__*/
|
|
33
|
-
className:
|
|
41
|
+
})) : /*#__PURE__*/ _react.default.createElement("img", {
|
|
42
|
+
className: (0, _instantsearchuicomponents.cx)('ais-InfiniteHits-banner-image', classNames.bannerImage),
|
|
34
43
|
src: banner.image.urls[0].url,
|
|
35
44
|
alt: banner.image.title
|
|
36
45
|
}));
|
|
@@ -49,39 +58,37 @@ function InfiniteHits(_0) {
|
|
|
49
58
|
"classNames",
|
|
50
59
|
"translations"
|
|
51
60
|
]);
|
|
52
|
-
return /*#__PURE__*/
|
|
53
|
-
className:
|
|
54
|
-
}), onShowPrevious && /*#__PURE__*/
|
|
55
|
-
className:
|
|
61
|
+
return /*#__PURE__*/ _react.default.createElement("div", _object_spread_props._(_object_spread._({}, props), {
|
|
62
|
+
className: (0, _instantsearchuicomponents.cx)('ais-InfiniteHits', classNames.root, hits.length === 0 && (0, _instantsearchuicomponents.cx)('ais-InfiniteHits--empty', classNames.emptyRoot), props.className)
|
|
63
|
+
}), onShowPrevious && /*#__PURE__*/ _react.default.createElement("button", {
|
|
64
|
+
className: (0, _instantsearchuicomponents.cx)('ais-InfiniteHits-loadPrevious', classNames.loadPrevious, isFirstPage && (0, _instantsearchuicomponents.cx)('ais-InfiniteHits-loadPrevious--disabled', classNames.disabledLoadPrevious)),
|
|
56
65
|
onClick: onShowPrevious,
|
|
57
66
|
disabled: isFirstPage
|
|
58
|
-
}, translations.showPreviousButtonText), banner && (BannerComponent ? /*#__PURE__*/
|
|
59
|
-
className:
|
|
67
|
+
}, translations.showPreviousButtonText), banner && (BannerComponent ? /*#__PURE__*/ _react.default.createElement(BannerComponent, {
|
|
68
|
+
className: (0, _instantsearchuicomponents.cx)('ais-InfiniteHits-banner', classNames.bannerRoot),
|
|
60
69
|
banner: banner
|
|
61
|
-
}) : /*#__PURE__*/
|
|
70
|
+
}) : /*#__PURE__*/ _react.default.createElement(DefaultBanner, {
|
|
62
71
|
classNames: classNames,
|
|
63
72
|
banner: banner
|
|
64
|
-
})), /*#__PURE__*/
|
|
65
|
-
className:
|
|
73
|
+
})), /*#__PURE__*/ _react.default.createElement("ol", {
|
|
74
|
+
className: (0, _instantsearchuicomponents.cx)('ais-InfiniteHits-list', classNames.list)
|
|
66
75
|
}, hits.map(function(hit) {
|
|
67
|
-
return /*#__PURE__*/
|
|
76
|
+
return /*#__PURE__*/ _react.default.createElement("li", {
|
|
68
77
|
key: hit.objectID,
|
|
69
|
-
className:
|
|
78
|
+
className: (0, _instantsearchuicomponents.cx)('ais-InfiniteHits-item', classNames.item),
|
|
70
79
|
onClick: function onClick() {
|
|
71
80
|
sendEvent('click:internal', hit, 'Hit Clicked');
|
|
72
81
|
},
|
|
73
82
|
onAuxClick: function onAuxClick() {
|
|
74
83
|
sendEvent('click:internal', hit, 'Hit Clicked');
|
|
75
84
|
}
|
|
76
|
-
}, /*#__PURE__*/
|
|
85
|
+
}, /*#__PURE__*/ _react.default.createElement(HitComponent, {
|
|
77
86
|
hit: hit,
|
|
78
87
|
sendEvent: sendEvent
|
|
79
88
|
}));
|
|
80
|
-
})), /*#__PURE__*/
|
|
81
|
-
className:
|
|
89
|
+
})), /*#__PURE__*/ _react.default.createElement("button", {
|
|
90
|
+
className: (0, _instantsearchuicomponents.cx)('ais-InfiniteHits-loadMore', classNames.loadMore, isLastPage && (0, _instantsearchuicomponents.cx)('ais-InfiniteHits-loadMore--disabled', classNames.disabledLoadMore)),
|
|
82
91
|
onClick: onShowMore,
|
|
83
92
|
disabled: isLastPage
|
|
84
93
|
}, translations.showMoreButtonText));
|
|
85
94
|
}
|
|
86
|
-
|
|
87
|
-
exports.InfiniteHits = InfiniteHits;
|
|
@@ -1,11 +1,17 @@
|
|
|
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, "InternalHighlight", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return InternalHighlight;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _instantsearchuicomponents = require("instantsearch-ui-components");
|
|
13
|
+
var _react = require("react");
|
|
14
|
+
var InternalHighlight = (0, _instantsearchuicomponents.createHighlightComponent)({
|
|
15
|
+
createElement: _react.createElement,
|
|
16
|
+
Fragment: _react.Fragment
|
|
9
17
|
});
|
|
10
|
-
|
|
11
|
-
exports.InternalHighlight = InternalHighlight;
|
package/dist/cjs/ui/Menu.js
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Menu", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return Menu;
|
|
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"));
|
|
18
|
+
var _isModifierClick = require("./lib/isModifierClick");
|
|
19
|
+
var _ShowMoreButton = require("./ShowMoreButton");
|
|
11
20
|
function Menu(_0) {
|
|
12
21
|
var items = _0.items, _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, showMore = _0.showMore, canToggleShowMore = _0.canToggleShowMore, onToggleShowMore = _0.onToggleShowMore, isShowingMore = _0.isShowingMore, createURL = _0.createURL, onRefine = _0.onRefine, translations = _0.translations, props = _object_without_properties._(_0, [
|
|
13
22
|
"items",
|
|
@@ -20,36 +29,34 @@ function Menu(_0) {
|
|
|
20
29
|
"onRefine",
|
|
21
30
|
"translations"
|
|
22
31
|
]);
|
|
23
|
-
return /*#__PURE__*/
|
|
24
|
-
className:
|
|
25
|
-
}), /*#__PURE__*/
|
|
26
|
-
className:
|
|
32
|
+
return /*#__PURE__*/ _react.default.createElement("div", _object_spread_props._(_object_spread._({}, props), {
|
|
33
|
+
className: (0, _instantsearchuicomponents.cx)('ais-Menu', classNames.root, items.length === 0 && (0, _instantsearchuicomponents.cx)('ais-Menu--noRefinement', classNames.noRefinementRoot), props.className)
|
|
34
|
+
}), /*#__PURE__*/ _react.default.createElement("ul", {
|
|
35
|
+
className: (0, _instantsearchuicomponents.cx)('ais-Menu-list', classNames.list)
|
|
27
36
|
}, items.map(function(item) {
|
|
28
|
-
return /*#__PURE__*/
|
|
37
|
+
return /*#__PURE__*/ _react.default.createElement("li", {
|
|
29
38
|
key: item.label,
|
|
30
|
-
className:
|
|
31
|
-
}, /*#__PURE__*/
|
|
32
|
-
className:
|
|
39
|
+
className: (0, _instantsearchuicomponents.cx)('ais-Menu-item', classNames.item, item.isRefined && (0, _instantsearchuicomponents.cx)('ais-Menu-item--selected', classNames.selectedItem))
|
|
40
|
+
}, /*#__PURE__*/ _react.default.createElement("a", {
|
|
41
|
+
className: (0, _instantsearchuicomponents.cx)('ais-Menu-link', classNames.link),
|
|
33
42
|
href: createURL(item.value),
|
|
34
43
|
onClick: function onClick(event) {
|
|
35
|
-
if (
|
|
44
|
+
if ((0, _isModifierClick.isModifierClick)(event)) {
|
|
36
45
|
return;
|
|
37
46
|
}
|
|
38
47
|
event.preventDefault();
|
|
39
48
|
onRefine(item);
|
|
40
49
|
}
|
|
41
|
-
}, /*#__PURE__*/
|
|
42
|
-
className:
|
|
43
|
-
}, item.label), /*#__PURE__*/
|
|
44
|
-
className:
|
|
50
|
+
}, /*#__PURE__*/ _react.default.createElement("span", {
|
|
51
|
+
className: (0, _instantsearchuicomponents.cx)('ais-Menu-label', classNames.label)
|
|
52
|
+
}, item.label), /*#__PURE__*/ _react.default.createElement("span", {
|
|
53
|
+
className: (0, _instantsearchuicomponents.cx)('ais-Menu-count', classNames.count)
|
|
45
54
|
}, item.count)));
|
|
46
|
-
})), showMore && /*#__PURE__*/
|
|
47
|
-
className:
|
|
55
|
+
})), showMore && /*#__PURE__*/ _react.default.createElement(_ShowMoreButton.ShowMoreButton, {
|
|
56
|
+
className: (0, _instantsearchuicomponents.cx)('ais-Menu-showMore', classNames.showMore, !canToggleShowMore && (0, _instantsearchuicomponents.cx)('ais-Menu-showMore--disabled', classNames.disabledShowMore)),
|
|
48
57
|
disabled: !canToggleShowMore,
|
|
49
58
|
onClick: onToggleShowMore,
|
|
50
59
|
isShowingMore: isShowingMore,
|
|
51
60
|
translations: translations
|
|
52
61
|
}));
|
|
53
62
|
}
|
|
54
|
-
|
|
55
|
-
exports.Menu = Menu;
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Pagination", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return Pagination;
|
|
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"));
|
|
18
|
+
var _isModifierClick = require("./lib/isModifierClick");
|
|
10
19
|
function Pagination(_0) {
|
|
11
20
|
var pages = _0.pages, currentPage = _0.currentPage, nbPages = _0.nbPages, isFirstPage = _0.isFirstPage, isLastPage = _0.isLastPage, _0_showFirst = _0.showFirst, showFirst = _0_showFirst === void 0 ? true : _0_showFirst, _0_showPrevious = _0.showPrevious, showPrevious = _0_showPrevious === void 0 ? true : _0_showPrevious, _0_showNext = _0.showNext, showNext = _0_showNext === void 0 ? true : _0_showNext, _0_showLast = _0.showLast, showLast = _0_showLast === void 0 ? true : _0_showLast, createURL = _0.createURL, onNavigate = _0.onNavigate, translations = _0.translations, _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, props = _object_without_properties._(_0, [
|
|
12
21
|
"pages",
|
|
@@ -27,22 +36,22 @@ function Pagination(_0) {
|
|
|
27
36
|
var previousPageIndex = currentPage - 1;
|
|
28
37
|
var nextPageIndex = currentPage + 1;
|
|
29
38
|
var lastPageIndex = nbPages - 1;
|
|
30
|
-
return /*#__PURE__*/
|
|
31
|
-
className:
|
|
32
|
-
}), /*#__PURE__*/
|
|
33
|
-
className:
|
|
34
|
-
}, showFirst && /*#__PURE__*/
|
|
39
|
+
return /*#__PURE__*/ _react.default.createElement("div", _object_spread_props._(_object_spread._({}, props), {
|
|
40
|
+
className: (0, _instantsearchuicomponents.cx)('ais-Pagination', classNames.root, nbPages <= 1 && (0, _instantsearchuicomponents.cx)('ais-Pagination--noRefinement', classNames.noRefinementRoot), props.className)
|
|
41
|
+
}), /*#__PURE__*/ _react.default.createElement("ul", {
|
|
42
|
+
className: (0, _instantsearchuicomponents.cx)('ais-Pagination-list', classNames.list)
|
|
43
|
+
}, showFirst && /*#__PURE__*/ _react.default.createElement(PaginationItem, {
|
|
35
44
|
isDisabled: isFirstPage,
|
|
36
|
-
className:
|
|
45
|
+
className: (0, _instantsearchuicomponents.cx)('ais-Pagination-item--firstPage', classNames.firstPageItem),
|
|
37
46
|
classNames: classNames,
|
|
38
47
|
"aria-label": translations.firstPageItemAriaLabel,
|
|
39
48
|
href: createURL(firstPageIndex),
|
|
40
49
|
onClick: function onClick() {
|
|
41
50
|
return onNavigate(firstPageIndex);
|
|
42
51
|
}
|
|
43
|
-
}, translations.firstPageItemText), showPrevious && /*#__PURE__*/
|
|
52
|
+
}, translations.firstPageItemText), showPrevious && /*#__PURE__*/ _react.default.createElement(PaginationItem, {
|
|
44
53
|
isDisabled: isFirstPage,
|
|
45
|
-
className:
|
|
54
|
+
className: (0, _instantsearchuicomponents.cx)('ais-Pagination-item--previousPage', classNames.previousPageItem),
|
|
46
55
|
classNames: classNames,
|
|
47
56
|
"aria-label": translations.previousPageItemAriaLabel,
|
|
48
57
|
href: createURL(previousPageIndex),
|
|
@@ -50,10 +59,10 @@ function Pagination(_0) {
|
|
|
50
59
|
return onNavigate(previousPageIndex);
|
|
51
60
|
}
|
|
52
61
|
}, translations.previousPageItemText), pages.map(function(page) {
|
|
53
|
-
return /*#__PURE__*/
|
|
62
|
+
return /*#__PURE__*/ _react.default.createElement(PaginationItem, {
|
|
54
63
|
key: page,
|
|
55
64
|
isDisabled: false,
|
|
56
|
-
className:
|
|
65
|
+
className: (0, _instantsearchuicomponents.cx)('ais-Pagination-item--page', classNames.pageItem, page === currentPage && (0, _instantsearchuicomponents.cx)('ais-Pagination-item--selected', classNames.selectedItem)),
|
|
57
66
|
classNames: classNames,
|
|
58
67
|
"aria-label": translations.pageItemAriaLabel({
|
|
59
68
|
currentPage: page + 1,
|
|
@@ -67,18 +76,18 @@ function Pagination(_0) {
|
|
|
67
76
|
currentPage: page + 1,
|
|
68
77
|
nbPages: nbPages
|
|
69
78
|
}));
|
|
70
|
-
}), showNext && /*#__PURE__*/
|
|
79
|
+
}), showNext && /*#__PURE__*/ _react.default.createElement(PaginationItem, {
|
|
71
80
|
isDisabled: isLastPage,
|
|
72
|
-
className:
|
|
81
|
+
className: (0, _instantsearchuicomponents.cx)('ais-Pagination-item--nextPage', classNames.nextPageItem),
|
|
73
82
|
classNames: classNames,
|
|
74
83
|
"aria-label": translations.nextPageItemAriaLabel,
|
|
75
84
|
href: createURL(nextPageIndex),
|
|
76
85
|
onClick: function onClick() {
|
|
77
86
|
return onNavigate(nextPageIndex);
|
|
78
87
|
}
|
|
79
|
-
}, translations.nextPageItemText), showLast && /*#__PURE__*/
|
|
88
|
+
}, translations.nextPageItemText), showLast && /*#__PURE__*/ _react.default.createElement(PaginationItem, {
|
|
80
89
|
isDisabled: isLastPage,
|
|
81
|
-
className:
|
|
90
|
+
className: (0, _instantsearchuicomponents.cx)('ais-Pagination-item--lastPage', classNames.lastPageItem),
|
|
82
91
|
classNames: classNames,
|
|
83
92
|
"aria-label": translations.lastPageItemAriaLabel,
|
|
84
93
|
href: createURL(lastPageIndex),
|
|
@@ -96,19 +105,19 @@ function PaginationItem(_0) {
|
|
|
96
105
|
"onClick"
|
|
97
106
|
]);
|
|
98
107
|
if (isDisabled) {
|
|
99
|
-
return /*#__PURE__*/
|
|
100
|
-
className:
|
|
101
|
-
}, /*#__PURE__*/
|
|
102
|
-
className:
|
|
108
|
+
return /*#__PURE__*/ _react.default.createElement("li", {
|
|
109
|
+
className: (0, _instantsearchuicomponents.cx)('ais-Pagination-item', classNames.item, 'ais-Pagination-item--disabled', classNames.disabledItem, className)
|
|
110
|
+
}, /*#__PURE__*/ _react.default.createElement("span", _object_spread._({
|
|
111
|
+
className: (0, _instantsearchuicomponents.cx)('ais-Pagination-link', classNames.link)
|
|
103
112
|
}, props)));
|
|
104
113
|
}
|
|
105
|
-
return /*#__PURE__*/
|
|
106
|
-
className:
|
|
107
|
-
}, /*#__PURE__*/
|
|
108
|
-
className:
|
|
114
|
+
return /*#__PURE__*/ _react.default.createElement("li", {
|
|
115
|
+
className: (0, _instantsearchuicomponents.cx)('ais-Pagination-item', classNames.item, className)
|
|
116
|
+
}, /*#__PURE__*/ _react.default.createElement("a", _object_spread._({
|
|
117
|
+
className: (0, _instantsearchuicomponents.cx)('ais-Pagination-link', classNames.link),
|
|
109
118
|
href: href,
|
|
110
119
|
onClick: function onClick1(event) {
|
|
111
|
-
if (
|
|
120
|
+
if ((0, _isModifierClick.isModifierClick)(event)) {
|
|
112
121
|
return;
|
|
113
122
|
}
|
|
114
123
|
event.preventDefault();
|
|
@@ -116,5 +125,3 @@ function PaginationItem(_0) {
|
|
|
116
125
|
}
|
|
117
126
|
}, props)));
|
|
118
127
|
}
|
|
119
|
-
|
|
120
|
-
exports.Pagination = Pagination;
|
package/dist/cjs/ui/PoweredBy.js
CHANGED
|
@@ -1,35 +1,42 @@
|
|
|
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, "PoweredBy", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return PoweredBy;
|
|
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 PoweredBy(_0) {
|
|
10
19
|
var _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, url = _0.url, _0_theme = _0.theme, theme = _0_theme === void 0 ? 'light' : _0_theme, props = _object_without_properties._(_0, [
|
|
11
20
|
"classNames",
|
|
12
21
|
"url",
|
|
13
22
|
"theme"
|
|
14
23
|
]);
|
|
15
|
-
return /*#__PURE__*/
|
|
16
|
-
className:
|
|
17
|
-
}), /*#__PURE__*/
|
|
24
|
+
return /*#__PURE__*/ _react.default.createElement("div", _object_spread_props._(_object_spread._({}, props), {
|
|
25
|
+
className: (0, _instantsearchuicomponents.cx)('ais-PoweredBy', theme === 'dark' ? (0, _instantsearchuicomponents.cx)('ais-PoweredBy--dark', classNames.dark) : (0, _instantsearchuicomponents.cx)('ais-PoweredBy--light', classNames.light), classNames.root, props.className)
|
|
26
|
+
}), /*#__PURE__*/ _react.default.createElement("a", {
|
|
18
27
|
href: url,
|
|
19
28
|
target: "_blank",
|
|
20
|
-
className:
|
|
29
|
+
className: (0, _instantsearchuicomponents.cx)('ais-PoweredBy-link', classNames.link),
|
|
21
30
|
"aria-label": "Search by Algolia",
|
|
22
31
|
rel: "noopener noreferrer"
|
|
23
|
-
}, /*#__PURE__*/
|
|
32
|
+
}, /*#__PURE__*/ _react.default.createElement("svg", {
|
|
24
33
|
viewBox: "0 0 572 64",
|
|
25
|
-
className:
|
|
26
|
-
}, /*#__PURE__*/
|
|
34
|
+
className: (0, _instantsearchuicomponents.cx)('ais-PoweredBy-logo', classNames.logo)
|
|
35
|
+
}, /*#__PURE__*/ _react.default.createElement("path", {
|
|
27
36
|
fill: theme === 'dark' ? '#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
|
}
|
|
34
|
-
|
|
35
|
-
exports.PoweredBy = PoweredBy;
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "RangeInput", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return RangeInput;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
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 _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
|
|
17
|
+
var _instantsearchuicomponents = require("instantsearch-ui-components");
|
|
18
|
+
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
10
19
|
// if the default value is undefined, React considers the component uncontrolled initially, which we don't want 0 or NaN as the default value
|
|
11
20
|
var unsetNumberInputValue = '';
|
|
12
21
|
// Strips leading `0` from a positive number value
|
|
@@ -30,8 +39,8 @@ function RangeInput(_0) {
|
|
|
30
39
|
min: minValue !== -Infinity && minValue !== min ? minValue : unsetNumberInputValue,
|
|
31
40
|
max: maxValue !== Infinity && maxValue !== max ? maxValue : unsetNumberInputValue
|
|
32
41
|
};
|
|
33
|
-
var _useState = _sliced_to_array._(
|
|
34
|
-
var _useState1 = _sliced_to_array._(
|
|
42
|
+
var _useState = _sliced_to_array._((0, _react.useState)(values), 2), prevValues = _useState[0], setPrevValues = _useState[1];
|
|
43
|
+
var _useState1 = _sliced_to_array._((0, _react.useState)({
|
|
35
44
|
from: (_values_min = values.min) === null || _values_min === void 0 ? void 0 : _values_min.toString(),
|
|
36
45
|
to: (_values_max = values.max) === null || _values_max === void 0 ? void 0 : _values_max.toString()
|
|
37
46
|
}), 2), _useState_ = _useState1[0], from = _useState_.from, to = _useState_.to, setRange = _useState1[1];
|
|
@@ -43,10 +52,10 @@ function RangeInput(_0) {
|
|
|
43
52
|
});
|
|
44
53
|
setPrevValues(values);
|
|
45
54
|
}
|
|
46
|
-
return /*#__PURE__*/
|
|
47
|
-
className:
|
|
48
|
-
}), /*#__PURE__*/
|
|
49
|
-
className:
|
|
55
|
+
return /*#__PURE__*/ _react.default.createElement("div", _object_spread_props._(_object_spread._({}, props), {
|
|
56
|
+
className: (0, _instantsearchuicomponents.cx)((0, _instantsearchuicomponents.cx)('ais-RangeInput', classNames.root), disabled && (0, _instantsearchuicomponents.cx)('ais-RangeInput--noRefinement', classNames.noRefinementRoot), props.className)
|
|
57
|
+
}), /*#__PURE__*/ _react.default.createElement("form", {
|
|
58
|
+
className: (0, _instantsearchuicomponents.cx)('ais-RangeInput-form', classNames.form),
|
|
50
59
|
onSubmit: function onSubmit1(event) {
|
|
51
60
|
event.preventDefault();
|
|
52
61
|
onSubmit([
|
|
@@ -54,10 +63,10 @@ function RangeInput(_0) {
|
|
|
54
63
|
to ? Number(to) : undefined
|
|
55
64
|
]);
|
|
56
65
|
}
|
|
57
|
-
}, /*#__PURE__*/
|
|
58
|
-
className:
|
|
59
|
-
}, /*#__PURE__*/
|
|
60
|
-
className:
|
|
66
|
+
}, /*#__PURE__*/ _react.default.createElement("label", {
|
|
67
|
+
className: (0, _instantsearchuicomponents.cx)('ais-RangeInput-label', classNames.label)
|
|
68
|
+
}, /*#__PURE__*/ _react.default.createElement("input", {
|
|
69
|
+
className: (0, _instantsearchuicomponents.cx)('ais-RangeInput-input', classNames.input, 'ais-RangeInput-input--min', classNames.inputMin),
|
|
61
70
|
type: "number",
|
|
62
71
|
min: min,
|
|
63
72
|
max: max,
|
|
@@ -73,12 +82,12 @@ function RangeInput(_0) {
|
|
|
73
82
|
to: to
|
|
74
83
|
});
|
|
75
84
|
}
|
|
76
|
-
})), /*#__PURE__*/
|
|
77
|
-
className:
|
|
78
|
-
}, translations.separatorElementText), /*#__PURE__*/
|
|
79
|
-
className:
|
|
80
|
-
}, /*#__PURE__*/
|
|
81
|
-
className:
|
|
85
|
+
})), /*#__PURE__*/ _react.default.createElement("span", {
|
|
86
|
+
className: (0, _instantsearchuicomponents.cx)('ais-RangeInput-separator', classNames.separator)
|
|
87
|
+
}, translations.separatorElementText), /*#__PURE__*/ _react.default.createElement("label", {
|
|
88
|
+
className: (0, _instantsearchuicomponents.cx)('ais-RangeInput-label', classNames.label)
|
|
89
|
+
}, /*#__PURE__*/ _react.default.createElement("input", {
|
|
90
|
+
className: (0, _instantsearchuicomponents.cx)('ais-RangeInput-input', classNames.input, 'ais-RangeInput-input--max', classNames.inputMax),
|
|
82
91
|
type: "number",
|
|
83
92
|
min: min,
|
|
84
93
|
max: max,
|
|
@@ -94,10 +103,8 @@ function RangeInput(_0) {
|
|
|
94
103
|
to: value || unsetNumberInputValue
|
|
95
104
|
});
|
|
96
105
|
}
|
|
97
|
-
})), /*#__PURE__*/
|
|
98
|
-
className:
|
|
106
|
+
})), /*#__PURE__*/ _react.default.createElement("button", {
|
|
107
|
+
className: (0, _instantsearchuicomponents.cx)('ais-RangeInput-submit', classNames.submit),
|
|
99
108
|
type: "submit"
|
|
100
109
|
}, translations.submitButtonText)));
|
|
101
110
|
}
|
|
102
|
-
|
|
103
|
-
exports.RangeInput = RangeInput;
|