@entur/dropdown 3.0.27 → 3.0.29

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.
@@ -9,6 +9,307 @@ import { LoadingDots } from '@entur/loader';
9
9
  import { space } from '@entur/tokens';
10
10
  import { IconButton } from '@entur/button';
11
11
 
12
+ function _regeneratorRuntime() {
13
+ _regeneratorRuntime = function () {
14
+ return exports;
15
+ };
16
+ var exports = {},
17
+ Op = Object.prototype,
18
+ hasOwn = Op.hasOwnProperty,
19
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
20
+ obj[key] = desc.value;
21
+ },
22
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
23
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
24
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
25
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
26
+ function define(obj, key, value) {
27
+ return Object.defineProperty(obj, key, {
28
+ value: value,
29
+ enumerable: !0,
30
+ configurable: !0,
31
+ writable: !0
32
+ }), obj[key];
33
+ }
34
+ try {
35
+ define({}, "");
36
+ } catch (err) {
37
+ define = function (obj, key, value) {
38
+ return obj[key] = value;
39
+ };
40
+ }
41
+ function wrap(innerFn, outerFn, self, tryLocsList) {
42
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
43
+ generator = Object.create(protoGenerator.prototype),
44
+ context = new Context(tryLocsList || []);
45
+ return defineProperty(generator, "_invoke", {
46
+ value: makeInvokeMethod(innerFn, self, context)
47
+ }), generator;
48
+ }
49
+ function tryCatch(fn, obj, arg) {
50
+ try {
51
+ return {
52
+ type: "normal",
53
+ arg: fn.call(obj, arg)
54
+ };
55
+ } catch (err) {
56
+ return {
57
+ type: "throw",
58
+ arg: err
59
+ };
60
+ }
61
+ }
62
+ exports.wrap = wrap;
63
+ var ContinueSentinel = {};
64
+ function Generator() {}
65
+ function GeneratorFunction() {}
66
+ function GeneratorFunctionPrototype() {}
67
+ var IteratorPrototype = {};
68
+ define(IteratorPrototype, iteratorSymbol, function () {
69
+ return this;
70
+ });
71
+ var getProto = Object.getPrototypeOf,
72
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
73
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
74
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
75
+ function defineIteratorMethods(prototype) {
76
+ ["next", "throw", "return"].forEach(function (method) {
77
+ define(prototype, method, function (arg) {
78
+ return this._invoke(method, arg);
79
+ });
80
+ });
81
+ }
82
+ function AsyncIterator(generator, PromiseImpl) {
83
+ function invoke(method, arg, resolve, reject) {
84
+ var record = tryCatch(generator[method], generator, arg);
85
+ if ("throw" !== record.type) {
86
+ var result = record.arg,
87
+ value = result.value;
88
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
89
+ invoke("next", value, resolve, reject);
90
+ }, function (err) {
91
+ invoke("throw", err, resolve, reject);
92
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
93
+ result.value = unwrapped, resolve(result);
94
+ }, function (error) {
95
+ return invoke("throw", error, resolve, reject);
96
+ });
97
+ }
98
+ reject(record.arg);
99
+ }
100
+ var previousPromise;
101
+ defineProperty(this, "_invoke", {
102
+ value: function (method, arg) {
103
+ function callInvokeWithMethodAndArg() {
104
+ return new PromiseImpl(function (resolve, reject) {
105
+ invoke(method, arg, resolve, reject);
106
+ });
107
+ }
108
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
109
+ }
110
+ });
111
+ }
112
+ function makeInvokeMethod(innerFn, self, context) {
113
+ var state = "suspendedStart";
114
+ return function (method, arg) {
115
+ if ("executing" === state) throw new Error("Generator is already running");
116
+ if ("completed" === state) {
117
+ if ("throw" === method) throw arg;
118
+ return doneResult();
119
+ }
120
+ for (context.method = method, context.arg = arg;;) {
121
+ var delegate = context.delegate;
122
+ if (delegate) {
123
+ var delegateResult = maybeInvokeDelegate(delegate, context);
124
+ if (delegateResult) {
125
+ if (delegateResult === ContinueSentinel) continue;
126
+ return delegateResult;
127
+ }
128
+ }
129
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
130
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
131
+ context.dispatchException(context.arg);
132
+ } else "return" === context.method && context.abrupt("return", context.arg);
133
+ state = "executing";
134
+ var record = tryCatch(innerFn, self, context);
135
+ if ("normal" === record.type) {
136
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
137
+ return {
138
+ value: record.arg,
139
+ done: context.done
140
+ };
141
+ }
142
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
143
+ }
144
+ };
145
+ }
146
+ function maybeInvokeDelegate(delegate, context) {
147
+ var methodName = context.method,
148
+ method = delegate.iterator[methodName];
149
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
150
+ var record = tryCatch(method, delegate.iterator, context.arg);
151
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
152
+ var info = record.arg;
153
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
154
+ }
155
+ function pushTryEntry(locs) {
156
+ var entry = {
157
+ tryLoc: locs[0]
158
+ };
159
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
160
+ }
161
+ function resetTryEntry(entry) {
162
+ var record = entry.completion || {};
163
+ record.type = "normal", delete record.arg, entry.completion = record;
164
+ }
165
+ function Context(tryLocsList) {
166
+ this.tryEntries = [{
167
+ tryLoc: "root"
168
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
169
+ }
170
+ function values(iterable) {
171
+ if (iterable) {
172
+ var iteratorMethod = iterable[iteratorSymbol];
173
+ if (iteratorMethod) return iteratorMethod.call(iterable);
174
+ if ("function" == typeof iterable.next) return iterable;
175
+ if (!isNaN(iterable.length)) {
176
+ var i = -1,
177
+ next = function next() {
178
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
179
+ return next.value = undefined, next.done = !0, next;
180
+ };
181
+ return next.next = next;
182
+ }
183
+ }
184
+ return {
185
+ next: doneResult
186
+ };
187
+ }
188
+ function doneResult() {
189
+ return {
190
+ value: undefined,
191
+ done: !0
192
+ };
193
+ }
194
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
195
+ value: GeneratorFunctionPrototype,
196
+ configurable: !0
197
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
198
+ value: GeneratorFunction,
199
+ configurable: !0
200
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
201
+ var ctor = "function" == typeof genFun && genFun.constructor;
202
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
203
+ }, exports.mark = function (genFun) {
204
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
205
+ }, exports.awrap = function (arg) {
206
+ return {
207
+ __await: arg
208
+ };
209
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
210
+ return this;
211
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
212
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
213
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
214
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
215
+ return result.done ? result.value : iter.next();
216
+ });
217
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
218
+ return this;
219
+ }), define(Gp, "toString", function () {
220
+ return "[object Generator]";
221
+ }), exports.keys = function (val) {
222
+ var object = Object(val),
223
+ keys = [];
224
+ for (var key in object) keys.push(key);
225
+ return keys.reverse(), function next() {
226
+ for (; keys.length;) {
227
+ var key = keys.pop();
228
+ if (key in object) return next.value = key, next.done = !1, next;
229
+ }
230
+ return next.done = !0, next;
231
+ };
232
+ }, exports.values = values, Context.prototype = {
233
+ constructor: Context,
234
+ reset: function (skipTempReset) {
235
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
236
+ },
237
+ stop: function () {
238
+ this.done = !0;
239
+ var rootRecord = this.tryEntries[0].completion;
240
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
241
+ return this.rval;
242
+ },
243
+ dispatchException: function (exception) {
244
+ if (this.done) throw exception;
245
+ var context = this;
246
+ function handle(loc, caught) {
247
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
248
+ }
249
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
250
+ var entry = this.tryEntries[i],
251
+ record = entry.completion;
252
+ if ("root" === entry.tryLoc) return handle("end");
253
+ if (entry.tryLoc <= this.prev) {
254
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
255
+ hasFinally = hasOwn.call(entry, "finallyLoc");
256
+ if (hasCatch && hasFinally) {
257
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
258
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
259
+ } else if (hasCatch) {
260
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
261
+ } else {
262
+ if (!hasFinally) throw new Error("try statement without catch or finally");
263
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
264
+ }
265
+ }
266
+ }
267
+ },
268
+ abrupt: function (type, arg) {
269
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
270
+ var entry = this.tryEntries[i];
271
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
272
+ var finallyEntry = entry;
273
+ break;
274
+ }
275
+ }
276
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
277
+ var record = finallyEntry ? finallyEntry.completion : {};
278
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
279
+ },
280
+ complete: function (record, afterLoc) {
281
+ if ("throw" === record.type) throw record.arg;
282
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
283
+ },
284
+ finish: function (finallyLoc) {
285
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
286
+ var entry = this.tryEntries[i];
287
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
288
+ }
289
+ },
290
+ catch: function (tryLoc) {
291
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
292
+ var entry = this.tryEntries[i];
293
+ if (entry.tryLoc === tryLoc) {
294
+ var record = entry.completion;
295
+ if ("throw" === record.type) {
296
+ var thrown = record.arg;
297
+ resetTryEntry(entry);
298
+ }
299
+ return thrown;
300
+ }
301
+ }
302
+ throw new Error("illegal catch attempt");
303
+ },
304
+ delegateYield: function (iterable, resultName, nextLoc) {
305
+ return this.delegate = {
306
+ iterator: values(iterable),
307
+ resultName: resultName,
308
+ nextLoc: nextLoc
309
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
310
+ }
311
+ }, exports;
312
+ }
12
313
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
13
314
  try {
14
315
  var info = gen[key](arg);
@@ -17,64 +318,55 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
17
318
  reject(error);
18
319
  return;
19
320
  }
20
-
21
321
  if (info.done) {
22
322
  resolve(value);
23
323
  } else {
24
324
  Promise.resolve(value).then(_next, _throw);
25
325
  }
26
326
  }
27
-
28
327
  function _asyncToGenerator(fn) {
29
328
  return function () {
30
329
  var self = this,
31
- args = arguments;
330
+ args = arguments;
32
331
  return new Promise(function (resolve, reject) {
33
332
  var gen = fn.apply(self, args);
34
-
35
333
  function _next(value) {
36
334
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
37
335
  }
38
-
39
336
  function _throw(err) {
40
337
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
41
338
  }
42
-
43
339
  _next(undefined);
44
340
  });
45
341
  };
46
342
  }
47
-
48
343
  function _extends() {
49
- _extends = Object.assign || function (target) {
344
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
50
345
  for (var i = 1; i < arguments.length; i++) {
51
346
  var source = arguments[i];
52
-
53
347
  for (var key in source) {
54
348
  if (Object.prototype.hasOwnProperty.call(source, key)) {
55
349
  target[key] = source[key];
56
350
  }
57
351
  }
58
352
  }
59
-
60
353
  return target;
61
354
  };
62
-
63
355
  return _extends.apply(this, arguments);
64
356
  }
65
-
357
+ function _objectDestructuringEmpty(obj) {
358
+ if (obj == null) throw new TypeError("Cannot destructure " + obj);
359
+ }
66
360
  function _objectWithoutPropertiesLoose(source, excluded) {
67
361
  if (source == null) return {};
68
362
  var target = {};
69
363
  var sourceKeys = Object.keys(source);
70
364
  var key, i;
71
-
72
365
  for (i = 0; i < sourceKeys.length; i++) {
73
366
  key = sourceKeys[i];
74
367
  if (excluded.indexOf(key) >= 0) continue;
75
368
  target[key] = source[key];
76
369
  }
77
-
78
370
  return target;
79
371
  }
