@algolia/autocomplete-js 1.8.0 → 1.8.2

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.
@@ -98,11 +98,14 @@ export function renderPanel(render, _ref2) {
98
98
  className: classNames.list
99
99
  }, propGetters.getListProps(_objectSpread({
100
100
  state: state,
101
- props: autocomplete.getListProps({})
101
+ props: autocomplete.getListProps({
102
+ sourceIndex: sourceIndex
103
+ })
102
104
  }, autocompleteScopeApi))), items.map(function (item) {
103
105
  var itemProps = autocomplete.getItemProps({
104
106
  item: item,
105
- source: source
107
+ source: source,
108
+ sourceIndex: sourceIndex
106
109
  });
107
110
  return renderer.createElement("li", _extends({
108
111
  key: itemProps.id,
@@ -1,4 +1,4 @@
1
- /*! @algolia/autocomplete-js 1.8.0 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */
1
+ /*! @algolia/autocomplete-js 1.8.2 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
4
4
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -353,7 +353,7 @@
353
353
 
354
354
  var noop = function noop() {};
355
355
 
356
- var version = '1.8.0';
356
+ var version = '1.8.2';
357
357
 
358
358
  var userAgents$1 = [{
359
359
  segment: 'autocomplete-core',
@@ -1906,7 +1906,9 @@
1906
1906
  _excluded2 = ["inputElement", "formElement", "panelElement"],
1907
1907
  _excluded3 = ["inputElement"],
1908
1908
  _excluded4 = ["inputElement", "maxLength"],
1909
- _excluded5 = ["item", "source"];
1909
+ _excluded5 = ["sourceIndex"],
1910
+ _excluded6 = ["sourceIndex"],
1911
+ _excluded7 = ["item", "source", "sourceIndex"];
1910
1912
 
1911
1913
  function ownKeys$6(object, enumerableOnly) {
1912
1914
  var keys = Object.keys(object);
@@ -2180,18 +2182,30 @@
2180
2182
  }, rest);
2181
2183
  };
2182
2184
 
2183
- var getLabelProps = function getLabelProps(rest) {
2185
+ var getAutocompleteId = function getAutocompleteId(instanceId, sourceId) {
2186
+ return typeof sourceId !== 'undefined' ? "".concat(instanceId, "-").concat(sourceId) : instanceId;
2187
+ };
2188
+
2189
+ var getLabelProps = function getLabelProps(providedProps) {
2190
+ var _ref3 = providedProps || {},
2191
+ sourceIndex = _ref3.sourceIndex,
2192
+ rest = _objectWithoutProperties$1(_ref3, _excluded5);
2193
+
2184
2194
  return _objectSpread$6({
2185
- htmlFor: "".concat(props.id, "-input"),
2186
- id: "".concat(props.id, "-label")
2195
+ htmlFor: "".concat(getAutocompleteId(props.id, sourceIndex), "-input"),
2196
+ id: "".concat(getAutocompleteId(props.id, sourceIndex), "-label")
2187
2197
  }, rest);
2188
2198
  };
2189
2199
 
2190
- var getListProps = function getListProps(rest) {
2200
+ var getListProps = function getListProps(providedProps) {
2201
+ var _ref4 = providedProps || {},
2202
+ sourceIndex = _ref4.sourceIndex,
2203
+ rest = _objectWithoutProperties$1(_ref4, _excluded6);
2204
+
2191
2205
  return _objectSpread$6({
2192
2206
  role: 'listbox',
2193
- 'aria-labelledby': "".concat(props.id, "-label"),
2194
- id: "".concat(props.id, "-list")
2207
+ 'aria-labelledby': "".concat(getAutocompleteId(props.id, sourceIndex), "-label"),
2208
+ id: "".concat(getAutocompleteId(props.id, sourceIndex), "-list")
2195
2209
  }, rest);
2196
2210
  };
2197
2211
 
@@ -2212,10 +2226,11 @@
2212
2226
  var getItemProps = function getItemProps(providedProps) {
2213
2227
  var item = providedProps.item,
2214
2228
  source = providedProps.source,
2215
- rest = _objectWithoutProperties$1(providedProps, _excluded5);
2229
+ sourceIndex = providedProps.sourceIndex,
2230
+ rest = _objectWithoutProperties$1(providedProps, _excluded7);
2216
2231
 
2217
2232
  return _objectSpread$6({
2218
- id: "".concat(props.id, "-item-").concat(item.__autocomplete_id),
2233
+ id: "".concat(getAutocompleteId(props.id, sourceIndex), "-item-").concat(item.__autocomplete_id),
2219
2234
  role: 'option',
2220
2235
  'aria-selected': store.getState().activeItemId === item.__autocomplete_id,
2221
2236
  onMouseMove: function onMouseMove(event) {
@@ -4042,11 +4057,14 @@
4042
4057
  className: classNames.list
4043
4058
  }, propGetters.getListProps(_objectSpread2({
4044
4059
  state: state,
4045
- props: autocomplete.getListProps({})
4060
+ props: autocomplete.getListProps({
4061
+ sourceIndex: sourceIndex
4062
+ })
4046
4063
  }, autocompleteScopeApi))), items.map(function (item) {
4047
4064
  var itemProps = autocomplete.getItemProps({
4048
4065
  item: item,
4049
- source: source
4066
+ source: source,
4067
+ sourceIndex: sourceIndex
4050
4068
  });
4051
4069
  return renderer.createElement("li", _extends({
4052
4070
  key: itemProps.id,