@bigbinary/neeto-form-frontend 1.1.0 → 1.1.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/dist/index.js CHANGED
@@ -34080,7 +34080,7 @@ cov_ulkgj7n39().s[23]++;
34080
34080
 
34081
34081
  function cov_291vtop84c() {
34082
34082
  var path = "/home/runner/work/neeto-form-frontend/neeto-form-frontend/src/components/Common/FormikWrap.js";
34083
- var hash = "2fa2c31db7e39b3e2b38f7ef5f4c947b5004b05f";
34083
+ var hash = "a26a6efe7c7b1236ea07677952837913631acb6c";
34084
34084
  var global = new Function("return this")();
34085
34085
  var gcv = "__coverage__";
34086
34086
  var coverageData = {
@@ -34092,18 +34092,18 @@ function cov_291vtop84c() {
34092
34092
  column: 19
34093
34093
  },
34094
34094
  end: {
34095
- line: 34,
34095
+ line: 43,
34096
34096
  column: 1
34097
34097
  }
34098
34098
  },
34099
34099
  "1": {
34100
34100
  start: {
34101
34101
  line: 15,
34102
- column: 52
34102
+ column: 61
34103
34103
  },
34104
34104
  end: {
34105
34105
  line: 15,
34106
- column: 70
34106
+ column: 79
34107
34107
  }
34108
34108
  },
34109
34109
  "2": {
@@ -34162,7 +34162,7 @@ function cov_291vtop84c() {
34162
34162
  column: 2
34163
34163
  },
34164
34164
  end: {
34165
- line: 31,
34165
+ line: 40,
34166
34166
  column: 30
34167
34167
  }
34168
34168
  },
@@ -34172,37 +34172,77 @@ function cov_291vtop84c() {
34172
34172
  column: 4
34173
34173
  },
34174
34174
  end: {
34175
- line: 30,
34175
+ line: 39,
34176
34176
  column: 5
34177
34177
  }
34178
34178
  },
34179
34179
  "9": {
34180
34180
  start: {
34181
- line: 29,
34182
- column: 6
34181
+ line: 30,
34182
+ column: 28
34183
34183
  },
34184
34184
  end: {
34185
- line: 29,
34186
- column: 57
34185
+ line: 36,
34186
+ column: 14
34187
34187
  }
34188
34188
  },
34189
34189
  "10": {
34190
34190
  start: {
34191
- line: 29,
34192
- column: 41
34191
+ line: 31,
34192
+ column: 23
34193
34193
  },
34194
34194
  end: {
34195
- line: 29,
34196
- column: 57
34195
+ line: 31,
34196
+ column: 35
34197
34197
  }
34198
34198
  },
34199
34199
  "11": {
34200
34200
  start: {
34201
34201
  line: 33,
34202
- column: 2
34202
+ column: 10
34203
34203
  },
34204
34204
  end: {
34205
34205
  line: 33,
34206
+ column: 33
34207
+ }
34208
+ },
34209
+ "12": {
34210
+ start: {
34211
+ line: 35,
34212
+ column: 10
34213
+ },
34214
+ end: {
34215
+ line: 35,
34216
+ column: 21
34217
+ }
34218
+ },
34219
+ "13": {
34220
+ start: {
34221
+ line: 38,
34222
+ column: 6
34223
+ },
34224
+ end: {
34225
+ line: 38,
34226
+ column: 64
34227
+ }
34228
+ },
34229
+ "14": {
34230
+ start: {
34231
+ line: 38,
34232
+ column: 41
34233
+ },
34234
+ end: {
34235
+ line: 38,
34236
+ column: 64
34237
+ }
34238
+ },
34239
+ "15": {
34240
+ start: {
34241
+ line: 42,
34242
+ column: 2
34243
+ },
34244
+ end: {
34245
+ line: 42,
34206
34246
  column: 18
34207
34247
  }
34208
34248
  }
@@ -34226,7 +34266,7 @@ function cov_291vtop84c() {
34226
34266
  column: 6
34227
34267
  },
34228
34268
  end: {
34229
- line: 34,
34269
+ line: 43,
34230
34270
  column: 1
34231
34271
  }
34232
34272
  },
@@ -34298,11 +34338,59 @@ function cov_291vtop84c() {
34298
34338
  column: 18
34299
34339
  },
34300
34340
  end: {
34301
- line: 31,
34341
+ line: 40,
34302
34342
  column: 3
34303
34343
  }
34304
34344
  },
34305
34345
  line: 27
