@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.cjs.js CHANGED
@@ -34120,7 +34120,7 @@ cov_ulkgj7n39().s[23]++;
34120
34120
 
34121
34121
  function cov_291vtop84c() {
34122
34122
  var path = "/home/runner/work/neeto-form-frontend/neeto-form-frontend/src/components/Common/FormikWrap.js";
34123
- var hash = "2fa2c31db7e39b3e2b38f7ef5f4c947b5004b05f";
34123
+ var hash = "a26a6efe7c7b1236ea07677952837913631acb6c";
34124
34124
  var global = new Function("return this")();
34125
34125
  var gcv = "__coverage__";
34126
34126
  var coverageData = {
@@ -34132,18 +34132,18 @@ function cov_291vtop84c() {
34132
34132
  column: 19
34133
34133
  },
34134
34134
  end: {
34135
- line: 34,
34135
+ line: 43,
34136
34136
  column: 1
34137
34137
  }
34138
34138
  },
34139
34139
  "1": {
34140
34140
  start: {
34141
34141
  line: 15,
34142
- column: 52
34142
+ column: 61
34143
34143
  },
34144
34144
  end: {
34145
34145
  line: 15,
34146
- column: 70
34146
+ column: 79
34147
34147
  }
34148
34148
  },
34149
34149
  "2": {
@@ -34202,7 +34202,7 @@ function cov_291vtop84c() {
34202
34202
  column: 2
34203
34203
  },
34204
34204
  end: {
34205
- line: 31,
34205
+ line: 40,
34206
34206
  column: 30
34207
34207
  }
34208
34208
  },
@@ -34212,37 +34212,77 @@ function cov_291vtop84c() {
34212
34212
  column: 4
34213
34213
  },
34214
34214
  end: {
34215
- line: 30,
34215
+ line: 39,
34216
34216
  column: 5
34217
34217
  }
34218
34218
  },
34219
34219
  "9": {
34220
34220
  start: {
34221
- line: 29,
34222
- column: 6
34221
+ line: 30,
34222
+ column: 28
34223
34223
  },
34224
34224
  end: {
34225
- line: 29,
34226
- column: 57
34225
+ line: 36,
34226
+ column: 14
34227
34227
  }
34228
34228
  },
34229
34229
  "10": {
34230
34230
  start: {
34231
- line: 29,
34232
- column: 41
34231
+ line: 31,
34232
+ column: 23
34233
34233
  },
34234
34234
  end: {
34235
- line: 29,
34236
- column: 57
34235
+ line: 31,
34236
+ column: 35
34237
34237
  }
34238
34238
  },
34239
34239
  "11": {
34240
34240
  start: {
34241
34241
  line: 33,
34242
- column: 2
34242
+ column: 10
34243
34243
  },
34244
34244
  end: {
34245
34245
  line: 33,
34246
+ column: 33
34247
+ }
34248
+ },
34249
+ "12": {
34250
+ start: {
34251
+ line: 35,
34252
+ column: 10
34253
+ },
34254
+ end: {
34255
+ line: 35,
34256
+ column: 21
34257
+ }
34258
+ },
34259
+ "13": {
34260
+ start: {
34261
+ line: 38,
34262
+ column: 6
34263
+ },
34264
+ end: {
34265
+ line: 38,
34266
+ column: 64
34267
+ }
34268
+ },
34269
+ "14": {
34270
+ start: {
34271
+ line: 38,
34272
+ column: 41
34273
+ },
34274
+ end: {
34275
+ line: 38,
34276
+ column: 64
34277
+ }
34278
+ },
34279
+ "15": {
34280
+ start: {
34281
+ line: 42,
34282
+ column: 2
34283
+ },
34284
+ end: {
34285
+ line: 42,
34246
34286
  column: 18
34247
34287
  }
34248
34288
  }
@@ -34266,7 +34306,7 @@ function cov_291vtop84c() {
34266
34306
  column: 6
34267
34307
  },
34268
34308
  end: {
34269
- line: 34,
34309
+ line: 43,
34270
34310
  column: 1
34271
34311
  }
34272
34312
  },
@@ -34338,11 +34378,59 @@ function cov_291vtop84c() {
34338
34378
  column: 18
34339
34379
  },
34340
34380
  end: {
34341
- line: 31,
34381
+ line: 40,
34342
34382
  column: 3
34343
34383
  }
34344
34384
  },
34345
34385
  line: 27
