iguazio.dashboard-react-controls 1.9.2 → 2.0.0

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 (56) hide show
  1. package/dist/components/Backdrop/Backdrop.js +7 -7
  2. package/dist/components/Button/Button.js +20 -26
  3. package/dist/components/ConfirmDialog/ConfirmDialog.js +18 -17
  4. package/dist/components/FormCheckBox/FormCheckBox.js +28 -32
  5. package/dist/components/FormChipCell/FormChip/FormChip.js +46 -50
  6. package/dist/components/FormChipCell/FormChipCell.js +122 -142
  7. package/dist/components/FormChipCell/FormChipCellView.js +44 -47
  8. package/dist/components/FormChipCell/HiddenChipsBlock/HiddenChipsBlock.js +23 -20
  9. package/dist/components/FormChipCell/NewChipForm/NewChipForm.js +129 -152
  10. package/dist/components/FormChipCell/NewChipInput/NewChipInput.js +24 -27
  11. package/dist/components/FormChipCell/formChipCell.util.js +6 -16
  12. package/dist/components/FormCombobox/FormCombobox.js +134 -195
  13. package/dist/components/FormInput/FormInput.js +134 -212
  14. package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.js +15 -14
  15. package/dist/components/FormKeyValueTable/FormKeyValueTable.js +72 -72
  16. package/dist/components/FormRadio/FormRadio.js +21 -25
  17. package/dist/components/FormSelect/FormSelect.js +98 -126
  18. package/dist/components/FormSelect/FormSelect.test.js +56 -60
  19. package/dist/components/FormTextarea/FormTextarea.js +55 -71
  20. package/dist/components/FormToggle/FormToggle.js +25 -29
  21. package/dist/components/Modal/Modal.js +17 -18
  22. package/dist/components/PopUpDialog/PopUpDialog.js +53 -63
  23. package/dist/components/RoundedIcon/RoundedIcon.js +14 -13
  24. package/dist/components/Tip/Tip.js +58 -64
  25. package/dist/components/Tip/Tip.test.js +41 -64
  26. package/dist/components/Tooltip/Tooltip.js +75 -89
  27. package/dist/components/TooltipTemplate/ProducerTooltipTemplate.js +6 -5
  28. package/dist/components/TooltipTemplate/TextTooltipTemplate.js +10 -10
  29. package/dist/components/Wizard/Wizard.js +73 -107
  30. package/dist/components/Wizard/WizardSteps/WizardSteps.js +19 -20
  31. package/dist/components/index.js +18 -18
  32. package/dist/constants.js +26 -44
  33. package/dist/elements/FormActionButton/FormActionButton.js +12 -13
  34. package/dist/elements/FormRowActions/FormRowActions.js +19 -22
  35. package/dist/elements/OptionsMenu/OptionsMenu.js +10 -8
  36. package/dist/elements/SelectOption/SelectOption.js +14 -13
  37. package/dist/elements/SelectOption/SelectOption.test.js +39 -47
  38. package/dist/elements/ValidationTemplate/ValidationTemplate.js +7 -6
  39. package/dist/elements/index.js +5 -5
  40. package/dist/hooks/index.js +5 -5
  41. package/dist/hooks/useChipCell.hook.js +66 -85
  42. package/dist/hooks/useDebounce.hook.js +22 -24
  43. package/dist/hooks/useDetectOutsideClick.hook.js +4 -4
  44. package/dist/hooks/useFormTable.hook.js +99 -112
  45. package/dist/hooks/useHiddenChipsBlock.hook.js +40 -55
  46. package/dist/index.js +2 -3
  47. package/dist/scss/borders.scss +6 -0
  48. package/dist/scss/mixins.scss +32 -0
  49. package/dist/types.js +43 -67
  50. package/dist/utils/common.util.js +19 -23
  51. package/dist/utils/form.util.js +33 -39
  52. package/dist/utils/generateChipsList.util.js +7 -7
  53. package/dist/utils/getFirstScrollableParent.util.js +4 -10
  54. package/dist/utils/math.util.js +3 -3
  55. package/dist/utils/validation.util.js +74 -131
  56. package/package.json +34 -34
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -23,7 +22,9 @@ var _popout = require("../../images/popout.svg");
23
22
  var _warning = require("../../images/warning.svg");