34346
+ },
34347
+ "4": {
34348
+ name: "(anonymous_4)",
34349
+ decl: {
34350
+ start: {
34351
+ line: 31,
34352
+ column: 16
34353
+ },
34354
+ end: {
34355
+ line: 31,
34356
+ column: 17
34357
+ }
34358
+ },
34359
+ loc: {
34360
+ start: {
34361
+ line: 31,
34362
+ column: 23
34363
+ },
34364
+ end: {
34365
+ line: 31,
34366
+ column: 35
34367
+ }
34368
+ },
34369
+ line: 31
34370
+ },
34371
+ "5": {
34372
+ name: "(anonymous_5)",
34373
+ decl: {
34374
+ start: {
34375
+ line: 32,
34376
+ column: 16
34377
+ },
34378
+ end: {
34379
+ line: 32,
34380
+ column: 17
34381
+ }
34382
+ },
34383
+ loc: {
34384
+ start: {
34385
+ line: 32,
34386
+ column: 30
34387
+ },
34388
+ end: {
34389
+ line: 36,
34390
+ column: 9
34391
+ }
34392
+ },
34393
+ line: 32
34306
34394
  }
34307
34395
  },
34308
34396
  branchMap: {
@@ -34388,7 +34476,7 @@ function cov_291vtop84c() {
34388
34476
  column: 4
34389
34477
  },
34390
34478
  end: {
34391
- line: 30,
34479
+ line: 39,
34392
34480
  column: 5
34393
34481
  }
34394
34482
  },
@@ -34399,7 +34487,7 @@ function cov_291vtop84c() {
34399
34487
  column: 4
34400
34488
  },
34401
34489
  end: {
34402
- line: 30,
34490
+ line: 39,
34403
34491
  column: 5
34404
34492
  }