34386
+ },
34387
+ "4": {
34388
+ name: "(anonymous_4)",
34389
+ decl: {
34390
+ start: {
34391
+ line: 31,
34392
+ column: 16
34393
+ },
34394
+ end: {
34395
+ line: 31,
34396
+ column: 17
34397
+ }
34398
+ },
34399
+ loc: {
34400
+ start: {
34401
+ line: 31,
34402
+ column: 23
34403
+ },
34404
+ end: {
34405
+ line: 31,
34406
+ column: 35
34407
+ }
34408
+ },
34409
+ line: 31
34410
+ },
34411
+ "5": {
34412
+ name: "(anonymous_5)",
34413
+ decl: {
34414
+ start: {
34415
+ line: 32,
34416
+ column: 16
34417
+ },
34418
+ end: {
34419
+ line: 32,
34420
+ column: 17
34421
+ }
34422
+ },
34423
+ loc: {
34424
+ start: {
34425
+ line: 32,
34426
+ column: 30
34427
+ },
34428
+ end: {
34429
+ line: 36,
34430
+ column: 9
34431
+ }
34432
+ },
34433
+ line: 32
34346
34434
  }
34347
34435
  },
34348
34436
  branchMap: {
@@ -34428,7 +34516,7 @@ function cov_291vtop84c() {
34428
34516
  column: 4
34429
34517
  },
34430
34518
  end: {
34431
- line: 30,
34519
+ line: 39,
34432
34520
  column: 5
34433
34521
  }
34434
34522
  },
@@ -34439,7 +34527,7 @@ function cov_291vtop84c() {
34439
34527
  column: 4
34440
34528
  },
34441
34529
  end: {
34442
- line: 30,
34530
+ line: 39,
34443
34531
  column: 5
34444
34532
  }
