@bigbinary/neetoui 5.0.2 → 5.0.4

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/formik.js CHANGED
@@ -14135,22 +14135,22 @@ var ActionBlock = function ActionBlock(_ref) {
14135
14135
  }, cancelButtonProps)));
14136
14136
  };
14137
14137
 
14138
- function _typeof$1(obj) {
14138
+ function _typeof$2(obj) {
14139
14139
  "@babel/helpers - typeof";
14140
14140
 
14141
- return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
14141
+ return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
14142
14142
  return typeof obj;
14143
14143
  } : function (obj) {
14144
14144
  return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
14145
- }, _typeof$1(obj);
14145
+ }, _typeof$2(obj);
14146
14146
  }
14147
14147
 
14148
14148
  function _toPrimitive(input, hint) {
14149
- if (_typeof$1(input) !== "object" || input === null) return input;
14149
+ if (_typeof$2(input) !== "object" || input === null) return input;
14150
14150
  var prim = input[Symbol.toPrimitive];
14151
14151
  if (prim !== undefined) {
14152
14152
  var res = prim.call(input, hint || "default");
14153
- if (_typeof$1(res) !== "object") return res;
14153
+ if (_typeof$2(res) !== "object") return res;
14154
14154
  throw new TypeError("@@toPrimitive must return a primitive value.");
14155
14155
  }
14156
14156
  return (hint === "string" ? String : Number)(input);
@@ -14158,7 +14158,7 @@ function _toPrimitive(input, hint) {
14158
14158
 
14159
14159
  function _toPropertyKey(arg) {
14160
14160
  var key = _toPrimitive(arg, "string");
14161
- return _typeof$1(key) === "symbol" ? key : String(key);
14161
+ return _typeof$2(key) === "symbol" ? key : String(key);
14162
14162
  }
14163
14163
 
14164
14164
  function _defineProperty$1(obj, key, value) {
@@ -17785,15 +17785,383 @@ Checkbox.propTypes = {
17785
17785
  name: propTypes.exports.string
17786
17786
  };
17787
17787
 
17788
- var _excluded$j = ["submitCount", "values", "validateForm", "setErrors", "setTouched"];
17788
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
17789
+ try {
17790
+ var info = gen[key](arg);
17791
+ var value = info.value;
17792
+ } catch (error) {
17793
+ reject(error);
17794
+ return;
17795
+ }
17796
+ if (info.done) {
17797
+ resolve(value);
17798
+ } else {
17799
+ Promise.resolve(value).then(_next, _throw);
17800
+ }
17801
+ }
17802
+ function _asyncToGenerator(fn) {
17803
+ return function () {
17804
+ var self = this,
17805
+ args = arguments;
17806
+ return new Promise(function (resolve, reject) {
17807
+ var gen = fn.apply(self, args);
17808
+ function _next(value) {
17809
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
17810
+ }
17811
+ function _throw(err) {
17812
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
17813
+ }
17814
+ _next(undefined);
17815
+ });
17816
+ };
17817
+ }
17818
+
17819
+ var regeneratorRuntime$1 = {exports: {}};
17820
+
17821
+ var _typeof$1 = {exports: {}};
17822
+
17823
+ (function (module) {
17824
+ function _typeof(obj) {
17825
+ "@babel/helpers - typeof";
17826
+
17827
+ return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
17828
+ return typeof obj;
17829
+ } : function (obj) {
17830
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
17831
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
17832
+ }
17833
+ module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
17834
+ } (_typeof$1));
17835
+
17836
+ (function (module) {
17837
+ var _typeof = _typeof$1.exports["default"];
17838
+ function _regeneratorRuntime() {
17839
+ module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
17840
+ return exports;
17841
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports;
17842
+ var exports = {},
17843
+ Op = Object.prototype,
17844
+ hasOwn = Op.hasOwnProperty,
17845
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
17846
+ obj[key] = desc.value;
17847
+ },
17848
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
17849
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
17850
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
17851
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
17852
+ function define(obj, key, value) {
17853
+ return Object.defineProperty(obj, key, {
17854
+ value: value,
17855
+ enumerable: !0,
17856
+ configurable: !0,
17857
+ writable: !0
17858
+ }), obj[key];
17859
+ }
17860
+ try {
17861
+ define({}, "");
17862
+ } catch (err) {
17863
+ define = function define(obj, key, value) {
17864
+ return obj[key] = value;
17865
+ };
17866
+ }
17867
+ function wrap(innerFn, outerFn, self, tryLocsList) {
17868
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
17869
+ generator = Object.create(protoGenerator.prototype),
17870
+ context = new Context(tryLocsList || []);
17871
+ return defineProperty(generator, "_invoke", {
17872
+ value: makeInvokeMethod(innerFn, self, context)
17873
+ }), generator;
17874
+ }
17875
+ function tryCatch(fn, obj, arg) {
17876
+ try {
17877
+ return {
17878
+ type: "normal",
17879
+ arg: fn.call(obj, arg)
17880
+ };
17881
+ } catch (err) {
17882
+ return {
17883
+ type: "throw",
17884
+ arg: err
17885
+ };
17886
+ }
17887
+ }
17888
+ exports.wrap = wrap;
17889
+ var ContinueSentinel = {};
17890
+ function Generator() {}
17891
+ function GeneratorFunction() {}
17892
+ function GeneratorFunctionPrototype() {}
17893
+ var IteratorPrototype = {};
17894
+ define(IteratorPrototype, iteratorSymbol, function () {
17895
+ return this;
17896
+ });
17897
+ var getProto = Object.getPrototypeOf,
17898
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
17899
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
17900
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
17901
+ function defineIteratorMethods(prototype) {
17902
+ ["next", "throw", "return"].forEach(function (method) {
17903
+ define(prototype, method, function (arg) {
17904
+ return this._invoke(method, arg);
17905
+ });
17906
+ });
17907
+ }
17908
+ function AsyncIterator(generator, PromiseImpl) {
17909
+ function invoke(method, arg, resolve, reject) {
17910
+ var record = tryCatch(generator[method], generator, arg);
17911
+ if ("throw" !== record.type) {
17912
+ var result = record.arg,
17913
+ value = result.value;
17914
+ return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
17915
+ invoke("next", value, resolve, reject);
17916
+ }, function (err) {
17917
+ invoke("throw", err, resolve, reject);
17918
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
17919
+ result.value = unwrapped, resolve(result);
17920
+ }, function (error) {
17921
+ return invoke("throw", error, resolve, reject);
17922
+ });
17923
+ }
17924
+ reject(record.arg);
17925
+ }
17926
+ var previousPromise;
17927
+ defineProperty(this, "_invoke", {
17928
+ value: function value(method, arg) {
17929
+ function callInvokeWithMethodAndArg() {
17930
+ return new PromiseImpl(function (resolve, reject) {
17931
+ invoke(method, arg, resolve, reject);
17932
+ });
17933
+ }
17934
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
17935
+ }
17936
+ });
17937
+ }
17938
+ function makeInvokeMethod(innerFn, self, context) {
17939
+ var state = "suspendedStart";
17940
+ return function (method, arg) {
17941
+ if ("executing" === state) throw new Error("Generator is already running");
17942
+ if ("completed" === state) {
17943
+ if ("throw" === method) throw arg;
17944
+ return doneResult();
17945
+ }
17946
+ for (context.method = method, context.arg = arg;;) {
17947
+ var delegate = context.delegate;
17948
+ if (delegate) {
17949
+ var delegateResult = maybeInvokeDelegate(delegate, context);
17950
+ if (delegateResult) {
17951
+ if (delegateResult === ContinueSentinel) continue;
17952
+ return delegateResult;
17953
+ }
17954
+ }
17955
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
17956
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
17957
+ context.dispatchException(context.arg);
17958
+ } else "return" === context.method && context.abrupt("return", context.arg);
17959
+ state = "executing";
17960
+ var record = tryCatch(innerFn, self, context);
17961
+ if ("normal" === record.type) {
17962
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
17963
+ return {
17964
+ value: record.arg,
17965
+ done: context.done
17966
+ };
17967
+ }
17968
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
17969
+ }
17970
+ };
17971
+ }
17972
+ function maybeInvokeDelegate(delegate, context) {
17973
+ var methodName = context.method,
17974
+ method = delegate.iterator[methodName];
17975
+ 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;
17976
+ var record = tryCatch(method, delegate.iterator, context.arg);
17977
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
17978
+ var info = record.arg;
17979
+ 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);
17980
+ }
17981
+ function pushTryEntry(locs) {
17982
+ var entry = {
17983
+ tryLoc: locs[0]
17984
+ };
17985
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
17986
+ }
17987
+ function resetTryEntry(entry) {
17988
+ var record = entry.completion || {};
17989
+ record.type = "normal", delete record.arg, entry.completion = record;
17990
+ }
17991
+ function Context(tryLocsList) {
17992
+ this.tryEntries = [{
17993
+ tryLoc: "root"
17994
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
17995
+ }
17996
+ function values(iterable) {
17997
+ if (iterable) {
17998
+ var iteratorMethod = iterable[iteratorSymbol];
17999
+ if (iteratorMethod) return iteratorMethod.call(iterable);
18000
+ if ("function" == typeof iterable.next) return iterable;
18001
+ if (!isNaN(iterable.length)) {
18002
+ var i = -1,
18003
+ next = function next() {
18004
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
18005
+ return next.value = undefined, next.done = !0, next;
18006
+ };
18007
+ return next.next = next;
18008
+ }
18009
+ }
18010
+ return {
18011
+ next: doneResult
18012
+ };
18013
+ }
18014
+ function doneResult() {
18015
+ return {
18016
+ value: undefined,
18017
+ done: !0
18018
+ };
18019
+ }
18020
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
18021
+ value: GeneratorFunctionPrototype,
18022
+ configurable: !0
18023
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
18024
+ value: GeneratorFunction,
18025
+ configurable: !0
18026
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
18027
+ var ctor = "function" == typeof genFun && genFun.constructor;
18028
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
18029
+ }, exports.mark = function (genFun) {
18030
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
18031
+ }, exports.awrap = function (arg) {
18032
+ return {
18033
+ __await: arg
18034
+ };
18035
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
18036
+ return this;
18037
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
18038
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
18039
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
18040
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
18041
+ return result.done ? result.value : iter.next();
18042
+ });
18043
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
18044
+ return this;
18045
+ }), define(Gp, "toString", function () {
18046
+ return "[object Generator]";
18047
+ }), exports.keys = function (val) {
18048
+ var object = Object(val),
18049
+ keys = [];
18050
+ for (var key in object) keys.push(key);
18051
+ return keys.reverse(), function next() {
18052
+ for (; keys.length;) {
18053
+ var key = keys.pop();
18054
+ if (key in object) return next.value = key, next.done = !1, next;
18055
+ }
18056
+ return next.done = !0, next;
18057
+ };
18058
+ }, exports.values = values, Context.prototype = {
18059
+ constructor: Context,
18060
+ reset: function reset(skipTempReset) {
18061
+ 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);
18062
+ },
18063
+ stop: function stop() {
18064
+ this.done = !0;
18065
+ var rootRecord = this.tryEntries[0].completion;
18066
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
18067
+ return this.rval;
18068
+ },
18069
+ dispatchException: function dispatchException(exception) {
18070
+ if (this.done) throw exception;
18071
+ var context = this;
18072
+ function handle(loc, caught) {
18073
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
18074
+ }
18075
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
18076
+ var entry = this.tryEntries[i],
18077
+ record = entry.completion;
18078
+ if ("root" === entry.tryLoc) return handle("end");
18079
+ if (entry.tryLoc <= this.prev) {
18080
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
18081
+ hasFinally = hasOwn.call(entry, "finallyLoc");
18082
+ if (hasCatch && hasFinally) {
18083
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
18084
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
18085
+ } else if (hasCatch) {
18086
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
18087
+ } else {
18088
+ if (!hasFinally) throw new Error("try statement without catch or finally");
18089
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
18090
+ }
18091
+ }
18092
+ }
18093
+ },
18094
+ abrupt: function abrupt(type, arg) {
18095
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
18096
+ var entry = this.tryEntries[i];
18097
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
18098
+ var finallyEntry = entry;
18099
+ break;
18100
+ }
18101
+ }
18102
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
18103
+ var record = finallyEntry ? finallyEntry.completion : {};
18104
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
18105
+ },
18106
+ complete: function complete(record, afterLoc) {
18107
+ if ("throw" === record.type) throw record.arg;
18108
+ 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;
18109
+ },
18110
+ finish: function finish(finallyLoc) {
18111
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
18112
+ var entry = this.tryEntries[i];
18113
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
18114
+ }
18115
+ },
18116
+ "catch": function _catch(tryLoc) {
18117
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
18118
+ var entry = this.tryEntries[i];
18119
+ if (entry.tryLoc === tryLoc) {
18120
+ var record = entry.completion;
18121
+ if ("throw" === record.type) {
18122
+ var thrown = record.arg;
18123
+ resetTryEntry(entry);
18124
+ }
18125
+ return thrown;
18126
+ }
18127
+ }
18128
+ throw new Error("illegal catch attempt");
18129
+ },
18130
+ delegateYield: function delegateYield(iterable, resultName, nextLoc) {
18131
+ return this.delegate = {
18132
+ iterator: values(iterable),
18133
+ resultName: resultName,
18134
+ nextLoc: nextLoc
18135
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
18136
+ }
18137
+ }, exports;
18138
+ }
18139
+ module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
18140
+ } (regeneratorRuntime$1));
18141
+
18142
+ // TODO(Babel 8): Remove this file.
18143
+
18144
+ var runtime = regeneratorRuntime$1.exports();
18145
+ var regenerator = runtime;
18146
+
18147
+ // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
18148
+ try {
18149
+ regeneratorRuntime = runtime;
18150
+ } catch (accidentalStrictMode) {
18151
+ if (typeof globalThis === "object") {
18152
+ globalThis.regeneratorRuntime = runtime;
18153
+ } else {
18154
+ Function("r", "regeneratorRuntime = r")(runtime);
18155
+ }
18156
+ }
18157
+
18158
+ var _excluded$j = ["values", "validateForm", "setErrors", "setTouched"];
17789
18159
  var FormWrapper = /*#__PURE__*/forwardRef$1(function (_ref, formRef) {
17790
18160
  var className = _ref.className,
17791
18161
  formProps = _ref.formProps,
17792
18162
  children = _ref.children,
17793
- onSubmit = _ref.onSubmit,
17794
- setEnableChangeAndBlurValidation = _ref.setEnableChangeAndBlurValidation;
18163
+ onSubmit = _ref.onSubmit;
17795
18164
  var _useFormikContext = useFormikContext(),
17796
- submitCount = _useFormikContext.submitCount,
17797
18165
  values = _useFormikContext.values,
17798
18166
  validateForm = _useFormikContext.validateForm,
17799
18167
  setErrors = _useFormikContext.setErrors,
@@ -17801,30 +18169,66 @@ var FormWrapper = /*#__PURE__*/forwardRef$1(function (_ref, formRef) {
17801
18169
  formikBag = _objectWithoutProperties$1(_useFormikContext, _excluded$j);
17802
18170
  var isFormDirty = formikBag.dirty,
17803
18171
  isSubmitting = formikBag.isSubmitting;
17804
- var handleKeyDown = useCallback(function (event) {
17805
- var isEventFromEditorOrTextarea = event.target.tagName === "TEXTAREA" || event.target.editor;
17806
- if (event.key !== "Enter") return;
17807
- if (isEventFromEditorOrTextarea && !event.metaKey) return;
17808
- event.preventDefault();
17809
- if (event.shiftKey) {
17810
- return;
17811
- }
17812
- if (!isFormDirty || isSubmitting) return;
17813
- validateForm().then(function (errors) {
17814
- setEnableChangeAndBlurValidation(true);
17815
- if (Object.keys(errors).length > 0) {
17816
- setErrors(errors);
17817
- setTouched(errors);
17818
- } else {
17819
- onSubmit(values, formikBag);
17820
- }
17821
- })["catch"](function () {});
17822
- }, [values, validateForm, setErrors, setTouched, onSubmit, isFormDirty, isSubmitting]);
17823
- useEffect(function () {
17824
- if (submitCount === 1) {
17825
- setEnableChangeAndBlurValidation(true);
17826
- }
17827
- }, [submitCount]);
18172
+ var handleKeyDown = useCallback( /*#__PURE__*/function () {
18173
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(event) {
18174
+ var isEventFromEditorOrTextarea, errors;
18175
+ return regenerator.wrap(function _callee$(_context) {
18176
+ while (1) switch (_context.prev = _context.next) {
18177
+ case 0:
18178
+ isEventFromEditorOrTextarea = event.target.tagName === "TEXTAREA" || event.target.editor;
18179
+ if (!(event.key !== "Enter")) {
18180
+ _context.next = 3;
18181
+ break;
18182
+ }
18183
+ return _context.abrupt("return");
18184
+ case 3:
18185
+ if (!(isEventFromEditorOrTextarea && !event.metaKey)) {
18186
+ _context.next = 5;
18187
+ break;
18188
+ }
18189
+ return _context.abrupt("return");
18190
+ case 5:
18191
+ event.preventDefault();
18192
+ if (!event.shiftKey) {
18193
+ _context.next = 8;
18194
+ break;
18195
+ }
18196
+ return _context.abrupt("return");
18197
+ case 8:
18198
+ if (!(!isFormDirty || isSubmitting)) {
18199
+ _context.next = 10;
18200
+ break;
18201
+ }
18202
+ return _context.abrupt("return");
18203
+ case 10:
18204
+ _context.prev = 10;
18205
+ _context.next = 13;
18206
+ return validateForm();
18207
+ case 13:
18208
+ errors = _context.sent;
18209
+ if (Object.keys(errors).length > 0) {
18210
+ setErrors(errors);
18211
+ setTouched(errors);
18212
+ } else {
18213
+ onSubmit(values, formikBag);
18214
+ }
18215
+ _context.next = 20;
18216
+ break;
18217
+ case 17:
18218
+ _context.prev = 17;
18219
+ _context.t0 = _context["catch"](10);
18220
+ // eslint-disable-next-line no-console
18221
+ console.error("An unhandled error was caught from validateForm()", _context.t0);
18222
+ case 20:
18223
+ case "end":
18224
+ return _context.stop();
18225
+ }
18226
+ }, _callee, null, [[10, 17]]);
18227
+ }));
18228
+ return function (_x) {
18229
+ return _ref2.apply(this, arguments);
18230
+ };
18231
+ }(), [values, validateForm, setErrors, setTouched, onSubmit, isFormDirty, isSubmitting]);
17828
18232
  return /*#__PURE__*/React__default.createElement(Form$1, _extends$2({
17829
18233
  noValidate: true,
17830
18234
  className: className,
@@ -17833,30 +18237,45 @@ var FormWrapper = /*#__PURE__*/forwardRef$1(function (_ref, formRef) {
17833
18237
  onKeyDown: handleKeyDown
17834
18238
  }, formProps), children);
17835
18239
  });
18240
+ FormWrapper.displayName = "FormWrapper";
17836
18241
 
17837
18242
  var Form = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
17838
18243
  var className = _ref.className,
17839
18244
  children = _ref.children,
17840
18245
  formikProps = _ref.formikProps,
17841
18246
  formProps = _ref.formProps;
17842
- var _useState = useState(false),
17843
- _useState2 = _slicedToArray$1(_useState, 2),
17844
- enabledChangeAndBlurValidation = _useState2[0],
17845
- setEnabledChangeAndBlurValidation = _useState2[1];
17846
- return /*#__PURE__*/React__default.createElement(Formik, _extends$2({}, formikProps, {
17847
- validateOnBlur: (formikProps === null || formikProps === void 0 ? void 0 : formikProps.validateOnBlur) && enabledChangeAndBlurValidation,
17848
- validateOnChange: (formikProps === null || formikProps === void 0 ? void 0 : formikProps.validateOnChange) && enabledChangeAndBlurValidation
17849
- }), function (props) {
18247
+ return /*#__PURE__*/React__default.createElement(Formik, formikProps, function (props) {
17850
18248
  return /*#__PURE__*/React__default.createElement(FormWrapper, {
17851
18249
  className: className,
17852
18250
  formProps: formProps,
17853
18251
  ref: ref,
17854
- setEnableChangeAndBlurValidation: setEnabledChangeAndBlurValidation,
17855
18252
  onSubmit: formikProps === null || formikProps === void 0 ? void 0 : formikProps.onSubmit
17856
18253
  }, typeof children === "function" ? children(props) : children);
17857
18254
  });
17858
18255
  });
17859
18256
  Form.displayName = "Form";
18257
+ Form.propTypes = {
18258
+ /**
18259
+ * Pass a function to render children or pass the children directly
18260
+ **/
18261
+ children: propTypes.exports.node,
18262
+ /**
18263
+ * Additional classnames to be passed to the form wrapper
18264
+ **/
18265
+ className: propTypes.exports.string,
18266
+ /**
18267
+ * Props to be passed to the Formik component like `initialValues`, `validationSchema`, `onSubmit`
18268
+ * Refer to the Formik docs for more details
18269
+ * https://formik.org/docs/api/formik
18270
+ **/
18271
+ formikProps: propTypes.exports.object,
18272
+ /**
18273
+ * Props to be passed to the form element like `className`.
18274
+ * Refer to the Formik docs for more details
18275
+ * https://formik.org/docs/api/form
18276
+ **/
18277
+ formProps: propTypes.exports.object
18278
+ };
17860
18279
 
17861
18280
  var _excluded$i = ["size", "type", "label", "error", "suffix", "prefix", "disabled", "helpText", "className", "nakedInput", "contentSize", "required", "maxLength", "unlimitedChars", "labelProps"];
17862
18281
  var SIZES$2 = {
@@ -24722,7 +25141,7 @@ var renderValidEmails = function renderValidEmails(values) {
24722
25141
  return email.valid && email;
24723
25142
  });
24724
25143
  };
24725
- var getEmailsCount = function getEmailsCount(values) {
25144
+ var getValidEmailsCount = function getValidEmailsCount(values) {
24726
25145
  return renderValidEmails(values).length;
24727
25146
  };
24728
25147
  var renderDefaultText = function renderDefaultText(count) {
@@ -24761,7 +25180,7 @@ var MultiEmailInput = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
24761
25180
  _useState2 = _slicedToArray$1(_useState, 2),
24762
25181
  inputValue = _useState2[0],
24763
25182
  setInputValue = _useState2[1];
24764
- var isCounterVisible = !!counter && (!counter.startsFrom || getEmailsCount(value) >= counter.startsFrom);
25183
+ var isCounterVisible = !!counter && (!counter.startsFrom || getValidEmailsCount(value) >= counter.startsFrom);
24765
25184
  var isOptionsPresent = !!otherProps.options;
24766
25185
  var handleFilterEmails = function handleFilterEmails() {
24767
25186
  return onChange(renderValidEmails(value));
@@ -24819,6 +25238,7 @@ var MultiEmailInput = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
24819
25238
  isValidNewOption: isValidNewOption
24820
25239
  };
24821
25240
  }
25241
+ var isFilterEmailsLinkVisible = !!filterInvalidEmails && value.length > getValidEmailsCount(value);
24822
25242
  return /*#__PURE__*/React__default.createElement("div", {
24823
25243
  className: "neeto-ui-flex neeto-ui-flex-col neeto-ui-email-input"
24824
25244
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -24831,7 +25251,7 @@ var MultiEmailInput = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
24831
25251
  className: "neeto-ui-email-input__counter",
24832
25252
  "data-cy": "".concat(hyphenize(label), "-email-counter"),
24833
25253
  style: "body2"
24834
- }, getEmailsCount(value), " ", counter.label ? counter.label : renderDefaultText(getEmailsCount(value)))), /*#__PURE__*/React__default.createElement(CreatableSelect, _extends$2({
25254
+ }, getValidEmailsCount(value), " ", counter.label ? counter.label : renderDefaultText(getValidEmailsCount(value)))), /*#__PURE__*/React__default.createElement(CreatableSelect, _extends$2({
24835
25255
  isMulti: true,
24836
25256
  required: true,
24837
25257
  classNamePrefix: "neeto-ui-react-select",
@@ -24864,7 +25284,7 @@ var MultiEmailInput = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
24864
25284
  className: "neeto-ui-input__error",
24865
25285
  "data-cy": "".concat(hyphenize(label), "-input-error"),
24866
25286
  style: "body3"
24867
- }, error, !!filterInvalidEmails && !isEmpty(value) && /*#__PURE__*/React__default.createElement("span", {
25287
+ }, error, isFilterEmailsLinkVisible && /*#__PURE__*/React__default.createElement("span", {
24868
25288
  className: "neeto-ui-typography neeto-ui-text-body3 neeto-ui-font-semibold cursor-pointer",
24869
25289
  onClick: handleFilterEmails
24870
25290
  }, "\xA0", filterInvalidEmails.label ? filterInvalidEmails.label : "Click here to remove invalid emails.")), !!helpText && /*#__PURE__*/React__default.createElement(Typography, {
@@ -25309,7 +25729,7 @@ var SelectField = /*#__PURE__*/forwardRef$1(function (props, ref) {
25309
25729
  return getOptionValue(option);
25310
25730
  };
25311
25731
  var buildValueObj = function buildValueObj(value, options) {
25312
- if (_typeof$1(value) === "object") return value;
25732
+ if (_typeof$2(value) === "object") return value;
25313
25733
  return options.filter(function (option) {
25314
25734
  return getRealOptionValue(option) === value;
25315
25735
  })[0];