react-instantsearch 7.25.0 → 7.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/AutocompleteSearch.js +25 -36
- package/dist/cjs/components/Carousel.js +25 -39
- package/dist/cjs/components/index.js +6 -15
- package/dist/cjs/index.js +85 -44
- package/dist/cjs/lib/useStickToBottom.js +11 -17
- package/dist/cjs/package.json +4 -1
- package/dist/cjs/types/PartialKeys.js +2 -1
- package/dist/cjs/types/Translatable.js +2 -1
- package/dist/cjs/types/index.js +1 -26
- package/dist/cjs/ui/Breadcrumb.js +52 -57
- package/dist/cjs/ui/ClearRefinements.js +23 -28
- package/dist/cjs/ui/CurrentRefinements.js +48 -50
- package/dist/cjs/ui/HierarchicalMenu.js +71 -79
- package/dist/cjs/ui/Highlight.js +21 -25
- package/dist/cjs/ui/HitsPerPage.js +31 -34
- package/dist/cjs/ui/InfiniteHits.js +83 -88
- package/dist/cjs/ui/InternalHighlight.js +9 -10
- package/dist/cjs/ui/Menu.js +53 -56
- package/dist/cjs/ui/Pagination.js +117 -124
- package/dist/cjs/ui/PoweredBy.js +33 -37
- package/dist/cjs/ui/RangeInput.js +96 -116
- package/dist/cjs/ui/RefinementList.js +66 -67
- package/dist/cjs/ui/ReverseHighlight.js +21 -25
- package/dist/cjs/ui/SearchBox.js +141 -151
- package/dist/cjs/ui/ShowMoreButton.js +14 -17
- package/dist/cjs/ui/Snippet.js +21 -25
- package/dist/cjs/ui/SortBy.js +32 -36
- package/dist/cjs/ui/Stats.js +29 -32
- package/dist/cjs/ui/ToggleRefinement.js +30 -33
- package/dist/cjs/ui/lib/capitalize.js +5 -7
- package/dist/cjs/ui/lib/index.js +8 -26
- package/dist/cjs/ui/lib/isModifierClick.js +6 -8
- package/dist/cjs/widgets/Autocomplete.js +450 -491
- package/dist/cjs/widgets/Breadcrumb.js +34 -47
- package/dist/cjs/widgets/Chat.js +174 -221
- package/dist/cjs/widgets/ClearRefinements.js +31 -42
- package/dist/cjs/widgets/CurrentRefinements.js +27 -32
- package/dist/cjs/widgets/FilterSuggestions.js +46 -53
- package/dist/cjs/widgets/FrequentlyBoughtTogether.js +66 -74
- package/dist/cjs/widgets/HierarchicalMenu.js +53 -68
- package/dist/cjs/widgets/Highlight.js +31 -31
- package/dist/cjs/widgets/Hits.js +59 -64
- package/dist/cjs/widgets/HitsPerPage.js +32 -38
- package/dist/cjs/widgets/InfiniteHits.js +44 -61
- package/dist/cjs/widgets/LookingSimilar.js +66 -74
- package/dist/cjs/widgets/Menu.js +48 -62
- package/dist/cjs/widgets/Pagination.js +59 -74
- package/dist/cjs/widgets/PoweredBy.js +14 -17
- package/dist/cjs/widgets/RangeInput.js +38 -51
- package/dist/cjs/widgets/RefinementList.js +100 -125
- package/dist/cjs/widgets/RelatedProducts.js +66 -74
- package/dist/cjs/widgets/ReverseHighlight.js +38 -44
- package/dist/cjs/widgets/SearchBox.js +63 -86
- package/dist/cjs/widgets/Snippet.js +31 -31
- package/dist/cjs/widgets/SortBy.js +26 -32
- package/dist/cjs/widgets/Stats.js +54 -68
- package/dist/cjs/widgets/ToggleRefinement.js +33 -38
- package/dist/cjs/widgets/TrendingItems.js +70 -78
- package/dist/cjs/widgets/chat/tools/SearchIndexTool.js +92 -99
- package/dist/cjs/widgets/index.js +77 -289
- package/dist/cjs/widgets/index.umd.js +68 -322
- package/dist/es/components/AutocompleteSearch.js +22 -28
- package/dist/es/components/Carousel.js +23 -31
- package/dist/es/components/index.js +1 -1
- package/dist/es/index.js +29 -4
- package/dist/es/lib/useStickToBottom.js +10 -12
- package/dist/es/package.json +4 -0
- package/dist/es/types/PartialKeys.js +1 -1
- package/dist/es/types/Translatable.js +1 -1
- package/dist/es/types/index.js +1 -2
- package/dist/es/ui/Breadcrumb.js +49 -49
- package/dist/es/ui/ClearRefinements.js +21 -21
- package/dist/es/ui/CurrentRefinements.js +46 -43
- package/dist/es/ui/HierarchicalMenu.js +68 -71
- package/dist/es/ui/Highlight.js +19 -18
- package/dist/es/ui/HitsPerPage.js +29 -27
- package/dist/es/ui/InfiniteHits.js +80 -80
- package/dist/es/ui/InternalHighlight.js +7 -4
- package/dist/es/ui/Menu.js +51 -49
- package/dist/es/ui/Pagination.js +114 -116
- package/dist/es/ui/PoweredBy.js +31 -30
- package/dist/es/ui/RangeInput.js +93 -107
- package/dist/es/ui/RefinementList.js +64 -60
- package/dist/es/ui/ReverseHighlight.js +19 -18
- package/dist/es/ui/SearchBox.js +138 -143
- package/dist/es/ui/ShowMoreButton.js +13 -11
- package/dist/es/ui/Snippet.js +19 -18
- package/dist/es/ui/SortBy.js +30 -29
- package/dist/es/ui/Stats.js +27 -25
- package/dist/es/ui/ToggleRefinement.js +28 -26
- package/dist/es/ui/lib/capitalize.js +5 -3
- package/dist/es/ui/lib/index.js +2 -2
- package/dist/es/ui/lib/isModifierClick.js +6 -4
- package/dist/es/widgets/Autocomplete.js +438 -474
- package/dist/es/widgets/Breadcrumb.js +31 -39
- package/dist/es/widgets/Chat.js +164 -196
- package/dist/es/widgets/ClearRefinements.js +28 -34
- package/dist/es/widgets/CurrentRefinements.js +24 -24
- package/dist/es/widgets/FilterSuggestions.js +41 -42
- package/dist/es/widgets/FrequentlyBoughtTogether.js +62 -65
- package/dist/es/widgets/HierarchicalMenu.js +50 -60
- package/dist/es/widgets/Highlight.js +30 -25
- package/dist/es/widgets/Hits.js +54 -53
- package/dist/es/widgets/HitsPerPage.js +29 -30
- package/dist/es/widgets/InfiniteHits.js +41 -53
- package/dist/es/widgets/LookingSimilar.js +62 -65
- package/dist/es/widgets/Menu.js +45 -54
- package/dist/es/widgets/Pagination.js +56 -66
- package/dist/es/widgets/PoweredBy.js +12 -10
- package/dist/es/widgets/RangeInput.js +35 -43
- package/dist/es/widgets/RefinementList.js +98 -118
- package/dist/es/widgets/RelatedProducts.js +61 -64
- package/dist/es/widgets/ReverseHighlight.js +36 -37
- package/dist/es/widgets/SearchBox.js +61 -79
- package/dist/es/widgets/Snippet.js +30 -25
- package/dist/es/widgets/SortBy.js +23 -24
- package/dist/es/widgets/Stats.js +51 -60
- package/dist/es/widgets/ToggleRefinement.js +30 -30
- package/dist/es/widgets/TrendingItems.js +65 -68
- package/dist/es/widgets/chat/tools/SearchIndexTool.js +89 -91
- package/dist/es/widgets/index.js +27 -26
- package/dist/es/widgets/index.umd.js +36 -33
- package/dist/umd/ReactInstantSearch.js +23411 -30098
- package/dist/umd/ReactInstantSearch.min.js +3 -3
- package/package.json +8 -12
- package/dist/umd/ReactInstantSearch.js.map +0 -1
- package/dist/umd/ReactInstantSearch.min.js.map +0 -1
|
@@ -1,123 +1,103 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _object_spread = require('@swc/helpers/_/_object_spread');
|
|
4
|
+
var _object_spread_props = require('@swc/helpers/_/_object_spread_props');
|
|
5
|
+
var _object_without_properties = require('@swc/helpers/_/_object_without_properties');
|
|
6
|
+
var _sliced_to_array = require('@swc/helpers/_/_sliced_to_array');
|
|
7
|
+
var instantsearchUiComponents = require('instantsearch-ui-components');
|
|
8
|
+
var React = require('react');
|
|
2
9
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.RangeInput = RangeInput;
|
|
8
|
-
var _instantsearchUiComponents = require("instantsearch-ui-components");
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _excluded = ["classNames", "range", "start", "step", "disabled", "onSubmit", "translations"];
|
|
11
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
12
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
13
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
14
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
15
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
16
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
18
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
19
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
20
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
21
10
|
// if the default value is undefined, React considers the component uncontrolled initially, which we don't want 0 or NaN as the default value
|
|
22
11
|
var unsetNumberInputValue = '';
|
|
23
|
-
|
|
24
12
|
// Strips leading `0` from a positive number value
|
|
25
13
|
function stripLeadingZeroFromInput(value) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
function RangeInput(_ref) {
|
|
31
|
-
var _values$min, _values$max;
|
|
32
|
-
var _ref$classNames = _ref.classNames,
|
|
33
|
-
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
34
|
-
_ref$range = _ref.range,
|
|
35
|
-
min = _ref$range.min,
|
|
36
|
-
max = _ref$range.max,
|
|
37
|
-
_ref$start = _slicedToArray(_ref.start, 2),
|
|
38
|
-
minValue = _ref$start[0],
|
|
39
|
-
maxValue = _ref$start[1],
|
|
40
|
-
_ref$step = _ref.step,
|
|
41
|
-
step = _ref$step === void 0 ? 1 : _ref$step,
|
|
42
|
-
disabled = _ref.disabled,
|
|
43
|
-
_onSubmit = _ref.onSubmit,
|
|
44
|
-
translations = _ref.translations,
|
|
45
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
46
|
-
var values = {
|
|
47
|
-
min: minValue !== -Infinity && minValue !== min ? minValue : unsetNumberInputValue,
|
|
48
|
-
max: maxValue !== Infinity && maxValue !== max ? maxValue : unsetNumberInputValue
|
|
49
|
-
};
|
|
50
|
-
var _useState = (0, _react.useState)(values),
|
|
51
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
52
|
-
prevValues = _useState2[0],
|
|
53
|
-
setPrevValues = _useState2[1];
|
|
54
|
-
var _useState3 = (0, _react.useState)({
|
|
55
|
-
from: (_values$min = values.min) === null || _values$min === void 0 ? void 0 : _values$min.toString(),
|
|
56
|
-
to: (_values$max = values.max) === null || _values$max === void 0 ? void 0 : _values$max.toString()
|
|
57
|
-
}),
|
|
58
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
59
|
-
_useState4$ = _useState4[0],
|
|
60
|
-
from = _useState4$.from,
|
|
61
|
-
to = _useState4$.to,
|
|
62
|
-
setRange = _useState4[1];
|
|
63
|
-
if (values.min !== prevValues.min || values.max !== prevValues.max) {
|
|
64
|
-
var _values$min2, _values$max2;
|
|
65
|
-
setRange({
|
|
66
|
-
from: (_values$min2 = values.min) === null || _values$min2 === void 0 ? void 0 : _values$min2.toString(),
|
|
67
|
-
to: (_values$max2 = values.max) === null || _values$max2 === void 0 ? void 0 : _values$max2.toString()
|
|
14
|
+
return value.replace(/^(0+)\d/, function(part) {
|
|
15
|
+
return Number(part).toString();
|
|
68
16
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
99
|
-
className: (0, _instantsearchUiComponents.cx)('ais-RangeInput-separator', classNames.separator)
|
|
100
|
-
}, translations.separatorElementText), /*#__PURE__*/_react.default.createElement("label", {
|
|
101
|
-
className: (0, _instantsearchUiComponents.cx)('ais-RangeInput-label', classNames.label)
|
|
102
|
-
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
103
|
-
className: (0, _instantsearchUiComponents.cx)('ais-RangeInput-input', classNames.input, 'ais-RangeInput-input--max', classNames.inputMax),
|
|
104
|
-
type: "number",
|
|
105
|
-
min: min,
|
|
106
|
-
max: max,
|
|
107
|
-
value: stripLeadingZeroFromInput(to || unsetNumberInputValue),
|
|
108
|
-
step: step,
|
|
109
|
-
placeholder: max === null || max === void 0 ? void 0 : max.toString(),
|
|
110
|
-
disabled: disabled,
|
|
111
|
-
onInput: function onInput(_ref3) {
|
|
112
|
-
var currentTarget = _ref3.currentTarget;
|
|
113
|
-
var value = currentTarget.value;
|
|
114
|
-
setRange({
|
|
115
|
-
from: from,
|
|
116
|
-
to: value || unsetNumberInputValue
|
|
117
|
-
});
|
|
17
|
+
}
|
|
18
|
+
function RangeInput(_0) {
|
|
19
|
+
var _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, _0_range = _0.range, min = _0_range.min, max = _0_range.max, _0_start = _sliced_to_array._(_0.start, 2), minValue = _0_start[0], maxValue = _0_start[1], _0_step = _0.step, step = _0_step === void 0 ? 1 : _0_step, disabled = _0.disabled, onSubmit = _0.onSubmit, translations = _0.translations, props = _object_without_properties._(_0, [
|
|
20
|
+
"classNames",
|
|
21
|
+
"range",
|
|
22
|
+
"start",
|
|
23
|
+
"step",
|
|
24
|
+
"disabled",
|
|
25
|
+
"onSubmit",
|
|
26
|
+
"translations"
|
|
27
|
+
]);
|
|
28
|
+
var _values_min, _values_max;
|
|
29
|
+
var values = {
|
|
30
|
+
min: minValue !== -Infinity && minValue !== min ? minValue : unsetNumberInputValue,
|
|
31
|
+
max: maxValue !== Infinity && maxValue !== max ? maxValue : unsetNumberInputValue
|
|
32
|
+
};
|
|
33
|
+
var _useState = _sliced_to_array._(React.useState(values), 2), prevValues = _useState[0], setPrevValues = _useState[1];
|
|
34
|
+
var _useState1 = _sliced_to_array._(React.useState({
|
|
35
|
+
from: (_values_min = values.min) === null || _values_min === void 0 ? void 0 : _values_min.toString(),
|
|
36
|
+
to: (_values_max = values.max) === null || _values_max === void 0 ? void 0 : _values_max.toString()
|
|
37
|
+
}), 2), _useState_ = _useState1[0], from = _useState_.from, to = _useState_.to, setRange = _useState1[1];
|
|
38
|
+
if (values.min !== prevValues.min || values.max !== prevValues.max) {
|
|
39
|
+
var _values_min1, _values_max1;
|
|
40
|
+
setRange({
|
|
41
|
+
from: (_values_min1 = values.min) === null || _values_min1 === void 0 ? void 0 : _values_min1.toString(),
|
|
42
|
+
to: (_values_max1 = values.max) === null || _values_max1 === void 0 ? void 0 : _values_max1.toString()
|
|
43
|
+
});
|
|
44
|
+
setPrevValues(values);
|
|
118
45
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
46
|
+
return /*#__PURE__*/ React.createElement("div", _object_spread_props._(_object_spread._({}, props), {
|
|
47
|
+
className: instantsearchUiComponents.cx(instantsearchUiComponents.cx('ais-RangeInput', classNames.root), disabled && instantsearchUiComponents.cx('ais-RangeInput--noRefinement', classNames.noRefinementRoot), props.className)
|
|
48
|
+
}), /*#__PURE__*/ React.createElement("form", {
|
|
49
|
+
className: instantsearchUiComponents.cx('ais-RangeInput-form', classNames.form),
|
|
50
|
+
onSubmit: function onSubmit1(event) {
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
onSubmit([
|
|
53
|
+
from ? Number(from) : undefined,
|
|
54
|
+
to ? Number(to) : undefined
|
|
55
|
+
]);
|
|
56
|
+
}
|
|
57
|
+
}, /*#__PURE__*/ React.createElement("label", {
|
|
58
|
+
className: instantsearchUiComponents.cx('ais-RangeInput-label', classNames.label)
|
|
59
|
+
}, /*#__PURE__*/ React.createElement("input", {
|
|
60
|
+
className: instantsearchUiComponents.cx('ais-RangeInput-input', classNames.input, 'ais-RangeInput-input--min', classNames.inputMin),
|
|
61
|
+
type: "number",
|
|
62
|
+
min: min,
|
|
63
|
+
max: max,
|
|
64
|
+
value: stripLeadingZeroFromInput(from || unsetNumberInputValue),
|
|
65
|
+
step: step,
|
|
66
|
+
placeholder: min === null || min === void 0 ? void 0 : min.toString(),
|
|
67
|
+
disabled: disabled,
|
|
68
|
+
onInput: function onInput(param) {
|
|
69
|
+
var currentTarget = param.currentTarget;
|
|
70
|
+
var value = currentTarget.value;
|
|
71
|
+
setRange({
|
|
72
|
+
from: value || unsetNumberInputValue,
|
|
73
|
+
to: to
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
})), /*#__PURE__*/ React.createElement("span", {
|
|
77
|
+
className: instantsearchUiComponents.cx('ais-RangeInput-separator', classNames.separator)
|
|
78
|
+
}, translations.separatorElementText), /*#__PURE__*/ React.createElement("label", {
|
|
79
|
+
className: instantsearchUiComponents.cx('ais-RangeInput-label', classNames.label)
|
|
80
|
+
}, /*#__PURE__*/ React.createElement("input", {
|
|
81
|
+
className: instantsearchUiComponents.cx('ais-RangeInput-input', classNames.input, 'ais-RangeInput-input--max', classNames.inputMax),
|
|
82
|
+
type: "number",
|
|
83
|
+
min: min,
|
|
84
|
+
max: max,
|
|
85
|
+
value: stripLeadingZeroFromInput(to || unsetNumberInputValue),
|
|
86
|
+
step: step,
|
|
87
|
+
placeholder: max === null || max === void 0 ? void 0 : max.toString(),
|
|
88
|
+
disabled: disabled,
|
|
89
|
+
onInput: function onInput(param) {
|
|
90
|
+
var currentTarget = param.currentTarget;
|
|
91
|
+
var value = currentTarget.value;
|
|
92
|
+
setRange({
|
|
93
|
+
from: from,
|
|
94
|
+
to: value || unsetNumberInputValue
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
})), /*#__PURE__*/ React.createElement("button", {
|
|
98
|
+
className: instantsearchUiComponents.cx('ais-RangeInput-submit', classNames.submit),
|
|
99
|
+
type: "submit"
|
|
100
|
+
}, translations.submitButtonText)));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
exports.RangeInput = RangeInput;
|
|
@@ -1,69 +1,68 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _object_spread = require('@swc/helpers/_/_object_spread');
|
|
4
|
+
var _object_spread_props = require('@swc/helpers/_/_object_spread_props');
|
|
5
|
+
var _object_without_properties = require('@swc/helpers/_/_object_without_properties');
|
|
6
|
+
var instantsearchUiComponents = require('instantsearch-ui-components');
|
|
7
|
+
var utils = require('instantsearch.js/cjs/lib/utils');
|
|
8
|
+
var React = require('react');
|
|
9
|
+
var Highlight = require('./Highlight.js');
|
|
10
|
+
var ShowMoreButton = require('./ShowMoreButton.js');
|
|
11
|
+
|
|
12
|
+
function RefinementList(_0) {
|
|
13
|
+
_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
|
+
"canRefine",
|
|
15
|
+
"items",
|
|
16
|
+
"onRefine",
|
|
17
|
+
"query",
|
|
18
|
+
"searchBox",
|
|
19
|
+
"noResults",
|
|
20
|
+
"showMore",
|
|
21
|
+
"canToggleShowMore",
|
|
22
|
+
"onToggleShowMore",
|
|
23
|
+
"isShowingMore",
|
|
24
|
+
"className",
|
|
25
|
+
"classNames",
|
|
26
|
+
"translations"
|
|
27
|
+
]);
|
|
28
|
+
return /*#__PURE__*/ React.createElement("div", _object_spread_props._(_object_spread._({}, props), {
|
|
29
|
+
className: instantsearchUiComponents.cx('ais-RefinementList', classNames.root, items.length === 0 && instantsearchUiComponents.cx('ais-RefinementList--noRefinement', classNames.noRefinementRoot), className)
|
|
30
|
+
}), searchBox && /*#__PURE__*/ React.createElement("div", {
|
|
31
|
+
className: instantsearchUiComponents.cx('ais-RefinementList-searchBox', classNames.searchBox)
|
|
32
|
+
}, searchBox), noResults ? /*#__PURE__*/ React.createElement("div", {
|
|
33
|
+
className: instantsearchUiComponents.cx('ais-RefinementList-noResults', classNames.noResults)
|
|
34
|
+
}, noResults) : /*#__PURE__*/ React.createElement("ul", {
|
|
35
|
+
className: instantsearchUiComponents.cx('ais-RefinementList-list', classNames.list)
|
|
36
|
+
}, items.map(function(item) {
|
|
37
|
+
return /*#__PURE__*/ React.createElement("li", {
|
|
38
|
+
key: item.value,
|
|
39
|
+
className: instantsearchUiComponents.cx('ais-RefinementList-item', classNames.item, item.isRefined && instantsearchUiComponents.cx('ais-RefinementList-item--selected', classNames.selectedItem))
|
|
40
|
+
}, /*#__PURE__*/ React.createElement("label", {
|
|
41
|
+
className: instantsearchUiComponents.cx('ais-RefinementList-label', classNames.label)
|
|
42
|
+
}, /*#__PURE__*/ React.createElement("input", {
|
|
43
|
+
checked: item.isRefined,
|
|
44
|
+
className: instantsearchUiComponents.cx('ais-RefinementList-checkbox', classNames.checkbox),
|
|
45
|
+
type: "checkbox",
|
|
46
|
+
value: item.value,
|
|
47
|
+
onChange: function onChange() {
|
|
48
|
+
onRefine(item);
|
|
49
|
+
}
|
|
50
|
+
}), /*#__PURE__*/ React.createElement("span", {
|
|
51
|
+
className: instantsearchUiComponents.cx('ais-RefinementList-labelText', classNames.labelText)
|
|
52
|
+
}, query.length > 0 ? /*#__PURE__*/ React.createElement(Highlight.Highlight, {
|
|
53
|
+
parts: [
|
|
54
|
+
utils.getHighlightedParts(utils.unescape(item.highlighted || ''))
|
|
55
|
+
]
|
|
56
|
+
}) : item.label), /*#__PURE__*/ React.createElement("span", {
|
|
57
|
+
className: instantsearchUiComponents.cx('ais-RefinementList-count', classNames.count)
|
|
58
|
+
}, item.count)));
|
|
59
|
+
})), showMore && /*#__PURE__*/ React.createElement(ShowMoreButton.ShowMoreButton, {
|
|
60
|
+
className: instantsearchUiComponents.cx('ais-RefinementList-showMore', classNames.showMore, !canToggleShowMore && instantsearchUiComponents.cx('ais-RefinementList-showMore--disabled', classNames.disabledShowMore)),
|
|
61
|
+
disabled: !canToggleShowMore,
|
|
62
|
+
onClick: onToggleShowMore,
|
|
63
|
+
isShowingMore: isShowingMore,
|
|
64
|
+
translations: translations
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
2
67
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
68
|
exports.RefinementList = RefinementList;
|
|
7
|
-
var _instantsearchUiComponents = require("instantsearch-ui-components");
|
|
8
|
-
var _utils = require("instantsearch.js/cjs/lib/utils");
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _Highlight = require("./Highlight");
|
|
11
|
-
var _ShowMoreButton = require("./ShowMoreButton");
|
|
12
|
-
var _excluded = ["canRefine", "items", "onRefine", "query", "searchBox", "noResults", "showMore", "canToggleShowMore", "onToggleShowMore", "isShowingMore", "className", "classNames", "translations"];
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
15
|
-
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; }
|
|
16
|
-
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; }
|
|
17
|
-
function RefinementList(_ref) {
|
|
18
|
-
var canRefine = _ref.canRefine,
|
|
19
|
-
items = _ref.items,
|
|
20
|
-
onRefine = _ref.onRefine,
|
|
21
|
-
query = _ref.query,
|
|
22
|
-
searchBox = _ref.searchBox,
|
|
23
|
-
noResults = _ref.noResults,
|
|
24
|
-
showMore = _ref.showMore,
|
|
25
|
-
canToggleShowMore = _ref.canToggleShowMore,
|
|
26
|
-
onToggleShowMore = _ref.onToggleShowMore,
|
|
27
|
-
isShowingMore = _ref.isShowingMore,
|
|
28
|
-
className = _ref.className,
|
|
29
|
-
_ref$classNames = _ref.classNames,
|
|
30
|
-
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
31
|
-
translations = _ref.translations,
|
|
32
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
-
return /*#__PURE__*/_react.default.createElement("div", _extends({}, props, {
|
|
34
|
-
className: (0, _instantsearchUiComponents.cx)('ais-RefinementList', classNames.root, items.length === 0 && (0, _instantsearchUiComponents.cx)('ais-RefinementList--noRefinement', classNames.noRefinementRoot), className)
|
|
35
|
-
}), searchBox && /*#__PURE__*/_react.default.createElement("div", {
|
|
36
|
-
className: (0, _instantsearchUiComponents.cx)('ais-RefinementList-searchBox', classNames.searchBox)
|
|
37
|
-
}, searchBox), noResults ? /*#__PURE__*/_react.default.createElement("div", {
|
|
38
|
-
className: (0, _instantsearchUiComponents.cx)('ais-RefinementList-noResults', classNames.noResults)
|
|
39
|
-
}, noResults) : /*#__PURE__*/_react.default.createElement("ul", {
|
|
40
|
-
className: (0, _instantsearchUiComponents.cx)('ais-RefinementList-list', classNames.list)
|
|
41
|
-
}, items.map(function (item) {
|
|
42
|
-
return /*#__PURE__*/_react.default.createElement("li", {
|
|
43
|
-
key: item.value,
|
|
44
|
-
className: (0, _instantsearchUiComponents.cx)('ais-RefinementList-item', classNames.item, item.isRefined && (0, _instantsearchUiComponents.cx)('ais-RefinementList-item--selected', classNames.selectedItem))
|
|
45
|
-
}, /*#__PURE__*/_react.default.createElement("label", {
|
|
46
|
-
className: (0, _instantsearchUiComponents.cx)('ais-RefinementList-label', classNames.label)
|
|
47
|
-
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
48
|
-
checked: item.isRefined,
|
|
49
|
-
className: (0, _instantsearchUiComponents.cx)('ais-RefinementList-checkbox', classNames.checkbox),
|
|
50
|
-
type: "checkbox",
|
|
51
|
-
value: item.value,
|
|
52
|
-
onChange: function onChange() {
|
|
53
|
-
onRefine(item);
|
|
54
|
-
}
|
|
55
|
-
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
56
|
-
className: (0, _instantsearchUiComponents.cx)('ais-RefinementList-labelText', classNames.labelText)
|
|
57
|
-
}, query.length > 0 ? /*#__PURE__*/_react.default.createElement(_Highlight.Highlight, {
|
|
58
|
-
parts: [(0, _utils.getHighlightedParts)((0, _utils.unescape)(item.highlighted || ''))]
|
|
59
|
-
}) : item.label), /*#__PURE__*/_react.default.createElement("span", {
|
|
60
|
-
className: (0, _instantsearchUiComponents.cx)('ais-RefinementList-count', classNames.count)
|
|
61
|
-
}, item.count)));
|
|
62
|
-
})), showMore && /*#__PURE__*/_react.default.createElement(_ShowMoreButton.ShowMoreButton, {
|
|
63
|
-
className: (0, _instantsearchUiComponents.cx)('ais-RefinementList-showMore', classNames.showMore, !canToggleShowMore && (0, _instantsearchUiComponents.cx)('ais-RefinementList-showMore--disabled', classNames.disabledShowMore)),
|
|
64
|
-
disabled: !canToggleShowMore,
|
|
65
|
-
onClick: onToggleShowMore,
|
|
66
|
-
isShowingMore: isShowingMore,
|
|
67
|
-
translations: translations
|
|
68
|
-
}));
|
|
69
|
-
}
|
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _object_spread = require('@swc/helpers/_/_object_spread');
|
|
4
|
+
var _object_without_properties = require('@swc/helpers/_/_object_without_properties');
|
|
5
|
+
var instantsearchUiComponents = require('instantsearch-ui-components');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var InternalHighlight = require('./InternalHighlight.js');
|
|
8
|
+
|
|
9
|
+
function ReverseHighlight(_0) {
|
|
10
|
+
var _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, props = _object_without_properties._(_0, [
|
|
11
|
+
"classNames"
|
|
12
|
+
]);
|
|
13
|
+
return /*#__PURE__*/ React.createElement(InternalHighlight.InternalHighlight, _object_spread._({
|
|
14
|
+
classNames: {
|
|
15
|
+
root: instantsearchUiComponents.cx('ais-ReverseHighlight', classNames.root),
|
|
16
|
+
highlighted: instantsearchUiComponents.cx('ais-ReverseHighlight-highlighted', classNames.highlighted),
|
|
17
|
+
nonHighlighted: instantsearchUiComponents.cx('ais-ReverseHighlight-nonHighlighted', classNames.nonHighlighted),
|
|
18
|
+
separator: instantsearchUiComponents.cx('ais-ReverseHighlight-separator', classNames.separator)
|
|
19
|
+
}
|
|
20
|
+
}, props));
|
|
21
|
+
}
|
|
2
22
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
23
|
exports.ReverseHighlight = ReverseHighlight;
|
|
7
|
-
var _instantsearchUiComponents = require("instantsearch-ui-components");
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _InternalHighlight = require("./InternalHighlight");
|
|
10
|
-
var _excluded = ["classNames"];
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
13
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
14
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
15
|
-
function ReverseHighlight(_ref) {
|
|
16
|
-
var _ref$classNames = _ref.classNames,
|
|
17
|
-
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
18
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
-
return /*#__PURE__*/_react.default.createElement(_InternalHighlight.InternalHighlight, _extends({
|
|
20
|
-
classNames: {
|
|
21
|
-
root: (0, _instantsearchUiComponents.cx)('ais-ReverseHighlight', classNames.root),
|
|
22
|
-
highlighted: (0, _instantsearchUiComponents.cx)('ais-ReverseHighlight-highlighted', classNames.highlighted),
|
|
23
|
-
nonHighlighted: (0, _instantsearchUiComponents.cx)('ais-ReverseHighlight-nonHighlighted', classNames.nonHighlighted),
|
|
24
|
-
separator: (0, _instantsearchUiComponents.cx)('ais-ReverseHighlight-separator', classNames.separator)
|
|
25
|
-
}
|
|
26
|
-
}, props));
|
|
27
|
-
}
|