@pingux/astro 2.17.0 → 2.18.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.test.js +13 -15
  2. package/lib/cjs/components/ArrayField/ArrayField.stories.js +1 -3
  3. package/lib/cjs/components/Calendar/Calendar.test.js +13 -15
  4. package/lib/cjs/components/CodeView/CodeView.test.js +45 -53
  5. package/lib/cjs/components/ComboBoxField/ComboBoxField.stories.js +35 -37
  6. package/lib/cjs/components/ComboBoxField/ComboBoxField.test.js +122 -132
  7. package/lib/cjs/components/CopyText/CopyText.test.js +191 -223
  8. package/lib/cjs/components/DataTable/DataTable.stories.js +75 -79
  9. package/lib/cjs/components/DataTable/DataTable.test.js +569 -629
  10. package/lib/cjs/components/DatePicker/DateField.js +1 -1
  11. package/lib/cjs/components/DatePicker/DatePicker.test.js +81 -87
  12. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +2 -2
  13. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +19 -16
  14. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumbAxe.test.js +7 -0
  15. package/lib/cjs/components/HelpHint/HelpHint.js +5 -2
  16. package/lib/cjs/components/HelpHint/HelpHint.stories.js +3 -2
  17. package/lib/cjs/components/HelpHint/HelpHint.styles.js +5 -1
  18. package/lib/cjs/components/HelpHint/HelpHint.test.js +145 -146
  19. package/lib/cjs/components/ImageUploadField/ImageUploadField.stories.js +73 -77
  20. package/lib/cjs/components/ImageUploadField/ImageUploadField.test.js +150 -162
  21. package/lib/cjs/components/LinkSelectField/LinkSelectField.stories.js +26 -28
  22. package/lib/cjs/components/LinkSelectField/LinkSelectField.test.js +13 -15
  23. package/lib/cjs/components/ListBox/ListBox.js +1 -1
  24. package/lib/cjs/components/ListBox/ListBox.test.js +13 -15
  25. package/lib/cjs/components/ListBox/Option.js +1 -1
  26. package/lib/cjs/components/ListView/ListView.stories.js +124 -95
  27. package/lib/cjs/components/ListView/ListView.test.js +119 -133
  28. package/lib/cjs/components/ListViewItem/ListViewItem.mdx +1 -0
  29. package/lib/cjs/components/ListViewItem/ListViewItem.stories.js +36 -2
  30. package/lib/cjs/components/ListViewItem/ListViewItem.styles.js +1 -1
  31. package/lib/cjs/components/ListViewItem/controls/ListViewItemMenu.test.js +23 -25
  32. package/lib/cjs/components/ListViewItem/controls/chart/ListViewItemChart.js +102 -0
  33. package/lib/cjs/components/ListViewItem/controls/chart/ListViewItemChart.mdx +11 -0
  34. package/lib/cjs/components/ListViewItem/controls/chart/ListViewItemChart.stories.js +50 -0
  35. package/lib/cjs/components/ListViewItem/controls/chart/ListViewItemChart.styles.js +112 -0
  36. package/lib/cjs/components/ListViewItem/controls/chart/ListViewItemChart.test.js +76 -0
  37. package/lib/cjs/components/ListViewItem/controls/chart/ListViewItemChartAttributes.js +127 -0
  38. package/lib/cjs/components/ListViewItem/controls/chart/chartData.js +45 -0
  39. package/lib/cjs/components/MultivaluesField/MultivaluesField.test.js +61 -72
  40. package/lib/cjs/components/PasswordField/PasswordField.test.js +44 -50
  41. package/lib/cjs/components/RadioGroupField/RadioGroupField.test.js +24 -26
  42. package/lib/cjs/components/ScrollBox/ScrollBox.js +2 -2
  43. package/lib/cjs/components/SelectField/SelectField.stories.js +26 -28
  44. package/lib/cjs/components/SelectFieldBase/SelectFieldBase.test.js +13 -15
  45. package/lib/cjs/components/Stepper/Stepper.test.js +53 -55
  46. package/lib/cjs/components/Tabs/Tabs.js +1 -1
  47. package/lib/cjs/components/Tabs/Tabs.test.js +37 -41
  48. package/lib/cjs/components/TextArea/TextArea.styles.js +7 -1
  49. package/lib/cjs/components/TooltipTrigger/TooltipTrigger.test.js +45 -29
  50. package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderMenu.test.js +23 -25
  51. package/lib/cjs/hooks/useComponentToggle/useComponentToggle.test.js +22 -26
  52. package/lib/cjs/hooks/useCopyToClipboard/useCopyToClipboard.js +42 -44
  53. package/lib/cjs/hooks/useCopyToClipboard/useCopyToClipboard.test.js +12 -14
  54. package/lib/cjs/hooks/useField/useField.js +1 -1
  55. package/lib/cjs/hooks/useImageUploadState/useImageUploadState.js +5 -5
  56. package/lib/cjs/hooks/useLabelHeight/useLabelHeight.js +2 -2
  57. package/lib/cjs/hooks/useOverlappingMenuHoverState/useOverlappingMenuHoverState.test.js +98 -112
  58. package/lib/cjs/index.d.ts +1 -0
  59. package/lib/cjs/index.js +8 -0
  60. package/lib/cjs/styles/variants/variants.js +2 -0
  61. package/lib/cjs/types/index.d.ts +1 -0
  62. package/lib/cjs/types/index.js +17 -6
  63. package/lib/cjs/types/item.d.ts +29 -0
  64. package/lib/cjs/types/item.js +6 -0
  65. package/lib/cjs/utils/testUtils/testAxe.js +25 -28
  66. package/lib/components/AccordionGridGroup/AccordionGridGroup.test.js +13 -15
  67. package/lib/components/ArrayField/ArrayField.stories.js +1 -3
  68. package/lib/components/Box/Box.js +6 -6
  69. package/lib/components/Calendar/Calendar.test.js +13 -15
  70. package/lib/components/CodeView/CodeView.test.js +45 -53
  71. package/lib/components/ComboBoxField/ComboBoxField.stories.js +35 -37
  72. package/lib/components/ComboBoxField/ComboBoxField.test.js +122 -132
  73. package/lib/components/CopyText/CopyText.test.js +191 -223
  74. package/lib/components/DataTable/DataTable.stories.js +75 -79
  75. package/lib/components/DataTable/DataTable.test.js +569 -629
  76. package/lib/components/DatePicker/DateField.js +1 -1
  77. package/lib/components/DatePicker/DatePicker.test.js +81 -87
  78. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +2 -2
  79. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +15 -18
  80. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumbAxe.test.js +4 -0
  81. package/lib/components/HelpHint/HelpHint.js +5 -2
  82. package/lib/components/HelpHint/HelpHint.stories.js +3 -2
  83. package/lib/components/HelpHint/HelpHint.styles.js +5 -1
  84. package/lib/components/HelpHint/HelpHint.test.js +145 -146
  85. package/lib/components/ImageUploadField/ImageUploadField.stories.js +73 -77
  86. package/lib/components/ImageUploadField/ImageUploadField.test.js +150 -162
  87. package/lib/components/LinkSelectField/LinkSelectField.stories.js +26 -28
  88. package/lib/components/LinkSelectField/LinkSelectField.test.js +13 -15
  89. package/lib/components/ListBox/ListBox.js +1 -1
  90. package/lib/components/ListBox/ListBox.test.js +13 -15
  91. package/lib/components/ListBox/Option.js +1 -1
  92. package/lib/components/ListView/ListView.stories.js +118 -94
  93. package/lib/components/ListView/ListView.test.js +119 -133
  94. package/lib/components/ListViewItem/ListViewItem.mdx +1 -0
  95. package/lib/components/ListViewItem/ListViewItem.stories.js +30 -2
  96. package/lib/components/ListViewItem/ListViewItem.styles.js +1 -1
  97. package/lib/components/ListViewItem/controls/ListViewItemMenu.test.js +23 -25
  98. package/lib/components/ListViewItem/controls/chart/ListViewItemChart.js +88 -0
  99. package/lib/components/ListViewItem/controls/chart/ListViewItemChart.mdx +11 -0
  100. package/lib/components/ListViewItem/controls/chart/ListViewItemChart.stories.js +35 -0
  101. package/lib/components/ListViewItem/controls/chart/ListViewItemChart.styles.js +104 -0
  102. package/lib/components/ListViewItem/controls/chart/ListViewItemChart.test.js +73 -0
  103. package/lib/components/ListViewItem/controls/chart/ListViewItemChartAttributes.js +118 -0
  104. package/lib/components/ListViewItem/controls/chart/chartData.js +37 -0
  105. package/lib/components/MultivaluesField/MultivaluesField.test.js +61 -72
  106. package/lib/components/PasswordField/PasswordField.test.js +44 -50
  107. package/lib/components/RadioGroupField/RadioGroupField.test.js +24 -26
  108. package/lib/components/ScrollBox/ScrollBox.js +2 -2
  109. package/lib/components/SelectField/SelectField.stories.js +26 -28
  110. package/lib/components/SelectFieldBase/SelectFieldBase.test.js +13 -15
  111. package/lib/components/Stepper/Stepper.test.js +53 -55
  112. package/lib/components/Tabs/Tabs.js +1 -1
  113. package/lib/components/Tabs/Tabs.test.js +37 -41
  114. package/lib/components/TextArea/TextArea.styles.js +7 -1
  115. package/lib/components/TooltipTrigger/TooltipTrigger.test.js +45 -29
  116. package/lib/experimental/PanelHeader/controls/PanelHeaderMenu.test.js +23 -25
  117. package/lib/hooks/useComponentToggle/useComponentToggle.test.js +22 -26
  118. package/lib/hooks/useCopyToClipboard/useCopyToClipboard.js +42 -44
  119. package/lib/hooks/useCopyToClipboard/useCopyToClipboard.test.js +12 -14
  120. package/lib/hooks/useField/useField.js +1 -1
  121. package/lib/hooks/useImageUploadState/useImageUploadState.js +5 -5
  122. package/lib/hooks/useLabelHeight/useLabelHeight.js +2 -2
  123. package/lib/hooks/useOverlappingMenuHoverState/useOverlappingMenuHoverState.test.js +98 -112
  124. package/lib/index.js +1 -0
  125. package/lib/styles/variants/variants.js +2 -0
  126. package/lib/types/index.js +1 -0
  127. package/lib/types/item.js +1 -0
  128. package/lib/utils/testUtils/testAxe.js +25 -28
  129. package/package.json +5 -4