34405
34493
  }, {
@@ -34450,23 +34538,23 @@ function cov_291vtop84c() {
34450
34538
  "4": {
34451
34539
  loc: {
34452
34540
  start: {
34453
- line: 29,
34541
+ line: 38,
34454
34542
  column: 6
34455
34543
  },
34456
34544
  end: {
34457
- line: 29,
34458
- column: 57
34545
+ line: 38,
34546
+ column: 64
34459
34547
  }
34460
34548
  },
34461
34549
  type: "if",
34462
34550
  locations: [{
34463
34551
  start: {
34464
- line: 29,
34552
+ line: 38,
34465
34553
  column: 6
34466
34554
  },
34467
34555
  end: {
34468
- line: 29,
34469
- column: 57
34556
+ line: 38,
34557
+ column: 64
34470
34558
  }
34471
34559
  }, {
34472
34560
  start: {
@@ -34478,7 +34566,7 @@ function cov_291vtop84c() {
34478
34566
  column: undefined
34479
34567
  }
34480
34568
  }],
34481
- line: 29
34569
+ line: 38
34482
34570
  }
34483
34571
  },
34484
34572
  s: {
@@ -34493,13 +34581,19 @@ function cov_291vtop84c() {
34493
34581
  "8": 0,
34494
34582
  "9": 0,
34495
34583
  "10": 0,
34496
- "11": 0
34584
+ "11": 0,
34585
+ "12": 0,
34586
+ "13": 0,
34587
+ "14": 0,
34588
+ "15": 0
34497
34589
  },
34498
34590
  f: {
34499
34591
  "0": 0,
34500
34592
  "1": 0,
34501
34593
  "2": 0,
34502
- "3": 0
34594
+ "3": 0,
34595
+ "4": 0,
34596
+ "5": 0
34503
34597
  },
34504
34598
  b: {
34505
34599
  "0": [0, 0, 0],
@@ -34509,7 +34603,7 @@ function cov_291vtop84c() {
34509
34603
  "4": [0, 0]
34510
34604
  },
34511
34605
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
34512
- hash: "2fa2c31db7e39b3e2b38f7ef5f4c947b5004b05f"
34606
+ hash: "a26a6efe7c7b1236ea07677952837913631acb6c"
34513
34607
  };
34514
34608
  var coverage = global[gcv] || (global[gcv] = {});
34515
34609
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -34535,6 +34629,7 @@ var FormikWrap = function FormikWrap(_ref) {
34535
34629
  cov_291vtop84c().f[0]++;
34536
34630
  var _ref2 = (cov_291vtop84c().s[1]++, useFormikContext()),
34537
34631
  errors = _ref2.errors,
34632
+ touched = _ref2.touched,
34538
34633
  isValid = _ref2.isValid,
34539
34634
  isSubmitting = _ref2.isSubmitting,
34540
34635
  values = _ref2.values;
@@ -34558,11 +34653,23 @@ var FormikWrap = function FormikWrap(_ref) {
34558
34653
  cov_291vtop84c().s[8]++;
34559
34654
  if ((cov_291vtop84c().b[3][0]++, !isSubmitting) && (cov_291vtop84c().b[3][1]++, !isValid)) {
34560
34655
  cov_291vtop84c().b[2][0]++;
34561
- cov_291vtop84c().s[9]++;
34656
+ // include only touched fields
34657
+ var touchedErrors = (cov_291vtop84c().s[9]++, Object.keys(errors).filter(function (key) {
34658
+ cov_291vtop84c().f[4]++;
34659
+ cov_291vtop84c().s[10]++;
34660
+ return touched[key];
34661
+ }).reduce(function (obj, key) {
34662
+ cov_291vtop84c().f[5]++;
34663
+ cov_291vtop84c().s[11]++;
34664
+ obj[key] = errors[key];
34665
+ cov_291vtop84c().s[12]++;
34666
+ return obj;
34667
+ }, {}));
34668
+ cov_291vtop84c().s[13]++;
34562
34669
  if (typeof onError === "function") {
34563
34670
  cov_291vtop84c().b[4][0]++;
34564
- cov_291vtop84c().s[10]++;
34565
- onError(errors);
34671
+ cov_291vtop84c().s[14]++;
34672
+ onError(touchedErrors);
34566
34673
  } else {
34567
34674
  cov_291vtop84c().b[4][1]++;
34568
34675
  }
@@ -34570,7 +34677,7 @@ var FormikWrap = function FormikWrap(_ref) {
34570
34677
  cov_291vtop84c().b[2][1]++;
34571
34678
  }
34572
34679
  }, [isValid, isSubmitting]);
34573
- cov_291vtop84c().s[11]++;
34680
+ cov_291vtop84c().s[15]++;
34574
34681
  return children;
34575
34682
  };
34576
34683
 
@@ -59541,7 +59648,7 @@ var Success$1 = /*#__PURE__*/React__default.memo(Success);
59541
59648
 
59542
59649
  function cov_2jkcclu7mz() {
59543
59650
  var path = "/home/runner/work/neeto-form-frontend/neeto-form-frontend/src/components/ExternalForm/index.jsx";
59544
- var hash = "c678672da6b7c438e8ebadee3ce8869460a8c3c6";
59651
+ var hash = "05c846696d6996a5fc58c9d61ade7f66c49c7270";
59545
59652
  var global = new Function("return this")();
59546
59653
  var gcv = "__coverage__";
59547
59654
  var coverageData = {
@@ -60234,7 +60341,7 @@ function cov_2jkcclu7mz() {
60234
60341
  },
60235
60342
  end: {
60236
60343
  line: 262,
60237
- column: 51
60344
+ column: 55
60238
60345
  }
60239
60346
  },
60240
60347
  "69": {
@@ -62218,7 +62325,7 @@ function cov_2jkcclu7mz() {
62218
62325
  "43": [0, 0]
62219
62326
  },
62220
62327
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
62221
- hash: "c678672da6b7c438e8ebadee3ce8869460a8c3c6"
62328
+ hash: "05c846696d6996a5fc58c9d61ade7f66c49c7270"
62222
62329
  };
62223
62330
  var coverage = global[gcv] || (global[gcv] = {});
62224
62331
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -62535,7 +62642,7 @@ var ExternalForm = function ExternalForm(_ref) {
62535
62642
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
62536
62643
  var formElement = _step.value;
62537
62644
  cov_2jkcclu7mz().s[54]++;
62538
- if (formElement.name === errorKeys[0]) {
62645
+ if (errorKeys.includes(formElement.name)) {
62539
62646
  cov_2jkcclu7mz().b[23][0]++;
62540
62647
  cov_2jkcclu7mz().s[55]++;
62541
62648
  formElement.scrollIntoView({
@@ -62630,7 +62737,7 @@ var ExternalForm = function ExternalForm(_ref) {
62630
62737
  if (!isEmpty(errors)) {
62631
62738
  cov_2jkcclu7mz().b[33][0]++;
62632
62739
  cov_2jkcclu7mz().s[68]++;
62633
- setFieldError(event.target.name);
62740
+ setFieldError(event.target.name, "");
62634
62741
  } else {
62635
62742
  cov_2jkcclu7mz().b[33][1]++;
62636
62743
  }