@pingux/astro 2.85.0 → 2.86.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.
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.test.js +3 -1
- package/lib/cjs/components/AstroProvider/AstroProvider.js +13 -19
- package/lib/cjs/components/Box/Box.js +11 -11
- package/lib/cjs/components/Button/Button.js +4 -6
- package/lib/cjs/components/Button/Button.test.js +46 -10
- package/lib/cjs/components/CodeView/CodeView.mdx +1 -4
- package/lib/cjs/components/CodeView/CodeView.test.js +18 -6
- package/lib/cjs/components/ColorField/ColorField.js +4 -6
- package/lib/cjs/components/CopyText/CopyText.test.js +21 -23
- package/lib/cjs/components/DataTable/DataTable.test.js +39 -34
- package/lib/cjs/components/FieldHelperText/FieldHelperText.js +3 -1
- package/lib/cjs/components/HelpHint/HelpHint.test.js +25 -13
- package/lib/cjs/components/Image/Image.js +1 -2
- package/lib/cjs/components/ImageUploadField/ImageUploadField.test.js +6 -2
- package/lib/cjs/components/ListView/ListView.test.js +3 -1
- package/lib/cjs/components/Messages/Messages.test.js +1 -2
- package/lib/cjs/components/Messages/utils/tests/messagesReducer.test.js +1 -2
- package/lib/cjs/components/Messages/utils/tests/multiMessagesReducer.test.js +1 -2
- package/lib/cjs/components/MultivaluesField/MultivaluesField.test.js +75 -25
- package/lib/cjs/components/NavBar/NavBar.test.js +9 -3
- package/lib/cjs/components/NavSideBar/NavSideBar.test.js +15 -5
- package/lib/cjs/components/NumberField/NumberField.test.js +3 -1
- package/lib/cjs/components/PasswordField/PasswordField.js +2 -0
- package/lib/cjs/components/PasswordField/PasswordField.test.js +28 -22
- package/lib/cjs/components/PopoverContainer/PopoverContainer.js +2 -4
- package/lib/cjs/components/SelectFieldBase/SelectFieldBase.test.js +39 -18
- package/lib/cjs/components/Stepper/Line.js +4 -4
- package/lib/cjs/components/Stepper/Stepper.js +7 -5
- package/lib/cjs/components/Tab/Tab.js +2 -2
- package/lib/cjs/components/Tabs/Tabs.test.js +404 -273
- package/lib/cjs/components/TooltipTrigger/TooltipTrigger.test.js +19 -10
- package/lib/cjs/hooks/useAriaLabelWarning/useAriaLabelWarning.test.js +3 -3
- package/lib/cjs/hooks/useComponentToggle/useComponentToggle.test.js +4 -5
- package/lib/cjs/hooks/useDebounce/useDebounce.test.js +5 -5
- package/lib/cjs/hooks/useDeprecationWarning/useDeprecationWarning.test.js +8 -8
- package/lib/cjs/hooks/useDevelopmentWarning/useDevelopmentWarning.test.js +3 -3
- package/lib/cjs/hooks/useFallbackImage/useFallbackImage.test.js +4 -4
- package/lib/cjs/hooks/useField/useField.test.js +14 -14
- package/lib/cjs/hooks/useModalState/useModalState.test.js +16 -16
- package/lib/cjs/hooks/useNavBarPress/useNavBarPress.test.js +3 -3
- package/lib/cjs/hooks/useNavBarStyling/useNavBarStyling.test.js +3 -3
- package/lib/cjs/hooks/useOverlayPanelState/useOverlayPanelState.test.js +2 -2
- package/lib/cjs/hooks/usePropWarning/usePropWarning.test.js +6 -6
- package/lib/cjs/hooks/useStatusClasses/useStatusClasses.test.js +5 -5
- package/lib/cjs/hooks/useTShirtSize/useTShirtSize.test.js +6 -6
- package/lib/cjs/index.d.ts +0 -1
- package/lib/cjs/index.js +0 -8
- package/lib/cjs/styles/variants/variants.js +0 -2
- package/lib/cjs/types/index.d.ts +0 -1
- package/lib/cjs/types/index.js +44 -55
- package/lib/cjs/types/tabs.d.ts +1 -0
- package/lib/cjs/utils/testUtils/setupTests.js +3 -0
- package/lib/cjs/utils/testUtils/testWrapper.d.ts +1 -1
- package/lib/components/AccordionGridGroup/AccordionGridGroup.test.js +3 -1
- package/lib/components/AstroProvider/AstroProvider.js +13 -19
- package/lib/components/Box/Box.js +11 -11
- package/lib/components/Button/Button.js +4 -6
- package/lib/components/Button/Button.test.js +47 -11
- package/lib/components/CodeView/CodeView.mdx +1 -4
- package/lib/components/CodeView/CodeView.test.js +18 -6
- package/lib/components/ColorField/ColorField.js +4 -6
- package/lib/components/CopyText/CopyText.test.js +15 -16
- package/lib/components/DataTable/DataTable.test.js +19 -14
- package/lib/components/FieldHelperText/FieldHelperText.js +3 -1
- package/lib/components/HelpHint/HelpHint.test.js +26 -14
- package/lib/components/Image/Image.js +1 -2
- package/lib/components/ImageUploadField/ImageUploadField.test.js +7 -3
- package/lib/components/ListView/ListView.test.js +4 -2
- package/lib/components/Messages/Messages.test.js +1 -2
- package/lib/components/Messages/utils/tests/messagesReducer.test.js +1 -2
- package/lib/components/Messages/utils/tests/multiMessagesReducer.test.js +1 -2
- package/lib/components/MultivaluesField/MultivaluesField.test.js +76 -26
- package/lib/components/NavBar/NavBar.test.js +10 -4
- package/lib/components/NavSideBar/NavSideBar.test.js +16 -6
- package/lib/components/NumberField/NumberField.test.js +4 -2
- package/lib/components/PasswordField/PasswordField.js +2 -0
- package/lib/components/PasswordField/PasswordField.test.js +27 -21
- package/lib/components/PopoverContainer/PopoverContainer.js +2 -4
- package/lib/components/SelectFieldBase/SelectFieldBase.test.js +40 -17
- package/lib/components/Stepper/Line.js +3 -4
- package/lib/components/Stepper/Stepper.js +7 -5
- package/lib/components/Tab/Tab.js +2 -2
- package/lib/components/Tabs/Tabs.test.js +404 -273
- package/lib/components/TooltipTrigger/TooltipTrigger.test.js +20 -11
- package/lib/hooks/useAriaLabelWarning/useAriaLabelWarning.test.js +1 -1
- package/lib/hooks/useComponentToggle/useComponentToggle.test.js +1 -2
- package/lib/hooks/useDebounce/useDebounce.test.js +1 -1
- package/lib/hooks/useDeprecationWarning/useDeprecationWarning.test.js +1 -1
- package/lib/hooks/useDevelopmentWarning/useDevelopmentWarning.test.js +1 -1
- package/lib/hooks/useFallbackImage/useFallbackImage.test.js +1 -1
- package/lib/hooks/useField/useField.test.js +2 -2
- package/lib/hooks/useModalState/useModalState.test.js +1 -1
- package/lib/hooks/useNavBarPress/useNavBarPress.test.js +1 -1
- package/lib/hooks/useNavBarStyling/useNavBarStyling.test.js +1 -1
- package/lib/hooks/useOverlayPanelState/useOverlayPanelState.test.js +1 -1
- package/lib/hooks/usePropWarning/usePropWarning.test.js +1 -1
- package/lib/hooks/useStatusClasses/useStatusClasses.test.js +1 -1
- package/lib/hooks/useTShirtSize/useTShirtSize.test.js +1 -1
- package/lib/index.js +0 -1
- package/lib/styles/variants/variants.js +0 -2
- package/lib/types/index.js +0 -1
- package/lib/utils/testUtils/setupTests.js +3 -0
- package/package.json +10 -22
- package/lib/cjs/components/CodeEditor/CodeEditor.d.ts +0 -4
- package/lib/cjs/components/CodeEditor/CodeEditor.js +0 -56
- package/lib/cjs/components/CodeEditor/CodeEditor.mdx +0 -33
- package/lib/cjs/components/CodeEditor/CodeEditor.stories.d.ts +0 -29
- package/lib/cjs/components/CodeEditor/CodeEditor.stories.js +0 -108
- package/lib/cjs/components/CodeEditor/CodeEditor.styles.d.ts +0 -10
- package/lib/cjs/components/CodeEditor/CodeEditor.styles.js +0 -30
- package/lib/cjs/components/CodeEditor/CodeEditor.test.d.ts +0 -1
- package/lib/cjs/components/CodeEditor/CodeEditor.test.js +0 -149
- package/lib/cjs/components/CodeEditor/DefaultEditor.d.ts +0 -4
- package/lib/cjs/components/CodeEditor/DefaultEditor.js +0 -83
- package/lib/cjs/components/CodeEditor/eslintConfig.d.ts +0 -18
- package/lib/cjs/components/CodeEditor/eslintConfig.js +0 -95
- package/lib/cjs/components/CodeEditor/index.d.ts +0 -1
- package/lib/cjs/components/CodeEditor/index.js +0 -14
- package/lib/cjs/hooks/useTsLinter/index.d.ts +0 -1
- package/lib/cjs/hooks/useTsLinter/index.js +0 -14
- package/lib/cjs/hooks/useTsLinter/useTsLinter.d.ts +0 -4
- package/lib/cjs/hooks/useTsLinter/useTsLinter.js +0 -91
- package/lib/cjs/types/codeEditor.d.ts +0 -14
- package/lib/cjs/types/codeEditor.js +0 -6
- package/lib/components/CodeEditor/CodeEditor.js +0 -42
- package/lib/components/CodeEditor/CodeEditor.mdx +0 -33
- package/lib/components/CodeEditor/CodeEditor.stories.js +0 -94
- package/lib/components/CodeEditor/CodeEditor.styles.js +0 -22
- package/lib/components/CodeEditor/CodeEditor.test.js +0 -146
- package/lib/components/CodeEditor/DefaultEditor.js +0 -69
- package/lib/components/CodeEditor/eslintConfig.js +0 -87
- package/lib/components/CodeEditor/index.js +0 -1
- package/lib/hooks/useTsLinter/index.js +0 -1
- package/lib/hooks/useTsLinter/useTsLinter.js +0 -82
- package/lib/types/codeEditor.js +0 -1
@@ -10,13 +10,13 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instan
|
|
10
10
|
import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
|
11
11
|
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
|
12
12
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
13
|
-
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 _context4; _forEachInstanceProperty(_context4 = ["next", "throw", "return"]).call(_context4, 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 _context5; 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(_context5 = this.tryEntries).call(_context5, 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; }
|
13
|
+
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; }
|
14
14
|
import React from 'react';
|
15
|
-
import { act } from 'react-dom/test-utils';
|
16
15
|
import createCache from '@emotion/cache';
|
17
16
|
import { CacheProvider } from '@emotion/react';
|
18
17
|
import { render, screen } from '@testing-library/react';
|
19
18
|
import userEvent from '@testing-library/user-event';
|
19
|
+
import { act } from '../../utils/testUtils/testWrapper';
|
20
20
|
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
21
21
|
import PasswordField from '.';
|
22
22
|
|
@@ -104,12 +104,9 @@ test('renders view icon', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenera
|
|
104
104
|
while (1) switch (_context.prev = _context.next) {
|
105
105
|
case 0:
|
106
106
|
getComponent();
|
107
|
-
|
108
|
-
return screen.findByTestId(defaultProps.viewHiddenIconTestId);
|
109
|
-
case 3:
|
110
|
-
viewIcon = _context.sent;
|
107
|
+
viewIcon = screen.getByTestId(defaultProps.viewHiddenIconTestId);
|
111
108
|
expect(viewIcon).toBeInTheDocument();
|
112
|
-
case
|
109
|
+
case 3:
|
113
110
|
case "end":
|
114
111
|
return _context.stop();
|
115
112
|
}
|
@@ -123,18 +120,12 @@ test('renders view-hidden icon', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_r
|
|
123
120
|
getComponent();
|
124
121
|
button = screen.getByRole('button');
|
125
122
|
userEvent.click(button);
|
126
|
-
|
127
|
-
return screen.findByTestId(defaultProps.viewIconTestId);
|
128
|
-
case 5:
|
129
|
-
viewHiddenIcon = _context2.sent;
|
123
|
+
viewHiddenIcon = screen.getByTestId(defaultProps.viewIconTestId);
|
130
124
|
expect(viewHiddenIcon).toBeInTheDocument();
|
131
125
|
userEvent.click(button);
|
132
|
-
|
133
|
-
return screen.findByTestId(defaultProps.viewHiddenIconTestId);
|
134
|
-
case 10:
|
135
|
-
viewIcon = _context2.sent;
|
126
|
+
viewIcon = screen.getByTestId(defaultProps.viewHiddenIconTestId);
|
136
127
|
expect(viewIcon).toBeInTheDocument();
|
137
|
-
case
|
128
|
+
case 8:
|
138
129
|
case "end":
|
139
130
|
return _context2.stop();
|
140
131
|
}
|
@@ -148,17 +139,32 @@ test('renders view icon', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenera
|
|
148
139
|
getComponent();
|
149
140
|
button = screen.getByRole('button');
|
150
141
|
userEvent.click(button);
|
151
|
-
|
152
|
-
return screen.findByTestId(defaultProps.viewIconTestId);
|
153
|
-
case 5:
|
154
|
-
viewHiddenIcon = _context3.sent;
|
142
|
+
viewHiddenIcon = screen.getByTestId(defaultProps.viewIconTestId);
|
155
143
|
expect(viewHiddenIcon).toBeInTheDocument();
|
156
|
-
case
|
144
|
+
case 5:
|
157
145
|
case "end":
|
158
146
|
return _context3.stop();
|
159
147
|
}
|
160
148
|
}, _callee3);
|
161
149
|
})));
|
150
|
+
test('onPress callback is called when iconButton is pressed', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
151
|
+
var onPress, button;
|
152
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
153
|
+
while (1) switch (_context4.prev = _context4.next) {
|
154
|
+
case 0:
|
155
|
+
onPress = jest.fn();
|
156
|
+
getComponent({
|
157
|
+
onVisibleChange: onPress
|
158
|
+
});
|
159
|
+
button = screen.getByRole('button');
|
160
|
+
userEvent.click(button);
|
161
|
+
expect(onPress).toHaveBeenCalled();
|
162
|
+
case 5:
|
163
|
+
case "end":
|
164
|
+
return _context4.stop();
|
165
|
+
}
|
166
|
+
}, _callee4);
|
167
|
+
})));
|
162
168
|
test('renders password input', function () {
|
163
169
|
getComponent();
|
164
170
|
var input = screen.getByLabelText(testLabel);
|
@@ -35,7 +35,8 @@ var PopoverContainer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
35
35
|
export var PopoverWrapper = /*#__PURE__*/forwardRef(function (props, ref) {
|
36
36
|
var children = props.children,
|
37
37
|
className = props.className,
|
38
|
-
placement = props.placement,
|
38
|
+
_props$placement = props.placement,
|
39
|
+
placement = _props$placement === void 0 ? 'bottom' : _props$placement,
|
39
40
|
arrowProps = props.arrowProps,
|
40
41
|
arrowCrossOffset = props.arrowCrossOffset,
|
41
42
|
isOpen = props.isOpen,
|
@@ -81,9 +82,6 @@ export var PopoverWrapper = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
81
82
|
direction: direction
|
82
83
|
})));
|
83
84
|
});
|
84
|
-
PopoverWrapper.defaultProps = {
|
85
|
-
placement: 'bottom'
|
86
|
-
};
|
87
85
|
export var PopoverArrow = function PopoverArrow(props) {
|
88
86
|
var arrowCrossOffset = props.arrowCrossOffset,
|
89
87
|
sx = props.sx,
|
@@ -1,6 +1,18 @@
|
|
1
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
2
|
+
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
3
|
+
import _Object$create from "@babel/runtime-corejs3/core-js-stable/object/create";
|
4
|
+
import _Object$getPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object/get-prototype-of";
|
5
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
6
|
+
import _Object$setPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object/set-prototype-of";
|
7
|
+
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
8
|
+
import _reverseInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reverse";
|
9
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
10
|
+
import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
|
11
|
+
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
|
1
12
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
2
13
|
import _objectDestructuringEmpty from "@babel/runtime-corejs3/helpers/esm/objectDestructuringEmpty";
|
3
14
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
15
|
+
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 _context2; _forEachInstanceProperty(_context2 = ["next", "throw", "return"]).call(_context2, 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 _context3; 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(_context3 = this.tryEntries).call(_context3, 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; }
|
4
16
|
import React, { forwardRef } from 'react';
|
5
17
|
import userEvent from '@testing-library/user-event';
|
6
18
|
import { useSelectField } from '../../hooks';
|
@@ -293,23 +305,34 @@ test('Item accepts a data-id and the data-id can be found in the DOM', function
|
|
293
305
|
expect(options[0]).toHaveAttribute('data-id', items[0].name);
|
294
306
|
});
|
295
307
|
describe('async loading', function () {
|
296
|
-
test('displays a loader while loading', function () {
|
297
|
-
var _getComponent
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
308
|
+
test('displays a loader while loading', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
309
|
+
var _getComponent, rerender, button, loader;
|
310
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
311
|
+
while (1) switch (_context.prev = _context.next) {
|
312
|
+
case 0:
|
313
|
+
_getComponent = getComponent({
|
314
|
+
items: [],
|
315
|
+
isLoading: true
|
316
|
+
}), rerender = _getComponent.rerender;
|
317
|
+
button = screen.getByRole('button');
|
318
|
+
loader = within(button).getByRole('alert');
|
319
|
+
expect(loader).toHaveAttribute('aria-label', 'Loading in progress');
|
320
|
+
expect(loader).not.toHaveAttribute('aria-valuenow');
|
321
|
+
getComponent({
|
322
|
+
items: items,
|
323
|
+
isLoading: false
|
324
|
+
}, {
|
325
|
+
renderFn: rerender
|
326
|
+
});
|
327
|
+
expect(function () {
|
328
|
+
return screen.getByRole('alert');
|
329
|
+
}).toThrow();
|
330
|
+
case 7:
|
331
|
+
case "end":
|
332
|
+
return _context.stop();
|
333
|
+
}
|
334
|
+
}, _callee);
|
335
|
+
})));
|
313
336
|
test('displays a loader inside the listbox when loading more', function () {
|
314
337
|
var newItems = [{
|
315
338
|
name: 'Foo'
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
2
|
+
/* istanbul ignore file */
|
2
3
|
import React from 'react';
|
3
4
|
import PropTypes from 'prop-types';
|
4
5
|
import { useStatusClasses } from '../../hooks';
|
@@ -8,7 +9,8 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
8
9
|
var INACTIVE = stepStatuses.INACTIVE;
|
9
10
|
var Line = function Line(_ref) {
|
10
11
|
var className = _ref.className,
|
11
|
-
status = _ref.status
|
12
|
+
_ref$status = _ref.status,
|
13
|
+
status = _ref$status === void 0 ? INACTIVE : _ref$status;
|
12
14
|
var _useStatusClasses = useStatusClasses(className, {
|
13
15
|
isInactive: status === INACTIVE
|
14
16
|
}),
|
@@ -21,7 +23,4 @@ var Line = function Line(_ref) {
|
|
21
23
|
Line.propTypes = {
|
22
24
|
status: PropTypes.oneOf(_Object$values(stepStatuses))
|
23
25
|
};
|
24
|
-
Line.defaultProps = {
|
25
|
-
status: INACTIVE
|
26
|
-
};
|
27
26
|
export default Line;
|
@@ -15,6 +15,7 @@ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/inst
|
|
15
15
|
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
16
16
|
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
17
17
|
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
18
|
+
/* istanbul ignore file */
|
18
19
|
import React, { forwardRef } from 'react';
|
19
20
|
import { useSingleSelectListState } from '@react-stately/list';
|
20
21
|
import PropTypes from 'prop-types';
|
@@ -27,7 +28,8 @@ var ACTIVE = stepStatuses.ACTIVE,
|
|
27
28
|
COMPLETED = stepStatuses.COMPLETED,
|
28
29
|
INACTIVE = stepStatuses.INACTIVE;
|
29
30
|
var Stepper = /*#__PURE__*/forwardRef(function (props, ref) {
|
30
|
-
var activeStep = props.activeStep,
|
31
|
+
var _props$activeStep = props.activeStep,
|
32
|
+
activeStep = _props$activeStep === void 0 ? 1 : _props$activeStep,
|
31
33
|
onStepChange = props.onStepChange,
|
32
34
|
tabListProps = props.tabListProps,
|
33
35
|
tooltipProps = props.tooltipProps,
|
@@ -64,6 +66,8 @@ var Stepper = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
64
66
|
status: stepStatus
|
65
67
|
});
|
66
68
|
var line = _Array$isArray(lines) ? lines[i - 1] : lines;
|
69
|
+
|
70
|
+
/* istanbul ignore next */
|
67
71
|
var textValue = item && item.value && item.value.label || item.textValue || stepIndex.toString();
|
68
72
|
var container = ___EmotionJSX(Tab, {
|
69
73
|
key: stepIndex,
|
@@ -98,7 +102,8 @@ var Stepper = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
98
102
|
});
|
99
103
|
Stepper.propTypes = {
|
100
104
|
/**
|
101
|
-
* *For performance reasons,
|
105
|
+
* *For performance reasons,
|
106
|
+
use this prop instead of Array.map when iteratively rendering Items*.
|
102
107
|
* For use with [dynamic collections](https://react-spectrum.adobe.com/react-stately/collections.html#dynamic-collections).
|
103
108
|
*/
|
104
109
|
items: PropTypes.arrayOf(PropTypes.shape({
|
@@ -118,8 +123,5 @@ Stepper.propTypes = {
|
|
118
123
|
tabListProps: PropTypes.shape({}),
|
119
124
|
tooltipProps: PropTypes.shape({})
|
120
125
|
};
|
121
|
-
Stepper.defaultProps = {
|
122
|
-
activeStep: 1
|
123
|
-
};
|
124
126
|
Stepper.displayName = 'Stepper';
|
125
127
|
export default Stepper;
|
@@ -59,7 +59,8 @@ export var CollectionTab = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
59
59
|
ref: tabRef
|
60
60
|
}, itemProps, {
|
61
61
|
title: itemProps === null || itemProps === void 0 ? void 0 : itemProps.textValue,
|
62
|
-
role: "tab"
|
62
|
+
role: "tab",
|
63
|
+
"data-testid": "test-me"
|
63
64
|
}), ___EmotionJSX(React.Fragment, null, itemProps === null || itemProps === void 0 ? void 0 : itemProps.icon, ___EmotionJSX(Text, _extends({
|
64
65
|
variant: "tabLabel"
|
65
66
|
}, itemProps === null || itemProps === void 0 ? void 0 : itemProps.tabLabelProps), rendered), isSelected && !isDisabled && ___EmotionJSX(TabLine, itemProps === null || itemProps === void 0 ? void 0 : itemProps.tabLineProps))), slots === null || slots === void 0 ? void 0 : slots.afterTab);
|
@@ -82,7 +83,6 @@ export var CollectionTab = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
82
83
|
}
|
83
84
|
return tab;
|
84
85
|
});
|
85
|
-
CollectionTab.displayName = 'CollectionTab';
|
86
86
|
export var TabLine = function TabLine(props) {
|
87
87
|
return ___EmotionJSX(Box, _extends({
|
88
88
|
role: "presentation",
|