@@ -16,7 +16,7 @@ import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
16
16
  import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
17
17
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
18
18
  import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
19
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = _Object$defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context5; _forEachInstanceProperty(_context5 = ["next", "throw", "return"]).call(_context5, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; 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; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; 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); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context6; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context6 = this.tryEntries).call(_context6, resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; 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; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
19
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = _Object$defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context5; _forEachInstanceProperty(_context5 = ["next", "throw", "return"]).call(_context5, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; 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; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; 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); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context6; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context6 = this.tryEntries).call(_context6, resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; 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; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
20
20
  import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
21
21
  import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
22
22
  import _startsWithInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/starts-with";
@@ -229,43 +229,41 @@ export var AsyncLoading = function AsyncLoading() {
229
229
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
230
230
  var signal, cursor, filterText, res, json;
231
231
  return _regeneratorRuntime().wrap(function _callee$(_context) {
232
- while (1) {
233
- switch (_context.prev = _context.next) {
234
- case 0:
235
- signal = _ref.signal, cursor = _ref.cursor, filterText = _ref.filterText;
236
- if (cursor) {
237
- // eslint-disable-next-line
238
- cursor = cursor.replace(/^http:\/\//i, 'https://');
239
- }
232
+ while (1) switch (_context.prev = _context.next) {
233
+ case 0:
234
+ signal = _ref.signal, cursor = _ref.cursor, filterText = _ref.filterText;
235
+ if (cursor) {
236
+ // eslint-disable-next-line
237
+ cursor = cursor.replace(/^http:\/\//i, 'https://');
238
+ }
240
239
 
241
- // If no cursor is available, then we're loading the first page,
242
- // filtering the results returned via a query string that
243
- // mirrors the ComboBox input text.
244
- // Otherwise, the cursor is the next URL to load,
245
- // as returned from the previous page.
246
- _context.next = 4;
247
- return fetch(cursor || "https://swapi.dev/api/people/?search=".concat(filterText), {
248
- signal: signal
249
- });
250
- case 4:
251
- res = _context.sent;
252
- _context.next = 7;
253
- return res.json();
254
- case 7:
255
- json = _context.sent;
256
- _context.next = 10;
257
- return new _Promise(function (resolve) {
258
- return _setTimeout(resolve, cursor ? 2000 : 3000);
259
- });
260
- case 10:
261
- return _context.abrupt("return", {
262
- items: json.results,
263
- cursor: json.next
264
- });
265
- case 11:
266
- case "end":
267
- return _context.stop();
268
- }
240
+ // If no cursor is available, then we're loading the first page,
241
+ // filtering the results returned via a query string that
242
+ // mirrors the ComboBox input text.
243
+ // Otherwise, the cursor is the next URL to load,
244
+ // as returned from the previous page.
245
+ _context.next = 4;
246
+ return fetch(cursor || "https://swapi.dev/api/people/?search=".concat(filterText), {
247
+ signal: signal
248
+ });
249
+ case 4:
250
+ res = _context.sent;
251
+ _context.next = 7;
252
+ return res.json();
253
+ case 7:
254
+ json = _context.sent;
255
+ _context.next = 10;
256
+ return new _Promise(function (resolve) {
257
+ return _setTimeout(resolve, cursor ? 2000 : 3000);
258
+ });
259
+ case 10:
260
+ return _context.abrupt("return", {
261
+ items: json.results,
262
+ cursor: json.next
263
+ });
264
+ case 11:
265
+ case "end":
266
+ return _context.stop();
269
267
  }
270
268
  }, _callee);
271
269
  }))();
@@ -18,7 +18,7 @@ import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
18
18
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
19
19
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
20
20
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context9, _context10; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context9 = ownKeys(Object(source), !0)).call(_context9, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context10 = ownKeys(Object(source))).call(_context10, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
21
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = _Object$defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context7; _forEachInstanceProperty(_context7 = ["next", "throw", "return"]).call(_context7, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; 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; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; 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); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context8; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context8 = this.tryEntries).call(_context8, resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; 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; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
21
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = _Object$defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context7; _forEachInstanceProperty(_context7 = ["next", "throw", "return"]).call(_context7, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; 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; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; 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); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context8; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context8 = this.tryEntries).call(_context8, resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; 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; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
22
22
  import _startsWithInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/starts-with";
23
23
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
24
24
  import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
@@ -515,145 +515,137 @@ test('should use default contains filtering', function () {
515
515
  test('should be able to use controlled filtering', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
516
516
  var options, input;
517
517
  return _regeneratorRuntime().wrap(function _callee$(_context2) {
518
- while (1) {
519
- switch (_context2.prev = _context2.next) {
520
- case 0:
521
- render(___EmotionJSX(ComboBoxWithCustomFilter, null));
522
- input = screen.queryByRole('combobox'); // Should list all without filterable input
523
- userEvent.type(input, '{arrowdown}');
524
- _context2.next = 5;
525
- return screen.findAllByRole('option');
526
- case 5:
527
- options = _context2.sent;
528
- expect(options).toHaveLength(items.length);
518
+ while (1) switch (_context2.prev = _context2.next) {
519
+ case 0:
520
+ render(___EmotionJSX(ComboBoxWithCustomFilter, null));
521
+ input = screen.queryByRole('combobox'); // Should list all without filterable input
522
+ userEvent.type(input, '{arrowdown}');
523
+ _context2.next = 5;
524
+ return screen.findAllByRole('option');
525
+ case 5:
526
+ options = _context2.sent;
527
+ expect(options).toHaveLength(items.length);
529
528
 
530
- // Should only list the second option
531
- userEvent.type(input, 'k');
532
- _context2.next = 10;
533
- return screen.findAllByRole('option');
534
- case 10:
535
- options = _context2.sent;
536
- expect(options[0]).toHaveTextContent(items[1].name);
537
- case 12:
538
- case "end":
539
- return _context2.stop();
540
- }
529
+ // Should only list the second option
530
+ userEvent.type(input, 'k');
531
+ _context2.next = 10;
532
+ return screen.findAllByRole('option');
533
+ case 10:
534
+ options = _context2.sent;
535
+ expect(options[0]).toHaveTextContent(items[1].name);
536
+ case 12:
537
+ case "end":
538
+ return _context2.stop();
541
539
  }
542
540
  }, _callee);
543
541
  })));
544
542
  test('should be able to use custom default filtering', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
545
543
  var options, defaultFilter, input;
546
544
  return _regeneratorRuntime().wrap(function _callee2$(_context3) {
547
- while (1) {
548
- switch (_context3.prev = _context3.next) {
549
- case 0:
550
- defaultFilter = function defaultFilter(option, inputValue) {
551
- return _startsWithInstanceProperty(option).call(option, inputValue);
552
- };
553
- getComponent({
554
- defaultFilter: defaultFilter
555
- });
556
- input = screen.queryByRole('combobox'); // Should list all without filterable input
557
- userEvent.type(input, '{arrowdown}');
558
- _context3.next = 6;
559
- return screen.findAllByRole('option');
560
- case 6:
561
- options = _context3.sent;
562
- expect(options).toHaveLength(items.length);
545
+ while (1) switch (_context3.prev = _context3.next) {
546
+ case 0:
547
+ defaultFilter = function defaultFilter(option, inputValue) {
548
+ return _startsWithInstanceProperty(option).call(option, inputValue);
549
+ };
550
+ getComponent({
551
+ defaultFilter: defaultFilter
552
+ });
553
+ input = screen.queryByRole('combobox'); // Should list all without filterable input
554
+ userEvent.type(input, '{arrowdown}');
555
+ _context3.next = 6;
556
+ return screen.findAllByRole('option');
557
+ case 6:
558
+ options = _context3.sent;
559
+ expect(options).toHaveLength(items.length);
563
560
 
564
- // Should only list the second option
565
- userEvent.type(input, 'K');
566
- _context3.next = 11;
567
- return screen.findAllByRole('option');
568
- case 11:
569
- options = _context3.sent;
570
- expect(options[0]).toHaveTextContent(items[1].name);
571
- case 13:
572
- case "end":
573
- return _context3.stop();
574
- }
561
+ // Should only list the second option
562
+ userEvent.type(input, 'K');
563
+ _context3.next = 11;
564
+ return screen.findAllByRole('option');
565
+ case 11:
566
+ options = _context3.sent;
567
+ expect(options[0]).toHaveTextContent(items[1].name);
568
+ case 13:
569
+ case "end":
570
+ return _context3.stop();
575
571
  }
576
572
  }, _callee2);
577
573
  })));
