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