@entur/dropdown 3.0.13 → 3.0.14

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.
@@ -1,4 +1,4 @@
1
- import { debounce, useRandomId, warnAboutMissingStyles } from '@entur/utils';
1
+ import { mergeRefs, debounce, useRandomId, warnAboutMissingStyles } from '@entur/utils';
2
2
  import React, { useState, useRef } from 'react';
3
3
  import Downshift, { useSelect } from 'downshift';
4
4
  import classNames from 'classnames';
@@ -77,44 +77,6 @@ function _objectWithoutPropertiesLoose(source, excluded) {
77
77
  return target;
78
78
  }
79
79
 
80
- function _unsupportedIterableToArray(o, minLen) {
81
- if (!o) return;
82
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
83
- var n = Object.prototype.toString.call(o).slice(8, -1);
84
- if (n === "Object" && o.constructor) n = o.constructor.name;
85
- if (n === "Map" || n === "Set") return Array.from(o);
86
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
87
- }
88
-
89
- function _arrayLikeToArray(arr, len) {
90
- if (len == null || len > arr.length) len = arr.length;
91
-
92
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
93
-
94
- return arr2;
95
- }
96
-
97
- function _createForOfIteratorHelperLoose(o, allowArrayLike) {
98
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
99
- if (it) return (it = it.call(o)).next.bind(it);
100
-
101
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
102
- if (it) o = it;
103
- var i = 0;
104
- return function () {
105
- if (i >= o.length) return {
106
- done: true
107
- };
108
- return {
109
- done: false,
110
- value: o[i++]
111
- };
112
- };
113
- }
114
-
115
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
116
- }
117
-
118
80
  var _excluded$8 = ["children", "onChange", "onInputValueChange", "highlightFirstItemOnOpen", "className", "style", "searchable"];
119
81
  var DownshiftContext = /*#__PURE__*/React.createContext(null);
120
82
  var DownshiftProvider = function DownshiftProvider(_ref) {
@@ -529,22 +491,6 @@ var SearchableDropdown = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
529
491
  })));
530
492
  });
531
493
 
532
- var mergeRefs = function mergeRefs() {
533
- for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
534
- refs[_key] = arguments[_key];
535
- }
536
-
537
- return function (node) {
538
- for (var _iterator = _createForOfIteratorHelperLoose(refs), _step; !(_step = _iterator()).done;) {
539
- var ref = _step.value;
540
-
541
- if (typeof ref === 'function') {
542
- ref(node);
543
- } else if (ref) ref.current = node;
544
- }
545
- };
546
- };
547
-
548
494
  var DropdownInputGroup = function DropdownInputGroup(_ref) {
549
495
  var children = _ref.children,
550
496
  feedback = _ref.feedback,