80
372
 
@@ -82,47 +374,41 @@ var _excluded$a = ["children", "onChange", "onInputValueChange", "highlightFirst
82
374
  var DownshiftContext = /*#__PURE__*/React.createContext(null);
83
375
  var DownshiftProvider = function DownshiftProvider(_ref) {
84
376
  var children = _ref.children,
85
- _ref$onChange = _ref.onChange,
86
- onChange = _ref$onChange === void 0 ? function () {
87
- return undefined;
88
- } : _ref$onChange,
89
- _ref$onInputValueChan = _ref.onInputValueChange,
90
- onInputValueChange = _ref$onInputValueChan === void 0 ? function () {
91
- return undefined;
92
- } : _ref$onInputValueChan,
93
- _ref$highlightFirstIt = _ref.highlightFirstItemOnOpen,
94
- highlightFirstItemOnOpen = _ref$highlightFirstIt === void 0 ? false : _ref$highlightFirstIt,
95
- className = _ref.className,
96
- style = _ref.style,
97
- _ref$searchable = _ref.searchable,
98
- searchable = _ref$searchable === void 0 ? false : _ref$searchable,
99
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$a);
100
-
377
+ _ref$onChange = _ref.onChange,
378
+ onChange = _ref$onChange === void 0 ? function () {
379
+ return undefined;
380
+ } : _ref$onChange,
381
+ _ref$onInputValueChan = _ref.onInputValueChange,
382
+ onInputValueChange = _ref$onInputValueChan === void 0 ? function () {
383
+ return undefined;
384
+ } : _ref$onInputValueChan,
385
+ _ref$highlightFirstIt = _ref.highlightFirstItemOnOpen,
386
+ highlightFirstItemOnOpen = _ref$highlightFirstIt === void 0 ? false : _ref$highlightFirstIt,
387
+ className = _ref.className,
388
+ style = _ref.style,
389
+ _ref$searchable = _ref.searchable,
390
+ searchable = _ref$searchable === void 0 ? false : _ref$searchable,
391
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$a);
101
392
  var handleStateChange = function handleStateChange(changes, stateAndHelpers) {
102
393
  if (changes.type === Downshift.stateChangeTypes.controlledPropUpdatedSelectedItem) {
103
394
  return;
104
395
  }
105
-
106
396
  if ('selectedItem' in changes) {
107
397
  onChange(changes.selectedItem, stateAndHelpers);
108
398
  } else if ('inputValue' in changes) {
109
399
  onInputValueChange(changes.inputValue);
110
400
  }
111
401
  };
112
-
113
402
  var stateReducer = function stateReducer(_, changes) {
114
403
  var highlightFirstOnOpen = highlightFirstItemOnOpen && 'isOpen' in changes && changes.isOpen;
115
404
  var highlightFirstItemIndex = highlightFirstOnOpen ? {
116
405
  highlightedIndex: 0
117
406
  } : {};
118
-
119
407
  if (searchable) {
120
408
  var type = changes.type;
121
-
122
409
  switch (type) {
123
410
  case '__autocomplete_change_input__':
124
411
  return _extends({}, changes, highlightFirstItemIndex);
125
-
126
412
  case '__autocomplete_click_item__':
127
413
  case '__autocomplete_keydown_enter__':
128
414
  case '__autocomplete_blur_input__':
@@ -132,7 +418,6 @@ var DownshiftProvider = function DownshiftProvider(_ref) {
132
418
  // we will reset input field value to blank
133
419
  inputValue: ''
134
420
  }, highlightFirstItemIndex);
135
-
136
421
  default:
137
422
  return _extends({}, changes, highlightFirstItemIndex);
138
423
  }
@@ -140,7 +425,6 @@ var DownshiftProvider = function DownshiftProvider(_ref) {
140
425
  return _extends({}, changes, highlightFirstItemIndex);
141
426
  }
142
427
  };
