kwikid-forms 0.1.15 → 0.1.16

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.
@@ -1325,10 +1325,169 @@
1325
1325
  });
1326
1326
  });
1327
1327
  };
1328
+ Apis.prototype.setRequestHeaders = function () {
1329
+ var _a, _b, _c, _d;
1330
+ return __awaiter(this, void 0, void 0, function () {
1331
+ var params, paramIndex, params_2, params_2_1, param, sources, sourceIndex, sources_3, sources_3_1, source, sources_4, value, validation, triggers, rules, actions, rulesMapping, actions_5, actions_5_1, action, conditionEvaluation, actions_6, e_5_1, e_6_1, e_7_1;
1332
+ var e_7, _e, e_6, _f, e_5, _g;
1333
+ return __generator(this, function (_h) {
1334
+ switch (_h.label) {
1335
+ case 0:
1336
+ if (!kwikidToolkit.checkObjectKeyExists(this._request, "headers")) return [3 /*break*/, 25];
1337
+ if (!kwikidToolkit.checkObjectKeyExists(this._request.headers, "params")) return [3 /*break*/, 23];
1338
+ params = this._request.headers.params;
1339
+ paramIndex = 0;
1340
+ _h.label = 1;
1341
+ case 1:
1342
+ _h.trys.push([1, 20, 21, 22]);
1343
+ params_2 = __values(params), params_2_1 = params_2.next();
1344
+ _h.label = 2;
1345
+ case 2:
1346
+ if (!!params_2_1.done) return [3 /*break*/, 19];
1347
+ param = params_2_1.value;
1348
+ sources = param.sources;
1349
+ sourceIndex = 0;
1350
+ _h.label = 3;
1351
+ case 3:
1352
+ _h.trys.push([3, 15, 16, 17]);
1353
+ sources_3 = (e_6 = void 0, __values(sources)), sources_3_1 = sources_3.next();
1354
+ _h.label = 4;
1355
+ case 4:
1356
+ if (!!sources_3_1.done) return [3 /*break*/, 14];
1357
+ source = sources_3_1.value;
1358
+ sources_4 = new kwikidToolkit.Source(this._object);
1359
+ value = sources_4.getValueFromSource(source);
1360
+ // Set the Value of current source.
1361
+ this._object.FIELD_CONFIG = kwikidToolkit.setValueToObjectPath(this._object.FIELD_CONFIG, "api.request.headers.params[" + paramIndex + "].sources[" + sourceIndex + "].value", value);
1362
+ validation = source.validation;
1363
+ triggers = (_a = validation === null || validation === void 0 ? void 0 : validation.triggers) !== null && _a !== void 0 ? _a : [];
1364
+ rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
1365
+ actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
1366
+ rulesMapping = new kwikidToolkit.Rule(rules, this._object).mapping();
1367
+ _h.label = 5;
1368
+ case 5:
1369
+ _h.trys.push([5, 10, 11, 12]);
1370
+ actions_5 = (e_5 = void 0, __values(actions)), actions_5_1 = actions_5.next();
1371
+ _h.label = 6;
1372
+ case 6:
1373
+ if (!!actions_5_1.done) return [3 /*break*/, 9];
1374
+ action = actions_5_1.value;
1375
+ conditionEvaluation = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
1376
+ if (!conditionEvaluation) return [3 /*break*/, 8];
1377
+ actions_6 = new kwikidToolkit.Action(action, rulesMapping, this._object, this._takeAction);
1378
+ return [4 /*yield*/, actions_6.execute()];
1379
+ case 7:
1380
+ _h.sent();
1381
+ _h.label = 8;
1382
+ case 8:
1383
+ actions_5_1 = actions_5.next();
1384
+ return [3 /*break*/, 6];
1385
+ case 9: return [3 /*break*/, 12];
1386
+ case 10:
1387
+ e_5_1 = _h.sent();
1388
+ e_5 = { error: e_5_1 };
1389
+ return [3 /*break*/, 12];
1390
+ case 11:
1391
+ try {
1392
+ if (actions_5_1 && !actions_5_1.done && (_g = actions_5.return)) _g.call(actions_5);
1393
+ }
1394
+ finally { if (e_5) throw e_5.error; }
1395
+ return [7 /*endfinally*/];
1396
+ case 12:
1397
+ sourceIndex++;
1398
+ _h.label = 13;
1399
+ case 13:
1400
+ sources_3_1 = sources_3.next();
1401
+ return [3 /*break*/, 4];
1402
+ case 14: return [3 /*break*/, 17];
1403
+ case 15:
1404
+ e_6_1 = _h.sent();
1405
+ e_6 = { error: e_6_1 };
1406
+ return [3 /*break*/, 17];
1407
+ case 16:
1408
+ try {
1409
+ if (sources_3_1 && !sources_3_1.done && (_f = sources_3.return)) _f.call(sources_3);
1410
+ }
1411
+ finally { if (e_6) throw e_6.error; }
1412
+ return [7 /*endfinally*/];
1413
+ case 17:
1414
+ paramIndex++;
1415
+ _h.label = 18;
1416
+ case 18:
1417
+ params_2_1 = params_2.next();
1418
+ return [3 /*break*/, 2];
1419
+ case 19: return [3 /*break*/, 22];
1420
+ case 20:
1421
+ e_7_1 = _h.sent();
1422
+ e_7 = { error: e_7_1 };
1423
+ return [3 /*break*/, 22];
1424
+ case 21:
1425
+ try {
1426
+ if (params_2_1 && !params_2_1.done && (_e = params_2.return)) _e.call(params_2);
1427
+ }
1428
+ finally { if (e_7) throw e_7.error; }
1429
+ return [7 /*endfinally*/];
1430
+ case 22: return [2 /*return*/, this._object.FIELD_CONFIG];
1431
+ case 23: return [2 /*return*/, this._object.FIELD_CONFIG];
1432
+ case 24: return [3 /*break*/, 26];
1433
+ case 25: return [2 /*return*/, this._object.FIELD_CONFIG];
1434
+ case 26: return [2 /*return*/];
1435
+ }
1436
+ });
1437
+ });
1438
+ };
1439
+ Apis.prototype.validateRequestHeaders = function () {
1440
+ var _a;
1441
+ return __awaiter(this, void 0, void 0, function () {
1442
+ var headers, validation, triggers, rules, actions, rulesMapping, actions_7, actions_7_1, action, conditionSuccess, actions_8, e_8_1;
1443
+ var e_8, _e;
1444
+ return __generator(this, function (_f) {
1445
+ switch (_f.label) {
1446
+ case 0:
1447
+ headers = this._request.headers;
1448
+ validation = headers.validation;
1449
+ triggers = validation.triggers;
1450
+ rules = validation.rules;
1451
+ actions = (_a = validation) === null || _a === void 0 ? void 0 : _a.actions;
1452
+ rulesMapping = new kwikidToolkit.Rule(rules, this._object).mapping();
1453
+ _f.label = 1;
1454
+ case 1:
1455
+ _f.trys.push([1, 6, 7, 8]);
1456
+ actions_7 = __values(actions), actions_7_1 = actions_7.next();
1457
+ _f.label = 2;
1458
+ case 2:
1459
+ if (!!actions_7_1.done) return [3 /*break*/, 5];
1460
+ action = actions_7_1.value;
1461
+ conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
1462
+ if (!conditionSuccess) return [3 /*break*/, 4];
1463
+ actions_8 = new kwikidToolkit.Action(action, rulesMapping, this._object, this._takeAction);
1464
+ return [4 /*yield*/, actions_8.execute()];
1465
+ case 3:
1466
+ _f.sent();
1467
+ _f.label = 4;
1468
+ case 4:
1469
+ actions_7_1 = actions_7.next();
1470
+ return [3 /*break*/, 2];
1471
+ case 5: return [3 /*break*/, 8];
1472
+ case 6:
1473
+ e_8_1 = _f.sent();
1474
+ e_8 = { error: e_8_1 };
1475
+ return [3 /*break*/, 8];
1476
+ case 7:
1477
+ try {
1478
+ if (actions_7_1 && !actions_7_1.done && (_e = actions_7.return)) _e.call(actions_7);
1479
+ }
1480
+ finally { if (e_8) throw e_8.error; }
1481
+ return [7 /*endfinally*/];
1482
+ case 8: return [2 /*return*/, this._object.FIELD_CONFIG];
1483
+ }
1484
+ });
1485
+ });
1486
+ };
1328
1487
  Apis.prototype.validateResponse = function () {
1329
1488
  return __awaiter(this, void 0, void 0, function () {
1330
- var validation, triggers, rules, actions, rulesMapping, actions_5, actions_5_1, action, conditionSuccess, actions_6, e_5_1;
1331
- var e_5, _e;
1489
+ var validation, triggers, rules, actions, rulesMapping, actions_9, actions_9_1, action, conditionSuccess, actions_10, e_9_1;
1490
+ var e_9, _e;
1332
1491
  return __generator(this, function (_f) {
1333
1492
  switch (_f.label) {
1334
1493
  case 0:
@@ -1340,31 +1499,31 @@
1340
1499
  _f.label = 1;
1341
1500
  case 1:
1342
1501
  _f.trys.push([1, 6, 7, 8]);
1343
- actions_5 = __values(actions), actions_5_1 = actions_5.next();
1502
+ actions_9 = __values(actions), actions_9_1 = actions_9.next();
1344
1503
  _f.label = 2;
1345
1504
  case 2:
1346
- if (!!actions_5_1.done) return [3 /*break*/, 5];
1347
- action = actions_5_1.value;
1505
+ if (!!actions_9_1.done) return [3 /*break*/, 5];
1506
+ action = actions_9_1.value;
1348
1507
  conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
1349
1508
  if (!conditionSuccess) return [3 /*break*/, 4];
1350
- actions_6 = new kwikidToolkit.Action(action, rulesMapping, this._object, this._takeAction);
1351
- return [4 /*yield*/, actions_6.execute()];
1509
+ actions_10 = new kwikidToolkit.Action(action, rulesMapping, this._object, this._takeAction);
1510
+ return [4 /*yield*/, actions_10.execute()];
1352
1511
  case 3:
1353
1512
  _f.sent();
1354
1513
  _f.label = 4;
1355
1514
  case 4:
1356
- actions_5_1 = actions_5.next();
1515
+ actions_9_1 = actions_9.next();
1357
1516
  return [3 /*break*/, 2];
1358
1517
  case 5: return [3 /*break*/, 8];
1359
1518
  case 6:
1360
- e_5_1 = _f.sent();
1361
- e_5 = { error: e_5_1 };
1519
+ e_9_1 = _f.sent();
1520
+ e_9 = { error: e_9_1 };
1362
1521
  return [3 /*break*/, 8];
1363
1522
  case 7:
1364
1523
  try {
1365
- if (actions_5_1 && !actions_5_1.done && (_e = actions_5.return)) _e.call(actions_5);
1524
+ if (actions_9_1 && !actions_9_1.done && (_e = actions_9.return)) _e.call(actions_9);
1366
1525
  }
1367
- finally { if (e_5) throw e_5.error; }
1526
+ finally { if (e_9) throw e_9.error; }
1368
1527
  return [7 /*endfinally*/];
1369
1528
  case 8: return [2 /*return*/, this._object.FIELD_CONFIG];
1370
1529
  }
@@ -1379,6 +1538,12 @@
1379
1538
  __decorate([
1380
1539
  kwikidToolkit.logMethod
1381
1540
  ], Apis.prototype, "validateRequestBody", null);
1541
+ __decorate([
1542
+ kwikidToolkit.logMethod
1543
+ ], Apis.prototype, "setRequestHeaders", null);
1544
+ __decorate([
1545
+ kwikidToolkit.logMethod
1546
+ ], Apis.prototype, "validateRequestHeaders", null);
1382
1547
  __decorate([
1383
1548
  kwikidToolkit.logMethod
1384
1549
  ], Apis.prototype, "validateResponse", null);
@@ -1434,8 +1599,8 @@
1434
1599
  KwikIDFormViewComponent.prototype.ngOnInit = function () {
1435
1600
  var _this = this;
1436
1601
  (function () { return __awaiter(_this, void 0, void 0, function () {
1437
- return __generator(this, function (_a) {
1438
- switch (_a.label) {
1602
+ return __generator(this, function (_b) {
1603
+ switch (_b.label) {
1439
1604
  case 0:
1440
1605
  this.formsList = this.formsList.filter(function (form) {
1441
1606
  if (kwikidToolkit.checkObjectKeyExists(form, "hidden")) {
@@ -1446,7 +1611,7 @@
1446
1611
  });
1447
1612
  return [4 /*yield*/, this.initFormConfig(this.formConfig)];
1448
1613
  case 1:
1449
- _a.sent();
1614
+ _b.sent();
1450
1615
  this.loading = false;
1451
1616
  return [2 /*return*/];
1452
1617
  }
@@ -1455,7 +1620,7 @@
1455
1620
  };
1456
1621
  KwikIDFormViewComponent.prototype.ngAfterViewInit = function () { };
1457
1622
  KwikIDFormViewComponent.prototype.ngOnChanges = function (changes) {
1458
- var _a, _b;
1623
+ var _b, _c;
1459
1624
  var _this = this;
1460
1625
  var verifyChange = function (key) {
1461
1626
  return kwikidToolkit.checkObjectKeyExists(changes, key) && !changes[key].firstChange;
@@ -1465,10 +1630,10 @@
1465
1630
  }
1466
1631
  if (verifyChange("apiCallResponse")) {
1467
1632
  this.apiCallResponse = changes.apiCallResponse.currentValue;
1468
- this.formData = Object.assign(Object.assign({}, this.formData), (_a = {}, _a[this.apiCallResponse.key] = this.apiCallResponse.response, _a));
1469
- this.formGroup.patchValue((_b = {},
1470
- _b[this.apiCallResponse.key] = this.apiCallResponse.response,
1471
- _b), { emitEvent: false });
1633
+ this.formData = Object.assign(Object.assign({}, this.formData), (_b = {}, _b[this.apiCallResponse.key] = this.apiCallResponse.response, _b));
1634
+ this.formGroup.patchValue((_c = {},
1635
+ _c[this.apiCallResponse.key] = this.apiCallResponse.response,
1636
+ _c), { emitEvent: false });
1472
1637
  var field_1 = getFormFieldByKey(this.formFields, this.apiCallResponse.key);
1473
1638
  var apis_1 = new Apis({
1474
1639
  FIELD_CONFIG: field_1,
@@ -1478,11 +1643,11 @@
1478
1643
  ALL_FORMS_DATA: this.allFormsData
1479
1644
  }, this.takeAction.bind(this));
1480
1645
  (function () { return __awaiter(_this, void 0, void 0, function () {
1481
- return __generator(this, function (_a) {
1482
- switch (_a.label) {
1646
+ return __generator(this, function (_b) {
1647
+ switch (_b.label) {
1483
1648
  case 0: return [4 /*yield*/, apis_1.validateResponse()];
1484
1649
  case 1:
1485
- field_1 = _a.sent();
1650
+ field_1 = _b.sent();
1486
1651
  return [2 /*return*/];
1487
1652
  }
1488
1653
  });
@@ -1506,11 +1671,11 @@
1506
1671
  if (verifyChange("formConfig")) {
1507
1672
  this.formConfig = changes.formConfig.currentValue;
1508
1673
  (function () { return __awaiter(_this, void 0, void 0, function () {
1509
- return __generator(this, function (_a) {
1510
- switch (_a.label) {
1674
+ return __generator(this, function (_b) {
1675
+ switch (_b.label) {
1511
1676
  case 0: return [4 /*yield*/, this.initFormConfig(this.formConfig)];
1512
1677
  case 1:
1513
- _a.sent();
1678
+ _b.sent();
1514
1679
  return [2 /*return*/];
1515
1680
  }
1516
1681
  });
@@ -1519,55 +1684,55 @@
1519
1684
  };
1520
1685
  KwikIDFormViewComponent.prototype.initFormConfig = function (formConfig) {
1521
1686
  return __awaiter(this, void 0, void 0, function () {
1522
- var _a, _loop_1, this_1, _b, _c, field, _d, _e, field, validations, e_1_1;
1523
- var e_2, _f, e_1, _g;
1687
+ var _b, _loop_1, this_1, _c, _d, field, _e, _f, field, validations, e_1_1;
1688
+ var e_2, _g, e_1, _h;
1524
1689
  var _this = this;
1525
- return __generator(this, function (_h) {
1526
- switch (_h.label) {
1690
+ return __generator(this, function (_j) {
1691
+ switch (_j.label) {
1527
1692
  case 0:
1528
1693
  this.setFormFieldsFromFormConfig(formConfig);
1529
1694
  this.setFormFieldGroupsFromFormConfig(formConfig);
1530
1695
  this.setFormDataFromAllFormsData();
1531
- _a = this;
1696
+ _b = this;
1532
1697
  return [4 /*yield*/, this.formViewService.createFormGroup(this.formFields, this.formData, this.previousFormData, this.allFormsData, this.takeAction.bind(this))];
1533
1698
  case 1:
1534
- _a.formGroup = _h.sent();
1699
+ _b.formGroup = _j.sent();
1535
1700
  _loop_1 = function (field) {
1536
- var _j;
1701
+ var _k;
1537
1702
  if (field.isFormElement) {
1538
- this_1.previousFormData = Object.assign(Object.assign({}, this_1.previousFormData), (_j = {}, _j[field.key] = this_1.formGroup.controls[field.key].value, _j));
1703
+ this_1.previousFormData = Object.assign(Object.assign({}, this_1.previousFormData), (_k = {}, _k[field.key] = this_1.formGroup.controls[field.key].value, _k));
1539
1704
  this_1.formGroup.controls[field.key].valueChanges
1540
1705
  .pipe(operators.pairwise())
1541
- .subscribe(function (_a) {
1542
- var _b, _c;
1543
- var _d = __read(_a, 2), previousValue = _d[0], currentValue = _d[1];
1544
- _this.previousFormData = Object.assign(Object.assign({}, _this.previousFormData), (_b = {}, _b[field.key] = convertFormFieldValueToStandardFormat(field, previousValue), _b));
1545
- _this.formData = Object.assign(Object.assign({}, _this.formData), (_c = {}, _c[field.key] = convertFormFieldValueToStandardFormat(field, currentValue), _c));
1706
+ .subscribe(function (_b) {
1707
+ var _c, _d;
1708
+ var _e = __read(_b, 2), previousValue = _e[0], currentValue = _e[1];
1709
+ _this.previousFormData = Object.assign(Object.assign({}, _this.previousFormData), (_c = {}, _c[field.key] = convertFormFieldValueToStandardFormat(field, previousValue), _c));
1710
+ _this.formData = Object.assign(Object.assign({}, _this.formData), (_d = {}, _d[field.key] = convertFormFieldValueToStandardFormat(field, currentValue), _d));
1546
1711
  });
1547
1712
  }
1548
1713
  };
1549
1714
  this_1 = this;
1550
1715
  try {
1551
- for (_b = __values(this.formFields), _c = _b.next(); !_c.done; _c = _b.next()) {
1552
- field = _c.value;
1716
+ for (_c = __values(this.formFields), _d = _c.next(); !_d.done; _d = _c.next()) {
1717
+ field = _d.value;
1553
1718
  _loop_1(field);
1554
1719
  }
1555
1720
  }
1556
1721
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
1557
1722
  finally {
1558
1723
  try {
1559
- if (_c && !_c.done && (_f = _b.return)) _f.call(_b);
1724
+ if (_d && !_d.done && (_g = _c.return)) _g.call(_c);
1560
1725
  }
1561
1726
  finally { if (e_2) throw e_2.error; }
1562
1727
  }
1563
- _h.label = 2;
1728
+ _j.label = 2;
1564
1729
  case 2:
1565
- _h.trys.push([2, 8, 9, 10]);
1566
- _d = __values(this.formFields), _e = _d.next();
1567
- _h.label = 3;
1730
+ _j.trys.push([2, 8, 9, 10]);
1731
+ _e = __values(this.formFields), _f = _e.next();
1732
+ _j.label = 3;
1568
1733
  case 3:
1569
- if (!!_e.done) return [3 /*break*/, 7];
1570
- field = _e.value;
1734
+ if (!!_f.done) return [3 /*break*/, 7];
1735
+ field = _f.value;
1571
1736
  if (!field.isFormElement) return [3 /*break*/, 6];
1572
1737
  if (!field.validation.triggers.includes("ON_INIT")) return [3 /*break*/, 5];
1573
1738
  validations = new kwikidToolkit.Validation({
@@ -1579,8 +1744,8 @@
1579
1744
  }, this.takeAction.bind(this));
1580
1745
  return [4 /*yield*/, validations.validate(field.validation)];
1581
1746
  case 4:
1582
- _h.sent();
1583
- _h.label = 5;
1747
+ _j.sent();
1748
+ _j.label = 5;
1584
1749
  case 5:
1585
1750
  if (kwikidToolkit.checkObjectKeyExists(field, "connectedElements")) {
1586
1751
  this.handleConnectedElements({
@@ -1588,18 +1753,18 @@
1588
1753
  value: this.formGroup.controls[field.key].value
1589
1754
  }, "ON_INIT");
1590
1755
  }
1591
- _h.label = 6;
1756
+ _j.label = 6;
1592
1757
  case 6:
1593
- _e = _d.next();
1758
+ _f = _e.next();
1594
1759
  return [3 /*break*/, 3];
1595
1760
  case 7: return [3 /*break*/, 10];
1596
1761
  case 8:
1597
- e_1_1 = _h.sent();
1762
+ e_1_1 = _j.sent();
1598
1763
  e_1 = { error: e_1_1 };
1599
1764
  return [3 /*break*/, 10];
1600
1765
  case 9:
1601
1766
  try {
1602
- if (_e && !_e.done && (_g = _d.return)) _g.call(_d);
1767
+ if (_f && !_f.done && (_h = _e.return)) _h.call(_e);
1603
1768
  }
1604
1769
  finally { if (e_1) throw e_1.error; }
1605
1770
  return [7 /*endfinally*/];
@@ -1630,10 +1795,10 @@
1630
1795
  };
1631
1796
  KwikIDFormViewComponent.prototype.handleConnectedElementFieldGroupActions = function (childFieldGroupConfig, parentField) {
1632
1797
  return __awaiter(this, void 0, void 0, function () {
1633
- var rulesMapping, _a, _b, action, conditionSuccess, actions, e_3_1;
1634
- var e_3, _c;
1635
- return __generator(this, function (_d) {
1636
- switch (_d.label) {
1798
+ var rulesMapping, _b, _c, action, conditionSuccess, actions, e_3_1;
1799
+ var e_3, _d;
1800
+ return __generator(this, function (_e) {
1801
+ switch (_e.label) {
1637
1802
  case 0:
1638
1803
  if (!kwikidToolkit.checkObjectKeyExists(childFieldGroupConfig, "rules")) return [3 /*break*/, 8];
1639
1804
  rulesMapping = new kwikidToolkit.Rule(childFieldGroupConfig.rules, {
@@ -1642,14 +1807,14 @@
1642
1807
  PREVIOUS_FORM_DATA: this.previousFormData,
1643
1808
  ALL_FORMS_DATA: this.allFormsData
1644
1809
  }).mapping();
1645
- _d.label = 1;
1810
+ _e.label = 1;
1646
1811
  case 1:
1647
- _d.trys.push([1, 6, 7, 8]);
1648
- _a = __values(childFieldGroupConfig.actions), _b = _a.next();
1649
- _d.label = 2;
1812
+ _e.trys.push([1, 6, 7, 8]);
1813
+ _b = __values(childFieldGroupConfig.actions), _c = _b.next();
1814
+ _e.label = 2;
1650
1815
  case 2:
1651
- if (!!_b.done) return [3 /*break*/, 5];
1652
- action = _b.value;
1816
+ if (!!_c.done) return [3 /*break*/, 5];
1817
+ action = _c.value;
1653
1818
  conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
1654
1819
  if (!conditionSuccess) return [3 /*break*/, 4];
1655
1820
  actions = new kwikidToolkit.Action(action, rulesMapping, {
@@ -1661,19 +1826,19 @@
1661
1826
  }, this.takeActionOnFieldGroup.bind(this));
1662
1827
  return [4 /*yield*/, actions.execute()];
1663
1828
  case 3:
1664
- _d.sent();
1665
- _d.label = 4;
1829
+ _e.sent();
1830
+ _e.label = 4;
1666
1831
  case 4:
1667
- _b = _a.next();
1832
+ _c = _b.next();
1668
1833
  return [3 /*break*/, 2];
1669
1834
  case 5: return [3 /*break*/, 8];
1670
1835
  case 6:
1671
- e_3_1 = _d.sent();
1836
+ e_3_1 = _e.sent();
1672
1837
  e_3 = { error: e_3_1 };
1673
1838
  return [3 /*break*/, 8];
1674
1839
  case 7:
1675
1840
  try {
1676
- if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
1841
+ if (_c && !_c.done && (_d = _b.return)) _d.call(_b);
1677
1842
  }
1678
1843
  finally { if (e_3) throw e_3.error; }
1679
1844
  return [7 /*endfinally*/];
@@ -1684,15 +1849,15 @@
1684
1849
  };
1685
1850
  KwikIDFormViewComponent.prototype.handleConnectedElementFieldGroup = function (currentField, connectedFieldGroupConfig, eventType) {
1686
1851
  return __awaiter(this, void 0, void 0, function () {
1687
- return __generator(this, function (_a) {
1688
- switch (_a.label) {
1852
+ return __generator(this, function (_b) {
1853
+ switch (_b.label) {
1689
1854
  case 0:
1690
1855
  if (!kwikidToolkit.checkObjectKeyExists(connectedFieldGroupConfig, "triggers")) return [3 /*break*/, 2];
1691
1856
  if (!connectedFieldGroupConfig.triggers.includes(eventType)) return [3 /*break*/, 2];
1692
1857
  return [4 /*yield*/, this.handleConnectedElementFieldGroupActions(connectedFieldGroupConfig, currentField)];
1693
1858
  case 1:
1694
- _a.sent();
1695
- _a.label = 2;
1859
+ _b.sent();
1860
+ _b.label = 2;
1696
1861
  case 2: return [2 /*return*/];
1697
1862
  }
1698
1863
  });
@@ -1700,10 +1865,10 @@
1700
1865
  };
1701
1866
  KwikIDFormViewComponent.prototype.handleConnectedElementFieldActions = function (connectedFieldConfig, connectedField) {
1702
1867
  return __awaiter(this, void 0, void 0, function () {
1703
- var rulesMapping, _a, _b, action, conditionSuccess, actions, e_4_1;
1704
- var e_4, _c;
1705
- return __generator(this, function (_d) {
1706
- switch (_d.label) {
1868
+ var rulesMapping, _b, _c, action, conditionSuccess, actions, e_4_1;
1869
+ var e_4, _d;
1870
+ return __generator(this, function (_e) {
1871
+ switch (_e.label) {
1707
1872
  case 0:
1708
1873
  if (!kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "rules")) return [3 /*break*/, 8];
1709
1874
  rulesMapping = new kwikidToolkit.Rule(connectedFieldConfig.rules, {
@@ -1712,14 +1877,14 @@
1712
1877
  PREVIOUS_FORM_DATA: this.previousFormData,
1713
1878
  ALL_FORMS_DATA: this.allFormsData
1714
1879
  }).mapping();
1715
- _d.label = 1;
1880
+ _e.label = 1;
1716
1881
  case 1:
1717
- _d.trys.push([1, 6, 7, 8]);
1718
- _a = __values(connectedFieldConfig.actions), _b = _a.next();
1719
- _d.label = 2;
1882
+ _e.trys.push([1, 6, 7, 8]);
1883
+ _b = __values(connectedFieldConfig.actions), _c = _b.next();
1884
+ _e.label = 2;
1720
1885
  case 2:
1721
- if (!!_b.done) return [3 /*break*/, 5];
1722
- action = _b.value;
1886
+ if (!!_c.done) return [3 /*break*/, 5];
1887
+ action = _c.value;
1723
1888
  conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
1724
1889
  if (!conditionSuccess) return [3 /*break*/, 4];
1725
1890
  actions = new kwikidToolkit.Action(action, rulesMapping, {
@@ -1731,19 +1896,19 @@
1731
1896
  }, this.takeAction.bind(this));
1732
1897
  return [4 /*yield*/, actions.execute()];
1733
1898
  case 3:
1734
- _d.sent();
1735
- _d.label = 4;
1899
+ _e.sent();
1900
+ _e.label = 4;
1736
1901
  case 4:
1737
- _b = _a.next();
1902
+ _c = _b.next();
1738
1903
  return [3 /*break*/, 2];
1739
1904
  case 5: return [3 /*break*/, 8];
1740
1905
  case 6:
1741
- e_4_1 = _d.sent();
1906
+ e_4_1 = _e.sent();
1742
1907
  e_4 = { error: e_4_1 };
1743
1908
  return [3 /*break*/, 8];
1744
1909
  case 7:
1745
1910
  try {
1746
- if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
1911
+ if (_c && !_c.done && (_d = _b.return)) _d.call(_b);
1747
1912
  }
1748
1913
  finally { if (e_4) throw e_4.error; }
1749
1914
  return [7 /*endfinally*/];
@@ -1755,16 +1920,16 @@
1755
1920
  KwikIDFormViewComponent.prototype.handleConnectedElementFields = function (currentField, connectedFieldConfig, eventType, nested) {
1756
1921
  return __awaiter(this, void 0, void 0, function () {
1757
1922
  var connectedField;
1758
- return __generator(this, function (_a) {
1759
- switch (_a.label) {
1923
+ return __generator(this, function (_b) {
1924
+ switch (_b.label) {
1760
1925
  case 0:
1761
1926
  connectedField = getFormFieldByKey(this.formFields, connectedFieldConfig["key"]);
1762
1927
  if (!kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "triggers")) return [3 /*break*/, 2];
1763
1928
  if (!connectedFieldConfig.triggers.includes(eventType)) return [3 /*break*/, 2];
1764
1929
  return [4 /*yield*/, this.handleConnectedElementFieldActions(connectedFieldConfig, connectedField)];
1765
1930
  case 1:
1766
- connectedField = _a.sent();
1767
- _a.label = 2;
1931
+ connectedField = _b.sent();
1932
+ _b.label = 2;
1768
1933
  case 2:
1769
1934
  if (kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "handleNestedFields")) {
1770
1935
  if (connectedFieldConfig.handleNestedFields) {
@@ -1779,67 +1944,67 @@
1779
1944
  KwikIDFormViewComponent.prototype.handleConnectedElements = function (e, eventType) {
1780
1945
  return __awaiter(this, void 0, void 0, function () {
1781
1946
  var currentField, connectedFieldGroups, connectedFieldGroups_1, connectedFieldGroups_1_1, connectedFieldGroupConfig, e_5_1, connectedFields, connectedFields_1, connectedFields_1_1, connectedFieldConfig, e_6_1;
1782
- var e_5, _a, e_6, _b;
1783
- return __generator(this, function (_c) {
1784
- switch (_c.label) {
1947
+ var e_5, _b, e_6, _c;
1948
+ return __generator(this, function (_d) {
1949
+ switch (_d.label) {
1785
1950
  case 0:
1786
1951
  currentField = getFormFieldByKey(this.formFields, e.key);
1787
1952
  if (!(currentField !== undefined)) return [3 /*break*/, 17];
1788
1953
  if (!kwikidToolkit.checkObjectKeyExists(currentField, "connectedElements")) return [3 /*break*/, 16];
1789
1954
  if (!kwikidToolkit.checkObjectKeyExists(currentField.connectedElements, "connectedFieldGroups")) return [3 /*break*/, 8];
1790
1955
  connectedFieldGroups = currentField.connectedElements.connectedFieldGroups;
1791
- _c.label = 1;
1956
+ _d.label = 1;
1792
1957
  case 1:
1793
- _c.trys.push([1, 6, 7, 8]);
1958
+ _d.trys.push([1, 6, 7, 8]);
1794
1959
  connectedFieldGroups_1 = __values(connectedFieldGroups), connectedFieldGroups_1_1 = connectedFieldGroups_1.next();
1795
- _c.label = 2;
1960
+ _d.label = 2;
1796
1961
  case 2:
1797
1962
  if (!!connectedFieldGroups_1_1.done) return [3 /*break*/, 5];
1798
1963
  connectedFieldGroupConfig = connectedFieldGroups_1_1.value;
1799
1964
  return [4 /*yield*/, this.handleConnectedElementFieldGroup(currentField, connectedFieldGroupConfig, eventType)];
1800
1965
  case 3:
1801
- _c.sent();
1802
- _c.label = 4;
1966
+ _d.sent();
1967
+ _d.label = 4;
1803
1968
  case 4:
1804
1969
  connectedFieldGroups_1_1 = connectedFieldGroups_1.next();
1805
1970
  return [3 /*break*/, 2];
1806
1971
  case 5: return [3 /*break*/, 8];
1807
1972
  case 6:
1808
- e_5_1 = _c.sent();
1973
+ e_5_1 = _d.sent();
1809
1974
  e_5 = { error: e_5_1 };
1810
1975
  return [3 /*break*/, 8];
1811
1976
  case 7:
1812
1977
  try {
1813
- if (connectedFieldGroups_1_1 && !connectedFieldGroups_1_1.done && (_a = connectedFieldGroups_1.return)) _a.call(connectedFieldGroups_1);
1978
+ if (connectedFieldGroups_1_1 && !connectedFieldGroups_1_1.done && (_b = connectedFieldGroups_1.return)) _b.call(connectedFieldGroups_1);
1814
1979
  }
1815
1980
  finally { if (e_5) throw e_5.error; }
1816
1981
  return [7 /*endfinally*/];
1817
1982
  case 8:
1818
1983
  if (!kwikidToolkit.checkObjectKeyExists(currentField.connectedElements, "connectedFields")) return [3 /*break*/, 16];
1819
1984
  connectedFields = currentField.connectedElements.connectedFields;
1820
- _c.label = 9;
1985
+ _d.label = 9;
1821
1986
  case 9:
1822
- _c.trys.push([9, 14, 15, 16]);
1987
+ _d.trys.push([9, 14, 15, 16]);
1823
1988
  connectedFields_1 = __values(connectedFields), connectedFields_1_1 = connectedFields_1.next();
1824
- _c.label = 10;
1989
+ _d.label = 10;
1825
1990
  case 10:
1826
1991
  if (!!connectedFields_1_1.done) return [3 /*break*/, 13];
1827
1992
  connectedFieldConfig = connectedFields_1_1.value;
1828
1993
  return [4 /*yield*/, this.handleConnectedElementFields(currentField, connectedFieldConfig, eventType, eventType)];
1829
1994
  case 11:
1830
- currentField = _c.sent();
1831
- _c.label = 12;
1995
+ currentField = _d.sent();
1996
+ _d.label = 12;
1832
1997
  case 12:
1833
1998
  connectedFields_1_1 = connectedFields_1.next();
1834
1999
  return [3 /*break*/, 10];
1835
2000
  case 13: return [3 /*break*/, 16];
1836
2001
  case 14:
1837
- e_6_1 = _c.sent();
2002
+ e_6_1 = _d.sent();
1838
2003
  e_6 = { error: e_6_1 };
1839
2004
  return [3 /*break*/, 16];
1840
2005
  case 15:
1841
2006
  try {
1842
- if (connectedFields_1_1 && !connectedFields_1_1.done && (_b = connectedFields_1.return)) _b.call(connectedFields_1);
2007
+ if (connectedFields_1_1 && !connectedFields_1_1.done && (_c = connectedFields_1.return)) _c.call(connectedFields_1);
1843
2008
  }
1844
2009
  finally { if (e_6) throw e_6.error; }
1845
2010
  return [7 /*endfinally*/];
@@ -1852,11 +2017,11 @@
1852
2017
  };
1853
2018
  // DOM Event Handlers
1854
2019
  KwikIDFormViewComponent.prototype.handleGetKeyValue = function (e) {
1855
- var _a;
2020
+ var _b;
1856
2021
  var _this = this;
1857
- this.formGroup.patchValue((_a = {},
1858
- _a[e.key] = e.value,
1859
- _a), { emitEvent: false });
2022
+ this.formGroup.patchValue((_b = {},
2023
+ _b[e.key] = e.value,
2024
+ _b), { emitEvent: false });
1860
2025
  var field = getFormFieldByKey(this.formFields, e.key);
1861
2026
  this.formData[e.key] = convertFormFieldValueToStandardFormat(field, e.value);
1862
2027
  if (field.isFormElement &&
@@ -1869,11 +2034,11 @@
1869
2034
  ALL_FORMS_DATA: this.allFormsData
1870
2035
  }, this.takeAction.bind(this));
1871
2036
  (function () { return __awaiter(_this, void 0, void 0, function () {
1872
- return __generator(this, function (_a) {
1873
- switch (_a.label) {
2037
+ return __generator(this, function (_b) {
2038
+ switch (_b.label) {
1874
2039
  case 0: return [4 /*yield*/, validations_1.validate(field.validation)];
1875
2040
  case 1:
1876
- _a.sent();
2041
+ _b.sent();
1877
2042
  return [2 /*return*/];
1878
2043
  }
1879
2044
  });
@@ -1889,25 +2054,25 @@
1889
2054
  };
1890
2055
  KwikIDFormViewComponent.prototype.handleOnClickResetFormFields = function (e, field) {
1891
2056
  return __awaiter(this, void 0, void 0, function () {
1892
- var _a, _b, f, _c, _d, action, resetField, actions, e_7_1, e_8_1;
1893
- var e_8, _e, e_7, _f;
1894
- return __generator(this, function (_g) {
1895
- switch (_g.label) {
2057
+ var _b, _c, f, _d, _e, action, resetField, actions, e_7_1, e_8_1;
2058
+ var e_8, _f, e_7, _g;
2059
+ return __generator(this, function (_h) {
2060
+ switch (_h.label) {
1896
2061
  case 0:
1897
- _g.trys.push([0, 11, 12, 13]);
1898
- _a = __values(field.reset.fields), _b = _a.next();
1899
- _g.label = 1;
2062
+ _h.trys.push([0, 11, 12, 13]);
2063
+ _b = __values(field.reset.fields), _c = _b.next();
2064
+ _h.label = 1;
1900
2065
  case 1:
1901
- if (!!_b.done) return [3 /*break*/, 10];
1902
- f = _b.value;
1903
- _g.label = 2;
2066
+ if (!!_c.done) return [3 /*break*/, 10];
2067
+ f = _c.value;
2068
+ _h.label = 2;
1904
2069
  case 2:
1905
- _g.trys.push([2, 7, 8, 9]);
1906
- _c = (e_7 = void 0, __values(f.actions)), _d = _c.next();
1907
- _g.label = 3;
2070
+ _h.trys.push([2, 7, 8, 9]);
2071
+ _d = (e_7 = void 0, __values(f.actions)), _e = _d.next();
2072
+ _h.label = 3;
1908
2073
  case 3:
1909
- if (!!_d.done) return [3 /*break*/, 6];
1910
- action = _d.value;
2074
+ if (!!_e.done) return [3 /*break*/, 6];
2075
+ action = _e.value;
1911
2076
  resetField = getFormFieldByKey(this.formFields, action.props.fieldKey);
1912
2077
  actions = new kwikidToolkit.Action(action, {}, {
1913
2078
  FIELD_CONFIG: resetField,
@@ -1918,33 +2083,33 @@
1918
2083
  }, this.takeAction.bind(this));
1919
2084
  return [4 /*yield*/, actions.execute()];
1920
2085
  case 4:
1921
- _g.sent();
1922
- _g.label = 5;
2086
+ _h.sent();
2087
+ _h.label = 5;
1923
2088
  case 5:
1924
- _d = _c.next();
2089
+ _e = _d.next();
1925
2090
  return [3 /*break*/, 3];
1926
2091
  case 6: return [3 /*break*/, 9];
1927
2092
  case 7:
1928
- e_7_1 = _g.sent();
2093
+ e_7_1 = _h.sent();
1929
2094
  e_7 = { error: e_7_1 };
1930
2095
  return [3 /*break*/, 9];
1931
2096
  case 8:
1932
2097
  try {
1933
- if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
2098
+ if (_e && !_e.done && (_g = _d.return)) _g.call(_d);
1934
2099
  }
1935
2100
  finally { if (e_7) throw e_7.error; }
1936
2101
  return [7 /*endfinally*/];
1937
2102
  case 9:
1938
- _b = _a.next();
2103
+ _c = _b.next();
1939
2104
  return [3 /*break*/, 1];
1940
2105
  case 10: return [3 /*break*/, 13];
1941
2106
  case 11:
1942
- e_8_1 = _g.sent();
2107
+ e_8_1 = _h.sent();
1943
2108
  e_8 = { error: e_8_1 };
1944
2109
  return [3 /*break*/, 13];
1945
2110
  case 12:
1946
2111
  try {
1947
- if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
2112
+ if (_c && !_c.done && (_f = _b.return)) _f.call(_b);
1948
2113
  }
1949
2114
  finally { if (e_8) throw e_8.error; }
1950
2115
  return [7 /*endfinally*/];
@@ -1954,13 +2119,14 @@
1954
2119
  });
1955
2120
  };
1956
2121
  KwikIDFormViewComponent.prototype.handleOnClickApiCall = function (e) {
2122
+ var _a;
1957
2123
  return __awaiter(this, void 0, void 0, function () {
1958
2124
  var field, apis;
1959
- return __generator(this, function (_a) {
1960
- switch (_a.label) {
2125
+ return __generator(this, function (_b) {
2126
+ switch (_b.label) {
1961
2127
  case 0:
1962
2128
  field = getFormFieldByKey(this.formFields, e.key);
1963
- if (!(field.type === "api-call")) return [3 /*break*/, 3];
2129
+ if (!(field.type === "api-call")) return [3 /*break*/, 5];
1964
2130
  // set button status to loading
1965
2131
  field["api"]["status"]["value"] = EApiStatusType.LOADING;
1966
2132
  field["showLoader"] = true;
@@ -1975,12 +2141,18 @@
1975
2141
  PREVIOUS_FORM_DATA: this.previousFormData,
1976
2142
  ALL_FORMS_DATA: this.allFormsData
1977
2143
  }, this.takeAction.bind(this));
1978
- return [4 /*yield*/, apis.setRequestBody()];
2144
+ return [4 /*yield*/, apis.setRequestHeaders()];
1979
2145
  case 1:
1980
- field = _a.sent();
1981
- return [4 /*yield*/, apis.validateRequestBody()];
2146
+ field = _b.sent();
2147
+ return [4 /*yield*/, apis.validateRequestHeaders()];
1982
2148
  case 2:
1983
- field = _a.sent();
2149
+ field = _b.sent();
2150
+ return [4 /*yield*/, apis.setRequestBody()];
2151
+ case 3:
2152
+ field = _b.sent();
2153
+ return [4 /*yield*/, apis.validateRequestBody()];
2154
+ case 4:
2155
+ field = _b.sent();
1984
2156
  if (field.api.request.body.validation.is_valid) {
1985
2157
  // Call API Here
1986
2158
  this.onClickApiCall.emit({
@@ -1988,7 +2160,7 @@
1988
2160
  request: {
1989
2161
  mode: "POST",
1990
2162
  body: field.api.request.body.value,
1991
- headers: {},
2163
+ headers: (_a = field.api.request.headers.value) !== null && _a !== void 0 ? _a : {},
1992
2164
  url: field.api.request.url
1993
2165
  }
1994
2166
  });
@@ -2006,8 +2178,8 @@
2006
2178
  this.viewFormsButton["showLoader"] = false;
2007
2179
  this.saveFormButton["disabled"] = false;
2008
2180
  this.saveFormButton["showLoader"] = false;
2009
- _a.label = 3;
2010
- case 3: return [2 /*return*/];
2181
+ _b.label = 5;
2182
+ case 5: return [2 /*return*/];
2011
2183
  }
2012
2184
  });
2013
2185
  });
@@ -2019,16 +2191,16 @@
2019
2191
  };
2020
2192
  KwikIDFormViewComponent.prototype.handleOnClickSaveForm = function (e) {
2021
2193
  return __awaiter(this, void 0, void 0, function () {
2022
- var formData, _a, _b, field, controls, firstFieldWithError, controls_1, controls_1_1, control, _c, _d, field, validations, e_9_1;
2023
- var e_10, _e, e_11, _f, e_9, _g;
2194
+ var formData, _b, _c, field, controls, firstFieldWithError, controls_1, controls_1_1, control, _d, _e, field, validations, e_9_1;
2195
+ var e_10, _f, e_11, _g, e_9, _h;
2024
2196
  var _this = this;
2025
- return __generator(this, function (_h) {
2026
- switch (_h.label) {
2197
+ return __generator(this, function (_j) {
2198
+ switch (_j.label) {
2027
2199
  case 0:
2028
2200
  formData = this.formGroup.getRawValue();
2029
2201
  try {
2030
- for (_a = __values(this.formFields), _b = _a.next(); !_b.done; _b = _a.next()) {
2031
- field = _b.value;
2202
+ for (_b = __values(this.formFields), _c = _b.next(); !_c.done; _c = _b.next()) {
2203
+ field = _c.value;
2032
2204
  if (field.isFormElement) {
2033
2205
  if (field.hidden) {
2034
2206
  delete formData[field.key];
@@ -2042,7 +2214,7 @@
2042
2214
  catch (e_10_1) { e_10 = { error: e_10_1 }; }
2043
2215
  finally {
2044
2216
  try {
2045
- if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
2217
+ if (_c && !_c.done && (_f = _b.return)) _f.call(_b);
2046
2218
  }
2047
2219
  finally { if (e_10) throw e_10.error; }
2048
2220
  }
@@ -2061,7 +2233,7 @@
2061
2233
  catch (e_11_1) { e_11 = { error: e_11_1 }; }
2062
2234
  finally {
2063
2235
  try {
2064
- if (controls_1_1 && !controls_1_1.done && (_f = controls_1.return)) _f.call(controls_1);
2236
+ if (controls_1_1 && !controls_1_1.done && (_g = controls_1.return)) _g.call(controls_1);
2065
2237
  }
2066
2238
  finally { if (e_11) throw e_11.error; }
2067
2239
  }
@@ -2071,14 +2243,14 @@
2071
2243
  }, 3000);
2072
2244
  return [2 /*return*/];
2073
2245
  }
2074
- _h.label = 1;
2246
+ _j.label = 1;
2075
2247
  case 1:
2076
- _h.trys.push([1, 6, 7, 8]);
2077
- _c = __values(this.formFields), _d = _c.next();
2078
- _h.label = 2;
2248
+ _j.trys.push([1, 6, 7, 8]);
2249
+ _d = __values(this.formFields), _e = _d.next();
2250
+ _j.label = 2;
2079
2251
  case 2:
2080
- if (!!_d.done) return [3 /*break*/, 5];
2081
- field = _d.value;
2252
+ if (!!_e.done) return [3 /*break*/, 5];
2253
+ field = _e.value;
2082
2254
  if (!(field.isFormElement &&
2083
2255
  field.validation.triggers.includes("ON_SAVE"))) return [3 /*break*/, 4];
2084
2256
  validations = new kwikidToolkit.Validation({
@@ -2090,7 +2262,7 @@
2090
2262
  }, this.takeAction.bind(this));
2091
2263
  return [4 /*yield*/, validations.validate(field.validation)];
2092
2264
  case 3:
2093
- _h.sent();
2265
+ _j.sent();
2094
2266
  if (!field.validation.is_valid) {
2095
2267
  this.toggleErrorNotification(true);
2096
2268
  setTimeout(function () {
@@ -2098,18 +2270,18 @@
2098
2270
  }, 3000);
2099
2271
  return [2 /*return*/];
2100
2272
  }
2101
- _h.label = 4;
2273
+ _j.label = 4;
2102
2274
  case 4:
2103
- _d = _c.next();
2275
+ _e = _d.next();
2104
2276
  return [3 /*break*/, 2];
2105
2277
  case 5: return [3 /*break*/, 8];
2106
2278
  case 6:
2107
- e_9_1 = _h.sent();
2279
+ e_9_1 = _j.sent();
2108
2280
  e_9 = { error: e_9_1 };
2109
2281
  return [3 /*break*/, 8];
2110
2282
  case 7:
2111
2283
  try {
2112
- if (_d && !_d.done && (_g = _c.return)) _g.call(_c);
2284
+ if (_e && !_e.done && (_h = _d.return)) _h.call(_d);
2113
2285
  }
2114
2286
  finally { if (e_9) throw e_9.error; }
2115
2287
  return [7 /*endfinally*/];
@@ -2138,17 +2310,17 @@
2138
2310
  this.formGroup.updateValueAndValidity();
2139
2311
  };
2140
2312
  KwikIDFormViewComponent.prototype.fieldGroupHide = function (fieldGroup) {
2141
- var e_12, _a;
2313
+ var e_12, _b;
2142
2314
  try {
2143
- for (var _b = __values(this.fieldGroups[fieldGroup]), _c = _b.next(); !_c.done; _c = _b.next()) {
2144
- var fieldKey = _c.value;
2315
+ for (var _c = __values(this.fieldGroups[fieldGroup]), _d = _c.next(); !_d.done; _d = _c.next()) {
2316
+ var fieldKey = _d.value;
2145
2317
  this.fieldHide(fieldKey);
2146
2318
  }
2147
2319
  }
2148
2320
  catch (e_12_1) { e_12 = { error: e_12_1 }; }
2149
2321
  finally {
2150
2322
  try {
2151
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
2323
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2152
2324
  }
2153
2325
  finally { if (e_12) throw e_12.error; }
2154
2326
  }
@@ -2162,17 +2334,17 @@
2162
2334
  this.formGroup.updateValueAndValidity();
2163
2335
  };
2164
2336
  KwikIDFormViewComponent.prototype.fieldGroupShow = function (fieldGroup) {
2165
- var e_13, _a;
2337
+ var e_13, _b;
2166
2338
  try {
2167
- for (var _b = __values(this.fieldGroups[fieldGroup]), _c = _b.next(); !_c.done; _c = _b.next()) {
2168
- var fieldKey = _c.value;
2339
+ for (var _c = __values(this.fieldGroups[fieldGroup]), _d = _c.next(); !_d.done; _d = _c.next()) {
2340
+ var fieldKey = _d.value;
2169
2341
  this.fieldShow(fieldKey);
2170
2342
  }
2171
2343
  }
2172
2344
  catch (e_13_1) { e_13 = { error: e_13_1 }; }
2173
2345
  finally {
2174
2346
  try {
2175
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
2347
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2176
2348
  }
2177
2349
  finally { if (e_13) throw e_13.error; }
2178
2350
  }
@@ -2193,17 +2365,17 @@
2193
2365
  }
2194
2366
  };
2195
2367
  KwikIDFormViewComponent.prototype.fieldGroupDisable = function (fieldGroup) {
2196
- var e_14, _a;
2368
+ var e_14, _b;
2197
2369
  try {
2198
- for (var _b = __values(this.fieldGroups[fieldGroup]), _c = _b.next(); !_c.done; _c = _b.next()) {
2199
- var fieldKey = _c.value;
2370
+ for (var _c = __values(this.fieldGroups[fieldGroup]), _d = _c.next(); !_d.done; _d = _c.next()) {
2371
+ var fieldKey = _d.value;
2200
2372
  this.fieldDisable(fieldKey);
2201
2373
  }
2202
2374
  }
2203
2375
  catch (e_14_1) { e_14 = { error: e_14_1 }; }
2204
2376
  finally {
2205
2377
  try {
2206
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
2378
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2207
2379
  }
2208
2380
  finally { if (e_14) throw e_14.error; }
2209
2381
  }
@@ -2224,17 +2396,17 @@
2224
2396
  }
2225
2397
  };
2226
2398
  KwikIDFormViewComponent.prototype.fieldGroupEnable = function (fieldGroup) {
2227
- var e_15, _a;
2399
+ var e_15, _b;
2228
2400
  try {
2229
- for (var _b = __values(this.fieldGroups[fieldGroup]), _c = _b.next(); !_c.done; _c = _b.next()) {
2230
- var fieldKey = _c.value;
2401
+ for (var _c = __values(this.fieldGroups[fieldGroup]), _d = _c.next(); !_d.done; _d = _c.next()) {
2402
+ var fieldKey = _d.value;
2231
2403
  this.fieldEnable(fieldKey);
2232
2404
  }
2233
2405
  }
2234
2406
  catch (e_15_1) { e_15 = { error: e_15_1 }; }
2235
2407
  finally {
2236
2408
  try {
2237
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
2409
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2238
2410
  }
2239
2411
  finally { if (e_15) throw e_15.error; }
2240
2412
  }
@@ -2312,10 +2484,10 @@
2312
2484
  };
2313
2485
  KwikIDFormViewComponent.prototype.setObjectValue = function (field, path, value) { };
2314
2486
  KwikIDFormViewComponent.prototype.patchFieldControlValue = function (key, value) {
2315
- var _a;
2316
- this.formGroup.patchValue((_a = {},
2317
- _a[key] = value,
2318
- _a), { emitEvent: false });
2487
+ var _b;
2488
+ this.formGroup.patchValue((_b = {},
2489
+ _b[key] = value,
2490
+ _b), { emitEvent: false });
2319
2491
  };
2320
2492
  KwikIDFormViewComponent.prototype.patchFormGroup = function (formData) {
2321
2493
  if (kwikidToolkit.isUndefined(this.formGroup) || kwikidToolkit.isUndefined(formData)) {
@@ -2336,7 +2508,7 @@
2336
2508
  };
2337
2509
  KwikIDFormViewComponent.prototype.takeActionOnFieldGroup = function (action, object) {
2338
2510
  return __awaiter(this, void 0, void 0, function () {
2339
- return __generator(this, function (_a) {
2511
+ return __generator(this, function (_b) {
2340
2512
  switch (action.key) {
2341
2513
  case EActionKey.FIELD_GROUP_HIDE:
2342
2514
  this.fieldGroupHide(action.props.groupKey);
@@ -2359,12 +2531,12 @@
2359
2531
  };
2360
2532
  KwikIDFormViewComponent.prototype.takeAction = function (action, object) {
2361
2533
  return __awaiter(this, void 0, void 0, function () {
2362
- var _a, setValue_Sources, sourceValue, setDropdownValue_Sources, dropdownValue, appendToPath, appendToPathStr, optionsPath;
2363
- return __generator(this, function (_b) {
2364
- switch (_b.label) {
2534
+ var _b, setValue_Sources, sourceValue, setDropdownValue_Sources, dropdownValue, appendToPath, appendToPathStr, optionsPath;
2535
+ return __generator(this, function (_c) {
2536
+ switch (_c.label) {
2365
2537
  case 0:
2366
- _a = action.key;
2367
- switch (_a) {
2538
+ _b = action.key;
2539
+ switch (_b) {
2368
2540
  case EActionKey.FIELD_HIDE: return [3 /*break*/, 1];
2369
2541
  case EActionKey.FIELD_SHOW: return [3 /*break*/, 2];
2370
2542
  case EActionKey.FIELD_DISABLE: return [3 /*break*/, 3];
@@ -2411,7 +2583,7 @@
2411
2583
  setValue_Sources = new kwikidToolkit.Source(object);
2412
2584
  return [4 /*yield*/, setValue_Sources.getValueFromSource(action.props.value.source)];
2413
2585
  case 11:
2414
- sourceValue = _b.sent();
2586
+ sourceValue = _c.sent();
2415
2587
  setValue_Sources.setValueToSource(action.props.value.destination, sourceValue);
2416
2588
  object.FIELD_CONFIG = setValue_Sources.object.FIELD_CONFIG;
2417
2589
  this.formData = setValue_Sources.object.FORM_DATA;
@@ -2423,12 +2595,12 @@
2423
2595
  setDropdownValue_Sources = new kwikidToolkit.Source(object);
2424
2596
  return [4 /*yield*/, setDropdownValue_Sources.getValueFromSource(action.props.value.source)];
2425
2597
  case 13:
2426
- dropdownValue = _b.sent();
2598
+ dropdownValue = _c.sent();
2427
2599
  if (!kwikidToolkit.checkObjectKeyExists(action.props, "options")) return [3 /*break*/, 16];
2428
2600
  if (!kwikidToolkit.checkObjectKeyExists(action.props.options, "appendToPath")) return [3 /*break*/, 15];
2429
2601
  return [4 /*yield*/, setDropdownValue_Sources.getValueFromSource(action.props.options.appendToPath.source)];
2430
2602
  case 14:
2431
- appendToPath = _b.sent();
2603
+ appendToPath = _c.sent();
2432
2604
  if (kwikidToolkit.isNotEmptyValue(appendToPath)) {
2433
2605
  appendToPathStr = kwikidToolkit.replaceString(appendToPath.match("" + action.props.options.appendToPath.filterSourceValue)[0], "[^a-zA-Z0-9_]", "_");
2434
2606
  optionsPath = "" + action.props.options.path + appendToPathStr;
@@ -2437,7 +2609,7 @@
2437
2609
  return [3 /*break*/, 16];
2438
2610
  case 15:
2439
2611
  dropdownValue = kwikidToolkit.getObjectValueFromPath(dropdownValue, action.props.options.path);
2440
- _b.label = 16;
2612
+ _c.label = 16;
2441
2613
  case 16:
2442
2614
  setDropdownValue_Sources.setValueToSource(action.props.value.destination, dropdownValue);
2443
2615
  object.FIELD_CONFIG = setDropdownValue_Sources.object.FIELD_CONFIG;