@bigbinary/neeto-form-frontend 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,10 +1,9 @@
1
1
  import * as React$2 from 'react';
2
2
  import React__default, { useLayoutEffect, useEffect, useMemo as useMemo$1, useContext, useReducer, useRef, useState, memo, forwardRef, Fragment } from 'react';
3
3
  import { useField, useFormikContext, FieldArray, Form as Form$1, Formik, Field, FastField } from 'formik';
4
- import { noop as noop$4, findBy, removeBy, isPresent, findById } from '@bigbinary/neeto-commons-frontend/pure';
4
+ import { curryN, isNil, complement, curry, either, isEmpty, assoc, prop, path, reject, omit, insert, compose as compose$1, trim, values as values$1, equals, not, pluck, times } from 'ramda';
5
5
  import PageLoader from 'neetomolecules/PageLoader';
6
6
  import { Toastr, Typography, Dropdown as Dropdown$2, Tooltip, Button as Button$1, Label, Alert, MultiEmailInput, DatePicker, Radio, Checkbox as Checkbox$2, Select, Textarea as Textarea$1, Input as Input$2, Spinner as Spinner$2 } from '@bigbinary/neetoui';
7
- import { assoc, prop, isEmpty, path, reject, omit, insert, compose as compose$1, trim, either, isNil, values as values$1, equals, not, pluck, times } from 'ramda';
8
7
  import ReactDOM, { unstable_batchedUpdates as unstable_batchedUpdates$1 } from 'react-dom';
9
8
  import i18next, { t as t$1 } from 'i18next';
10
9
  import { Input, Email as Email$2, Phone as Phone$2, Up, Down, MenuHorizontal, Delete, Plus, NeetoInvisible, MultipleChoice as MultipleChoice$2, ListDot, Dropdown as Dropdown$3, Rating as Rating$4, Smiley, Checkbox as Checkbox$1, Calendar, Check, Close } from '@bigbinary/neeto-icons';
@@ -40,22 +39,22 @@ function _extends$8() {
40
39
  return _extends$8.apply(this, arguments);
41
40
  }
42
41
 
43
- function _typeof$6(obj) {
42
+ function _typeof$7(obj) {
44
43
  "@babel/helpers - typeof";
45
44
 
46
- return _typeof$6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
45
+ return _typeof$7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
47
46
  return typeof obj;
48
47
  } : function (obj) {
49
48
  return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
50
- }, _typeof$6(obj);
49
+ }, _typeof$7(obj);
51
50
  }
52
51
 