578
574
  test('should show in input "textValue" if provided', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
579
575
  var newItems, input, options;
580
576
  return _regeneratorRuntime().wrap(function _callee3$(_context4) {
581
- while (1) {
582
- switch (_context4.prev = _context4.next) {
583
- case 0:
584
- newItems = _mapInstanceProperty(items).call(items, function (item) {
585
- return _objectSpread(_objectSpread({}, item), {}, {
586
- textValue: item.id
587
- });
588
- });
589
- getComponent({
590
- items: newItems
577
+ while (1) switch (_context4.prev = _context4.next) {
578
+ case 0:
579
+ newItems = _mapInstanceProperty(items).call(items, function (item) {
580
+ return _objectSpread(_objectSpread({}, item), {}, {
581
+ textValue: item.id
591
582
  });
592
- input = screen.queryByRole('combobox');
593
- userEvent.click(input);
594
- _context4.next = 6;
595
- return screen.findAllByRole('option');
596
- case 6:
597
- options = _context4.sent;
598
- userEvent.click(options[0]);
599
- expect(input).toHaveValue(newItems[0].textValue);
583
+ });
584
+ getComponent({
585
+ items: newItems
586
+ });
587
+ input = screen.queryByRole('combobox');
588
+ userEvent.click(input);
589
+ _context4.next = 6;
590
+ return screen.findAllByRole('option');
591
+ case 6:
592
+ options = _context4.sent;
593
+ userEvent.click(options[0]);
594
+ expect(input).toHaveValue(newItems[0].textValue);
600
595
 
601
- // Check that on clicking again "textValue" still returning
602
- userEvent.click(options[0]);
603
- expect(input).toHaveValue(newItems[0].textValue);
604
- case 11:
605
- case "end":
606
- return _context4.stop();
607
- }
596
+ // Check that on clicking again "textValue" still returning
597
+ userEvent.click(options[0]);
598
+ expect(input).toHaveValue(newItems[0].textValue);
599
+ case 11:
600
+ case "end":
601
+ return _context4.stop();
608
602
  }
609
603
  }, _callee3);
610
604
  })));