24
23
  require("./formInput.scss");
25
24
  var _jsxRuntime = require("react/jsx-runtime");
26
- var _excluded = ["async", "className", "customRequiredLabel", "density", "disabled", "focused", "iconClass", "iconClick", "inputIcon", "invalidText", "label", "link", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "pattern", "required", "suggestionList", "tip", "validationRules", "validator", "withoutBorder"];
25
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
27
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
27
28
  /*
28
29
  Copyright 2022 Iguazio Systems Ltd.
29
30
  Licensed under the Apache License, Version 2.0 (the "License") with
@@ -40,147 +41,113 @@ illegal under applicable law, and the grant of the foregoing license
40
41
  under the Apache 2.0 license is conditioned upon your compliance with
41
42
  such restriction.
42
43
  */
43
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
44
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
45
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
46
- 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) { ["next", "throw", "return"].forEach(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" }], tryLocsList.forEach(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 keys.reverse(), 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) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, 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; }
47
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
48
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
49
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
50
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
51
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
52
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
53
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
54
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
55
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
56
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
57
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
58
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
59
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
60
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
61
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
62
- var FormInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
44
+
45
+ const FormInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
63
46
  var _ref2;
64
- var async = _ref.async,
65
- className = _ref.className,
66
- customRequiredLabel = _ref.customRequiredLabel,
67
- density = _ref.density,
68
- disabled = _ref.disabled,
69
- focused = _ref.focused,
70
- iconClass = _ref.iconClass,
71
- iconClick = _ref.iconClick,
72
- inputIcon = _ref.inputIcon,
73
- invalidText = _ref.invalidText,
74
- label = _ref.label,
75
- link = _ref.link,
76
- name = _ref.name,
77
- onBlur = _ref.onBlur,
78
- onChange = _ref.onChange,
79
- onFocus = _ref.onFocus,
80
- onKeyDown = _ref.onKeyDown,
81
- pattern = _ref.pattern,
82
- required = _ref.required,
83
- suggestionList = _ref.suggestionList,
84
- tip = _ref.tip,
85
- rules = _ref.validationRules,
86
- validator = _ref.validator,
87
- withoutBorder = _ref.withoutBorder,
88
- inputProps = _objectWithoutProperties(_ref, _excluded);
89
- var _useField = (0, _reactFinalForm.useField)(name),
90
- input = _useField.input,
91
- meta = _useField.meta;
92
- var _useState = (0, _react.useState)(false),
93
- _useState2 = _slicedToArray(_useState, 2),
94
- isInvalid = _useState2[0],
95
- setIsInvalid = _useState2[1];
96
- var _useState3 = (0, _react.useState)(false),
97
- _useState4 = _slicedToArray(_useState3, 2),
98
- isFocused = _useState4[0],
99
- setIsFocused = _useState4[1];
100
- var _useState5 = (0, _react.useState)(''),
101
- _useState6 = _slicedToArray(_useState5, 2),
102
- typedValue = _useState6[0],
103
- setTypedValue = _useState6[1];
104
- var _useState7 = (0, _react.useState)(RegExp(pattern)),
105
- _useState8 = _slicedToArray(_useState7, 1),
106
- validationPattern = _useState8[0];
107
- var _useState9 = (0, _react.useState)(rules),
108
- _useState10 = _slicedToArray(_useState9, 2),
109
- validationRules = _useState10[0],
110
- setValidationRules = _useState10[1];
111
- var _useState11 = (0, _react.useState)(false),
112
- _useState12 = _slicedToArray(_useState11, 2),
113
- showValidationRules = _useState12[0],
114
- setShowValidationRules = _useState12[1];
115
- var wrapperRef = (0, _react.useRef)();
47
+ let {
48
+ async,
49
+ className,
50
+ customRequiredLabel,
51
+ density,
52
+ disabled,
53
+ focused,
54
+ iconClass,
55
+ iconClick,
56
+ inputIcon,
57
+ invalidText,
58
+ label,
59
+ link,
60
+ name,
61
+ onBlur,
62
+ onChange,
63
+ onFocus,
64
+ onKeyDown,
65
+ pattern,
66
+ required,
67
+ suggestionList,
68
+ tip,
69
+ validationRules: rules,
70
+ validator,
71
+ withoutBorder,
72
+ ...inputProps
73
+ } = _ref;
74
+ const {
75
+ input,
76
+ meta
77
+ } = (0, _reactFinalForm.useField)(name);
78
+ const [isInvalid, setIsInvalid] = (0, _react.useState)(false);
79
+ const [isFocused, setIsFocused] = (0, _react.useState)(false);
80
+ const [typedValue, setTypedValue] = (0, _react.useState)('');
81
+ const [validationPattern] = (0, _react.useState)(RegExp(pattern));
82
+ const [validationRules, setValidationRules] = (0, _react.useState)(rules);
83
+ const [showValidationRules, setShowValidationRules] = (0, _react.useState)(false);
84
+ const wrapperRef = (0, _react.useRef)();
116
85
  (_ref2 = ref) !== null && _ref2 !== void 0 ? _ref2 : ref = wrapperRef;
117
- var inputRef = (0, _react.useRef)();
118
- var errorsRef = (0, _react.useRef)();
119
- var isRequiredRulePresentRef = (0, _react.useRef)(false);
120
- (0, _hooks.useDetectOutsideClick)(ref, function () {
121
- return setShowValidationRules(false);
122
- });
123
- var debounceAsync = (0, _hooks.useDebounce)();
124
- var formFieldClassNames = (0, _classnames.default)('form-field-input', className);
125
- var inputWrapperClassNames = (0, _classnames.default)('form-field__wrapper', "form-field__wrapper-".concat(density), disabled && 'form-field__wrapper-disabled', isInvalid && 'form-field__wrapper-invalid', withoutBorder && 'without-border');
126
- var labelClassNames = (0, _classnames.default)('form-field__label', disabled && 'form-field__label-disabled');
127
- (0, _react.useEffect)(function () {
86
+ const inputRef = (0, _react.useRef)();
87
+ const errorsRef = (0, _react.useRef)();
88
+ const isRequiredRulePresentRef = (0, _react.useRef)(false);
89
+ (0, _hooks.useDetectOutsideClick)(ref, () => setShowValidationRules(false));
90
+ const debounceAsync = (0, _hooks.useDebounce)();
91
+ const formFieldClassNames = (0, _classnames.default)('form-field-input', className);
92
+ const inputWrapperClassNames = (0, _classnames.default)('form-field__wrapper', "form-field__wrapper-".concat(density), disabled && 'form-field__wrapper-disabled', isInvalid && 'form-field__wrapper-invalid', withoutBorder && 'without-border');
93
+ const labelClassNames = (0, _classnames.default)('form-field__label', disabled && 'form-field__label-disabled');
94
+ (0, _react.useEffect)(() => {
128
95
  setTypedValue(String(input.value)); // convert from number to string
129
96
  }, [input.value]);
130
- (0, _react.useEffect)(function () {
97
+ (0, _react.useEffect)(() => {
131
98
  setIsInvalid(errorsRef.current && meta.invalid && (meta.validating || meta.modified || meta.submitFailed && meta.touched));
132
99
  }, [meta.invalid, meta.modified, meta.submitFailed, meta.touched, meta.validating]);
133
- (0, _react.useEffect)(function () {
100
+ (0, _react.useEffect)(() => {
134
101
  if (!errorsRef.current) {
135
102
  if (meta.valid && showValidationRules) {
136
103
  setShowValidationRules(false);
137
104
  }
138
105
  }
139
106
  }, [errorsRef.current, meta.valid, showValidationRules]);
140
- (0, _react.useEffect)(function () {
107
+ (0, _react.useEffect)(() => {
141
108
  if (showValidationRules) {
142
109
  window.addEventListener('scroll', handleScroll, true);
143
110
  }
144
- return function () {
111
+ return () => {
145
112
  window.removeEventListener('scroll', handleScroll, true);
146
113
  };
147
114
  }, [showValidationRules]);
148
- (0, _react.useEffect)(function () {
115
+ (0, _react.useEffect)(() => {
149
116
  if (focused) {
150
117
  inputRef.current.focus();
151
118
  }
152
119
  }, [focused]);
153
- (0, _react.useEffect)(function () {
154
- setValidationRules(function () {
120
+ (0, _react.useEffect)(() => {
121
+ setValidationRules(() => {
155
122
  isRequiredRulePresentRef.current = false;
156
- return rules.map(function (rule) {
123
+ return rules.map(rule => {
157
124
  if (rule.name === _constants.validation.REQUIRED.NAME) {
158
125
  isRequiredRulePresentRef.current = true;
159
126
  }
160
- return _objectSpread(_objectSpread({}, rule), {}, {
161
- isValid: !errorsRef.current || !Array.isArray(errorsRef.current) ? true : !errorsRef.current.some(function (err) {
162
- return err.name === rule.name;
163
- })
164
- });
127
+ return {
128
+ ...rule,
129
+ isValid: !errorsRef.current || !Array.isArray(errorsRef.current) ? true : !errorsRef.current.some(err => err.name === rule.name)
130
+ };
165
131
  });
166
132
  });
167
133
  }, [rules]);
168
- var getValidationRules = function getValidationRules() {
169
- return validationRules.map(function (_ref3) {
170
- var _ref3$isValid = _ref3.isValid,
171
- isValid = _ref3$isValid === void 0 ? false : _ref3$isValid,
172
- label = _ref3.label,
173
- name = _ref3.name;
134
+ const getValidationRules = () => {
135
+ return validationRules.map(_ref3 => {
136
+ let {
137
+ isValid = false,
138
+ label,
139
+ name
140
+ } = _ref3;
174
141
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ValidationTemplate.default, {
175
142
  valid: isValid,
176
143
  validationMessage: label
177
144
  }, name);
178
145
  });
179
146
  };
180
- var isValueEmptyAndValid = function isValueEmptyAndValid(value) {
147
+ const isValueEmptyAndValid = value => {
181
148
  return !value && !required || disabled;
182
149
  };
183
- var handleInputBlur = function handleInputBlur(event) {
150
+ const handleInputBlur = event => {
184
151
  var _event$relatedTarget;
185
152
  input.onBlur && input.onBlur(event);
186
153
  if (!event.relatedTarget || !((_event$relatedTarget = event.relatedTarget) !== null && _event$relatedTarget !== void 0 && _event$relatedTarget.closest('.form-field__suggestion-list'))) {
@@ -188,56 +155,47 @@ var FormInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
188
155
  onBlur && onBlur(event);
189
156
  }
190
157
  };
191
- var handleInputFocus = function handleInputFocus(event) {
158
+ const handleInputFocus = event => {
192
159
  input.onFocus && input.onFocus(event);
193
160
  onFocus && onFocus(event);
194
161
  setIsFocused(true);
195
162
  };
196
- var handleInputKeyDown = function handleInputKeyDown(event) {
163
+ const handleInputKeyDown = event => {
197
164
  input.onKeyDown && input.onKeyDown(event);
198
165
  onKeyDown && onKeyDown(event);
199
166
  };
200
- var handleScroll = function handleScroll(event) {
167
+ const handleScroll = event => {
201
168
  if (inputRef.current && inputRef.current.contains(event.target)) return;
202
169
  if (!event.target.closest('.options-menu') && !event.target.classList.contains('form-field-input')) {
203
170
  setShowValidationRules(false);
204
171
  }
205
172
  };
206
- var handleSuggestionClick = function handleSuggestionClick(item) {
173
+ const handleSuggestionClick = item => {
207
174
  input.onChange && input.onChange(item);
208
175
  setIsFocused(false);
209
176
  onBlur();
210
177
  };
211
- var toggleValidationRulesMenu = function toggleValidationRulesMenu() {
178
+ const toggleValidationRulesMenu = () => {
212
179
  inputRef.current.focus();
213
- setShowValidationRules(function (state) {
214
- return !state;
215
- });
180
+ setShowValidationRules(state => !state);
216
181
  };
217
- var validateField = function validateField(value, allValues) {
218
- var valueToValidate = (0, _lodash.isNil)(value) ? '' : String(value);
182
+ const validateField = (value, allValues) => {
183
+ let valueToValidate = (0, _lodash.isNil)(value) ? '' : String(value);
219
184
  if (isValueEmptyAndValid(valueToValidate)) return;
220
- var validationError = null;
185
+ let validationError = null;
221
186
  if (required && valueToValidate.trim().length === 0 && !isRequiredRulePresentRef.current) {
222
187
  validationError = {
223
188
  name: 'required',
224
189
  label: customRequiredLabel || 'This field is required'
225
190
  };
226
191
  } else if (!(0, _lodash.isEmpty)(rules) && !async) {
227
- var _checkPatternsValidit = (0, _validation.checkPatternsValidity)(rules, valueToValidate),
228
- _checkPatternsValidit2 = _slicedToArray(_checkPatternsValidit, 2),
229
- newRules = _checkPatternsValidit2[0],
230
- isValidField = _checkPatternsValidit2[1];
231
- var invalidRules = newRules.filter(function (rule) {
232
- return !rule.isValid;
233
- });
192
+ const [newRules, isValidField] = (0, _validation.checkPatternsValidity)(rules, valueToValidate);
193
+ const invalidRules = newRules.filter(rule => !rule.isValid);
234
194
  if (!isValidField) {
235
- validationError = invalidRules.map(function (rule) {
236
- return {
237
- name: rule.name,
238
- label: rule.label
239
- };
240
- });
195
+ validationError = invalidRules.map(rule => ({
196
+ name: rule.name,
197
+ label: rule.label
198
+ }));
241
199
  }
242
200
  }
243
201
  if ((0, _lodash.isEmpty)(validationError)) {
@@ -273,65 +231,35 @@ var FormInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
273
231
  errorsRef.current = validationError;
274
232
  return validationError;
275
233
  };
276
- var validateFieldAsync = debounceAsync( /*#__PURE__*/function () {
277
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value, allValues) {
278
- var valueToValidate, validationError, _yield$checkPatternsV, _yield$checkPatternsV2, newRules, isValidField, invalidRules;
279
- return _regeneratorRuntime().wrap(function _callee$(_context) {
280
- while (1) switch (_context.prev = _context.next) {
281
- case 0:
282
- valueToValidate = (0, _lodash.isNil)(value) ? '' : String(value);
283
- if (!isValueEmptyAndValid(valueToValidate)) {
284
- _context.next = 3;
285
- break;
286
- }
287
- return _context.abrupt("return");
288
- case 3:
289
- validationError = validateField(valueToValidate, allValues);
290
- if ((0, _lodash.isEmpty)(rules)) {
291
- _context.next = 13;
292
- break;
293
- }
294
- _context.next = 7;
295
- return (0, _validation.checkPatternsValidityAsync)(rules, valueToValidate);
296
- case 7:
297
- _yield$checkPatternsV = _context.sent;
298
- _yield$checkPatternsV2 = _slicedToArray(_yield$checkPatternsV, 2);
299
- newRules = _yield$checkPatternsV2[0];
300
- isValidField = _yield$checkPatternsV2[1];
301
- invalidRules = newRules.filter(function (rule) {
302
- return !rule.isValid;
303
- });
304
- if (!isValidField) {
305
- validationError = invalidRules.map(function (rule) {
306
- return {
307
- name: rule.name,
308
- label: rule.label
309
- };
310
- });
311
- }
312
- case 13:
313
- errorsRef.current = validationError;
314
- return _context.abrupt("return", validationError);
315
- case 15:
316
- case "end":
317
- return _context.stop();
318
- }
319
- }, _callee);
320
- }));
321
- return function (_x2, _x3) {
322
- return _ref4.apply(this, arguments);
323
- };
324
- }(), 400);
325
- var parseField = function parseField(val) {
234
+ const validateFieldAsync = debounceAsync(async (value, allValues) => {
235
+ let valueToValidate = (0, _lodash.isNil)(value) ? '' : String(value);
236
+ if (isValueEmptyAndValid(valueToValidate)) return;
237
+ let validationError = validateField(valueToValidate, allValues);
238
+ if (!(0, _lodash.isEmpty)(rules)) {
239
+ const [newRules, isValidField] = await (0, _validation.checkPatternsValidityAsync)(rules, valueToValidate);
240
+ const invalidRules = newRules.filter(rule => !rule.isValid);
241
+ if (!isValidField) {
242
+ validationError = invalidRules.map(rule => ({
243
+ name: rule.name,
244
+ label: rule.label
245
+ }));
246
+ }
247
+ }
248
+ errorsRef.current = validationError;
249
+ return validationError;
250
+ }, 400);
251
+ const parseField = val => {
326
252
  return inputProps.type === 'number' && val ? parseFloat(val) || val : val;
327
253
  };
328
254
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
329
255
  validate: async ? validateFieldAsync : validateField,
330
256
  name: name,
331
257
  parse: parseField,
332
- children: function children(_ref5) {
258
+ children: _ref4 => {
333
259
  var _inputProps$autocompl, _errorsRef$current$la, _errorsRef$current;
334
- var input = _ref5.input;
260
+ let {
261
+ input
262
+ } = _ref4;
335
263
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
336
264
  ref: ref,
337
265
  className: formFieldClassNames,
@@ -341,9 +269,7 @@ var FormInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
341
269
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
342
270
  "data-testid": name ? "".concat(name, "-form-label") : 'form-label',
343
271
  htmlFor: input.name,
344
- children: [label, (required || validationRules.find(function (rule) {
345
- return rule.name === 'required';
346
- })) && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
272
+ children: [label, (required || validationRules.find(rule => rule.name === 'required')) && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
347
273
  className: "form-field__label-mandatory",
348
274
  children: " *"
349
275
  })]
@@ -355,9 +281,7 @@ var FormInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
355
281
  }),
356
282
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
357
283
  href: link.url || typedValue,
358
- onClick: function onClick(event) {
359
- return event.stopPropagation();
360
- },
284
+ onClick: event => event.stopPropagation(),
361
285
  target: "_blank",
362
286
  rel: "noreferrer",
363
287
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_popout.ReactComponent, {})
@@ -368,20 +292,20 @@ var FormInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
368
292
  className: inputWrapperClassNames,
369
293
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
370
294
  className: "form-field__control",
371
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", _objectSpread(_objectSpread({
295
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
372
296
  "data-testid": name ? "".concat(name, "-form-input") : 'form-input',
373
297
  id: input.name,
374
298
  ref: inputRef,
375
- required: isInvalid || required
376
- }, _objectSpread(_objectSpread({
377
- disabled: disabled,
378
- pattern: pattern
379
- }, inputProps), input)), {}, {
299
+ required: isInvalid || required,
300
+ disabled,
301
+ pattern,
302
+ ...inputProps,
303
+ ...input,
380
304
  autoComplete: (_inputProps$autocompl = inputProps.autocomplete) !== null && _inputProps$autocompl !== void 0 ? _inputProps$autocompl : 'off',
381
305
  onBlur: handleInputBlur,
382
306
  onKeyDown: handleInputKeyDown,
383
307
  onFocus: handleInputFocus
384
- }))
308
+ })
385
309
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
386
310
  className: "form-field__icons",
387
311
  children: [isInvalid && !Array.isArray(errorsRef.current) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
@@ -404,24 +328,23 @@ var FormInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
404
328
  onClick: iconClick,
405
329
  children: inputIcon
406
330
  })]
407
- }), inputProps.type === 'number' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputNumberButtons.default, _objectSpread({}, _objectSpread(_objectSpread(_objectSpread({}, inputProps), {}, {
408
- step: +inputProps.step
409
- }, input), {}, {
410
- disabled: disabled
411
- })))]
331
+ }), inputProps.type === 'number' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputNumberButtons.default, {
332
+ ...inputProps,
333
+ step: +inputProps.step,
334
+ ...input,
335
+ disabled
336
+ })]
412
337
  }), (suggestionList === null || suggestionList === void 0 ? void 0 : suggestionList.length) > 0 && isFocused && /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
413
338
  className: "form-field__suggestion-list",
414
- children: suggestionList.map(function (item, index) {
339
+ children: suggestionList.map((item, index) => {
415
340
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
416
341
  className: "suggestion-item",
417
- onClick: function onClick() {
342
+ onClick: () => {
418
343
  handleSuggestionClick(item);
419
344
  },
420
345
  tabIndex: index,
421
346
  dangerouslySetInnerHTML: {
422
- __html: item.replace(new RegExp(typedValue, 'gi'), function (match) {
423
- return match ? "<b>".concat(match, "</b>") : match;
424
- })
347
+ __html: item.replace(new RegExp(typedValue, 'gi'), match => match ? "<b>".concat(match, "</b>") : match)
425
348
  }
426
349
  }, "".concat(item).concat(index));
427
350
  })
@@ -442,7 +365,7 @@ FormInput.defaultProps = {
442
365
  disabled: false,
443
366
  focused: false,
444
367
  iconClass: '',
445
- iconClick: function iconClick() {},
368
+ iconClick: () => {},
446
369
  inputIcon: null,
447
370
  invalidText: 'This field is invalid',
448
371
  label: '',
@@ -452,9 +375,9 @@ FormInput.defaultProps = {
452
375
  },
453
376
  min: null,
454
377
  max: null,
455
- onBlur: function onBlur() {},
456
- onChange: function onChange() {},
457
- onKeyDown: function onKeyDown() {},
378
+ onBlur: () => {},
379
+ onChange: () => {},
380
+ onKeyDown: () => {},
458
381
  pattern: null,
459
382
  placeholder: '',
460
383
  required: false,
@@ -463,7 +386,7 @@ FormInput.defaultProps = {
463
386
  tip: '',
464
387
  type: 'text',
465
388
  validationRules: [],
466
- validator: function validator() {},
389
+ validator: () => {},
467
390
  value: '',
468
391
  withoutBorder: false
469
392
  };
@@ -499,5 +422,4 @@ FormInput.propTypes = {
499
422
  value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
500
423
  withoutBorder: _propTypes.default.bool
501
424
  };
502
- var _default = /*#__PURE__*/_react.default.memo(FormInput);
503
- exports.default = _default;
425
+ var _default = exports.default = /*#__PURE__*/_react.default.memo(FormInput);
@@ -29,28 +29,30 @@ under the Apache 2.0 license is conditioned upon your compliance with
29
29
  such restriction.
30
30
  */
31
31
 
32
- var InputNumberButtons = function InputNumberButtons(_ref) {
33
- var disabled = _ref.disabled,
34
- min = _ref.min,
35
- max = _ref.max,
36
- onChange = _ref.onChange,
37
- step = _ref.step,
38
- value = _ref.value;
39
- var handleIncrease = function handleIncrease(event) {
32
+ const InputNumberButtons = _ref => {
33
+ let {
34
+ disabled,
35
+ min,
36
+ max,
37
+ onChange,
38
+ step,
39
+ value
40
+ } = _ref;
41
+ const handleIncrease = event => {
40
42
  event.preventDefault();
41
43
  if (max && value >= max) return;
42
- var newValue = isCurrentValueEmpty() ? step : (0, _math.performFloatOperation)(value, step, '+');
44
+ let newValue = isCurrentValueEmpty() ? step : (0, _math.performFloatOperation)(value, step, '+');
43
45
  newValue = max && newValue > max ? max : newValue;
44
46
  onChange(newValue);
45
47
  };
46
- var handleDecrease = function handleDecrease(event) {
48
+ const handleDecrease = event => {
47
49
  event.preventDefault();
48
50
  if (min && value <= min) return;
49
- var newValue = isCurrentValueEmpty() ? -step : (0, _math.performFloatOperation)(value, step, '-');
51
+ let newValue = isCurrentValueEmpty() ? -step : (0, _math.performFloatOperation)(value, step, '-');
50
52
  newValue = min && newValue < min ? min : newValue;
51
53
  onChange(newValue);
52
54
  };
53
- var isCurrentValueEmpty = function isCurrentValueEmpty() {
55
+ const isCurrentValueEmpty = () => {
54
56
  return (0, _lodash.isNil)(value) || value === '';
55
57
  };
56
58
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -92,5 +94,4 @@ InputNumberButtons.propTypes = {
92
94
  step: _propTypes.default.number,
93
95
  value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired
94
96
  };
95
- var _default = /*#__PURE__*/_react.default.memo(InputNumberButtons);
96
- exports.default = _default;
97
+ var _default = exports.default = /*#__PURE__*/_react.default.memo(InputNumberButtons);