34445
34533
  }, {
@@ -34490,23 +34578,23 @@ function cov_291vtop84c() {
34490
34578
  "4": {
34491
34579
  loc: {
34492
34580
  start: {
34493
- line: 29,
34581
+ line: 38,
34494
34582
  column: 6
34495
34583
  },
34496
34584
  end: {
34497
- line: 29,
34498
- column: 57
34585
+ line: 38,
34586
+ column: 64
34499
34587
  }
34500
34588
  },
34501
34589
  type: "if",
34502
34590
  locations: [{
34503
34591
  start: {
34504
- line: 29,
34592
+ line: 38,
34505
34593
  column: 6
34506
34594
  },
34507
34595
  end: {
34508
- line: 29,
34509
- column: 57
34596
+ line: 38,
34597
+ column: 64
34510
34598
  }
34511
34599
  }, {
34512
34600
  start: {
@@ -34518,7 +34606,7 @@ function cov_291vtop84c() {
34518
34606
  column: undefined
34519
34607
  }
34520
34608
  }],
34521
- line: 29
34609
+ line: 38
34522
34610
  }
34523
34611
  },
34524
34612
  s: {
@@ -34533,13 +34621,19 @@ function cov_291vtop84c() {
34533
34621
  "8": 0,
34534
34622
  "9": 0,
34535
34623
  "10": 0,
34536
- "11": 0
34624
+ "11": 0,
34625
+ "12": 0,
34626
+ "13": 0,
34627
+ "14": 0,
34628
+ "15": 0
34537
34629
  },
34538
34630
  f: {
34539
34631
  "0": 0,
34540
34632
  "1": 0,
34541
34633
  "2": 0,
34542
- "3": 0
34634
+ "3": 0,
34635
+ "4": 0,
34636
+ "5": 0
34543
34637
  },
34544
34638
  b: {
34545
34639
  "0": [0, 0, 0],
@@ -34549,7 +34643,7 @@ function cov_291vtop84c() {
34549
34643
  "4": [0, 0]
34550
34644
  },
34551
34645
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
34552
- hash: "2fa2c31db7e39b3e2b38f7ef5f4c947b5004b05f"
34646
+ hash: "a26a6efe7c7b1236ea07677952837913631acb6c"
34553
34647
  };
34554
34648
  var coverage = global[gcv] || (global[gcv] = {});
34555
34649
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -34575,6 +34669,7 @@ var FormikWrap = function FormikWrap(_ref) {
34575
34669
  cov_291vtop84c().f[0]++;
34576
34670
  var _ref2 = (cov_291vtop84c().s[1]++, formik.useFormikContext()),
34577
34671
  errors = _ref2.errors,
34672
+ touched = _ref2.touched,
34578
34673
  isValid = _ref2.isValid,
34579
34674
  isSubmitting = _ref2.isSubmitting,
34580
34675
  values = _ref2.values;
@@ -34598,11 +34693,23 @@ var FormikWrap = function FormikWrap(_ref) {
34598
34693
  cov_291vtop84c().s[8]++;
34599
34694
  if ((cov_291vtop84c().b[3][0]++, !isSubmitting) && (cov_291vtop84c().b[3][1]++, !isValid)) {
34600
34695
  cov_291vtop84c().b[2][0]++;
34601
- cov_291vtop84c().s[9]++;
34696
+ // include only touched fields
34697
+ var touchedErrors = (cov_291vtop84c().s[9]++, Object.keys(errors).filter(function (key) {
34698
+ cov_291vtop84c().f[4]++;
34699
+ cov_291vtop84c().s[10]++;
34700
+ return touched[key];
34701
+ }).reduce(function (obj, key) {
34702
+ cov_291vtop84c().f[5]++;
34703
+ cov_291vtop84c().s[11]++;
34704
+ obj[key] = errors[key];
34705
+ cov_291vtop84c().s[12]++;
34706
+ return obj;
34707
+ }, {}));
34708
+ cov_291vtop84c().s[13]++;
34602
34709
  if (typeof onError === "function") {
34603
34710
  cov_291vtop84c().b[4][0]++;
34604
- cov_291vtop84c().s[10]++;
34605
- onError(errors);
34711
+ cov_291vtop84c().s[14]++;
34712
+ onError(touchedErrors);
34606
34713
  } else {
34607
34714
  cov_291vtop84c().b[4][1]++;
34608
34715
  }
@@ -34610,7 +34717,7 @@ var FormikWrap = function FormikWrap(_ref) {
34610
34717
  cov_291vtop84c().b[2][1]++;
34611
34718
  }
34612
34719
  }, [isValid, isSubmitting]);
34613
- cov_291vtop84c().s[11]++;
34720
+ cov_291vtop84c().s[15]++;
34614
34721
  return children;
34615
34722
  };
34616
34723
 
@@ -59581,7 +59688,7 @@ var Success$1 = /*#__PURE__*/React__default["default"].memo(Success);
59581
59688
 
59582
59689
  function cov_2jkcclu7mz() {
59583
59690
  var path = "/home/runner/work/neeto-form-frontend/neeto-form-frontend/src/components/ExternalForm/index.jsx";
59584
- var hash = "c678672da6b7c438e8ebadee3ce8869460a8c3c6";
59691
+ var hash = "05c846696d6996a5fc58c9d61ade7f66c49c7270";
59585
59692
  var global = new Function("return this")();
59586
59693
  var gcv = "__coverage__";
59587
59694
  var coverageData = {
@@ -60274,7 +60381,7 @@ function cov_2jkcclu7mz() {
60274
60381
  },
60275
60382
  end: {
60276
60383
  line: 262,
60277
- column: 51
60384
+ column: 55
60278
60385
  }
60279
60386
  },
60280
60387
  "69": {
@@ -62258,7 +62365,7 @@ function cov_2jkcclu7mz() {
62258
62365
  "43": [0, 0]
62259
62366
  },
62260
62367
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
62261
- hash: "c678672da6b7c438e8ebadee3ce8869460a8c3c6"
62368
+ hash: "05c846696d6996a5fc58c9d61ade7f66c49c7270"
62262
62369
  };
62263
62370
  var coverage = global[gcv] || (global[gcv] = {});
62264
62371
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -62575,7 +62682,7 @@ var ExternalForm = function ExternalForm(_ref) {
62575
62682
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
62576
62683
  var formElement = _step.value;
62577
62684
  cov_2jkcclu7mz().s[54]++;
62578
- if (formElement.name === errorKeys[0]) {
62685
+ if (errorKeys.includes(formElement.name)) {
62579
62686
  cov_2jkcclu7mz().b[23][0]++;
62580
62687
  cov_2jkcclu7mz().s[55]++;
62581
62688
  formElement.scrollIntoView({
@@ -62670,7 +62777,7 @@ var ExternalForm = function ExternalForm(_ref) {
62670
62777
  if (!ramda.isEmpty(errors)) {
62671
62778
  cov_2jkcclu7mz().b[33][0]++;
62672
62779
  cov_2jkcclu7mz().s[68]++;
62673
- setFieldError(event.target.name);
62780
+ setFieldError(event.target.name, "");
62674
62781
  } else {
62675
62782
  cov_2jkcclu7mz().b[33][1]++;
62676
62783
  }