611
605
  test('option list should be opened on scroll input value', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
612
606
  var options, otherItems, input;
613
607
  return _regeneratorRuntime().wrap(function _callee4$(_context5) {
614
- while (1) {
615
- switch (_context5.prev = _context5.next) {
616
- case 0:
617
- otherItems = [{
618
- name: 'Short item name one',
619
- id: '1'
620
- }, {
621
- name: 'Short item name two',
622
- id: '2'
623
- }, {
624
- name: 'Short item name three',
625
- id: '3'
626
- }, {
627
- name: 'This is very very very long item name',
628
- id: '4'
629
- }];
630
- getComponent({
631
- defaultItems: otherItems
632
- });
633
- input = screen.queryByRole('combobox');
634
- userEvent.type(input, '{arrowdown}');
635
- options = screen.queryAllByRole('option');
636
- expect(options).toHaveLength(otherItems.length);
637
- userEvent.type(input, 'This is very very very long item name');
638
- fireEvent.scroll(input, {
639
- target: {
640
- scrollX: 10
641
- }
642
- });
643
- options = screen.queryAllByRole('option');
644
- expect(options.length).toBe(1);
645
- expect(options[0]).toHaveTextContent(otherItems[3].name);
646
- fireEvent.scroll(window, {
647
- target: {
648
- scrollX: 10
649
- }
650
- });
651
- options = screen.queryAllByRole('option');
652
- expect(options.length).toBe(0);
653
- case 14:
654
- case "end":
655
- return _context5.stop();
656
- }
608
+ while (1) switch (_context5.prev = _context5.next) {
609
+ case 0:
610
+ otherItems = [{
611
+ name: 'Short item name one',
612
+ id: '1'
613
+ }, {
614
+ name: 'Short item name two',
615
+ id: '2'
616
+ }, {
617
+ name: 'Short item name three',
618
+ id: '3'
619
+ }, {
620
+ name: 'This is very very very long item name',
621
+ id: '4'
622
+ }];
623
+ getComponent({
624
+ defaultItems: otherItems
625
+ });
626
+ input = screen.queryByRole('combobox');
627
+ userEvent.type(input, '{arrowdown}');
628
+ options = screen.queryAllByRole('option');
629
+ expect(options).toHaveLength(otherItems.length);
630
+ userEvent.type(input, 'This is very very very long item name');
631
+ fireEvent.scroll(input, {
632
+ target: {
633
+ scrollX: 10
634
+ }
635
+ });
636
+ options = screen.queryAllByRole('option');
637
+ expect(options.length).toBe(1);
638
+ expect(options[0]).toHaveTextContent(otherItems[3].name);
639
+ fireEvent.scroll(window, {
640
+ target: {
641
+ scrollX: 10
642
+ }
643
+ });
644
+ options = screen.queryAllByRole('option');
645
+ expect(options.length).toBe(0);
646
+ case 14:
647
+ case "end":
648
+ return _context5.stop();
657
649
  }
658
650
  }, _callee4);
659
651
  })));