143
-
144
428
  return React.createElement(Downshift, _extends({
145
429
  itemToString: function itemToString(item) {
146
430
  return item ? item.label : '';
@@ -158,32 +442,29 @@ var DownshiftProvider = function DownshiftProvider(_ref) {
158
442
  };
159
443
  var useDownshift = function useDownshift() {
160
444
  var context = React.useContext(DownshiftContext);
161
-
162
445
  if (!context) {
163
446
  throw new Error('You need to wrap your component in a DownshiftProvider');
164
447
  }
165
-
166
448
  return context;
167
449
  };
168
450
 
169
451
  var _excluded$9 = ["items"];
170
452
  var DropdownList$1 = function DropdownList(_ref) {
171
453
  var items = _ref.items,
172
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$9);
173
-
454
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$9);
174
455
  var _useDownshift = useDownshift(),
175
- highlightedIndex = _useDownshift.highlightedIndex,
176
- isOpen = _useDownshift.isOpen,
177
- selectedItem = _useDownshift.selectedItem,
178
- getItemProps = _useDownshift.getItemProps,
179
- getMenuProps = _useDownshift.getMenuProps;
180
-
456
+ highlightedIndex = _useDownshift.highlightedIndex,
457
+ isOpen = _useDownshift.isOpen,
458
+ selectedItem = _useDownshift.selectedItem,
459
+ getItemProps = _useDownshift.getItemProps,
460
+ getMenuProps = _useDownshift.getMenuProps;
181
461
  return React.createElement("ul", _extends({
182
462
  className: classNames('eds-dropdown-list', {
183
463
  'eds-dropdown-list--open': isOpen
184
464
  })
185
465
  }, getMenuProps(), rest), isOpen ? items.map(function (item, index) {
186
- return (// eslint-disable-next-line react/jsx-key
466
+ return (
467
+ // eslint-disable-next-line react/jsx-key
187
468
  React.createElement("li", _extends({
188
469
  className: classNames('eds-dropdown-list__item', {
189
470
  'eds-dropdown-list__item--highlighted': highlightedIndex === index,
@@ -206,9 +487,8 @@ var DropdownList$1 = function DropdownList(_ref) {
206
487
 
207
488
  var DropdownToggleButton$1 = function DropdownToggleButton() {
208
489
  var _useDownshift = useDownshift(),
209
- getToggleButtonProps = _useDownshift.getToggleButtonProps,
210
- isOpen = _useDownshift.isOpen;
211
-
490
+ getToggleButtonProps = _useDownshift.getToggleButtonProps,
491
+ isOpen = _useDownshift.isOpen;
212
492
  return React.createElement("button", _extends({}, getToggleButtonProps({
213
493
  className: classNames('eds-dropdown__toggle-button', {
214
494
  'eds-dropdown__toggle-button--open': isOpen
@@ -222,9 +502,8 @@ var DropdownToggleButton$1 = function DropdownToggleButton() {
222
502
  var _excluded$8 = ["className", "children"];
223
503
  var DropdownLoadingDots = function DropdownLoadingDots(_ref) {
224
504
  var className = _ref.className,
225
- children = _ref.children,
226
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$8);
227
-
505
+ children = _ref.children,
506
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$8);
228
507
  return React.createElement("div", _extends({
229
508
  className: classNames('eds-inline-spinner', className)
230
509
  }, rest), React.createElement(LoadingDots, null), React.createElement(VisuallyHidden, null, children));
@@ -233,24 +512,22 @@ var DropdownLoadingDots = function DropdownLoadingDots(_ref) {
233
512
  var _excluded$7 = ["children", "className", "items", "loading", "loadingText", "placeholder", "style", "listStyle", "clearable", "label", "isFilled", "disableLabelAnimation"];
234
513
  var BaseDropdown = function BaseDropdown(_ref) {
235
514
  var children = _ref.children,
236
- className = _ref.className,
237
- items = _ref.items,
238
- _ref$loading = _ref.loading,
239
- loading = _ref$loading === void 0 ? false : _ref$loading,
240
- _ref$loadingText = _ref.loadingText,
241
- loadingText = _ref$loadingText === void 0 ? 'Loading...' : _ref$loadingText,
242
- style = _ref.style,
243
- listStyle = _ref.listStyle,
244
- clearable = _ref.clearable,
245
- label = _ref.label,
246
- _ref$isFilled = _ref.isFilled,
247
- isFilled = _ref$isFilled === void 0 ? false : _ref$isFilled,
248
- disableLabelAnimation = _ref.disableLabelAnimation,
249
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$7);
250
-
515
+ className = _ref.className,
516
+ items = _ref.items,
517
+ _ref$loading = _ref.loading,
518
+ loading = _ref$loading === void 0 ? false : _ref$loading,
519
+ _ref$loadingText = _ref.loadingText,
520
+ loadingText = _ref$loadingText === void 0 ? 'Loading...' : _ref$loadingText,
521
+ style = _ref.style,
522
+ listStyle = _ref.listStyle,
523
+ clearable = _ref.clearable,
524
+ label = _ref.label,
525
+ _ref$isFilled = _ref.isFilled,
526
+ isFilled = _ref$isFilled === void 0 ? false : _ref$isFilled,
527
+ disableLabelAnimation = _ref.disableLabelAnimation,
528
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$7);
251
529
  var _useDownshift = useDownshift(),
252
- getLabelProps = _useDownshift.getLabelProps;
253
-
530
+ getLabelProps = _useDownshift.getLabelProps;
254
531
  return React.createElement("div", {
255
532
  className: "eds-dropdown-wrapper",
256
533
  style: style
@@ -274,14 +551,11 @@ var BaseDropdown = function BaseDropdown(_ref) {
274
551
  }, listStyle)
275
552
  }, rest)));
276
553
  };
277
-
278
554
  var ClearButton$1 = function ClearButton(_ref2) {
279
- var props = _extends({}, _ref2);
280
-
555
+ var props = _extends({}, (_objectDestructuringEmpty(_ref2), _ref2));
281
556
  var _useDownshift2 = useDownshift(),
282
- clearSelection = _useDownshift2.clearSelection,
283
- selectedItem = _useDownshift2.selectedItem;
284
-
557
+ clearSelection = _useDownshift2.clearSelection,
558
+ selectedItem = _useDownshift2.selectedItem;
285
559
  return React.createElement(React.Fragment, null, selectedItem && React.createElement("button", _extends({
286
560
  className: "eds-dropdown__clear-button",
287
561
  type: "button",
@@ -293,52 +567,46 @@ var ClearButton$1 = function ClearButton(_ref2) {
293
567
  className: "eds-dropdown__divider"
294
568
  }));
295
569
  };
296
-
297
570
  var Appendix$2 = function Appendix(_ref3) {
298
571
  var clearable = _ref3.clearable,
299
- loading = _ref3.loading,
300
- loadingText = _ref3.loadingText,
301
- readOnly = _ref3.readOnly;
302
-
572
+ loading = _ref3.loading,
573
+ loadingText = _ref3.loadingText,
574
+ readOnly = _ref3.readOnly;
303
575
  if (loading) {
304
576
  return React.createElement(DropdownLoadingDots, null, loadingText);
305
577
  }
306
-
307
578
  if (readOnly) {
308
579
  return null;
309
580
  }
310
-
311
581
  return clearable ? React.createElement(React.Fragment, null, React.createElement(ClearButton$1, null), " ", React.createElement(DropdownToggleButton$1, null)) : React.createElement(DropdownToggleButton$1, null);
312
582
  };
313
583
 
314
584
  var _excluded$6 = ["disabled", "placeholder", "selectOnTab", "openOnFocus", "listStyle", "items", "label", "disableLabelAnimation", "loading", "loadingText", "className", "clearable"];
315
585
  var RegularDropdown = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
316
586
  var disabled = _ref.disabled,
317
- _ref$placeholder = _ref.placeholder,
318
- placeholder = _ref$placeholder === void 0 ? 'Vennligst velg' : _ref$placeholder,
319
- _ref$selectOnTab = _ref.selectOnTab,
320
- selectOnTab = _ref$selectOnTab === void 0 ? false : _ref$selectOnTab,
321
- _ref$openOnFocus = _ref.openOnFocus,
322
- openOnFocus = _ref$openOnFocus === void 0 ? false : _ref$openOnFocus,
323
- listStyle = _ref.listStyle,
324
- items = _ref.items,
325
- label = _ref.label,
326
- disableLabelAnimation = _ref.disableLabelAnimation,
327
- loading = _ref.loading,
328
- loadingText = _ref.loadingText,
329
- className = _ref.className,
330
- clearable = _ref.clearable,
331
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$6);
332
-
587
+ _ref$placeholder = _ref.placeholder,
588
+ placeholder = _ref$placeholder === void 0 ? 'Vennligst velg' : _ref$placeholder,
589
+ _ref$selectOnTab = _ref.selectOnTab,
590
+ selectOnTab = _ref$selectOnTab === void 0 ? false : _ref$selectOnTab,
591
+ _ref$openOnFocus = _ref.openOnFocus,
592
+ openOnFocus = _ref$openOnFocus === void 0 ? false : _ref$openOnFocus,
593
+ listStyle = _ref.listStyle,
594
+ items = _ref.items,
595
+ label = _ref.label,
596
+ disableLabelAnimation = _ref.disableLabelAnimation,
597
+ loading = _ref.loading,
598
+ loadingText = _ref.loadingText,
599
+ className = _ref.className,
600
+ clearable = _ref.clearable,
601
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$6);
333
602
  var _useDownshift = useDownshift(),
334
- getToggleButtonProps = _useDownshift.getToggleButtonProps,
335
- selectedItem = _useDownshift.selectedItem,
336
- selectHighlightedItem = _useDownshift.selectHighlightedItem,
337
- openMenu = _useDownshift.openMenu,
338
- isOpen = _useDownshift.isOpen,
339
- highlightedIndex = _useDownshift.highlightedIndex,
340
- setHighlightedIndex = _useDownshift.setHighlightedIndex;
341
-
603
+ getToggleButtonProps = _useDownshift.getToggleButtonProps,
604
+ selectedItem = _useDownshift.selectedItem,
605
+ selectHighlightedItem = _useDownshift.selectHighlightedItem,
606
+ openMenu = _useDownshift.openMenu,
607
+ isOpen = _useDownshift.isOpen,
608
+ highlightedIndex = _useDownshift.highlightedIndex,
609
+ setHighlightedIndex = _useDownshift.setHighlightedIndex;
342
610
  return React.createElement(BaseDropdown, _extends({
343
611
  disabled: disabled,
344
612
  listStyle: listStyle,
@@ -361,7 +629,6 @@ var RegularDropdown = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
361
629
  if (selectOnTab && e.key === 'Tab') {
362
630
  selectHighlightedItem();
363
631
  }
364
-
365
632
  if (isOpen) {
366
633
  var keyDownValue = e.key;
367
634
  var matchedItems = items.map(function (item, index) {
@@ -375,7 +642,6 @@ var RegularDropdown = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
375
642
  var nextHighlightItem = matchedItems.find(function (item) {
376
643
  return item.index > (highlightedIndex != null ? highlightedIndex : 0);
377
644
  });
378
-
379
645
  if (nextHighlightItem) {
380
646
  setHighlightedIndex(nextHighlightItem.index);
381
647
  } else if (matchedItems.length > 0) {
@@ -394,55 +660,49 @@ var RegularDropdown = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
394
660
  });
395
661
 
396
662
  var _excluded$5 = ["disabled", "className", "items", "loading", "loadingText", "readOnly", "prepend", "selectOnTab", "openOnFocus", "listStyle", "clearable", "itemFilter", "label", "disableLabelAnimation", "placeholder"];
397
-
398
663
  function LowerCaseFilterTest(item, input) {
399
664
  if (!input) {
400
665
  return true;
401
666
  }
402
-
403
667
  var sanitizeEscapeCharacters = input.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
404
668
  var inputRegex = new RegExp(sanitizeEscapeCharacters, 'i');
405
669
  return inputRegex.test(item.label);
406
670
  }
407
-
408
671
  var SearchableDropdown = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
409
672
  var _ref$disabled = _ref.disabled,
410
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
411
- className = _ref.className,
412
- items = _ref.items,
413
- loading = _ref.loading,
414
- loadingText = _ref.loadingText,
415
- _ref$readOnly = _ref.readOnly,
416
- readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
417
- prepend = _ref.prepend,
418
- _ref$selectOnTab = _ref.selectOnTab,
419
- selectOnTab = _ref$selectOnTab === void 0 ? false : _ref$selectOnTab,
420
- _ref$openOnFocus = _ref.openOnFocus,
421
- openOnFocus = _ref$openOnFocus === void 0 ? false : _ref$openOnFocus,
422
- listStyle = _ref.listStyle,
423
- clearable = _ref.clearable,
424
- _ref$itemFilter = _ref.itemFilter,
425
- itemFilter = _ref$itemFilter === void 0 ? function (item, inputValue) {
426
- return LowerCaseFilterTest(item, inputValue);
427
- } : _ref$itemFilter,
428
- label = _ref.label,
429
- disableLabelAnimation = _ref.disableLabelAnimation,
430
- placeholder = _ref.placeholder,
431
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$5);
432
-
673
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
674
+ className = _ref.className,
675
+ items = _ref.items,
676
+ loading = _ref.loading,
677
+ loadingText = _ref.loadingText,
678
+ _ref$readOnly = _ref.readOnly,
679
+ readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
680
+ prepend = _ref.prepend,
681
+ _ref$selectOnTab = _ref.selectOnTab,
682
+ selectOnTab = _ref$selectOnTab === void 0 ? false : _ref$selectOnTab,
683
+ _ref$openOnFocus = _ref.openOnFocus,
684
+ openOnFocus = _ref$openOnFocus === void 0 ? false : _ref$openOnFocus,
685
+ listStyle = _ref.listStyle,
686
+ clearable = _ref.clearable,
687
+ _ref$itemFilter = _ref.itemFilter,
688
+ itemFilter = _ref$itemFilter === void 0 ? function (item, inputValue) {
689
+ return LowerCaseFilterTest(item, inputValue);
690
+ } : _ref$itemFilter,
691
+ label = _ref.label,
692
+ disableLabelAnimation = _ref.disableLabelAnimation,
693
+ placeholder = _ref.placeholder,
694
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$5);
433
695
  var _useDownshift = useDownshift(),
434
- getInputProps = _useDownshift.getInputProps,
435
- inputValue = _useDownshift.inputValue,
436
- selectHighlightedItem = _useDownshift.selectHighlightedItem,
437
- isOpen = _useDownshift.isOpen,
438
- openMenu = _useDownshift.openMenu,
439
- closeMenu = _useDownshift.closeMenu,
440
- selectedItem = _useDownshift.selectedItem;
441
-
696
+ getInputProps = _useDownshift.getInputProps,
697
+ inputValue = _useDownshift.inputValue,
698
+ selectHighlightedItem = _useDownshift.selectHighlightedItem,
699
+ isOpen = _useDownshift.isOpen,
700
+ openMenu = _useDownshift.openMenu,
701
+ closeMenu = _useDownshift.closeMenu,
702
+ selectedItem = _useDownshift.selectedItem;
442
703
  var _useState = useState(false),
443
- hideSelectedItem = _useState[0],
444
- setHideSelectedItem = _useState[1];
445
-
704
+ hideSelectedItem = _useState[0],
705
+ setHideSelectedItem = _useState[1];
446
706
  var inputRef = useRef(null);
447
707
  var filteredItems = React.useMemo(function () {
448
708
  return items.filter(function (item) {
@@ -468,7 +728,6 @@ var SearchableDropdown = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
468
728
  className: "eds-dropdown__searchable-selected-item",
469
729
  onClick: function onClick() {
470
730
  var _inputRef$current;
471
-
472
731
  return (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.focus();
473
732
  }
474
733
  }, selectedItem.label)), React.createElement("input", _extends({}, getInputProps(_extends({
@@ -494,10 +753,10 @@ var SearchableDropdown = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
494
753
 
495
754
  var DropdownInputGroup = function DropdownInputGroup(_ref) {
496
755
  var children = _ref.children,
497
- feedback = _ref.feedback,
498
- variant = _ref.variant,
499
- className = _ref.className,
500
- style = _ref.style;
756
+ feedback = _ref.feedback,
757
+ variant = _ref.variant,
758
+ className = _ref.className,
759
+ style = _ref.style;
501
760
  return React.createElement(VariantProvider, {
502
761
  variant: variant
503
762
  }, React.createElement("div", {
@@ -508,735 +767,6 @@ var DropdownInputGroup = function DropdownInputGroup(_ref) {
508
767
  }, feedback)));
509
768
  };
510
769
 
511
- var runtime = {exports: {}};
512
-
513
- /**
514
- * Copyright (c) 2014-present, Facebook, Inc.
515
- *
516
- * This source code is licensed under the MIT license found in the
517
- * LICENSE file in the root directory of this source tree.
518
- */
519
-
520
- (function (module) {
521
- var runtime = /*#__PURE__*/function (exports) {
522
-
523
- var Op = Object.prototype;
524
- var hasOwn = Op.hasOwnProperty;
525
- var undefined$1; // More compressible than void 0.
526
-
527
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
528
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
529
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
530
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
531
-
532
- function define(obj, key, value) {
533
- Object.defineProperty(obj, key, {
534
- value: value,
535
- enumerable: true,
536
- configurable: true,
537
- writable: true
538
- });
539
- return obj[key];
540
- }
541
-
542
- try {
543
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
544
- define({}, "");
545
- } catch (err) {
546
- define = function define(obj, key, value) {
547
- return obj[key] = value;
548
- };
549
- }
550
-
551
- function wrap(innerFn, outerFn, self, tryLocsList) {
552
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
553
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
554
- var generator = Object.create(protoGenerator.prototype);
555
- var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
556
- // .throw, and .return methods.
557
-
558
- generator._invoke = makeInvokeMethod(innerFn, self, context);
559
- return generator;
560
- }
561
-
562
- exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
563
- // record like context.tryEntries[i].completion. This interface could
564
- // have been (and was previously) designed to take a closure to be
565
- // invoked without arguments, but in all the cases we care about we
566
- // already have an existing method we want to call, so there's no need
567
- // to create a new function object. We can even get away with assuming
568
- // the method takes exactly one argument, since that happens to be true
569
- // in every case, so we don't have to touch the arguments object. The
570
- // only additional allocation required is the completion record, which
571
- // has a stable shape and so hopefully should be cheap to allocate.
572
-
573
- function tryCatch(fn, obj, arg) {
574
- try {
575
- return {
576
- type: "normal",
577
- arg: fn.call(obj, arg)
578
- };
579
- } catch (err) {
580
- return {
581
- type: "throw",
582
- arg: err
583
- };
584
- }
585
- }
586
-
587
- var GenStateSuspendedStart = "suspendedStart";
588
- var GenStateSuspendedYield = "suspendedYield";
589
- var GenStateExecuting = "executing";
590
- var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
591
- // breaking out of the dispatch switch statement.
592
-
593
- var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
594
- // .constructor.prototype properties for functions that return Generator
595
- // objects. For full spec compliance, you may wish to configure your
596
- // minifier not to mangle the names of these two functions.
597
-
598
- function Generator() {}
599
-
600
- function GeneratorFunction() {}
601
-
602
- function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
603
- // don't natively support it.
604
-
605
-
606
- var IteratorPrototype = {};
607
-
608
- IteratorPrototype[iteratorSymbol] = function () {
609
- return this;
610
- };
611
-
612
- var getProto = Object.getPrototypeOf;
613
- var NativeIteratorPrototype = getProto && /*#__PURE__*/getProto( /*#__PURE__*/getProto( /*#__PURE__*/values([])));
614
-
615
- if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
616
- // This environment has a native %IteratorPrototype%; use it instead
617
- // of the polyfill.
618
- IteratorPrototype = NativeIteratorPrototype;
619
- }
620
-
621
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = /*#__PURE__*/Object.create(IteratorPrototype);
622
- GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
623
- GeneratorFunctionPrototype.constructor = GeneratorFunction;
624
- GeneratorFunction.displayName = /*#__PURE__*/define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
625
- // Iterator interface in terms of a single ._invoke method.
626
-
627
- function defineIteratorMethods(prototype) {
628
- ["next", "throw", "return"].forEach(function (method) {
629
- define(prototype, method, function (arg) {
630
- return this._invoke(method, arg);
631
- });
632
- });
633
- }
634
-
635
- exports.isGeneratorFunction = function (genFun) {
636
- var ctor = typeof genFun === "function" && genFun.constructor;
637
- return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
638
- // do is to check its .name property.
639
- (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
640
- };
641
-
642
- exports.mark = function (genFun) {
643
- if (Object.setPrototypeOf) {
644
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
645
- } else {
646
- genFun.__proto__ = GeneratorFunctionPrototype;
647
- define(genFun, toStringTagSymbol, "GeneratorFunction");
648
- }
649
-
650
- genFun.prototype = Object.create(Gp);
651
- return genFun;
652
- }; // Within the body of any async function, `await x` is transformed to
653
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
654
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
655
- // meant to be awaited.
656
-
657
-
658
- exports.awrap = function (arg) {
659
- return {
660
- __await: arg
661
- };
662
- };
663
-
664
- function AsyncIterator(generator, PromiseImpl) {
665
- function invoke(method, arg, resolve, reject) {
666
- var record = tryCatch(generator[method], generator, arg);
667
-
668
- if (record.type === "throw") {
669
- reject(record.arg);
670
- } else {
671
- var result = record.arg;
672
- var value = result.value;
673
-
674
- if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
675
- return PromiseImpl.resolve(value.__await).then(function (value) {
676
- invoke("next", value, resolve, reject);
677
- }, function (err) {
678
- invoke("throw", err, resolve, reject);
679
- });
680
- }
681
-
682
- return PromiseImpl.resolve(value).then(function (unwrapped) {
683
- // When a yielded Promise is resolved, its final value becomes
684
- // the .value of the Promise<{value,done}> result for the
685
- // current iteration.
686
- result.value = unwrapped;
687
- resolve(result);
688
- }, function (error) {
689
- // If a rejected Promise was yielded, throw the rejection back
690
- // into the async generator function so it can be handled there.
691
- return invoke("throw", error, resolve, reject);
692
- });
693
- }
694
- }
695
-
696
- var previousPromise;
697
-
698
- function enqueue(method, arg) {
699
- function callInvokeWithMethodAndArg() {
700
- return new PromiseImpl(function (resolve, reject) {
701
- invoke(method, arg, resolve, reject);
702
- });
703
- }
704
-
705
- return previousPromise = // If enqueue has been called before, then we want to wait until
706
- // all previous Promises have been resolved before calling invoke,
707
- // so that results are always delivered in the correct order. If
708
- // enqueue has not been called before, then it is important to
709
- // call invoke immediately, without waiting on a callback to fire,
710
- // so that the async generator function has the opportunity to do
711
- // any necessary setup in a predictable way. This predictability
712
- // is why the Promise constructor synchronously invokes its
713
- // executor callback, and why async functions synchronously
714
- // execute code before the first await. Since we implement simple
715
- // async functions in terms of async generators, it is especially
716
- // important to get this right, even though it requires care.
717
- previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
718
- // invocations of the iterator.
719
- callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
720
- } // Define the unified helper method that is used to implement .next,
721
- // .throw, and .return (see defineIteratorMethods).
722
-
723
-
724
- this._invoke = enqueue;
725
- }
726
-
727
- defineIteratorMethods(AsyncIterator.prototype);
728
-
729
- AsyncIterator.prototype[asyncIteratorSymbol] = function () {
730
- return this;
731
- };
732
-
733
- exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
734
- // AsyncIterator objects; they just return a Promise for the value of
735
- // the final result produced by the iterator.
736
-
737
- exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
738
- if (PromiseImpl === void 0) PromiseImpl = Promise;
739
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
740
- return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
741
- : iter.next().then(function (result) {
742
- return result.done ? result.value : iter.next();
743
- });
744
- };
745
-
746
- function makeInvokeMethod(innerFn, self, context) {
747
- var state = GenStateSuspendedStart;
748
- return function invoke(method, arg) {
749
- if (state === GenStateExecuting) {
750
- throw new Error("Generator is already running");
751
- }
752
-
753
- if (state === GenStateCompleted) {
754
- if (method === "throw") {
755
- throw arg;
756
- } // Be forgiving, per 25.3.3.3.3 of the spec:
757
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
758
-
759
-
760
- return doneResult();
761
- }
762
-
763
- context.method = method;
764
- context.arg = arg;
765
-
766
- while (true) {
767
- var delegate = context.delegate;
768
-
769
- if (delegate) {
770
- var delegateResult = maybeInvokeDelegate(delegate, context);
771
-
772
- if (delegateResult) {
773
- if (delegateResult === ContinueSentinel) continue;
774
- return delegateResult;
775
- }
776
- }
777
-
778
- if (context.method === "next") {
779
- // Setting context._sent for legacy support of Babel's
780
- // function.sent implementation.
781
- context.sent = context._sent = context.arg;
782
- } else if (context.method === "throw") {
783
- if (state === GenStateSuspendedStart) {
784
- state = GenStateCompleted;
785
- throw context.arg;
786
- }
787
-
788
- context.dispatchException(context.arg);
789
- } else if (context.method === "return") {
790
- context.abrupt("return", context.arg);
791
- }
792
-
793
- state = GenStateExecuting;
794
- var record = tryCatch(innerFn, self, context);
795
-
796
- if (record.type === "normal") {
797
- // If an exception is thrown from innerFn, we leave state ===
798
- // GenStateExecuting and loop back for another invocation.
799
- state = context.done ? GenStateCompleted : GenStateSuspendedYield;
800
-
801
- if (record.arg === ContinueSentinel) {
802
- continue;
803
- }
804
-
805
- return {
806
- value: record.arg,
807
- done: context.done
808
- };
809
- } else if (record.type === "throw") {
810
- state = GenStateCompleted; // Dispatch the exception by looping back around to the
811
- // context.dispatchException(context.arg) call above.
812
-
813
- context.method = "throw";
814
- context.arg = record.arg;
815
- }
816
- }
817
- };
818
- } // Call delegate.iterator[context.method](context.arg) and handle the
819
- // result, either by returning a { value, done } result from the
820
- // delegate iterator, or by modifying context.method and context.arg,
821
- // setting context.delegate to null, and returning the ContinueSentinel.
822
-
823
-
824
- function maybeInvokeDelegate(delegate, context) {
825
- var method = delegate.iterator[context.method];
826
-
827
- if (method === undefined$1) {
828
- // A .throw or .return when the delegate iterator has no .throw
829
- // method always terminates the yield* loop.
830
- context.delegate = null;
831
-
832
- if (context.method === "throw") {
833
- // Note: ["return"] must be used for ES3 parsing compatibility.
834
- if (delegate.iterator["return"]) {
835
- // If the delegate iterator has a return method, give it a
836
- // chance to clean up.
837
- context.method = "return";
838
- context.arg = undefined$1;
839
- maybeInvokeDelegate(delegate, context);
840
-
841
- if (context.method === "throw") {
842
- // If maybeInvokeDelegate(context) changed context.method from
843
- // "return" to "throw", let that override the TypeError below.
844
- return ContinueSentinel;
845
- }
846
- }
847
-
848
- context.method = "throw";
849
- context.arg = new TypeError("The iterator does not provide a 'throw' method");
850
- }
851
-
852
- return ContinueSentinel;
853
- }
854
-
855
- var record = tryCatch(method, delegate.iterator, context.arg);
856
-
857
- if (record.type === "throw") {
858
- context.method = "throw";
859
- context.arg = record.arg;
860
- context.delegate = null;
861
- return ContinueSentinel;
862
- }
863
-
864
- var info = record.arg;
865
-
866
- if (!info) {
867
- context.method = "throw";
868
- context.arg = new TypeError("iterator result is not an object");
869
- context.delegate = null;
870
- return ContinueSentinel;
871
- }
872
-
873
- if (info.done) {
874
- // Assign the result of the finished delegate to the temporary
875
- // variable specified by delegate.resultName (see delegateYield).
876
- context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
877
-
878
- context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
879
- // exception, let the outer generator proceed normally. If
880
- // context.method was "next", forget context.arg since it has been
881
- // "consumed" by the delegate iterator. If context.method was
882
- // "return", allow the original .return call to continue in the
883
- // outer generator.
884
-
885
- if (context.method !== "return") {
886
- context.method = "next";
887
- context.arg = undefined$1;
888
- }
889
- } else {
890
- // Re-yield the result returned by the delegate method.
891
- return info;
892
- } // The delegate iterator is finished, so forget it and continue with
893
- // the outer generator.
894
-
895
-
896
- context.delegate = null;
897
- return ContinueSentinel;
898
- } // Define Generator.prototype.{next,throw,return} in terms of the
899
- // unified ._invoke helper method.
900
-
901
-
902
- defineIteratorMethods(Gp);
903
- define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the
904
- // @@iterator function is called on it. Some browsers' implementations of the
905
- // iterator prototype chain incorrectly implement this, causing the Generator
906
- // object to not be returned from this call. This ensures that doesn't happen.
907
- // See https://github.com/facebook/regenerator/issues/274 for more details.
908
-
909
- Gp[iteratorSymbol] = function () {
910
- return this;
911
- };
912
-
913
- Gp.toString = function () {
914
- return "[object Generator]";
915
- };
916
-
917
- function pushTryEntry(locs) {
918
- var entry = {
919
- tryLoc: locs[0]
920
- };
921
-
922
- if (1 in locs) {
923
- entry.catchLoc = locs[1];
924
- }
925
-
926
- if (2 in locs) {
927
- entry.finallyLoc = locs[2];
928
- entry.afterLoc = locs[3];
929
- }
930
-
931
- this.tryEntries.push(entry);
932
- }
933
-
934
- function resetTryEntry(entry) {
935
- var record = entry.completion || {};
936
- record.type = "normal";
937
- delete record.arg;
938
- entry.completion = record;
939
- }
940
-
941
- function Context(tryLocsList) {
942
- // The root entry object (effectively a try statement without a catch
943
- // or a finally block) gives us a place to store values thrown from
944
- // locations where there is no enclosing try statement.
945
- this.tryEntries = [{
946
- tryLoc: "root"
947
- }];
948
- tryLocsList.forEach(pushTryEntry, this);
949
- this.reset(true);
950
- }
951
-
952
- exports.keys = function (object) {
953
- var keys = [];
954
-
955
- for (var key in object) {
956
- keys.push(key);
957
- }
958
-
959
- keys.reverse(); // Rather than returning an object with a next method, we keep
960
- // things simple and return the next function itself.
961
-
962
- return function next() {
963
- while (keys.length) {
964
- var key = keys.pop();
965
-
966
- if (key in object) {
967
- next.value = key;
968
- next.done = false;
969
- return next;
970
- }
971
- } // To avoid creating an additional object, we just hang the .value
972
- // and .done properties off the next function object itself. This
973
- // also ensures that the minifier will not anonymize the function.
974
-
975
-
976
- next.done = true;
977
- return next;
978
- };
979
- };
980
-
981
- function values(iterable) {
982
- if (iterable) {
983
- var iteratorMethod = iterable[iteratorSymbol];
984
-
985
- if (iteratorMethod) {
986
- return iteratorMethod.call(iterable);
987
- }
988
-
989
- if (typeof iterable.next === "function") {
990
- return iterable;
991
- }
992
-
993
- if (!isNaN(iterable.length)) {
994
- var i = -1,
995
- next = function next() {
996
- while (++i < iterable.length) {
997
- if (hasOwn.call(iterable, i)) {
998
- next.value = iterable[i];
999
- next.done = false;
1000
- return next;
1001
- }
1002
- }
1003
-
1004
- next.value = undefined$1;
1005
- next.done = true;
1006
- return next;
1007
- };
1008
-
1009
- return next.next = next;
1010
- }
1011
- } // Return an iterator with no values.
1012
-
1013
-
1014
- return {
1015
- next: doneResult
1016
- };
1017
- }
1018
-
1019
- exports.values = values;
1020
-
1021
- function doneResult() {
1022
- return {
1023
- value: undefined$1,
1024
- done: true
1025
- };
1026
- }
1027
-
1028
- Context.prototype = {
1029
- constructor: Context,
1030
- reset: function reset(skipTempReset) {
1031
- this.prev = 0;
1032
- this.next = 0; // Resetting context._sent for legacy support of Babel's
1033
- // function.sent implementation.
1034
-
1035
- this.sent = this._sent = undefined$1;
1036
- this.done = false;
1037
- this.delegate = null;
1038
- this.method = "next";
1039
- this.arg = undefined$1;
1040
- this.tryEntries.forEach(resetTryEntry);
1041
-
1042
- if (!skipTempReset) {
1043
- for (var name in this) {
1044
- // Not sure about the optimal order of these conditions:
1045
- if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
1046
- this[name] = undefined$1;
1047
- }
1048
- }
1049
- }
1050
- },
1051
- stop: function stop() {
1052
- this.done = true;
1053
- var rootEntry = this.tryEntries[0];
1054
- var rootRecord = rootEntry.completion;
1055
-
1056
- if (rootRecord.type === "throw") {
1057
- throw rootRecord.arg;
1058
- }
1059
-
1060
- return this.rval;
1061
- },
1062
- dispatchException: function dispatchException(exception) {
1063
- if (this.done) {
1064
- throw exception;
1065
- }
1066
-
1067
- var context = this;
1068
-
1069
- function handle(loc, caught) {
1070
- record.type = "throw";
1071
- record.arg = exception;
1072
- context.next = loc;
1073
-
1074
- if (caught) {
1075
- // If the dispatched exception was caught by a catch block,
1076
- // then let that catch block handle the exception normally.
1077
- context.method = "next";
1078
- context.arg = undefined$1;
1079
- }
1080
-
1081
- return !!caught;
1082
- }
1083
-
1084
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1085
- var entry = this.tryEntries[i];
1086
- var record = entry.completion;
1087
-
1088
- if (entry.tryLoc === "root") {
1089
- // Exception thrown outside of any try block that could handle
1090
- // it, so set the completion value of the entire function to
1091
- // throw the exception.
1092
- return handle("end");
1093
- }
1094
-
1095
- if (entry.tryLoc <= this.prev) {
1096
- var hasCatch = hasOwn.call(entry, "catchLoc");
1097
- var hasFinally = hasOwn.call(entry, "finallyLoc");
1098
-
1099
- if (hasCatch && hasFinally) {
1100
- if (this.prev < entry.catchLoc) {
1101
- return handle(entry.catchLoc, true);
1102
- } else if (this.prev < entry.finallyLoc) {
1103
- return handle(entry.finallyLoc);
1104
- }
1105
- } else if (hasCatch) {
1106
- if (this.prev < entry.catchLoc) {
1107
- return handle(entry.catchLoc, true);
1108
- }
1109
- } else if (hasFinally) {
1110
- if (this.prev < entry.finallyLoc) {
1111
- return handle(entry.finallyLoc);
1112
- }
1113
- } else {
1114
- throw new Error("try statement without catch or finally");
1115
- }
1116
- }
1117
- }
1118
- },
1119
- abrupt: function abrupt(type, arg) {
1120
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1121
- var entry = this.tryEntries[i];
1122
-
1123
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
1124
- var finallyEntry = entry;
1125
- break;
1126
- }
1127
- }
1128
-
1129
- if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
1130
- // Ignore the finally entry if control is not jumping to a
1131
- // location outside the try/catch block.
1132
- finallyEntry = null;
1133
- }
1134
-
1135
- var record = finallyEntry ? finallyEntry.completion : {};
1136
- record.type = type;
1137
- record.arg = arg;
1138
-
1139
- if (finallyEntry) {
1140
- this.method = "next";
1141
- this.next = finallyEntry.finallyLoc;
1142
- return ContinueSentinel;
1143
- }
1144
-
1145
- return this.complete(record);
1146
- },
1147
- complete: function complete(record, afterLoc) {
1148
- if (record.type === "throw") {
1149
- throw record.arg;
1150
- }
1151
-
1152
- if (record.type === "break" || record.type === "continue") {
1153
- this.next = record.arg;
1154
- } else if (record.type === "return") {
1155
- this.rval = this.arg = record.arg;
1156
- this.method = "return";
1157
- this.next = "end";
1158
- } else if (record.type === "normal" && afterLoc) {
1159
- this.next = afterLoc;
1160
- }
1161
-
1162
- return ContinueSentinel;
1163
- },
1164
- finish: function finish(finallyLoc) {
1165
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1166
- var entry = this.tryEntries[i];
1167
-
1168
- if (entry.finallyLoc === finallyLoc) {
1169
- this.complete(entry.completion, entry.afterLoc);
1170
- resetTryEntry(entry);
1171
- return ContinueSentinel;
1172
- }
1173
- }
1174
- },
1175
- "catch": function _catch(tryLoc) {
1176
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1177
- var entry = this.tryEntries[i];
1178
-
1179
- if (entry.tryLoc === tryLoc) {
1180
- var record = entry.completion;
1181
-
1182
- if (record.type === "throw") {
1183
- var thrown = record.arg;
1184
- resetTryEntry(entry);
1185
- }
1186
-
1187
- return thrown;
1188
- }
1189
- } // The context.catch method must only be called with a location
1190
- // argument that corresponds to a known catch block.
1191
-
1192
-
1193
- throw new Error("illegal catch attempt");
1194
- },
1195
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
1196
- this.delegate = {
1197
- iterator: values(iterable),
1198
- resultName: resultName,
1199
- nextLoc: nextLoc
1200
- };
1201
-
1202
- if (this.method === "next") {
1203
- // Deliberately forget the last sent value so that we don't
1204
- // accidentally pass it on to the delegate.
1205
- this.arg = undefined$1;
1206
- }
1207
-
1208
- return ContinueSentinel;
1209
- }
1210
- }; // Regardless of whether this script is executing as a CommonJS module
1211
- // or not, return the runtime object so that we can declare the variable
1212
- // regeneratorRuntime in the outer scope, which allows this module to be
1213
- // injected easily by `bin/regenerator --include-runtime script.js`.
1214
-
1215
- return exports;
1216
- }( // If this script is executing as a CommonJS module, use module.exports
1217
- // as the regeneratorRuntime namespace. Otherwise create a new empty
1218
- // object. Either way, the resulting object will be used to initialize
1219
- // the regeneratorRuntime variable at the top of this file.
1220
- module.exports );
1221
-
1222
- try {
1223
- regeneratorRuntime = runtime;
1224
- } catch (accidentalStrictMode) {
1225
- // This module should not be running in strict mode, so the above
1226
- // assignment should always work unless something is misconfigured. Just
1227
- // in case runtime.js accidentally runs in strict mode, we can escape
1228
- // strict mode using a global Function call. This could conceivably fail
1229
- // if a Content Security Policy forbids using Function, but in that case
1230
- // the proper solution is to fix the accidental strict mode problem. If
1231
- // you've misconfigured your bundler to force strict mode and applied a
1232
- // CSP to forbid Function, and you're not willing to fix either of those
1233
- // problems, please detail your unique predicament in a GitHub issue.
1234
- Function("r", "regeneratorRuntime = r")(runtime);
1235
- }
1236
- })(runtime);
1237
-
1238
- var _regeneratorRuntime = runtime.exports;
1239
-
1240
770
  var useNormalizedItems = function useNormalizedItems(items) {
1241
771
  return React.useMemo(function () {
1242
772
  return items.map(function (item) {
@@ -1246,13 +776,11 @@ var useNormalizedItems = function useNormalizedItems(items) {
1246
776
  label: item
1247
777
  };
1248
778
  }
1249
-
1250
779
  if (!('value' in item)) {
1251
780
  return _extends({}, item, {
1252
781
  value: item.label
1253
782
  });
1254
783
  }
1255
-
1256
784
  return item;
1257
785
  });
1258
786
  }, [items]);
@@ -1267,7 +795,6 @@ var useIsMounted = function useIsMounted() {
1267
795
  }, []);
1268
796
  return isMountedRef.current;
1269
797
  };
1270
-
1271
798
  var reducer = function reducer(_state, action) {
1272
799
  switch (action.type) {
1273
800
  case 'request results':
@@ -1275,7 +802,6 @@ var reducer = function reducer(_state, action) {
1275
802
  items: [],
1276
803
  loading: true
1277
804
  };
1278
-
1279
805
  case 'received results':
1280
806
  return {
1281
807
  items: action.payload,
@@ -1283,44 +809,38 @@ var reducer = function reducer(_state, action) {
1283
809
  };
1284
810
  }
1285
811
  };
1286
-
1287
- var useResolvedItems = function useResolvedItems(
1288
- /** The list of items, or an async function that resolves the list of items */
1289
- itemsOrItemsResolver,
1290
- /** The time to wait after the input changes to the fetchItems method is called */
812
+ var useResolvedItems = function useResolvedItems( /** The list of items, or an async function that resolves the list of items */
813
+ itemsOrItemsResolver, /** The time to wait after the input changes to the fetchItems method is called */
1291
814
  debounceTimeout) {
1292
815
  if (debounceTimeout === void 0) {
1293
816
  debounceTimeout = 250;
1294
817
  }
1295
-
1296
- var isItemsFunction = typeof itemsOrItemsResolver === 'function'; // Here, we normalize the itemsResolver argument to an async function, so we
818
+ var isItemsFunction = typeof itemsOrItemsResolver === 'function';
819
+ // Here, we normalize the itemsResolver argument to an async function, so we
1297
820
  // can use it without thinking about the differences later
1298
-
1299
821
  var itemsResolver = React.useMemo(function () {
1300
822
  return isItemsFunction ? itemsOrItemsResolver : function () {
1301
823
  return Promise.resolve(itemsOrItemsResolver);
1302
824
  };
1303
825
  }, [itemsOrItemsResolver, isItemsFunction]);
1304
-
1305
826
  var _React$useReducer = React.useReducer(reducer, {
1306
- items: isItemsFunction ? [] : itemsOrItemsResolver,
1307
- loading: false
1308
- }),
1309
- _React$useReducer$ = _React$useReducer[0],
1310
- items = _React$useReducer$.items,
1311
- loading = _React$useReducer$.loading,
1312
- dispatch = _React$useReducer[1]; // This is a way to check whether or not the dropdown is still in the
827
+ items: isItemsFunction ? [] : itemsOrItemsResolver,
828
+ loading: false
829
+ }),
830
+ _React$useReducer$ = _React$useReducer[0],
831
+ items = _React$useReducer$.items,
832
+ loading = _React$useReducer$.loading,
833
+ dispatch = _React$useReducer[1];
834
+ // This is a way to check whether or not the dropdown is still in the
1313
835
  // document. We use it below to make sure we're not updating the state of
1314
836
  // an unmounted component.
1315
-
1316
-
1317
- var isMounted = useIsMounted(); // Next, let's create the fetching function. This should be called whenever
837
+ var isMounted = useIsMounted();
838
+ // Next, let's create the fetching function. This should be called whenever
1318
839
  // the input value changes
1319
-
1320
840
  var fetchItems = React.useCallback( /*#__PURE__*/function () {
1321
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(inputValue) {
841
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(inputValue) {
1322
842
  var resolvedItems;
1323
- return _regeneratorRuntime.wrap(function _callee$(_context) {
843
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1324
844
  while (1) {
1325
845
  switch (_context.prev = _context.next) {
1326
846
  case 0:
@@ -1328,26 +848,21 @@ debounceTimeout) {
1328
848
  _context.next = 2;
1329
849
  break;
1330
850
  }
1331
-
1332
851
  return _context.abrupt("return");
1333
-
1334
852
  case 2:
1335
853
  dispatch({
1336
854
  type: 'request results'
1337
855
  });
1338
856
  _context.next = 5;
1339
857
  return itemsResolver(inputValue);
1340
-
1341
858
  case 5:
1342
859
  resolvedItems = _context.sent;
1343
-
1344
860
  if (isMounted) {
1345
861
  dispatch({
1346
862
  type: 'received results',
1347
863
  payload: resolvedItems
1348
864
  });
1349
865
  }
1350
-
1351
866
  case 7:
1352
867
  case "end":
1353
868
  return _context.stop();
@@ -1355,7 +870,6 @@ debounceTimeout) {
1355
870
  }
1356
871
  }, _callee);
1357
872
  }));
1358
-
1359
873
  return function (_x) {
1360
874
  return _ref.apply(this, arguments);
1361
875
  };
@@ -1377,38 +891,36 @@ debounceTimeout) {
1377
891
  var _excluded$4 = ["highlightFirstItemOnOpen", "debounceTimeout", "disabled", "feedback", "items", "label", "loadingText", "onChange", "placeholder", "prepend", "readOnly", "searchable", "selectOnTab", "openOnFocus", "variant", "value", "clearable", "className", "style", "listStyle", "itemFilter", "disableLabelAnimation"];
1378
892
  var Dropdown = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1379
893
  var highlightFirstItemOnOpen = _ref.highlightFirstItemOnOpen,
1380
- debounceTimeout = _ref.debounceTimeout,
1381
- disabled = _ref.disabled,
1382
- feedback = _ref.feedback,
1383
- items = _ref.items,
1384
- label = _ref.label,
1385
- loadingText = _ref.loadingText,
1386
- _ref$onChange = _ref.onChange,
1387
- onChange = _ref$onChange === void 0 ? function () {
1388
- return undefined;
1389
- } : _ref$onChange,
1390
- placeholder = _ref.placeholder,
1391
- prepend = _ref.prepend,
1392
- readOnly = _ref.readOnly,
1393
- searchable = _ref.searchable,
1394
- selectOnTab = _ref.selectOnTab,
1395
- openOnFocus = _ref.openOnFocus,
1396
- variant = _ref.variant,
1397
- value = _ref.value,
1398
- _ref$clearable = _ref.clearable,
1399
- clearable = _ref$clearable === void 0 ? false : _ref$clearable,
1400
- className = _ref.className,
1401
- style = _ref.style,
1402
- listStyle = _ref.listStyle,
1403
- itemFilter = _ref.itemFilter,
1404
- disableLabelAnimation = _ref.disableLabelAnimation,
1405
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
1406
-
894
+ debounceTimeout = _ref.debounceTimeout,
895
+ disabled = _ref.disabled,
896
+ feedback = _ref.feedback,
897
+ items = _ref.items,
898
+ label = _ref.label,
899
+ loadingText = _ref.loadingText,
900
+ _ref$onChange = _ref.onChange,
901
+ onChange = _ref$onChange === void 0 ? function () {
902
+ return undefined;
903
+ } : _ref$onChange,
904
+ placeholder = _ref.placeholder,
905
+ prepend = _ref.prepend,
906
+ readOnly = _ref.readOnly,
907
+ searchable = _ref.searchable,
908
+ selectOnTab = _ref.selectOnTab,
909
+ openOnFocus = _ref.openOnFocus,
910
+ variant = _ref.variant,
911
+ value = _ref.value,
912
+ _ref$clearable = _ref.clearable,
913
+ clearable = _ref$clearable === void 0 ? false : _ref$clearable,
914
+ className = _ref.className,
915
+ style = _ref.style,
916
+ listStyle = _ref.listStyle,
917
+ itemFilter = _ref.itemFilter,
918
+ disableLabelAnimation = _ref.disableLabelAnimation,
919
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
1407
920
  var _useResolvedItems = useResolvedItems(items, debounceTimeout),
1408
- normalizedItems = _useResolvedItems.items,
1409
- loading = _useResolvedItems.loading,
1410
- fetchItems = _useResolvedItems.fetchItems;
1411
-
921
+ normalizedItems = _useResolvedItems.items,
922
+ loading = _useResolvedItems.loading,
923
+ fetchItems = _useResolvedItems.fetchItems;
1412
924
  var selectedItem = value === undefined ? undefined : normalizedItems.find(function (item) {
1413
925
  return value === item.value;
1414
926
  }) || null;
@@ -1454,34 +966,30 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1454
966
  var _excluded$3 = ["className", "disabled", "readOnly", "items", "loadingText", "prepend", "style", "label", "variant", "feedback", "disableLabelAnimation"];
1455
967
  var NativeDropdown = function NativeDropdown(_ref) {
1456
968
  var className = _ref.className,
1457
- _ref$disabled = _ref.disabled,
1458
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
1459
- _ref$readOnly = _ref.readOnly,
1460
- readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
1461
- items = _ref.items,
1462
- loadingText = _ref.loadingText,
1463
- prepend = _ref.prepend,
1464
- style = _ref.style,
1465
- label = _ref.label,
1466
- variant = _ref.variant,
1467
- feedback = _ref.feedback,
1468
- disableLabelAnimation = _ref.disableLabelAnimation,
1469
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
1470
-
969
+ _ref$disabled = _ref.disabled,
970
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
971
+ _ref$readOnly = _ref.readOnly,
972
+ readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
973
+ items = _ref.items,
974
+ loadingText = _ref.loadingText,
975
+ prepend = _ref.prepend,
976
+ style = _ref.style,
977
+ label = _ref.label,
978
+ variant = _ref.variant,
979
+ feedback = _ref.feedback,
980
+ disableLabelAnimation = _ref.disableLabelAnimation,
981
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
1471
982
  var _useResolvedItems = useResolvedItems(items),
1472
- normalizedItems = _useResolvedItems.items,
1473
- loading = _useResolvedItems.loading;
1474
-
983
+ normalizedItems = _useResolvedItems.items,
984
+ loading = _useResolvedItems.loading;
1475
985
  var rightSideIcon = React.createElement(DownArrowIcon, {
1476
986
  inline: true
1477
987
  });
1478
-
1479
988
  if (disabled || readOnly) {
1480
989
  rightSideIcon = null;
1481
990
  } else if (loading) {
1482
991
  rightSideIcon = React.createElement(DropdownLoadingDots, null, loadingText);
1483
992
  }
1484
-
1485
993
  var nativeDropdownId = useRandomId('eds-native-dropdown');
1486
994
  return React.createElement(BaseFormControl, {
1487
995
  disabled: disabled,
@@ -1510,22 +1018,18 @@ var NativeDropdown = function NativeDropdown(_ref) {
1510
1018
 
1511
1019
  var _excluded$2 = ["items", "itemsSelectedLabel", "label", "feedback", "variant", "disabled", "readOnly", "onChange", "className", "clearable", "loading", "loadingText", "openOnFocus", "style", "listStyle", "initialSelectedItems", "debounceTimeout"];
1512
1020
  var MultiSelectContext = /*#__PURE__*/React.createContext(null);
1513
-
1514
1021
  var useMultiSelectContext = function useMultiSelectContext() {
1515
1022
  var context = React.useContext(MultiSelectContext);
1516
-
1517
1023
  if (!context) {
1518
1024
  throw new Error('You need to wrap your component in a DownshiftProvider');
1519
1025
  }
1520
-
1521
1026
  return context;
1522
1027
  };
1523
-
1524
- function stateReducer(state, //StateChangeOptions<NormalizedDropdownItemType>,
1028
+ function stateReducer(state,
1029
+ //StateChangeOptions<NormalizedDropdownItemType>,
1525
1030
  actionAndChanges) {
1526
1031
  var changes = actionAndChanges.changes,
1527
- type = actionAndChanges.type;
1528
-
1032
+ type = actionAndChanges.type;
1529
1033
  switch (type) {
1530
1034
  case useSelect.stateChangeTypes.MenuKeyDownEnter:
1531
1035
  case useSelect.stateChangeTypes.MenuKeyDownSpaceButton:
@@ -1534,96 +1038,84 @@ actionAndChanges) {
1534
1038
  isOpen: true,
1535
1039
  highlightedIndex: state.highlightedIndex
1536
1040
  });
1537
-
1538
1041
  default:
1539
1042
  return changes;
1540
1043
  }
1541
1044
  }
1542
-
1543
1045
  var MultiSelect = function MultiSelect(_ref) {
1544
1046
  var input = _ref.items,
1545
- _ref$itemsSelectedLab = _ref.itemsSelectedLabel,
1546
- itemsSelectedLabel = _ref$itemsSelectedLab === void 0 ? function (items) {
1547
- return SelectedItemsLabel(items);
1548
- } : _ref$itemsSelectedLab,
1549
- label = _ref.label,
1550
- feedback = _ref.feedback,
1551
- variant = _ref.variant,
1552
- disabled = _ref.disabled,
1553
- _ref$readOnly = _ref.readOnly,
1554
- readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
1555
- _ref$onChange = _ref.onChange,
1556
- onChange = _ref$onChange === void 0 ? function () {
1557
- return undefined;
1558
- } : _ref$onChange,
1559
- className = _ref.className,
1560
- _ref$clearable = _ref.clearable,
1561
- clearable = _ref$clearable === void 0 ? false : _ref$clearable,
1562
- _ref$loading = _ref.loading,
1563
- loading = _ref$loading === void 0 ? false : _ref$loading,
1564
- _ref$loadingText = _ref.loadingText,
1565
- loadingText = _ref$loadingText === void 0 ? '' : _ref$loadingText,
1566
- _ref$openOnFocus = _ref.openOnFocus,
1567
- openOnFocus = _ref$openOnFocus === void 0 ? false : _ref$openOnFocus,
1568
- style = _ref.style,
1569
- listStyle = _ref.listStyle,
1570
- _ref$initialSelectedI = _ref.initialSelectedItems,
1571
- initialSelectedItems = _ref$initialSelectedI === void 0 ? [] : _ref$initialSelectedI,
1572
- debounceTimeout = _ref.debounceTimeout,
1573
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
1574
-
1047
+ _ref$itemsSelectedLab = _ref.itemsSelectedLabel,
1048
+ itemsSelectedLabel = _ref$itemsSelectedLab === void 0 ? function (items) {
1049
+ return SelectedItemsLabel(items);
1050
+ } : _ref$itemsSelectedLab,
1051
+ label = _ref.label,
1052
+ feedback = _ref.feedback,
1053
+ variant = _ref.variant,
1054
+ disabled = _ref.disabled,
1055
+ _ref$readOnly = _ref.readOnly,
1056
+ readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
1057
+ _ref$onChange = _ref.onChange,
1058
+ onChange = _ref$onChange === void 0 ? function () {
1059
+ return undefined;
1060
+ } : _ref$onChange,
1061
+ className = _ref.className,
1062
+ _ref$clearable = _ref.clearable,
1063
+ clearable = _ref$clearable === void 0 ? false : _ref$clearable,
1064
+ _ref$loading = _ref.loading,
1065
+ loading = _ref$loading === void 0 ? false : _ref$loading,
1066
+ _ref$loadingText = _ref.loadingText,
1067
+ loadingText = _ref$loadingText === void 0 ? '' : _ref$loadingText,
1068
+ _ref$openOnFocus = _ref.openOnFocus,
1069
+ openOnFocus = _ref$openOnFocus === void 0 ? false : _ref$openOnFocus,
1070
+ style = _ref.style,
1071
+ listStyle = _ref.listStyle,
1072
+ _ref$initialSelectedI = _ref.initialSelectedItems,
1073
+ initialSelectedItems = _ref$initialSelectedI === void 0 ? [] : _ref$initialSelectedI,
1074
+ debounceTimeout = _ref.debounceTimeout,
1075
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
1575
1076
  var _useResolvedItems = useResolvedItems(input, debounceTimeout),
1576
- items = _useResolvedItems.items;
1577
-
1077
+ items = _useResolvedItems.items;
1578
1078
  var _useState = useState(initialSelectedItems),
1579
- selectedItems = _useState[0],
1580
- setSelectedItems = _useState[1];
1581
-
1079
+ selectedItems = _useState[0],
1080
+ setSelectedItems = _useState[1];
1582
1081
  var reset = React.useCallback(function () {
1583
1082
  setSelectedItems([]);
1584
1083
  }, []);
1585
-
1586
1084
  function isSelected(selectedCheckboxItem) {
1587
1085
  return selectedItems.some(function (selected) {
1588
1086
  return selected.value === selectedCheckboxItem.value;
1589
1087
  });
1590
1088
  }
1591
-
1592
1089
  var _useSelect = useSelect(_extends({
1593
- items: items,
1594
- stateReducer: stateReducer,
1595
- selectedItem: null,
1596
- onSelectedItemChange: function onSelectedItemChange(_ref2) {
1597
- var selectedItem = _ref2.selectedItem;
1598
-
1599
- if (!selectedItem) {
1600
- return;
1601
- }
1602
-
1603
- var itemIsFound = isSelected(selectedItem);
1604
-
1605
- if (itemIsFound) {
1606
- var slicedItemList = selectedItems.filter(function (item) {
1607
- return item.value !== selectedItem.value;
1608
- });
1609
- setSelectedItems(slicedItemList);
1610
- onChange(slicedItemList);
1611
- } else {
1612
- var _slicedItemList = [].concat(selectedItems, [selectedItem]);
1613
-
1614
- setSelectedItems(_slicedItemList);
1615
- onChange(_slicedItemList);
1090
+ items: items,
1091
+ stateReducer: stateReducer,
1092
+ selectedItem: null,
1093
+ onSelectedItemChange: function onSelectedItemChange(_ref2) {
1094
+ var selectedItem = _ref2.selectedItem;
1095
+ if (!selectedItem) {
1096
+ return;
1097
+ }
1098
+ var itemIsFound = isSelected(selectedItem);
1099
+ if (itemIsFound) {
1100
+ var slicedItemList = selectedItems.filter(function (item) {
1101
+ return item.value !== selectedItem.value;
1102
+ });
1103
+ setSelectedItems(slicedItemList);
1104
+ onChange(slicedItemList);
1105
+ } else {
1106
+ var _slicedItemList = [].concat(selectedItems, [selectedItem]);
1107
+ setSelectedItems(_slicedItemList);
1108
+ onChange(_slicedItemList);
1109
+ }
1616
1110
  }
1617
- }
1618
- }, rest)),
1619
- isOpen = _useSelect.isOpen,
1620
- getToggleButtonProps = _useSelect.getToggleButtonProps,
1621
- getLabelProps = _useSelect.getLabelProps,
1622
- getMenuProps = _useSelect.getMenuProps,
1623
- highlightedIndex = _useSelect.highlightedIndex,
1624
- getItemProps = _useSelect.getItemProps,
1625
- openMenu = _useSelect.openMenu;
1626
-
1111
+ }, rest)),
1112
+ isOpen = _useSelect.isOpen,
1113
+ getToggleButtonProps = _useSelect.getToggleButtonProps,
1114
+ getLabelProps = _useSelect.getLabelProps,
1115
+ getMenuProps = _useSelect.getMenuProps,
1116
+ highlightedIndex = _useSelect.highlightedIndex,
1117
+ getItemProps = _useSelect.getItemProps,
1118
+ openMenu = _useSelect.openMenu;
1627
1119
  var buttonText = selectedItems.length ? itemsSelectedLabel(selectedItems) : '';
1628
1120
  var multiSelectId = useRandomId('eds-multiselect');
1629
1121
  return React.createElement(MultiSelectContext.Provider, {
@@ -1700,13 +1192,10 @@ var MultiSelect = function MultiSelect(_ref) {
1700
1192
  })));
1701
1193
  }))));
1702
1194
  };
1703
-
1704
1195
  var ClearButton = function ClearButton(_ref3) {
1705
- var props = _extends({}, _ref3);
1706
-
1196
+ var props = _extends({}, (_objectDestructuringEmpty(_ref3), _ref3));
1707
1197
  var _useMultiSelectContex = useMultiSelectContext(),
1708
- reset = _useMultiSelectContex.reset;
1709
-
1198
+ reset = _useMultiSelectContex.reset;
1710
1199
  return React.createElement(React.Fragment, null, React.createElement("button", _extends({
1711
1200
  className: "eds-dropdown__clear-button",
1712
1201
  type: "button",
@@ -1718,31 +1207,25 @@ var ClearButton = function ClearButton(_ref3) {
1718
1207
  className: "eds-dropdown__divider"
1719
1208
  }));
1720
1209
  };
1721
-
1722
1210
  var Appendix$1 = function Appendix(_ref4) {
1723
1211
  var loading = _ref4.loading,
1724
- loadingText = _ref4.loadingText,
1725
- readOnly = _ref4.readOnly,
1726
- hasSelected = _ref4.hasSelected;
1727
-
1212
+ loadingText = _ref4.loadingText,
1213
+ readOnly = _ref4.readOnly,
1214
+ hasSelected = _ref4.hasSelected;
1728
1215
  if (loading) {
1729
1216
  return React.createElement(DropdownLoadingDots, null, loadingText);
1730
1217
  }
1731
-
1732
1218
  if (readOnly) {
1733
1219
  return null;
1734
1220
  }
1735
-
1736
1221
  return hasSelected ? React.createElement(React.Fragment, null, React.createElement(ClearButton, null), React.createElement(DropdownToggleButton, null)) : React.createElement(DropdownToggleButton, null);
1737
1222
  };
1738
-
1739
1223
  var DropdownToggleButton = function DropdownToggleButton() {
1740
1224
  var _useMultiSelectContex2 = useMultiSelectContext(),
1741
- getToggleButtonProps = _useMultiSelectContex2.getToggleButtonProps,
1742
- isOpen = _useMultiSelectContex2.isOpen,
1743
- openMenu = _useMultiSelectContex2.openMenu,
1744
- openOnFocus = _useMultiSelectContex2.openOnFocus;
1745
-
1225
+ getToggleButtonProps = _useMultiSelectContex2.getToggleButtonProps,
1226
+ isOpen = _useMultiSelectContex2.isOpen,
1227
+ openMenu = _useMultiSelectContex2.openMenu,
1228
+ openOnFocus = _useMultiSelectContex2.openOnFocus;
1746
1229
  return React.createElement("button", _extends({}, getToggleButtonProps({
1747
1230
  className: classNames('eds-dropdown__toggle-button', {
1748
1231
  'eds-dropdown__toggle-button--open': isOpen
@@ -1756,7 +1239,6 @@ var DropdownToggleButton = function DropdownToggleButton() {
1756
1239
  type: "button"
1757
1240
  }), React.createElement(DownArrowIcon, null));
1758
1241
  };
1759
-
1760
1242
  var CheckboxIcon = function CheckboxIcon() {
1761
1243
  return React.createElement("svg", {
1762
1244
  className: "eds-checkbox-icon",
@@ -1769,7 +1251,6 @@ var CheckboxIcon = function CheckboxIcon() {
1769
1251
  fill: "none"
1770
1252
  }));
1771
1253
  };
1772
-
1773
1254
  function SelectedItemsLabel(items) {
1774
1255
  return items.length < 3 ? items.map(function (item) {
1775
1256
  return item.label;
@@ -1779,14 +1260,13 @@ function SelectedItemsLabel(items) {
1779
1260
  var _excluded$1 = ["selectedItem", "isOpen", "getMenuProps", "getItemProps", "filteredItems", "highlightedIndex", "listStyle"];
1780
1261
  var DropdownList = function DropdownList(_ref) {
1781
1262
  var selectedItem = _ref.selectedItem,
1782
- isOpen = _ref.isOpen,
1783
- getMenuProps = _ref.getMenuProps,
1784
- getItemProps = _ref.getItemProps,
1785
- filteredItems = _ref.filteredItems,
1786
- highlightedIndex = _ref.highlightedIndex,
1787
- listStyle = _ref.listStyle,
1788
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
1789
-
1263
+ isOpen = _ref.isOpen,
1264
+ getMenuProps = _ref.getMenuProps,
1265
+ getItemProps = _ref.getItemProps,
1266
+ filteredItems = _ref.filteredItems,
1267
+ highlightedIndex = _ref.highlightedIndex,
1268
+ listStyle = _ref.listStyle,
1269
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
1790
1270
  return React.createElement("ul", _extends({
1791
1271
  className: classNames('eds-searchable-dropdown__list', {
1792
1272
  'eds-searchable-dropdown__list--open': isOpen
@@ -1794,7 +1274,8 @@ var DropdownList = function DropdownList(_ref) {
1794
1274
  }, getMenuProps(), {
1795
1275
  style: _extends({}, rest.style, listStyle)
1796
1276
  }), isOpen ? filteredItems.map(function (item, index) {
1797
- return (// eslint-disable-next-line react/jsx-key
1277
+ return (
1278
+ // eslint-disable-next-line react/jsx-key
1798
1279
  React.createElement("li", _extends({
1799
1280
  className: classNames('eds-searchable-dropdown__list__item', {
1800
1281
  'eds-searchable-dropdown__list__item--highlighted': highlightedIndex === index,
@@ -1816,53 +1297,45 @@ var DropdownList = function DropdownList(_ref) {
1816
1297
  };
1817
1298
 
1818
1299
  var _excluded = ["items", "selectedItem", "onChange", "label", "placeholder", "clearable", "openOnFocus", "readonly", "feedback", "variant", "className", "listStyle"];
1819
-
1820
1300
  function lowerCaseFilterTest(item, input) {
1821
1301
  if (!input) {
1822
1302
  return true;
1823
1303
  }
1824
-
1825
1304
  var sanitizeEscapeCharacters = input.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
1826
1305
  var inputRegex = new RegExp(sanitizeEscapeCharacters, 'i');
1827
1306
  return inputRegex.test(item.label);
1828
- } // TODO Husk å @deprecate searchable-prop-en til Dropdown når denne komponenten skal ha official release
1307
+ }
1308
+ // TODO Husk å @deprecate searchable-prop-en til Dropdown når denne komponenten skal ha official release
1829
1309
  // TODO Husk å generelt legge inn støtte for typeof value === string
1830
-
1831
-
1832
1310
  var SearchableDropdownBeta = function SearchableDropdownBeta(_ref) {
1833
1311
  var _selectedItem$label;
1834
-
1835
1312
  var items = _ref.items,
1836
- value = _ref.selectedItem,
1837
- onChange = _ref.onChange,
1838
- label = _ref.label,
1839
- placeholder = _ref.placeholder,
1840
- _ref$clearable = _ref.clearable,
1841
- clearable = _ref$clearable === void 0 ? false : _ref$clearable,
1842
- _ref$openOnFocus = _ref.openOnFocus,
1843
- openOnFocus = _ref$openOnFocus === void 0 ? false : _ref$openOnFocus,
1844
- _ref$readonly = _ref.readonly,
1845
- readonly = _ref$readonly === void 0 ? false : _ref$readonly,
1846
- feedback = _ref.feedback,
1847
- _ref$variant = _ref.variant,
1848
- variant = _ref$variant === void 0 ? 'info' : _ref$variant,
1849
- className = _ref.className,
1850
- listStyle = _ref.listStyle,
1851
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
1852
-
1313
+ value = _ref.selectedItem,
1314
+ onChange = _ref.onChange,
1315
+ label = _ref.label,
1316
+ placeholder = _ref.placeholder,
1317
+ _ref$clearable = _ref.clearable,
1318
+ clearable = _ref$clearable === void 0 ? false : _ref$clearable,
1319
+ _ref$openOnFocus = _ref.openOnFocus,
1320
+ openOnFocus = _ref$openOnFocus === void 0 ? false : _ref$openOnFocus,
1321
+ _ref$readonly = _ref.readonly,
1322
+ readonly = _ref$readonly === void 0 ? false : _ref$readonly,
1323
+ feedback = _ref.feedback,
1324
+ _ref$variant = _ref.variant,
1325
+ variant = _ref$variant === void 0 ? 'info' : _ref$variant,
1326
+ className = _ref.className,
1327
+ listStyle = _ref.listStyle,
1328
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
1853
1329
  var _React$useState = React.useState(items),
1854
- filteredItems = _React$useState[0],
1855
- setFilteredItems = _React$useState[1];
1856
-
1330
+ filteredItems = _React$useState[0],
1331
+ setFilteredItems = _React$useState[1];
1857
1332
  var _useState = useState(false),
1858
- hideSelectedItem = _useState[0],
1859
- setHideSelectedItem = _useState[1];
1860
-
1333
+ hideSelectedItem = _useState[0],
1334
+ setHideSelectedItem = _useState[1];
1861
1335
  var inputRef = useRef(null);
1862
1336
  var stateReducer = React.useCallback(function (_, actionAndChanges) {
1863
1337
  var type = actionAndChanges.type,
1864
- changes = actionAndChanges.changes;
1865
-
1338
+ changes = actionAndChanges.changes;
1866
1339
  switch (type) {
1867
1340
  case useCombobox.stateChangeTypes.ItemClick:
1868
1341
  case useCombobox.stateChangeTypes.InputKeyDownEnter:
@@ -1871,43 +1344,40 @@ var SearchableDropdownBeta = function SearchableDropdownBeta(_ref) {
1871
1344
  return _extends({}, changes, changes.selectedItem && {
1872
1345
  inputValue: ''
1873
1346
  });
1874
-
1875
1347
  default:
1876
1348
  return changes;
1877
1349
  }
1878
1350
  }, []);
1879
-
1880
1351
  var _useCombobox = useCombobox(_extends({
1881
- onInputValueChange: function onInputValueChange(_ref2) {
1882
- var inputValue = _ref2.inputValue;
1883
- setFilteredItems(items.filter(function (item) {
1884
- return lowerCaseFilterTest(item, inputValue);
1885
- }));
1886
- },
1887
- items: filteredItems,
1888
- itemToString: function itemToString(item) {
1889
- if (item) return item.value;
1890
- return '';
1891
- },
1892
- stateReducer: stateReducer,
1893
- selectedItem: value,
1894
- onSelectedItemChange: function onSelectedItemChange(_ref3) {
1895
- var newSelectedItem = _ref3.selectedItem;
1896
- return onChange(newSelectedItem != null ? newSelectedItem : null);
1897
- }
1898
- }, rest)),
1899
- isOpen = _useCombobox.isOpen,
1900
- getToggleButtonProps = _useCombobox.getToggleButtonProps,
1901
- getLabelProps = _useCombobox.getLabelProps,
1902
- getMenuProps = _useCombobox.getMenuProps,
1903
- getInputProps = _useCombobox.getInputProps,
1904
- getComboboxProps = _useCombobox.getComboboxProps,
1905
- highlightedIndex = _useCombobox.highlightedIndex,
1906
- getItemProps = _useCombobox.getItemProps,
1907
- selectedItem = _useCombobox.selectedItem,
1908
- openMenu = _useCombobox.openMenu,
1909
- inputValue = _useCombobox.inputValue;
1910
-
1352
+ onInputValueChange: function onInputValueChange(_ref2) {
1353
+ var inputValue = _ref2.inputValue;
1354
+ setFilteredItems(items.filter(function (item) {
1355
+ return lowerCaseFilterTest(item, inputValue);
1356
+ }));
1357
+ },
1358
+ items: filteredItems,
1359
+ itemToString: function itemToString(item) {
1360
+ if (item) return item.value;
1361
+ return '';
1362
+ },
1363
+ stateReducer: stateReducer,
1364
+ selectedItem: value,
1365
+ onSelectedItemChange: function onSelectedItemChange(_ref3) {
1366
+ var newSelectedItem = _ref3.selectedItem;
1367
+ return onChange(newSelectedItem != null ? newSelectedItem : null);
1368
+ }
1369
+ }, rest)),
1370
+ isOpen = _useCombobox.isOpen,
1371
+ getToggleButtonProps = _useCombobox.getToggleButtonProps,
1372
+ getLabelProps = _useCombobox.getLabelProps,
1373
+ getMenuProps = _useCombobox.getMenuProps,
1374
+ getInputProps = _useCombobox.getInputProps,
1375
+ getComboboxProps = _useCombobox.getComboboxProps,
1376
+ highlightedIndex = _useCombobox.highlightedIndex,
1377
+ getItemProps = _useCombobox.getItemProps,
1378
+ selectedItem = _useCombobox.selectedItem,
1379
+ openMenu = _useCombobox.openMenu,
1380
+ inputValue = _useCombobox.inputValue;
1911
1381
  return React.createElement("div", {
1912
1382
  className: "eds-searchable-dropdown__wrapper"
1913
1383
  }, React.createElement(BaseFormControl, _extends({
@@ -1934,7 +1404,6 @@ var SearchableDropdownBeta = function SearchableDropdownBeta(_ref) {
1934
1404
  className: "eds-searchable-dropdown__selected-item",
1935
1405
  onClick: function onClick() {
1936
1406
  var _inputRef$current;
1937
-
1938
1407
  return (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.focus();
1939
1408
  }
1940
1409
  }, selectedItem.label)), React.createElement("input", _extends({
@@ -1959,15 +1428,13 @@ var SearchableDropdownBeta = function SearchableDropdownBeta(_ref) {
1959
1428
  getItemProps: getItemProps
1960
1429
  }));
1961
1430
  };
1962
-
1963
1431
  var Appendix = function Appendix(_ref4) {
1964
1432
  var clearable = _ref4.clearable,
1965
- readOnly = _ref4.readOnly,
1966
- getToggleButtonProps = _ref4.getToggleButtonProps,
1967
- selectedItem = _ref4.selectedItem,
1968
- isOpen = _ref4.isOpen,
1969
- onChange = _ref4.onChange;
1970
-
1433
+ readOnly = _ref4.readOnly,
1434
+ getToggleButtonProps = _ref4.getToggleButtonProps,
1435
+ selectedItem = _ref4.selectedItem,
1436
+ isOpen = _ref4.isOpen,
1437
+ onChange = _ref4.onChange;
1971
1438
  // TODO implement loading / async
1972
1439
  // if (loading) {
1973
1440
  // return <DropdownLoadingDots>{loadingText}</DropdownLoadingDots>;
@@ -1975,7 +1442,6 @@ var Appendix = function Appendix(_ref4) {
1975
1442
  if (readOnly) {
1976
1443
  return null;
1977
1444
  }
1978
-
1979
1445
  return React.createElement("div", {
1980
1446
  style: {
1981
1447
  display: 'flex',