53
52
  function _toPrimitive$1(input, hint) {
54
- if (_typeof$6(input) !== "object" || input === null) return input;
53
+ if (_typeof$7(input) !== "object" || input === null) return input;
55
54
  var prim = input[Symbol.toPrimitive];
56
55
  if (prim !== undefined) {
57
56
  var res = prim.call(input, hint || "default");
58
- if (_typeof$6(res) !== "object") return res;
57
+ if (_typeof$7(res) !== "object") return res;
59
58
  throw new TypeError("@@toPrimitive must return a primitive value.");
60
59
  }
61
60
  return (hint === "string" ? String : Number)(input);
@@ -63,7 +62,7 @@ function _toPrimitive$1(input, hint) {
63
62
 
64
63
  function _toPropertyKey$1(arg) {
65
64
  var key = _toPrimitive$1(arg, "string");
66
- return _typeof$6(key) === "symbol" ? key : String(key);
65
+ return _typeof$7(key) === "symbol" ? key : String(key);
67
66
  }
68
67
 
69
68
  function _defineProperty$7(obj, key, value) {
@@ -208,6 +207,131 @@ var QUERY_KEYS = (cov_4tvsihi60().s[4]++, {
208
207
  });
209
208
  var DEFAULT_STALE_TIME = (cov_4tvsihi60().s[5]++, 3200000); // 1 hour
210
209
 
210
+ function _arrayWithHoles$5(arr) {
211
+ if (Array.isArray(arr)) return arr;
212
+ }
213
+
214
+ function _iterableToArrayLimit$5(arr, i) {
215
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
216
+ if (null != _i) {
217
+ var _s,
218
+ _e,
219
+ _x,
220
+ _r,
221
+ _arr = [],
222
+ _n = !0,
223
+ _d = !1;
224
+ try {
225
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
226
+ if (Object(_i) !== _i) return;
227
+ _n = !1;
228
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
229
+ } catch (err) {
230
+ _d = !0, _e = err;
231
+ } finally {
232
+ try {
233
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
234
+ } finally {
235
+ if (_d) throw _e;
236
+ }
237
+ }
238
+ return _arr;
239
+ }
240
+ }
241
+
242
+ function _arrayLikeToArray$h(arr, len) {
243
+ if (len == null || len > arr.length) len = arr.length;
244
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
245
+ return arr2;
246
+ }
247
+
248
+ function _unsupportedIterableToArray$h(o, minLen) {
249
+ if (!o) return;
250
+ if (typeof o === "string") return _arrayLikeToArray$h(o, minLen);
251
+ var n = Object.prototype.toString.call(o).slice(8, -1);
252
+ if (n === "Object" && o.constructor) n = o.constructor.name;
253
+ if (n === "Map" || n === "Set") return Array.from(o);
254
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$h(o, minLen);
255
+ }
256
+
257
+ function _nonIterableRest$5() {
258
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
259
+ }
260
+
261
+ function _slicedToArray$5(arr, i) {
262
+ return _arrayWithHoles$5(arr) || _iterableToArrayLimit$5(arr, i) || _unsupportedIterableToArray$h(arr, i) || _nonIterableRest$5();
263
+ }
264
+
265
+ function _typeof$6(obj) {
266
+ "@babel/helpers - typeof";
267
+
268
+ return _typeof$6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
269
+ return typeof obj;
270
+ } : function (obj) {
271
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
272
+ }, _typeof$6(obj);
273
+ }
274
+
275
+ /**
276
+ * @template {Function} T
277
+ * @param {T} func
278
+ * @returns {T}
279
+ */
280
+ var nullSafe = function nullSafe(func) {
281
+ return (
282
+ // @ts-ignore
283
+ curryN(func.length, function () {
284
+ var _ref;
285
+ var dataArg = (_ref = func.length - 1, _ref < 0 || arguments.length <= _ref ? undefined : arguments[_ref]);
286
+ return isNil(dataArg) ? dataArg : func.apply(void 0, arguments);
287
+ })
288
+ );
289
+ };
290
+ var noop$4 = function noop() {};
291
+ var isNotPresent = /*#__PURE__*/either(isNil, isEmpty);
292
+ var isPresent = /*#__PURE__*/complement(isNotPresent);
293
+
294
+ var matchesImpl = function matchesImpl(pattern, object) {
295
+ var __parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : object;
296
+ if (object === pattern) return true;
297
+ if (typeof pattern === "function" && pattern(object, __parent)) return true;
298
+ if (isNil(pattern) || isNil(object)) return false;
299
+ if (_typeof$6(pattern) !== "object") return false;
300
+ return Object.entries(pattern).every(function (_ref) {
301
+ var _ref2 = _slicedToArray$5(_ref, 2),
302
+ key = _ref2[0],
303
+ value = _ref2[1];
304
+ return matchesImpl(value, object[key], __parent);
305
+ });
306
+ };
307
+ var matches = /*#__PURE__*/curry(function (pattern, object) {
308
+ return matchesImpl(pattern, object);
309
+ });
310
+ var filterNonNull = function filterNonNull(object) {
311
+ return Object.fromEntries(Object.entries(object).filter(function (_ref5) {
312
+ var _ref6 = _slicedToArray$5(_ref5, 2),
313
+ v = _ref6[1];
314
+ return !isNil(v);
315
+ }).map(function (_ref7) {
316
+ var _ref8 = _slicedToArray$5(_ref7, 2),
317
+ k = _ref8[0],
318
+ v = _ref8[1];
319
+ return [k, _typeof$6(v) === "object" && !Array.isArray(v) ? filterNonNull(v) : v];
320
+ }));
321
+ };
322
+ nullSafe(filterNonNull);
323
+ var findById = /*#__PURE__*/curry(function (id, array) {
324
+ return array.find(function (item) {
325
+ return item.id === id;
326
+ });
327
+ });
328
+ var findBy = /*#__PURE__*/curry(function (pattern, array) {
329
+ return array.find(matches(pattern));
330
+ });
331
+ var removeBy = /*#__PURE__*/curry(function (pattern, array) {
332
+ return array.filter(complement(matches(pattern)));
333
+ });
334
+
211
335
  function _setPrototypeOf$2(o, p) {
212
336
  _setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
213
337
  o.__proto__ = p;