@@ -1024,20 +1016,18 @@ test('passing helper text should display it and correct aria attributes on input
1024
1016
  test('should have no accessibility violations', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
1025
1017
  var _getComponent6, container, results;
1026
1018
  return _regeneratorRuntime().wrap(function _callee5$(_context6) {
1027
- while (1) {
1028
- switch (_context6.prev = _context6.next) {
1029
- case 0:
1030
- jest.useRealTimers();
1031
- _getComponent6 = getComponent(), container = _getComponent6.container;
1032
- _context6.next = 4;
1033
- return axe(container);
1034
- case 4:
1035
- results = _context6.sent;
1036
- expect(results).toHaveNoViolations();
1037
- case 6:
1038
- case "end":
1039
- return _context6.stop();
1040
- }
1019
+ while (1) switch (_context6.prev = _context6.next) {
1020
+ case 0:
1021
+ jest.useRealTimers();
1022
+ _getComponent6 = getComponent(), container = _getComponent6.container;
1023
+ _context6.next = 4;
1024
+ return axe(container);
1025
+ case 4:
1026
+ results = _context6.sent;
1027
+ expect(results).toHaveNoViolations();
1028
+ case 6:
1029
+ case "end":
1030
+ return _context6.stop();
1041
1031
  }
1042
1032
  }, _callee5);
1043
1033
  })));