react-instantsearch 7.2.0 → 7.2.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/README.md +6 -0
- package/dist/cjs/ui/CurrentRefinements.js +2 -4
- package/dist/cjs/widgets/CurrentRefinements.js +0 -2
- package/dist/cjs/widgets/Pagination.js +4 -4
- package/dist/es/ui/CurrentRefinements.d.ts +3 -4
- package/dist/es/ui/CurrentRefinements.js +2 -4
- package/dist/es/widgets/CurrentRefinements.d.ts +1 -1
- package/dist/es/widgets/CurrentRefinements.js +0 -2
- package/dist/es/widgets/Pagination.js +4 -4
- package/dist/umd/ReactInstantSearch.js +734 -605
- package/dist/umd/ReactInstantSearch.js.map +1 -1
- package/dist/umd/ReactInstantSearch.min.js +1 -1
- package/dist/umd/ReactInstantSearch.min.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/react/">
|
|
3
|
+
<img alt="React InstantSearch" src="https://github.com/algolia/instantsearch/blob/master/.github/react-instantsearch-banner.png?raw=true">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
1
7
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
2
8
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
3
9
|
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.CurrentRefinements = CurrentRefinements;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _lib = require("./lib");
|
|
9
|
-
var _excluded = ["classNames", "items", "
|
|
9
|
+
var _excluded = ["classNames", "items", "hasRefinements"];
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
12
12
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -16,8 +16,6 @@ function CurrentRefinements(_ref) {
|
|
|
16
16
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
17
17
|
_ref$items = _ref.items,
|
|
18
18
|
items = _ref$items === void 0 ? [] : _ref$items,
|
|
19
|
-
_ref$onRemove = _ref.onRemove,
|
|
20
|
-
onRemove = _ref$onRemove === void 0 ? function () {} : _ref$onRemove,
|
|
21
19
|
_ref$hasRefinements = _ref.hasRefinements,
|
|
22
20
|
hasRefinements = _ref$hasRefinements === void 0 ? false : _ref$hasRefinements,
|
|
23
21
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -44,7 +42,7 @@ function CurrentRefinements(_ref) {
|
|
|
44
42
|
if ((0, _lib.isModifierClick)(event)) {
|
|
45
43
|
return;
|
|
46
44
|
}
|
|
47
|
-
|
|
45
|
+
item.refine(refinement);
|
|
48
46
|
},
|
|
49
47
|
className: (0, _lib.cx)('ais-CurrentRefinements-delete', classNames.delete)
|
|
50
48
|
}, "\u2715"));
|
|
@@ -25,11 +25,9 @@ function CurrentRefinements(_ref) {
|
|
|
25
25
|
$$widgetType: 'ais.currentRefinements'
|
|
26
26
|
}),
|
|
27
27
|
items = _useCurrentRefinement.items,
|
|
28
|
-
refine = _useCurrentRefinement.refine,
|
|
29
28
|
canRefine = _useCurrentRefinement.canRefine;
|
|
30
29
|
var uiProps = {
|
|
31
30
|
items: items,
|
|
32
|
-
onRemove: refine,
|
|
33
31
|
hasRefinements: canRefine
|
|
34
32
|
};
|
|
35
33
|
return /*#__PURE__*/_react.default.createElement(_CurrentRefinements.CurrentRefinements, _extends({}, props, uiProps));
|
|
@@ -57,10 +57,10 @@ function Pagination(_ref) {
|
|
|
57
57
|
var currentPage = _ref2.currentPage;
|
|
58
58
|
return String(currentPage);
|
|
59
59
|
},
|
|
60
|
-
firstPageItemAriaLabel: 'First',
|
|
61
|
-
previousPageItemAriaLabel: 'Previous',
|
|
62
|
-
nextPageItemAriaLabel: 'Next',
|
|
63
|
-
lastPageItemAriaLabel:
|
|
60
|
+
firstPageItemAriaLabel: 'First Page',
|
|
61
|
+
previousPageItemAriaLabel: 'Previous Page',
|
|
62
|
+
nextPageItemAriaLabel: 'Next Page',
|
|
63
|
+
lastPageItemAriaLabel: "Last Page, Page ".concat(nbPages),
|
|
64
64
|
pageItemAriaLabel: function pageItemAriaLabel(_ref3) {
|
|
65
65
|
var currentPage = _ref3.currentPage;
|
|
66
66
|
return "Page ".concat(currentPage);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { CurrentRefinementsConnectorParamsItem
|
|
2
|
+
import type { CurrentRefinementsConnectorParamsItem } from 'instantsearch.js/es/connectors/current-refinements/connectCurrentRefinements';
|
|
3
3
|
export type CurrentRefinementsProps = React.ComponentProps<'div'> & {
|
|
4
4
|
classNames?: Partial<CurrentRefinementsClassNames>;
|
|
5
|
-
items?: Array<Pick<CurrentRefinementsConnectorParamsItem, 'label' | 'refinements'> & Record<string, unknown>>;
|
|
6
|
-
onRemove?: (refinement: CurrentRefinementsConnectorParamsRefinement) => void;
|
|
5
|
+
items?: Array<Pick<CurrentRefinementsConnectorParamsItem, 'label' | 'refinements' | 'refine'> & Record<string, unknown>>;
|
|
7
6
|
hasRefinements?: boolean;
|
|
8
7
|
};
|
|
9
8
|
export type CurrentRefinementsClassNames = {
|
|
@@ -44,4 +43,4 @@ export type CurrentRefinementsClassNames = {
|
|
|
44
43
|
*/
|
|
45
44
|
delete: string;
|
|
46
45
|
};
|
|
47
|
-
export declare function CurrentRefinements({ classNames, items,
|
|
46
|
+
export declare function CurrentRefinements({ classNames, items, hasRefinements, ...props }: CurrentRefinementsProps): JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["classNames", "items", "
|
|
1
|
+
var _excluded = ["classNames", "items", "hasRefinements"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -9,8 +9,6 @@ export function CurrentRefinements(_ref) {
|
|
|
9
9
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
10
10
|
_ref$items = _ref.items,
|
|
11
11
|
items = _ref$items === void 0 ? [] : _ref$items,
|
|
12
|
-
_ref$onRemove = _ref.onRemove,
|
|
13
|
-
onRemove = _ref$onRemove === void 0 ? function () {} : _ref$onRemove,
|
|
14
12
|
_ref$hasRefinements = _ref.hasRefinements,
|
|
15
13
|
hasRefinements = _ref$hasRefinements === void 0 ? false : _ref$hasRefinements,
|
|
16
14
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -37,7 +35,7 @@ export function CurrentRefinements(_ref) {
|
|
|
37
35
|
if (isModifierClick(event)) {
|
|
38
36
|
return;
|
|
39
37
|
}
|
|
40
|
-
|
|
38
|
+
item.refine(refinement);
|
|
41
39
|
},
|
|
42
40
|
className: cx('ais-CurrentRefinements-delete', classNames.delete)
|
|
43
41
|
}, "\u2715"));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CurrentRefinementsProps as CurrentRefinementsUiComponentProps } from '../ui/CurrentRefinements';
|
|
2
2
|
import type { UseCurrentRefinementsProps } from 'react-instantsearch-core';
|
|
3
|
-
type UiProps = Pick<CurrentRefinementsUiComponentProps, 'items' | '
|
|
3
|
+
type UiProps = Pick<CurrentRefinementsUiComponentProps, 'items' | 'hasRefinements'>;
|
|
4
4
|
export type CurrentRefinementsProps = Omit<CurrentRefinementsUiComponentProps, keyof UiProps> & UseCurrentRefinementsProps;
|
|
5
5
|
export declare function CurrentRefinements({ includedAttributes, excludedAttributes, transformItems, ...props }: CurrentRefinementsProps): JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -18,11 +18,9 @@ export function CurrentRefinements(_ref) {
|
|
|
18
18
|
$$widgetType: 'ais.currentRefinements'
|
|
19
19
|
}),
|
|
20
20
|
items = _useCurrentRefinement.items,
|
|
21
|
-
refine = _useCurrentRefinement.refine,
|
|
22
21
|
canRefine = _useCurrentRefinement.canRefine;
|
|
23
22
|
var uiProps = {
|
|
24
23
|
items: items,
|
|
25
|
-
onRemove: refine,
|
|
26
24
|
hasRefinements: canRefine
|
|
27
25
|
};
|
|
28
26
|
return /*#__PURE__*/React.createElement(CurrentRefinementsUiComponent, _extends({}, props, uiProps));
|
|
@@ -50,10 +50,10 @@ export function Pagination(_ref) {
|
|
|
50
50
|
var currentPage = _ref2.currentPage;
|
|
51
51
|
return String(currentPage);
|
|
52
52
|
},
|
|
53
|
-
firstPageItemAriaLabel: 'First',
|
|
54
|
-
previousPageItemAriaLabel: 'Previous',
|
|
55
|
-
nextPageItemAriaLabel: 'Next',
|
|
56
|
-
lastPageItemAriaLabel:
|
|
53
|
+
firstPageItemAriaLabel: 'First Page',
|
|
54
|
+
previousPageItemAriaLabel: 'Previous Page',
|
|
55
|
+
nextPageItemAriaLabel: 'Next Page',
|
|
56
|
+
lastPageItemAriaLabel: "Last Page, Page ".concat(nbPages),
|
|
57
57
|
pageItemAriaLabel: function pageItemAriaLabel(_ref3) {
|
|
58
58
|
var currentPage = _ref3.currentPage;
|
|
59
59
|
return "Page ".concat(currentPage);
|