kwikid-forms 0.6.22 → 0.6.24

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.
@@ -935,6 +935,15 @@
935
935
  field.focus = error;
936
936
  return field;
937
937
  };
938
+ var appendHtmlMessage = function (field, message) {
939
+ if (kwikidToolkit.checkObjectKeyExists(field, "html")) {
940
+ if (kwikidToolkit.isNotEmptyValue(field.html)) {
941
+ var html = field.html.replace("{{message}}", message.message);
942
+ field.html = html;
943
+ }
944
+ }
945
+ return field;
946
+ };
938
947
  var appendFormFieldMessage = function (field, message) {
939
948
  var hasDuplicateMessage = function (messages, message) {
940
949
  return messages.some(function (fieldMessage) {
@@ -3010,6 +3019,7 @@
3010
3019
  EActionKey["REDIRECT_TO_URL"] = "REDIRECT_TO_URL";
3011
3020
  EActionKey["SAVE_FORM"] = "SAVE_FORM";
3012
3021
  EActionKey["ALERT_SHOW"] = "ALERT_SHOW";
3022
+ EActionKey["SET_HTML"] = "SET_HTML";
3013
3023
  })(EActionKey || (EActionKey = {}));
3014
3024
 
3015
3025
  var EApiStatusType;
@@ -4408,11 +4418,11 @@
4408
4418
  (function () { return __awaiter(_this, void 0, void 0, function () {
4409
4419
  var res;
4410
4420
  var _this = this;
4411
- return __generator(this, function (_k) {
4412
- switch (_k.label) {
4421
+ return __generator(this, function (_o) {
4422
+ switch (_o.label) {
4413
4423
  case 0: return [4 /*yield*/, this.initFormConfig(this.formConfig)];
4414
4424
  case 1:
4415
- res = _k.sent();
4425
+ res = _o.sent();
4416
4426
  if (res) {
4417
4427
  this.loading = false;
4418
4428
  this.cameraRecordingTimerSubcription = this.cameraRecordService
@@ -4435,7 +4445,7 @@
4435
4445
  };
4436
4446
  KwikIDFormViewComponent.prototype.ngAfterViewInit = function () { };
4437
4447
  KwikIDFormViewComponent.prototype.ngOnChanges = function (changes) {
4438
- var _k, _l, _m;
4448
+ var _o, _p, _q;
4439
4449
  var _this = this;
4440
4450
  var _a, _b, _c, _d;
4441
4451
  var verifyChange = function (key) {
@@ -4457,9 +4467,9 @@
4457
4467
  ? changes.popupFormCallback.currentValue.popupFormData["data"]
4458
4468
  : changes.popupFormCallback.currentValue.popupFormData;
4459
4469
  var popupFormConfig = changes.popupFormCallback.currentValue.popupFormConfig;
4460
- this.popupFormData = kwikidToolkit.mergeObjects(this.popupFormData, (_k = {},
4461
- _k[popupFormConfig.key] = popupFormData,
4462
- _k));
4470
+ this.popupFormData = kwikidToolkit.mergeObjects(this.popupFormData, (_o = {},
4471
+ _o[popupFormConfig.key] = popupFormData,
4472
+ _o));
4463
4473
  this.formData = kwikidToolkit.mergeObjects(this.formData, this.popupFormData);
4464
4474
  if (kwikidToolkit.checkObjectKeyExists(changes.popupFormCallback.currentValue, "stopTaskExecution")) {
4465
4475
  this.stopTaskExecution =
@@ -4500,9 +4510,9 @@
4500
4510
  emitEvent: false,
4501
4511
  onlySelf: false
4502
4512
  });
4503
- this.formGroup.patchValue((_l = {},
4504
- _l[field_1.key] = kwikidToolkit.getObjectDeepCopy([image]),
4505
- _l), { emitEvent: false });
4513
+ this.formGroup.patchValue((_p = {},
4514
+ _p[field_1.key] = kwikidToolkit.getObjectDeepCopy([image]),
4515
+ _p), { emitEvent: false });
4506
4516
  this.formGroup.controls[field_1.key].updateValueAndValidity({
4507
4517
  emitEvent: false
4508
4518
  });
@@ -4522,11 +4532,11 @@
4522
4532
  ALL_FORMS_DATA: this.allFormsData
4523
4533
  }, this.takeAction.bind(this));
4524
4534
  (function () { return __awaiter(_this, void 0, void 0, function () {
4525
- return __generator(this, function (_k) {
4526
- switch (_k.label) {
4535
+ return __generator(this, function (_o) {
4536
+ switch (_o.label) {
4527
4537
  case 0: return [4 /*yield*/, validations_1.validate(field_1.validation)];
4528
4538
  case 1:
4529
- _k.sent();
4539
+ _o.sent();
4530
4540
  return [2 /*return*/];
4531
4541
  }
4532
4542
  });
@@ -4555,9 +4565,9 @@
4555
4565
  emitEvent: false,
4556
4566
  onlySelf: false
4557
4567
  });
4558
- this.formGroup.patchValue((_m = {},
4559
- _m[field_1.key] = kwikidToolkit.getObjectDeepCopy([video]),
4560
- _m), { emitEvent: false });
4568
+ this.formGroup.patchValue((_q = {},
4569
+ _q[field_1.key] = kwikidToolkit.getObjectDeepCopy([video]),
4570
+ _q), { emitEvent: false });
4561
4571
  this.formGroup.controls[field_1.key].updateValueAndValidity({
4562
4572
  emitEvent: false
4563
4573
  });
@@ -4577,11 +4587,11 @@
4577
4587
  ALL_FORMS_DATA: this.allFormsData
4578
4588
  }, this.takeAction.bind(this));
4579
4589
  (function () { return __awaiter(_this, void 0, void 0, function () {
4580
- return __generator(this, function (_k) {
4581
- switch (_k.label) {
4590
+ return __generator(this, function (_o) {
4591
+ switch (_o.label) {
4582
4592
  case 0: return [4 /*yield*/, validations_2.validate(field_1.validation)];
4583
4593
  case 1:
4584
- _k.sent();
4594
+ _o.sent();
4585
4595
  return [2 /*return*/];
4586
4596
  }
4587
4597
  });
@@ -4633,11 +4643,11 @@
4633
4643
  ALL_FORMS_DATA: this.allFormsData
4634
4644
  }, this.takeAction.bind(this));
4635
4645
  (function () { return __awaiter(_this, void 0, void 0, function () {
4636
- return __generator(this, function (_k) {
4637
- switch (_k.label) {
4646
+ return __generator(this, function (_o) {
4647
+ switch (_o.label) {
4638
4648
  case 0: return [4 /*yield*/, validations_3.validate(field_2.validation)];
4639
4649
  case 1:
4640
- _k.sent();
4650
+ _o.sent();
4641
4651
  return [2 /*return*/];
4642
4652
  }
4643
4653
  });
@@ -4652,11 +4662,11 @@
4652
4662
  if (verifyChange("formConfig")) {
4653
4663
  this.formConfig = changes.formConfig.currentValue;
4654
4664
  (function () { return __awaiter(_this, void 0, void 0, function () {
4655
- return __generator(this, function (_k) {
4656
- switch (_k.label) {
4665
+ return __generator(this, function (_o) {
4666
+ switch (_o.label) {
4657
4667
  case 0: return [4 /*yield*/, this.initFormConfig(this.formConfig)];
4658
4668
  case 1:
4659
- _k.sent();
4669
+ _o.sent();
4660
4670
  return [2 /*return*/];
4661
4671
  }
4662
4672
  });
@@ -4673,11 +4683,11 @@
4673
4683
  };
4674
4684
  KwikIDFormViewComponent.prototype.initFormConfig = function (formConfig) {
4675
4685
  return __awaiter(this, void 0, void 0, function () {
4676
- var _k, _l, preTask, task, e_1_1, _m, _loop_1, this_1, _o, _p, field, _q, _r, field, validations, e_2_1;
4677
- var e_1, _s, e_3, _t, e_2, _u;
4686
+ var _o, _p, preTask, task, e_1_1, _q, _loop_1, this_1, _r, _s, field, _t, _u, field, validations, e_2_1;
4687
+ var e_1, _v, e_3, _w, e_2, _x;
4678
4688
  var _this = this;
4679
- return __generator(this, function (_v) {
4680
- switch (_v.label) {
4689
+ return __generator(this, function (_y) {
4690
+ switch (_y.label) {
4681
4691
  case 0:
4682
4692
  formConfig = new Converter().convertFormConfig(formConfig);
4683
4693
  formConfig = new Converter().updateFormConfigProperties(formConfig);
@@ -4686,14 +4696,14 @@
4686
4696
  this.setFormDataFromAllFormsData();
4687
4697
  if (!(kwikidToolkit.checkObjectKeyExists(this.formConfig, "tasks") &&
4688
4698
  kwikidToolkit.checkObjectKeyExists(this.formConfig.tasks, "pre"))) return [3 /*break*/, 10];
4689
- _v.label = 1;
4699
+ _y.label = 1;
4690
4700
  case 1:
4691
- _v.trys.push([1, 7, 8, 9]);
4692
- _k = __values(this.formConfig.tasks.pre), _l = _k.next();
4693
- _v.label = 2;
4701
+ _y.trys.push([1, 7, 8, 9]);
4702
+ _o = __values(this.formConfig.tasks.pre), _p = _o.next();
4703
+ _y.label = 2;
4694
4704
  case 2:
4695
- if (!!_l.done) return [3 /*break*/, 6];
4696
- preTask = _l.value;
4705
+ if (!!_p.done) return [3 /*break*/, 6];
4706
+ preTask = _p.value;
4697
4707
  task = new Tasks(preTask, {
4698
4708
  FORM_CONFIG: this.formConfig,
4699
4709
  FORM_FIELDS: this.formFields,
@@ -4711,7 +4721,7 @@
4711
4721
  }
4712
4722
  return [4 /*yield*/, task.execute()];
4713
4723
  case 3:
4714
- _v.sent();
4724
+ _y.sent();
4715
4725
  // Wait for ngOnChanges to be called before continuing to the next task
4716
4726
  return [4 /*yield*/, new Promise(function (resolve) {
4717
4727
  var intervalId = setInterval(function () {
@@ -4723,36 +4733,36 @@
4723
4733
  })];
4724
4734
  case 4:
4725
4735
  // Wait for ngOnChanges to be called before continuing to the next task
4726
- _v.sent();
4736
+ _y.sent();
4727
4737
  if (this.stopTaskExecution) {
4728
4738
  return [3 /*break*/, 6];
4729
4739
  }
4730
- _v.label = 5;
4740
+ _y.label = 5;
4731
4741
  case 5:
4732
- _l = _k.next();
4742
+ _p = _o.next();
4733
4743
  return [3 /*break*/, 2];
4734
4744
  case 6: return [3 /*break*/, 9];
4735
4745
  case 7:
4736
- e_1_1 = _v.sent();
4746
+ e_1_1 = _y.sent();
4737
4747
  e_1 = { error: e_1_1 };
4738
4748
  return [3 /*break*/, 9];
4739
4749
  case 8:
4740
4750
  try {
4741
- if (_l && !_l.done && (_s = _k.return)) _s.call(_k);
4751
+ if (_p && !_p.done && (_v = _o.return)) _v.call(_o);
4742
4752
  }
4743
4753
  finally { if (e_1) throw e_1.error; }
4744
4754
  return [7 /*endfinally*/];
4745
4755
  case 9:
4746
4756
  this.formData = kwikidToolkit.mergeObjects(this.formData, this.popupFormData);
4747
- _v.label = 10;
4757
+ _y.label = 10;
4748
4758
  case 10:
4749
4759
  if (this.stopTaskExecution) {
4750
4760
  return [2 /*return*/, false];
4751
4761
  }
4752
- _m = this;
4762
+ _q = this;
4753
4763
  return [4 /*yield*/, this.formViewService.createFormGroup(this.formFields, this.formData, this.previousFormData, this.allFormsData, this.takeAction.bind(this))];
4754
4764
  case 11:
4755
- _m.formGroup = _v.sent();
4765
+ _q.formGroup = _y.sent();
4756
4766
  /**
4757
4767
  * For some reason if their a field of type 'IMAGE' then
4758
4768
  * formData is adding a 'undefined' key with last image's value from the array.
@@ -4762,10 +4772,10 @@
4762
4772
  delete this.formData["undefined"];
4763
4773
  }
4764
4774
  _loop_1 = function (field) {
4765
- var _w, _x;
4775
+ var _z, _0;
4766
4776
  if (field.isFormElement) {
4767
- this_1.previousFormData = Object.assign(Object.assign({}, this_1.previousFormData), (_w = {}, _w[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _w));
4768
- this_1.formData = Object.assign(Object.assign({}, this_1.formData), (_x = {}, _x[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _x));
4777
+ this_1.previousFormData = Object.assign(Object.assign({}, this_1.previousFormData), (_z = {}, _z[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _z));
4778
+ this_1.formData = Object.assign(Object.assign({}, this_1.formData), (_0 = {}, _0[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _0));
4769
4779
  if (field.type === EFieldType.FILE) {
4770
4780
  this_1.files[field.key] = this_1.formGroup.controls[field.key].value;
4771
4781
  }
@@ -4779,11 +4789,11 @@
4779
4789
  }
4780
4790
  this_1.formGroup.controls[field.key].valueChanges
4781
4791
  .pipe(operators.pairwise())
4782
- .subscribe(function (_k) {
4783
- var _l, _m;
4784
- var _o = __read(_k, 2), previousValue = _o[0], currentValue = _o[1];
4785
- _this.previousFormData = Object.assign(Object.assign({}, _this.previousFormData), (_l = {}, _l[field.key] = convertFormFieldValueToStandardFormat(field, previousValue), _l));
4786
- _this.formData = Object.assign(Object.assign({}, _this.formData), (_m = {}, _m[field.key] = convertFormFieldValueToStandardFormat(field, currentValue), _m));
4792
+ .subscribe(function (_o) {
4793
+ var _p, _q;
4794
+ var _r = __read(_o, 2), previousValue = _r[0], currentValue = _r[1];
4795
+ _this.previousFormData = Object.assign(Object.assign({}, _this.previousFormData), (_p = {}, _p[field.key] = convertFormFieldValueToStandardFormat(field, previousValue), _p));
4796
+ _this.formData = Object.assign(Object.assign({}, _this.formData), (_q = {}, _q[field.key] = convertFormFieldValueToStandardFormat(field, currentValue), _q));
4787
4797
  if (field.type === EFieldType.FILE) {
4788
4798
  _this.files[field.key] = currentValue;
4789
4799
  }
@@ -4800,26 +4810,26 @@
4800
4810
  };
4801
4811
  this_1 = this;
4802
4812
  try {
4803
- for (_o = __values(this.formFields), _p = _o.next(); !_p.done; _p = _o.next()) {
4804
- field = _p.value;
4813
+ for (_r = __values(this.formFields), _s = _r.next(); !_s.done; _s = _r.next()) {
4814
+ field = _s.value;
4805
4815
  _loop_1(field);
4806
4816
  }
4807
4817
  }
4808
4818
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
4809
4819
  finally {
4810
4820
  try {
4811
- if (_p && !_p.done && (_t = _o.return)) _t.call(_o);
4821
+ if (_s && !_s.done && (_w = _r.return)) _w.call(_r);
4812
4822
  }
4813
4823
  finally { if (e_3) throw e_3.error; }
4814
4824
  }
4815
- _v.label = 12;
4825
+ _y.label = 12;
4816
4826
  case 12:
4817
- _v.trys.push([12, 18, 19, 20]);
4818
- _q = __values(this.formFields), _r = _q.next();
4819
- _v.label = 13;
4827
+ _y.trys.push([12, 18, 19, 20]);
4828
+ _t = __values(this.formFields), _u = _t.next();
4829
+ _y.label = 13;
4820
4830
  case 13:
4821
- if (!!_r.done) return [3 /*break*/, 17];
4822
- field = _r.value;
4831
+ if (!!_u.done) return [3 /*break*/, 17];
4832
+ field = _u.value;
4823
4833
  if (!field.isFormElement) return [3 /*break*/, 16];
4824
4834
  if (!kwikidToolkit.checkObjectKeyExists(field, "validation")) return [3 /*break*/, 15];
4825
4835
  if (!field.validation.triggers.includes("ON_INIT")) return [3 /*break*/, 15];
@@ -4833,8 +4843,8 @@
4833
4843
  }, this.takeAction.bind(this));
4834
4844
  return [4 /*yield*/, validations.validate(field.validation)];
4835
4845
  case 14:
4836
- _v.sent();
4837
- _v.label = 15;
4846
+ _y.sent();
4847
+ _y.label = 15;
4838
4848
  case 15:
4839
4849
  if (kwikidToolkit.checkObjectKeyExists(field, "connectedElements")) {
4840
4850
  this.handleConnectedElements({
@@ -4842,18 +4852,18 @@
4842
4852
  value: this.formGroup.controls[field.key].value
4843
4853
  }, "ON_INIT");
4844
4854
  }
4845
- _v.label = 16;
4855
+ _y.label = 16;
4846
4856
  case 16:
4847
- _r = _q.next();
4857
+ _u = _t.next();
4848
4858
  return [3 /*break*/, 13];
4849
4859
  case 17: return [3 /*break*/, 20];
4850
4860
  case 18:
4851
- e_2_1 = _v.sent();
4861
+ e_2_1 = _y.sent();
4852
4862
  e_2 = { error: e_2_1 };
4853
4863
  return [3 /*break*/, 20];
4854
4864
  case 19:
4855
4865
  try {
4856
- if (_r && !_r.done && (_u = _q.return)) _u.call(_q);
4866
+ if (_u && !_u.done && (_x = _t.return)) _x.call(_t);
4857
4867
  }
4858
4868
  finally { if (e_2) throw e_2.error; }
4859
4869
  return [7 /*endfinally*/];
@@ -4891,10 +4901,10 @@
4891
4901
  };
4892
4902
  KwikIDFormViewComponent.prototype.handleConnectedElementFieldGroupActions = function (childFieldGroupConfig, parentField) {
4893
4903
  return __awaiter(this, void 0, void 0, function () {
4894
- var rulesMapping, _k, _l, action, conditionSuccess, actions, e_4_1;
4895
- var e_4, _m;
4896
- return __generator(this, function (_o) {
4897
- switch (_o.label) {
4904
+ var rulesMapping, _o, _p, action, conditionSuccess, actions, e_4_1;
4905
+ var e_4, _q;
4906
+ return __generator(this, function (_r) {
4907
+ switch (_r.label) {
4898
4908
  case 0:
4899
4909
  if (!kwikidToolkit.checkObjectKeyExists(childFieldGroupConfig, "rules")) return [3 /*break*/, 8];
4900
4910
  rulesMapping = new kwikidToolkit.Rule(childFieldGroupConfig.rules, {
@@ -4904,14 +4914,14 @@
4904
4914
  PREVIOUS_FORM_DATA: this.previousFormData,
4905
4915
  ALL_FORMS_DATA: this.allFormsData
4906
4916
  }).mapping();
4907
- _o.label = 1;
4917
+ _r.label = 1;
4908
4918
  case 1:
4909
- _o.trys.push([1, 6, 7, 8]);
4910
- _k = __values(childFieldGroupConfig.actions), _l = _k.next();
4911
- _o.label = 2;
4919
+ _r.trys.push([1, 6, 7, 8]);
4920
+ _o = __values(childFieldGroupConfig.actions), _p = _o.next();
4921
+ _r.label = 2;
4912
4922
  case 2:
4913
- if (!!_l.done) return [3 /*break*/, 5];
4914
- action = _l.value;
4923
+ if (!!_p.done) return [3 /*break*/, 5];
4924
+ action = _p.value;
4915
4925
  conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
4916
4926
  if (!conditionSuccess) return [3 /*break*/, 4];
4917
4927
  actions = new kwikidToolkit.Action(action, rulesMapping, {
@@ -4924,19 +4934,19 @@
4924
4934
  }, this.takeActionOnFieldGroup.bind(this));
4925
4935
  return [4 /*yield*/, actions.execute()];
4926
4936
  case 3:
4927
- _o.sent();
4928
- _o.label = 4;
4937
+ _r.sent();
4938
+ _r.label = 4;
4929
4939
  case 4:
4930
- _l = _k.next();
4940
+ _p = _o.next();
4931
4941
  return [3 /*break*/, 2];
4932
4942
  case 5: return [3 /*break*/, 8];
4933
4943
  case 6:
4934
- e_4_1 = _o.sent();
4944
+ e_4_1 = _r.sent();
4935
4945
  e_4 = { error: e_4_1 };
4936
4946
  return [3 /*break*/, 8];
4937
4947
  case 7:
4938
4948
  try {
4939
- if (_l && !_l.done && (_m = _k.return)) _m.call(_k);
4949
+ if (_p && !_p.done && (_q = _o.return)) _q.call(_o);
4940
4950
  }
4941
4951
  finally { if (e_4) throw e_4.error; }
4942
4952
  return [7 /*endfinally*/];
@@ -4947,15 +4957,15 @@
4947
4957
  };
4948
4958
  KwikIDFormViewComponent.prototype.handleConnectedElementFieldGroup = function (currentField, connectedFieldGroupConfig, eventType) {
4949
4959
  return __awaiter(this, void 0, void 0, function () {
4950
- return __generator(this, function (_k) {
4951
- switch (_k.label) {
4960
+ return __generator(this, function (_o) {
4961
+ switch (_o.label) {
4952
4962
  case 0:
4953
4963
  if (!kwikidToolkit.checkObjectKeyExists(connectedFieldGroupConfig, "triggers")) return [3 /*break*/, 2];
4954
4964
  if (!connectedFieldGroupConfig.triggers.includes(eventType)) return [3 /*break*/, 2];
4955
4965
  return [4 /*yield*/, this.handleConnectedElementFieldGroupActions(connectedFieldGroupConfig, currentField)];
4956
4966
  case 1:
4957
- _k.sent();
4958
- _k.label = 2;
4967
+ _o.sent();
4968
+ _o.label = 2;
4959
4969
  case 2: return [2 /*return*/];
4960
4970
  }
4961
4971
  });
@@ -4963,10 +4973,10 @@
4963
4973
  };
4964
4974
  KwikIDFormViewComponent.prototype.handleConnectedElementFieldActions = function (connectedFieldConfig, connectedField) {
4965
4975
  return __awaiter(this, void 0, void 0, function () {
4966
- var rulesMapping, _k, _l, action, conditionSuccess, actions, e_5_1;
4967
- var e_5, _m;
4968
- return __generator(this, function (_o) {
4969
- switch (_o.label) {
4976
+ var rulesMapping, _o, _p, action, conditionSuccess, actions, e_5_1;
4977
+ var e_5, _q;
4978
+ return __generator(this, function (_r) {
4979
+ switch (_r.label) {
4970
4980
  case 0:
4971
4981
  if (!kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "rules")) return [3 /*break*/, 8];
4972
4982
  rulesMapping = new kwikidToolkit.Rule(connectedFieldConfig.rules, {
@@ -4976,14 +4986,14 @@
4976
4986
  PREVIOUS_FORM_DATA: this.previousFormData,
4977
4987
  ALL_FORMS_DATA: this.allFormsData
4978
4988
  }).mapping();
4979
- _o.label = 1;
4989
+ _r.label = 1;
4980
4990
  case 1:
4981
- _o.trys.push([1, 6, 7, 8]);
4982
- _k = __values(connectedFieldConfig.actions), _l = _k.next();
4983
- _o.label = 2;
4991
+ _r.trys.push([1, 6, 7, 8]);
4992
+ _o = __values(connectedFieldConfig.actions), _p = _o.next();
4993
+ _r.label = 2;
4984
4994
  case 2:
4985
- if (!!_l.done) return [3 /*break*/, 5];
4986
- action = _l.value;
4995
+ if (!!_p.done) return [3 /*break*/, 5];
4996
+ action = _p.value;
4987
4997
  conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
4988
4998
  if (!conditionSuccess) return [3 /*break*/, 4];
4989
4999
  actions = new kwikidToolkit.Action(action, rulesMapping, {
@@ -4996,19 +5006,19 @@
4996
5006
  }, this.takeAction.bind(this));
4997
5007
  return [4 /*yield*/, actions.execute()];
4998
5008
  case 3:
4999
- _o.sent();
5000
- _o.label = 4;
5009
+ _r.sent();
5010
+ _r.label = 4;
5001
5011
  case 4:
5002
- _l = _k.next();
5012
+ _p = _o.next();
5003
5013
  return [3 /*break*/, 2];
5004
5014
  case 5: return [3 /*break*/, 8];
5005
5015
  case 6:
5006
- e_5_1 = _o.sent();
5016
+ e_5_1 = _r.sent();
5007
5017
  e_5 = { error: e_5_1 };
5008
5018
  return [3 /*break*/, 8];
5009
5019
  case 7:
5010
5020
  try {
5011
- if (_l && !_l.done && (_m = _k.return)) _m.call(_k);
5021
+ if (_p && !_p.done && (_q = _o.return)) _q.call(_o);
5012
5022
  }
5013
5023
  finally { if (e_5) throw e_5.error; }
5014
5024
  return [7 /*endfinally*/];
@@ -5020,16 +5030,16 @@
5020
5030
  KwikIDFormViewComponent.prototype.handleConnectedElementFields = function (currentField, connectedFieldConfig, eventType, nested) {
5021
5031
  return __awaiter(this, void 0, void 0, function () {
5022
5032
  var connectedField;
5023
- return __generator(this, function (_k) {
5024
- switch (_k.label) {
5033
+ return __generator(this, function (_o) {
5034
+ switch (_o.label) {
5025
5035
  case 0:
5026
5036
  connectedField = getFormFieldByKey(this.formFields, connectedFieldConfig["key"]);
5027
5037
  if (!kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "triggers")) return [3 /*break*/, 2];
5028
5038
  if (!connectedFieldConfig.triggers.includes(eventType)) return [3 /*break*/, 2];
5029
5039
  return [4 /*yield*/, this.handleConnectedElementFieldActions(connectedFieldConfig, connectedField)];
5030
5040
  case 1:
5031
- connectedField = _k.sent();
5032
- _k.label = 2;
5041
+ connectedField = _o.sent();
5042
+ _o.label = 2;
5033
5043
  case 2:
5034
5044
  if (kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "handleNestedFields")) {
5035
5045
  if (connectedFieldConfig.handleNestedFields) {
@@ -5044,67 +5054,67 @@
5044
5054
  KwikIDFormViewComponent.prototype.handleConnectedElements = function (e, eventType) {
5045
5055
  return __awaiter(this, void 0, void 0, function () {
5046
5056
  var currentField, connectedFieldGroups, connectedFieldGroups_1, connectedFieldGroups_1_1, connectedFieldGroupConfig, e_6_1, connectedFields, connectedFields_1, connectedFields_1_1, connectedFieldConfig, e_7_1;
5047
- var e_6, _k, e_7, _l;
5048
- return __generator(this, function (_m) {
5049
- switch (_m.label) {
5057
+ var e_6, _o, e_7, _p;
5058
+ return __generator(this, function (_q) {
5059
+ switch (_q.label) {
5050
5060
  case 0:
5051
5061
  currentField = getFormFieldByKey(this.formFields, e.key);
5052
5062
  if (!(currentField !== undefined)) return [3 /*break*/, 17];
5053
5063
  if (!kwikidToolkit.checkObjectKeyExists(currentField, "connectedElements")) return [3 /*break*/, 16];
5054
5064
  if (!kwikidToolkit.checkObjectKeyExists(currentField.connectedElements, "connectedFieldGroups")) return [3 /*break*/, 8];
5055
5065
  connectedFieldGroups = currentField.connectedElements.connectedFieldGroups;
5056
- _m.label = 1;
5066
+ _q.label = 1;
5057
5067
  case 1:
5058
- _m.trys.push([1, 6, 7, 8]);
5068
+ _q.trys.push([1, 6, 7, 8]);
5059
5069
  connectedFieldGroups_1 = __values(connectedFieldGroups), connectedFieldGroups_1_1 = connectedFieldGroups_1.next();
5060
- _m.label = 2;
5070
+ _q.label = 2;
5061
5071
  case 2:
5062
5072
  if (!!connectedFieldGroups_1_1.done) return [3 /*break*/, 5];
5063
5073
  connectedFieldGroupConfig = connectedFieldGroups_1_1.value;
5064
5074
  return [4 /*yield*/, this.handleConnectedElementFieldGroup(currentField, connectedFieldGroupConfig, eventType)];
5065
5075
  case 3:
5066
- _m.sent();
5067
- _m.label = 4;
5076
+ _q.sent();
5077
+ _q.label = 4;
5068
5078
  case 4:
5069
5079
  connectedFieldGroups_1_1 = connectedFieldGroups_1.next();
5070
5080
  return [3 /*break*/, 2];
5071
5081
  case 5: return [3 /*break*/, 8];
5072
5082
  case 6:
5073
- e_6_1 = _m.sent();
5083
+ e_6_1 = _q.sent();
5074
5084
  e_6 = { error: e_6_1 };
5075
5085
  return [3 /*break*/, 8];
5076
5086
  case 7:
5077
5087
  try {
5078
- if (connectedFieldGroups_1_1 && !connectedFieldGroups_1_1.done && (_k = connectedFieldGroups_1.return)) _k.call(connectedFieldGroups_1);
5088
+ if (connectedFieldGroups_1_1 && !connectedFieldGroups_1_1.done && (_o = connectedFieldGroups_1.return)) _o.call(connectedFieldGroups_1);
5079
5089
  }
5080
5090
  finally { if (e_6) throw e_6.error; }
5081
5091
  return [7 /*endfinally*/];
5082
5092
  case 8:
5083
5093
  if (!kwikidToolkit.checkObjectKeyExists(currentField.connectedElements, "connectedFields")) return [3 /*break*/, 16];
5084
5094
  connectedFields = currentField.connectedElements.connectedFields;
5085
- _m.label = 9;
5095
+ _q.label = 9;
5086
5096
  case 9:
5087
- _m.trys.push([9, 14, 15, 16]);
5097
+ _q.trys.push([9, 14, 15, 16]);
5088
5098
  connectedFields_1 = __values(connectedFields), connectedFields_1_1 = connectedFields_1.next();
5089
- _m.label = 10;
5099
+ _q.label = 10;
5090
5100
  case 10:
5091
5101
  if (!!connectedFields_1_1.done) return [3 /*break*/, 13];
5092
5102
  connectedFieldConfig = connectedFields_1_1.value;
5093
5103
  return [4 /*yield*/, this.handleConnectedElementFields(currentField, connectedFieldConfig, eventType, eventType)];
5094
5104
  case 11:
5095
- currentField = _m.sent();
5096
- _m.label = 12;
5105
+ currentField = _q.sent();
5106
+ _q.label = 12;
5097
5107
  case 12:
5098
5108
  connectedFields_1_1 = connectedFields_1.next();
5099
5109
  return [3 /*break*/, 10];
5100
5110
  case 13: return [3 /*break*/, 16];
5101
5111
  case 14:
5102
- e_7_1 = _m.sent();
5112
+ e_7_1 = _q.sent();
5103
5113
  e_7 = { error: e_7_1 };
5104
5114
  return [3 /*break*/, 16];
5105
5115
  case 15:
5106
5116
  try {
5107
- if (connectedFields_1_1 && !connectedFields_1_1.done && (_l = connectedFields_1.return)) _l.call(connectedFields_1);
5117
+ if (connectedFields_1_1 && !connectedFields_1_1.done && (_p = connectedFields_1.return)) _p.call(connectedFields_1);
5108
5118
  }
5109
5119
  finally { if (e_7) throw e_7.error; }
5110
5120
  return [7 /*endfinally*/];
@@ -5116,23 +5126,23 @@
5116
5126
  });
5117
5127
  };
5118
5128
  KwikIDFormViewComponent.prototype.handleRemovedFile = function (e) {
5119
- var _k;
5129
+ var _o;
5120
5130
  this.showApiLoader();
5121
5131
  if (this.formGroup["controls"][e.key].enabled) {
5122
5132
  this.files[e.key] = e.files;
5123
5133
  this.formData[e.key] = filterDuplicatesFiles(this.files[e.key]);
5124
- this.formGroup.patchValue((_k = {},
5125
- _k[e.key] = this.formData[e.key],
5126
- _k), { emitEvent: false });
5134
+ this.formGroup.patchValue((_o = {},
5135
+ _o[e.key] = this.formData[e.key],
5136
+ _o), { emitEvent: false });
5127
5137
  }
5128
5138
  this.hideApiLoader();
5129
5139
  };
5130
5140
  KwikIDFormViewComponent.prototype.handleGetKeyValueFile = function (e) {
5131
5141
  return __awaiter(this, void 0, void 0, function () {
5132
5142
  var field, values, values_1, values_1_1, value, e_8_1, _loop_2, this_2, values_2, values_2_1, value, e_9_1;
5133
- var e_8, _k, e_9, _l;
5134
- return __generator(this, function (_m) {
5135
- switch (_m.label) {
5143
+ var e_8, _o, e_9, _p;
5144
+ return __generator(this, function (_q) {
5145
+ switch (_q.label) {
5136
5146
  case 0:
5137
5147
  this.showApiLoader();
5138
5148
  field = getFormFieldByKey(this.formFields, e.key);
@@ -5140,41 +5150,41 @@
5140
5150
  if (!(kwikidToolkit.checkObjectKeyExists(field, "properties") &&
5141
5151
  kwikidToolkit.checkObjectKeyExists(field.properties, "uploadFileToServer") &&
5142
5152
  field.properties.uploadFileToServer)) return [3 /*break*/, 9];
5143
- _m.label = 1;
5153
+ _q.label = 1;
5144
5154
  case 1:
5145
- _m.trys.push([1, 6, 7, 8]);
5155
+ _q.trys.push([1, 6, 7, 8]);
5146
5156
  values_1 = __values(values), values_1_1 = values_1.next();
5147
- _m.label = 2;
5157
+ _q.label = 2;
5148
5158
  case 2:
5149
5159
  if (!!values_1_1.done) return [3 /*break*/, 5];
5150
5160
  value = values_1_1.value;
5151
5161
  return [4 /*yield*/, this.uploadFile(field, value)];
5152
5162
  case 3:
5153
- _m.sent();
5154
- _m.label = 4;
5163
+ _q.sent();
5164
+ _q.label = 4;
5155
5165
  case 4:
5156
5166
  values_1_1 = values_1.next();
5157
5167
  return [3 /*break*/, 2];
5158
5168
  case 5: return [3 /*break*/, 8];
5159
5169
  case 6:
5160
- e_8_1 = _m.sent();
5170
+ e_8_1 = _q.sent();
5161
5171
  e_8 = { error: e_8_1 };
5162
5172
  return [3 /*break*/, 8];
5163
5173
  case 7:
5164
5174
  try {
5165
- if (values_1_1 && !values_1_1.done && (_k = values_1.return)) _k.call(values_1);
5175
+ if (values_1_1 && !values_1_1.done && (_o = values_1.return)) _o.call(values_1);
5166
5176
  }
5167
5177
  finally { if (e_8) throw e_8.error; }
5168
5178
  return [7 /*endfinally*/];
5169
5179
  case 8: return [3 /*break*/, 18];
5170
5180
  case 9:
5171
5181
  _loop_2 = function (value) {
5172
- var updatedFile, _o;
5173
- return __generator(this, function (_p) {
5174
- switch (_p.label) {
5182
+ var updatedFile, _r;
5183
+ return __generator(this, function (_s) {
5184
+ switch (_s.label) {
5175
5185
  case 0:
5176
5186
  this_2.updateFiles(value, "LOADING", e.key);
5177
- _o = kwikidToolkit.getObjectDeepCopy;
5187
+ _r = kwikidToolkit.getObjectDeepCopy;
5178
5188
  return [4 /*yield*/, new Promise(function (resolve) {
5179
5189
  setTimeout(function () {
5180
5190
  resolve({
@@ -5188,42 +5198,42 @@
5188
5198
  }, 300); // 1000 ms = 1 sec
5189
5199
  })];
5190
5200
  case 1:
5191
- updatedFile = _o.apply(void 0, [_p.sent()]);
5201
+ updatedFile = _r.apply(void 0, [_s.sent()]);
5192
5202
  this_2.updateFiles(updatedFile, "NORMAL", e.key);
5193
5203
  return [2 /*return*/];
5194
5204
  }
5195
5205
  });
5196
5206
  };
5197
5207
  this_2 = this;
5198
- _m.label = 10;
5208
+ _q.label = 10;
5199
5209
  case 10:
5200
- _m.trys.push([10, 15, 16, 17]);
5210
+ _q.trys.push([10, 15, 16, 17]);
5201
5211
  values_2 = __values(values), values_2_1 = values_2.next();
5202
- _m.label = 11;
5212
+ _q.label = 11;
5203
5213
  case 11:
5204
5214
  if (!!values_2_1.done) return [3 /*break*/, 14];
5205
5215
  value = values_2_1.value;
5206
5216
  return [5 /*yield**/, _loop_2(value)];
5207
5217
  case 12:
5208
- _m.sent();
5209
- _m.label = 13;
5218
+ _q.sent();
5219
+ _q.label = 13;
5210
5220
  case 13:
5211
5221
  values_2_1 = values_2.next();
5212
5222
  return [3 /*break*/, 11];
5213
5223
  case 14: return [3 /*break*/, 17];
5214
5224
  case 15:
5215
- e_9_1 = _m.sent();
5225
+ e_9_1 = _q.sent();
5216
5226
  e_9 = { error: e_9_1 };
5217
5227
  return [3 /*break*/, 17];
5218
5228
  case 16:
5219
5229
  try {
5220
- if (values_2_1 && !values_2_1.done && (_l = values_2.return)) _l.call(values_2);
5230
+ if (values_2_1 && !values_2_1.done && (_p = values_2.return)) _p.call(values_2);
5221
5231
  }
5222
5232
  finally { if (e_9) throw e_9.error; }
5223
5233
  return [7 /*endfinally*/];
5224
5234
  case 17:
5225
5235
  this.hideApiLoader();
5226
- _m.label = 18;
5236
+ _q.label = 18;
5227
5237
  case 18: return [2 /*return*/];
5228
5238
  }
5229
5239
  });
@@ -5231,31 +5241,31 @@
5231
5241
  };
5232
5242
  /** Methods for Camera related fields like 'CAPTURE' or 'RECORD' */
5233
5243
  KwikIDFormViewComponent.prototype.handleOnClickGetRemovedMediaFile = function (e) {
5234
- var _k;
5244
+ var _o;
5235
5245
  this.showApiLoader();
5236
5246
  if (this.formGroup["controls"][e.key].enabled) {
5237
5247
  this.resetCamera();
5238
5248
  this.mediaFiles[e.key] = e.mediaFiles;
5239
5249
  this.formData[e.key] = filterDuplicatesMediaFiles(this.mediaFiles[e.key]);
5240
- this.formGroup.patchValue((_k = {},
5241
- _k[e.key] = this.formData[e.key],
5242
- _k), { emitEvent: false });
5250
+ this.formGroup.patchValue((_o = {},
5251
+ _o[e.key] = this.formData[e.key],
5252
+ _o), { emitEvent: false });
5243
5253
  }
5244
5254
  this.hideApiLoader();
5245
5255
  };
5246
5256
  KwikIDFormViewComponent.prototype.handleOnClickInputCamera = function (e, field) {
5247
5257
  var _a, _b, _c, _d, _e, _f;
5248
5258
  return __awaiter(this, void 0, void 0, function () {
5249
- var fieldKey, fieldcameraConfig, _k, cameraHelper, _l, _m;
5250
- return __generator(this, function (_o) {
5251
- switch (_o.label) {
5259
+ var fieldKey, fieldcameraConfig, _o, cameraHelper, _p, _q;
5260
+ return __generator(this, function (_r) {
5261
+ switch (_r.label) {
5252
5262
  case 0:
5253
5263
  fieldKey = field.key;
5254
5264
  fieldcameraConfig = (_b = (_a = field === null || field === void 0 ? void 0 : field.properties) === null || _a === void 0 ? void 0 : _a.cameraConfig) !== null && _b !== void 0 ? _b : {};
5255
5265
  this.cameraType = (field === null || field === void 0 ? void 0 : field.type.toUpperCase()) || "";
5256
5266
  this.cameraFieldKey = fieldKey;
5257
- _k = this.cameraType;
5258
- switch (_k) {
5267
+ _o = this.cameraType;
5268
+ switch (_o) {
5259
5269
  case "CAPTURE": return [3 /*break*/, 1];
5260
5270
  case "RECORD": return [3 /*break*/, 5];
5261
5271
  }
@@ -5268,16 +5278,16 @@
5268
5278
  if (!(((_d = (_c = this.cameraConfig) === null || _c === void 0 ? void 0 : _c.others) === null || _d === void 0 ? void 0 : _d.isWatermark) ||
5269
5279
  ((_f = (_e = this.cameraConfig) === null || _e === void 0 ? void 0 : _e.others) === null || _f === void 0 ? void 0 : _f.isWatermarkForImageUpload))) return [3 /*break*/, 3];
5270
5280
  cameraHelper = new CameraHelper(field, this.formFields, this.allFormsData, this.formData, this.previousFormData);
5271
- _l = this;
5272
- _m = {};
5281
+ _p = this;
5282
+ _q = {};
5273
5283
  return [4 /*yield*/, cameraHelper.getCameraWatermarkData()];
5274
5284
  case 2:
5275
- _l.cameraData = (_m.watermark = _o.sent(),
5276
- _m);
5285
+ _p.cameraData = (_q.watermark = _r.sent(),
5286
+ _q);
5277
5287
  return [3 /*break*/, 4];
5278
5288
  case 3:
5279
5289
  this.cameraData = undefined;
5280
- _o.label = 4;
5290
+ _r.label = 4;
5281
5291
  case 4: return [3 /*break*/, 7];
5282
5292
  case 5:
5283
5293
  this.cameraConfig = kwikidToolkit.mergeObjectsDeep([
@@ -5303,10 +5313,10 @@
5303
5313
  KwikIDFormViewComponent.prototype.setCameraMedia = function (media) {
5304
5314
  return __awaiter(this, void 0, void 0, function () {
5305
5315
  var field, validations_4;
5306
- var _k;
5316
+ var _o;
5307
5317
  var _this = this;
5308
- return __generator(this, function (_l) {
5309
- switch (_l.label) {
5318
+ return __generator(this, function (_p) {
5319
+ switch (_p.label) {
5310
5320
  case 0:
5311
5321
  field = getFormFieldByKey(this.formFields, this.cameraFieldKey);
5312
5322
  if (!(kwikidToolkit.checkObjectKeyExists(field, "properties") &&
@@ -5314,7 +5324,7 @@
5314
5324
  field.properties.uploadFileToServer)) return [3 /*break*/, 2];
5315
5325
  return [4 /*yield*/, this.uploadFile(field, media)];
5316
5326
  case 1:
5317
- _l.sent();
5327
+ _p.sent();
5318
5328
  return [3 /*break*/, 3];
5319
5329
  case 2:
5320
5330
  this.resetCamera();
@@ -5324,9 +5334,9 @@
5324
5334
  emitEvent: false,
5325
5335
  onlySelf: false
5326
5336
  });
5327
- this.formGroup.patchValue((_k = {},
5328
- _k[field.key] = kwikidToolkit.getObjectDeepCopy([media]),
5329
- _k), { emitEvent: false });
5337
+ this.formGroup.patchValue((_o = {},
5338
+ _o[field.key] = kwikidToolkit.getObjectDeepCopy([media]),
5339
+ _o), { emitEvent: false });
5330
5340
  this.formGroup.controls[field.key].updateValueAndValidity({
5331
5341
  emitEvent: false
5332
5342
  });
@@ -5346,11 +5356,11 @@
5346
5356
  ALL_FORMS_DATA: this.allFormsData
5347
5357
  }, this.takeAction.bind(this));
5348
5358
  (function () { return __awaiter(_this, void 0, void 0, function () {
5349
- return __generator(this, function (_k) {
5350
- switch (_k.label) {
5359
+ return __generator(this, function (_o) {
5360
+ switch (_o.label) {
5351
5361
  case 0: return [4 /*yield*/, validations_4.validate(field.validation)];
5352
5362
  case 1:
5353
- _k.sent();
5363
+ _o.sent();
5354
5364
  return [2 /*return*/];
5355
5365
  }
5356
5366
  });
@@ -5363,7 +5373,7 @@
5363
5373
  value: this.formGroup.controls[field.key].value
5364
5374
  }, "ON_CHANGE");
5365
5375
  }
5366
- _l.label = 3;
5376
+ _p.label = 3;
5367
5377
  case 3: return [2 /*return*/];
5368
5378
  }
5369
5379
  });
@@ -5458,7 +5468,7 @@
5458
5468
  * This method is used to update the files array with the new file and it's state and response from the api of uploading the file.
5459
5469
  */
5460
5470
  KwikIDFormViewComponent.prototype.updateFiles = function (file, state, key) {
5461
- var _k;
5471
+ var _o;
5462
5472
  var _this = this;
5463
5473
  var _a;
5464
5474
  var fileWithState = kwikidToolkit.mergeObjects(file, { state: state });
@@ -5486,9 +5496,9 @@
5486
5496
  emitEvent: false,
5487
5497
  onlySelf: false
5488
5498
  });
5489
- this.formGroup.patchValue((_k = {},
5490
- _k[key] = normalFiles,
5491
- _k), { emitEvent: false });
5499
+ this.formGroup.patchValue((_o = {},
5500
+ _o[key] = normalFiles,
5501
+ _o), { emitEvent: false });
5492
5502
  this.getUnsavedDataState.emit(true);
5493
5503
  if (field.isFormElement &&
5494
5504
  kwikidToolkit.checkObjectKeyExists(field, "validation") &&
@@ -5502,11 +5512,11 @@
5502
5512
  ALL_FORMS_DATA: this.allFormsData
5503
5513
  }, this.takeAction.bind(this));
5504
5514
  (function () { return __awaiter(_this, void 0, void 0, function () {
5505
- return __generator(this, function (_k) {
5506
- switch (_k.label) {
5515
+ return __generator(this, function (_o) {
5516
+ switch (_o.label) {
5507
5517
  case 0: return [4 /*yield*/, validations_5.validate(field.validation)];
5508
5518
  case 1:
5509
- _k.sent();
5519
+ _o.sent();
5510
5520
  return [2 /*return*/];
5511
5521
  }
5512
5522
  });
@@ -5525,7 +5535,7 @@
5525
5535
  */
5526
5536
  KwikIDFormViewComponent.prototype.uploadFile = function (field, file) {
5527
5537
  return __awaiter(this, void 0, void 0, function () {
5528
- return __generator(this, function (_k) {
5538
+ return __generator(this, function (_o) {
5529
5539
  switch (field.type) {
5530
5540
  case EFieldType.FILE:
5531
5541
  this.updateFiles(file, "LOADING", field.key);
@@ -5586,11 +5596,11 @@
5586
5596
  });
5587
5597
  };
5588
5598
  KwikIDFormViewComponent.prototype.handleOnClickFormFieldButton = function (field) {
5589
- var e_10, _k;
5599
+ var e_10, _o;
5590
5600
  var formData = this.formGroup.getRawValue();
5591
5601
  try {
5592
- for (var _l = __values(this.formFields), _m = _l.next(); !_m.done; _m = _l.next()) {
5593
- var field_3 = _m.value;
5602
+ for (var _p = __values(this.formFields), _q = _p.next(); !_q.done; _q = _p.next()) {
5603
+ var field_3 = _q.value;
5594
5604
  if (field_3.isFormElement) {
5595
5605
  if (field_3.hidden) {
5596
5606
  delete formData[field_3.key];
@@ -5604,22 +5614,22 @@
5604
5614
  catch (e_10_1) { e_10 = { error: e_10_1 }; }
5605
5615
  finally {
5606
5616
  try {
5607
- if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
5617
+ if (_q && !_q.done && (_o = _p.return)) _o.call(_p);
5608
5618
  }
5609
5619
  finally { if (e_10) throw e_10.error; }
5610
5620
  }
5611
5621
  var extendedFormData = this.formFields.reduce(function (result, field, index) {
5612
- var _k;
5622
+ var _o;
5613
5623
  if (field.isFormElement && !field.hidden) {
5614
- var fieldData = (_k = {},
5615
- _k[field.key] = {
5624
+ var fieldData = (_o = {},
5625
+ _o[field.key] = {
5616
5626
  key: field.key,
5617
5627
  label: field.label,
5618
5628
  value: kwikidToolkit.isEmptyValue(formData[field.key]) ? "" : formData[field.key],
5619
5629
  type: field.type,
5620
5630
  index: index
5621
5631
  },
5622
- _k);
5632
+ _o);
5623
5633
  result[field.key] = fieldData[field.key];
5624
5634
  }
5625
5635
  return result;
@@ -5632,11 +5642,11 @@
5632
5642
  };
5633
5643
  // DOM Event Handlers
5634
5644
  KwikIDFormViewComponent.prototype.handleGetKeyValue = function (e) {
5635
- var _k;
5645
+ var _o;
5636
5646
  var _this = this;
5637
- this.formGroup.patchValue((_k = {},
5638
- _k[e.key] = e.value,
5639
- _k), { emitEvent: false });
5647
+ this.formGroup.patchValue((_o = {},
5648
+ _o[e.key] = e.value,
5649
+ _o), { emitEvent: false });
5640
5650
  var field = getFormFieldByKey(this.formFields, e.key);
5641
5651
  this.formData[e.key] = convertFormFieldValueToStandardFormat(field, e.value);
5642
5652
  this.getUnsavedDataState.emit(true);
@@ -5652,11 +5662,11 @@
5652
5662
  ALL_FORMS_DATA: this.allFormsData
5653
5663
  }, this.takeAction.bind(this));
5654
5664
  (function () { return __awaiter(_this, void 0, void 0, function () {
5655
- return __generator(this, function (_k) {
5656
- switch (_k.label) {
5665
+ return __generator(this, function (_o) {
5666
+ switch (_o.label) {
5657
5667
  case 0: return [4 /*yield*/, validations_6.validate(field.validation)];
5658
5668
  case 1:
5659
- _k.sent();
5669
+ _o.sent();
5660
5670
  return [2 /*return*/];
5661
5671
  }
5662
5672
  });
@@ -5675,27 +5685,27 @@
5675
5685
  return __awaiter(this, void 0, void 0, function () {
5676
5686
  var resetFormFields, BYPASS_RESET_CONFIRM, CONFIRM_RESET;
5677
5687
  var _this = this;
5678
- return __generator(this, function (_k) {
5688
+ return __generator(this, function (_o) {
5679
5689
  resetFormFields = function () { return __awaiter(_this, void 0, void 0, function () {
5680
- var _k, _l, f, _m, _o, action, resetField, actions, e_11_1, e_12_1;
5681
- var e_12, _p, e_11, _q;
5682
- return __generator(this, function (_r) {
5683
- switch (_r.label) {
5690
+ var _o, _p, f, _q, _r, action, resetField, actions, e_11_1, e_12_1;
5691
+ var e_12, _s, e_11, _t;
5692
+ return __generator(this, function (_u) {
5693
+ switch (_u.label) {
5684
5694
  case 0:
5685
- _r.trys.push([0, 11, 12, 13]);
5686
- _k = __values(field.reset.fields), _l = _k.next();
5687
- _r.label = 1;
5695
+ _u.trys.push([0, 11, 12, 13]);
5696
+ _o = __values(field.reset.fields), _p = _o.next();
5697
+ _u.label = 1;
5688
5698
  case 1:
5689
- if (!!_l.done) return [3 /*break*/, 10];
5690
- f = _l.value;
5691
- _r.label = 2;
5699
+ if (!!_p.done) return [3 /*break*/, 10];
5700
+ f = _p.value;
5701
+ _u.label = 2;
5692
5702
  case 2:
5693
- _r.trys.push([2, 7, 8, 9]);
5694
- _m = (e_11 = void 0, __values(f.actions)), _o = _m.next();
5695
- _r.label = 3;
5703
+ _u.trys.push([2, 7, 8, 9]);
5704
+ _q = (e_11 = void 0, __values(f.actions)), _r = _q.next();
5705
+ _u.label = 3;
5696
5706
  case 3:
5697
- if (!!_o.done) return [3 /*break*/, 6];
5698
- action = _o.value;
5707
+ if (!!_r.done) return [3 /*break*/, 6];
5708
+ action = _r.value;
5699
5709
  resetField = getFormFieldByKey(this.formFields, action.props.fieldKey);
5700
5710
  actions = new kwikidToolkit.Action(action, {}, {
5701
5711
  FIELD_CONFIG: resetField,
@@ -5707,33 +5717,33 @@
5707
5717
  }, this.takeAction.bind(this));
5708
5718
  return [4 /*yield*/, actions.execute()];
5709
5719
  case 4:
5710
- _r.sent();
5711
- _r.label = 5;
5720
+ _u.sent();
5721
+ _u.label = 5;
5712
5722
  case 5:
5713
- _o = _m.next();
5723
+ _r = _q.next();
5714
5724
  return [3 /*break*/, 3];
5715
5725
  case 6: return [3 /*break*/, 9];
5716
5726
  case 7:
5717
- e_11_1 = _r.sent();
5727
+ e_11_1 = _u.sent();
5718
5728
  e_11 = { error: e_11_1 };
5719
5729
  return [3 /*break*/, 9];
5720
5730
  case 8:
5721
5731
  try {
5722
- if (_o && !_o.done && (_q = _m.return)) _q.call(_m);
5732
+ if (_r && !_r.done && (_t = _q.return)) _t.call(_q);
5723
5733
  }
5724
5734
  finally { if (e_11) throw e_11.error; }
5725
5735
  return [7 /*endfinally*/];
5726
5736
  case 9:
5727
- _l = _k.next();
5737
+ _p = _o.next();
5728
5738
  return [3 /*break*/, 1];
5729
5739
  case 10: return [3 /*break*/, 13];
5730
5740
  case 11:
5731
- e_12_1 = _r.sent();
5741
+ e_12_1 = _u.sent();
5732
5742
  e_12 = { error: e_12_1 };
5733
5743
  return [3 /*break*/, 13];
5734
5744
  case 12:
5735
5745
  try {
5736
- if (_l && !_l.done && (_p = _k.return)) _p.call(_k);
5746
+ if (_p && !_p.done && (_s = _o.return)) _s.call(_o);
5737
5747
  }
5738
5748
  finally { if (e_12) throw e_12.error; }
5739
5749
  return [7 /*endfinally*/];
@@ -5758,9 +5768,9 @@
5758
5768
  KwikIDFormViewComponent.prototype.handleFieldApiCall = function (field, api) {
5759
5769
  return __awaiter(this, void 0, void 0, function () {
5760
5770
  var apis;
5761
- var _k, _l;
5762
- return __generator(this, function (_m) {
5763
- switch (_m.label) {
5771
+ var _o, _p;
5772
+ return __generator(this, function (_q) {
5773
+ switch (_q.label) {
5764
5774
  case 0: return [4 /*yield*/, this.executeApiCall(api, {
5765
5775
  FIELD_CONFIG: field,
5766
5776
  API_CONFIG: api,
@@ -5771,13 +5781,13 @@
5771
5781
  ALL_FORMS_DATA: this.allFormsData
5772
5782
  })];
5773
5783
  case 1:
5774
- api = _m.sent();
5784
+ api = _q.sent();
5775
5785
  if (!this.isValidRequestHeadersAndBody(api)) return [3 /*break*/, 3];
5776
5786
  if (kwikidToolkit.checkObjectKeyExists(field.api, "request")) {
5777
- this.formData = Object.assign(Object.assign({}, this.formData), (_k = {}, _k[field.key] = api.response.value, _k));
5778
- this.formGroup.patchValue((_l = {},
5779
- _l[field.key] = api.response.value,
5780
- _l), { emitEvent: false });
5787
+ this.formData = Object.assign(Object.assign({}, this.formData), (_o = {}, _o[field.key] = api.response.value, _o));
5788
+ this.formGroup.patchValue((_p = {},
5789
+ _p[field.key] = api.response.value,
5790
+ _p), { emitEvent: false });
5781
5791
  }
5782
5792
  apis = new Apis({
5783
5793
  FIELD_CONFIG: field,
@@ -5791,14 +5801,14 @@
5791
5801
  }, this.takeAction.bind(this));
5792
5802
  return [4 /*yield*/, apis.validateResponse()];
5793
5803
  case 2:
5794
- api = _m.sent();
5804
+ api = _q.sent();
5795
5805
  return [3 /*break*/, 4];
5796
5806
  case 3:
5797
5807
  setTimeout(function () {
5798
5808
  field["api"]["status"]["value"] = EApiStatusType.FAILED;
5799
5809
  field["showLoader"] = false;
5800
5810
  }, 500);
5801
- _m.label = 4;
5811
+ _q.label = 4;
5802
5812
  case 4: return [2 /*return*/, { field: field, api: api }];
5803
5813
  }
5804
5814
  });
@@ -5807,8 +5817,8 @@
5807
5817
  KwikIDFormViewComponent.prototype.handleApiCall = function (api) {
5808
5818
  return __awaiter(this, void 0, void 0, function () {
5809
5819
  var apis;
5810
- return __generator(this, function (_k) {
5811
- switch (_k.label) {
5820
+ return __generator(this, function (_o) {
5821
+ switch (_o.label) {
5812
5822
  case 0: return [4 /*yield*/, this.executeApiCall(api, {
5813
5823
  FORM_CONFIG: this.formConfig,
5814
5824
  API_CONFIG: api,
@@ -5819,7 +5829,7 @@
5819
5829
  ALL_FORMS_DATA: this.allFormsData
5820
5830
  })];
5821
5831
  case 1:
5822
- api = _k.sent();
5832
+ api = _o.sent();
5823
5833
  apis = new Apis({
5824
5834
  FORM_CONFIG: this.formConfig,
5825
5835
  API_CONFIG: api,
@@ -5832,38 +5842,38 @@
5832
5842
  if (!this.isValidRequestHeadersAndBody(api)) return [3 /*break*/, 3];
5833
5843
  return [4 /*yield*/, apis.validateResponse()];
5834
5844
  case 2:
5835
- api = _k.sent();
5836
- _k.label = 3;
5845
+ api = _o.sent();
5846
+ _o.label = 3;
5837
5847
  case 3: return [2 /*return*/, { api: api }];
5838
5848
  }
5839
5849
  });
5840
5850
  });
5841
5851
  };
5842
5852
  KwikIDFormViewComponent.prototype.executeApiCall = function (api, object) {
5843
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
5853
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
5844
5854
  return __awaiter(this, void 0, void 0, function () {
5845
- var apis, apiCallResponse, apiCallResponseStatusCode, url, method, headers, body, response, err_1, response, err_2;
5846
- return __generator(this, function (_k) {
5847
- switch (_k.label) {
5855
+ var apis, apiCallResponse, apiCallResponseStatusCode, url, method, headers, response, err_1, body, isSecure, response, isSecure_1, encryptedResponse, decryptedResponse, err_2;
5856
+ return __generator(this, function (_o) {
5857
+ switch (_o.label) {
5848
5858
  case 0:
5849
5859
  apis = new Apis(object, this.takeAction.bind(this));
5850
5860
  return [4 /*yield*/, apis.setUrl()];
5851
5861
  case 1:
5852
- api = _k.sent();
5862
+ api = _o.sent();
5853
5863
  return [4 /*yield*/, apis.setRequestHeaders()];
5854
5864
  case 2:
5855
- api = _k.sent();
5865
+ api = _o.sent();
5856
5866
  return [4 /*yield*/, apis.validateRequestHeaders()];
5857
5867
  case 3:
5858
- api = _k.sent();
5868
+ api = _o.sent();
5859
5869
  return [4 /*yield*/, apis.setRequestBody()];
5860
5870
  case 4:
5861
- api = _k.sent();
5871
+ api = _o.sent();
5862
5872
  return [4 /*yield*/, apis.validateRequestBody()];
5863
5873
  case 5:
5864
- api = _k.sent();
5874
+ api = _o.sent();
5865
5875
  apiCallResponse = {};
5866
- if (!this.isValidRequestHeadersAndBody(api)) return [3 /*break*/, 18];
5876
+ if (!this.isValidRequestHeadersAndBody(api)) return [3 /*break*/, 22];
5867
5877
  if (!(api.request.url.hasOwnProperty("type") &&
5868
5878
  api.request.url.type === EApiRequestUrlType.MOCK)) return [3 /*break*/, 7];
5869
5879
  return [4 /*yield*/, new Promise(function (resolve) {
@@ -5872,53 +5882,69 @@
5872
5882
  }, 1000); // 1000 ms = 1 sec
5873
5883
  })];
5874
5884
  case 6:
5875
- apiCallResponse = _k.sent();
5885
+ apiCallResponse = _o.sent();
5876
5886
  apiCallResponseStatusCode = (_b = (_a = api.request.url.props) === null || _a === void 0 ? void 0 : _a.statusCode) !== null && _b !== void 0 ? _b : 200; // Default Status Code for Mocked APIs
5877
- return [3 /*break*/, 17];
5887
+ return [3 /*break*/, 21];
5878
5888
  case 7:
5879
5889
  url = api.request.url.value;
5880
5890
  method = (_d = (_c = api.request) === null || _c === void 0 ? void 0 : _c.method) !== null && _d !== void 0 ? _d : "POST";
5881
5891
  headers = Object.assign({ "Content-Type": "application/json" }, (((_f = (_e = api.request) === null || _e === void 0 ? void 0 : _e.headers) === null || _f === void 0 ? void 0 : _f.value) || {}));
5882
- body = (_j = (_h = (_g = api.request) === null || _g === void 0 ? void 0 : _g.body) === null || _h === void 0 ? void 0 : _h.value) !== null && _j !== void 0 ? _j : null;
5883
5892
  if (!(method === "GET")) return [3 /*break*/, 13];
5884
- _k.label = 8;
5893
+ _o.label = 8;
5885
5894
  case 8:
5886
- _k.trys.push([8, 11, , 12]);
5895
+ _o.trys.push([8, 11, , 12]);
5887
5896
  return [4 /*yield*/, fetch(url, {
5888
5897
  method: method,
5889
5898
  headers: Object.assign({}, headers)
5890
5899
  })];
5891
5900
  case 9:
5892
- response = _k.sent();
5901
+ response = _o.sent();
5893
5902
  return [4 /*yield*/, response.json()];
5894
5903
  case 10:
5895
- apiCallResponse = _k.sent();
5904
+ apiCallResponse = _o.sent();
5896
5905
  apiCallResponseStatusCode = response.status;
5897
5906
  return [3 /*break*/, 12];
5898
5907
  case 11:
5899
- err_1 = _k.sent();
5908
+ err_1 = _o.sent();
5900
5909
  apiCallResponse = {};
5901
5910
  return [3 /*break*/, 12];
5902
- case 12: return [3 /*break*/, 17];
5911
+ case 12: return [3 /*break*/, 21];
5903
5912
  case 13:
5904
- _k.trys.push([13, 16, , 17]);
5913
+ body = JSON.stringify((_j = (_h = (_g = api === null || api === void 0 ? void 0 : api.request) === null || _g === void 0 ? void 0 : _g.body) === null || _h === void 0 ? void 0 : _h.value) !== null && _j !== void 0 ? _j : {});
5914
+ isSecure = (_l = (_k = api === null || api === void 0 ? void 0 : api.request) === null || _k === void 0 ? void 0 : _k.body) === null || _l === void 0 ? void 0 : _l.isSecure;
5915
+ if (isSecure) {
5916
+ body = kwikidToolkit.encryptWithAES(body);
5917
+ }
5918
+ _o.label = 14;
5919
+ case 14:
5920
+ _o.trys.push([14, 20, , 21]);
5905
5921
  return [4 /*yield*/, fetch(url, {
5906
5922
  method: method,
5907
5923
  headers: Object.assign({}, headers),
5908
- body: JSON.stringify(body)
5924
+ body: body
5909
5925
  })];
5910
- case 14:
5911
- response = _k.sent();
5912
- return [4 /*yield*/, response.json()];
5913
5926
  case 15:
5914
- apiCallResponse = _k.sent();
5915
- apiCallResponseStatusCode = response.status;
5916
- return [3 /*break*/, 17];
5927
+ response = _o.sent();
5928
+ isSecure_1 = (_m = api === null || api === void 0 ? void 0 : api.response) === null || _m === void 0 ? void 0 : _m.isSecure;
5929
+ if (!isSecure_1) return [3 /*break*/, 17];
5930
+ return [4 /*yield*/, response.text()];
5917
5931
  case 16:
5918
- err_2 = _k.sent();
5932
+ encryptedResponse = _o.sent();
5933
+ decryptedResponse = kwikidToolkit.decryptWithAES(encryptedResponse);
5934
+ apiCallResponse = JSON.parse(decryptedResponse);
5935
+ return [3 /*break*/, 19];
5936
+ case 17: return [4 /*yield*/, response.json()];
5937
+ case 18:
5938
+ apiCallResponse = _o.sent();
5939
+ _o.label = 19;
5940
+ case 19:
5941
+ apiCallResponseStatusCode = response.status;
5942
+ return [3 /*break*/, 21];
5943
+ case 20:
5944
+ err_2 = _o.sent();
5919
5945
  apiCallResponse = {};
5920
- return [3 /*break*/, 17];
5921
- case 17:
5946
+ return [3 /*break*/, 21];
5947
+ case 21:
5922
5948
  api.response = kwikidToolkit.setValueToObjectPath(api.response, "value", apiCallResponse);
5923
5949
  api.response = kwikidToolkit.setValueToObjectPath(api.response, "status", apiCallResponseStatusCode);
5924
5950
  this.getLogs.emit({
@@ -5929,8 +5955,8 @@
5929
5955
  response: api.response
5930
5956
  }
5931
5957
  });
5932
- _k.label = 18;
5933
- case 18: return [2 /*return*/, api];
5958
+ _o.label = 22;
5959
+ case 22: return [2 /*return*/, api];
5934
5960
  }
5935
5961
  });
5936
5962
  });
@@ -5967,8 +5993,8 @@
5967
5993
  KwikIDFormViewComponent.prototype.handleOnClickApiCall = function (e) {
5968
5994
  return __awaiter(this, void 0, void 0, function () {
5969
5995
  var field, apis;
5970
- return __generator(this, function (_k) {
5971
- switch (_k.label) {
5996
+ return __generator(this, function (_o) {
5997
+ switch (_o.label) {
5972
5998
  case 0:
5973
5999
  field = getFormFieldByKey(this.formFields, e.key);
5974
6000
  if (!(field.type === EFieldType.API)) return [3 /*break*/, 5];
@@ -5979,7 +6005,7 @@
5979
6005
  if (!kwikidToolkit.checkObjectKeyExists(field.api, "request")) return [3 /*break*/, 2];
5980
6006
  return [4 /*yield*/, this.handleFieldApiCall(field, field.api)];
5981
6007
  case 1:
5982
- _k.sent();
6008
+ _o.sent();
5983
6009
  return [3 /*break*/, 4];
5984
6010
  case 2:
5985
6011
  apis = new Apis({
@@ -5993,11 +6019,11 @@
5993
6019
  }, this.takeAction.bind(this));
5994
6020
  return [4 /*yield*/, apis.callNextApi(field.api.entrypoint)];
5995
6021
  case 3:
5996
- _k.sent();
5997
- _k.label = 4;
6022
+ _o.sent();
6023
+ _o.label = 4;
5998
6024
  case 4:
5999
6025
  this.hideApiLoader();
6000
- _k.label = 5;
6026
+ _o.label = 5;
6001
6027
  case 5: return [2 /*return*/];
6002
6028
  }
6003
6029
  });
@@ -6042,11 +6068,11 @@
6042
6068
  };
6043
6069
  KwikIDFormViewComponent.prototype.handleOnClickSaveForm = function (e) {
6044
6070
  return __awaiter(this, void 0, void 0, function () {
6045
- var controls, firstFieldWithError, controls_1, controls_1_1, control, _k, _l, field, validations, e_13_1, formData, _m, _o, field, extendedFormData, _p, _q, postTask, task, e_14_1;
6046
- var e_15, _r, e_13, _s, e_16, _t, e_14, _u;
6071
+ var controls, firstFieldWithError, controls_1, controls_1_1, control, _o, _p, field, validations, e_13_1, formData, _q, _r, field, extendedFormData, _s, _t, postTask, task, e_14_1;
6072
+ var e_15, _u, e_13, _v, e_16, _w, e_14, _x;
6047
6073
  var _this = this;
6048
- return __generator(this, function (_v) {
6049
- switch (_v.label) {
6074
+ return __generator(this, function (_y) {
6075
+ switch (_y.label) {
6050
6076
  case 0:
6051
6077
  controls = new FormValidation().getFormFieldsInvalidControls(this.formGroup);
6052
6078
  firstFieldWithError = "";
@@ -6062,7 +6088,7 @@
6062
6088
  catch (e_15_1) { e_15 = { error: e_15_1 }; }
6063
6089
  finally {
6064
6090
  try {
6065
- if (controls_1_1 && !controls_1_1.done && (_r = controls_1.return)) _r.call(controls_1);
6091
+ if (controls_1_1 && !controls_1_1.done && (_u = controls_1.return)) _u.call(controls_1);
6066
6092
  }
6067
6093
  finally { if (e_15) throw e_15.error; }
6068
6094
  }
@@ -6073,14 +6099,14 @@
6073
6099
  }, 3000);
6074
6100
  return [2 /*return*/];
6075
6101
  }
6076
- _v.label = 1;
6102
+ _y.label = 1;
6077
6103
  case 1:
6078
- _v.trys.push([1, 6, 7, 8]);
6079
- _k = __values(this.formFields), _l = _k.next();
6080
- _v.label = 2;
6104
+ _y.trys.push([1, 6, 7, 8]);
6105
+ _o = __values(this.formFields), _p = _o.next();
6106
+ _y.label = 2;
6081
6107
  case 2:
6082
- if (!!_l.done) return [3 /*break*/, 5];
6083
- field = _l.value;
6108
+ if (!!_p.done) return [3 /*break*/, 5];
6109
+ field = _p.value;
6084
6110
  if (!(field.isFormElement &&
6085
6111
  !field.hidden &&
6086
6112
  kwikidToolkit.checkObjectKeyExists(field, "validation") &&
@@ -6095,7 +6121,7 @@
6095
6121
  }, this.takeAction.bind(this));
6096
6122
  return [4 /*yield*/, validations.validate(field.validation)];
6097
6123
  case 3:
6098
- _v.sent();
6124
+ _y.sent();
6099
6125
  if (!field.validation.is_valid) {
6100
6126
  this.toggleErrorNotification(true);
6101
6127
  setTimeout(function () {
@@ -6103,26 +6129,26 @@
6103
6129
  }, 3000);
6104
6130
  return [2 /*return*/];
6105
6131
  }
6106
- _v.label = 4;
6132
+ _y.label = 4;
6107
6133
  case 4:
6108
- _l = _k.next();
6134
+ _p = _o.next();
6109
6135
  return [3 /*break*/, 2];
6110
6136
  case 5: return [3 /*break*/, 8];
6111
6137
  case 6:
6112
- e_13_1 = _v.sent();
6138
+ e_13_1 = _y.sent();
6113
6139
  e_13 = { error: e_13_1 };
6114
6140
  return [3 /*break*/, 8];
6115
6141
  case 7:
6116
6142
  try {
6117
- if (_l && !_l.done && (_s = _k.return)) _s.call(_k);
6143
+ if (_p && !_p.done && (_v = _o.return)) _v.call(_o);
6118
6144
  }
6119
6145
  finally { if (e_13) throw e_13.error; }
6120
6146
  return [7 /*endfinally*/];
6121
6147
  case 8:
6122
6148
  formData = this.formGroup.getRawValue();
6123
6149
  try {
6124
- for (_m = __values(this.formFields), _o = _m.next(); !_o.done; _o = _m.next()) {
6125
- field = _o.value;
6150
+ for (_q = __values(this.formFields), _r = _q.next(); !_r.done; _r = _q.next()) {
6151
+ field = _r.value;
6126
6152
  if (field.isFormElement) {
6127
6153
  if (field.hidden) {
6128
6154
  delete formData[field.key];
@@ -6136,22 +6162,22 @@
6136
6162
  catch (e_16_1) { e_16 = { error: e_16_1 }; }
6137
6163
  finally {
6138
6164
  try {
6139
- if (_o && !_o.done && (_t = _m.return)) _t.call(_m);
6165
+ if (_r && !_r.done && (_w = _q.return)) _w.call(_q);
6140
6166
  }
6141
6167
  finally { if (e_16) throw e_16.error; }
6142
6168
  }
6143
6169
  extendedFormData = this.formFields.reduce(function (result, field, index) {
6144
- var _k;
6170
+ var _o;
6145
6171
  if (field.isFormElement && !field.hidden) {
6146
- var fieldData = (_k = {},
6147
- _k[field.key] = {
6172
+ var fieldData = (_o = {},
6173
+ _o[field.key] = {
6148
6174
  key: field.key,
6149
6175
  label: field.label,
6150
6176
  value: kwikidToolkit.isEmptyValue(formData[field.key]) ? "" : formData[field.key],
6151
6177
  type: field.type,
6152
6178
  index: index
6153
6179
  },
6154
- _k);
6180
+ _o);
6155
6181
  result[field.key] = fieldData[field.key];
6156
6182
  }
6157
6183
  return result;
@@ -6163,14 +6189,14 @@
6163
6189
  });
6164
6190
  if (!(kwikidToolkit.checkObjectKeyExists(this.formConfig, "tasks") &&
6165
6191
  kwikidToolkit.checkObjectKeyExists(this.formConfig.tasks, "post"))) return [3 /*break*/, 18];
6166
- _v.label = 9;
6192
+ _y.label = 9;
6167
6193
  case 9:
6168
- _v.trys.push([9, 15, 16, 17]);
6169
- _p = __values(this.formConfig.tasks.post), _q = _p.next();
6170
- _v.label = 10;
6194
+ _y.trys.push([9, 15, 16, 17]);
6195
+ _s = __values(this.formConfig.tasks.post), _t = _s.next();
6196
+ _y.label = 10;
6171
6197
  case 10:
6172
- if (!!_q.done) return [3 /*break*/, 14];
6173
- postTask = _q.value;
6198
+ if (!!_t.done) return [3 /*break*/, 14];
6199
+ postTask = _t.value;
6174
6200
  task = new Tasks(postTask, {
6175
6201
  FORM_CONFIG: this.formConfig,
6176
6202
  FORM_FIELDS: this.formFields,
@@ -6188,7 +6214,7 @@
6188
6214
  }
6189
6215
  return [4 /*yield*/, task.execute()];
6190
6216
  case 11:
6191
- _v.sent();
6217
+ _y.sent();
6192
6218
  // Wait for ngOnChanges to be called before continuing to the next task
6193
6219
  return [4 /*yield*/, new Promise(function (resolve) {
6194
6220
  var intervalId = setInterval(function () {
@@ -6200,22 +6226,22 @@
6200
6226
  })];
6201
6227
  case 12:
6202
6228
  // Wait for ngOnChanges to be called before continuing to the next task
6203
- _v.sent();
6229
+ _y.sent();
6204
6230
  if (this.stopTaskExecution) {
6205
6231
  return [3 /*break*/, 14];
6206
6232
  }
6207
- _v.label = 13;
6233
+ _y.label = 13;
6208
6234
  case 13:
6209
- _q = _p.next();
6235
+ _t = _s.next();
6210
6236
  return [3 /*break*/, 10];
6211
6237
  case 14: return [3 /*break*/, 17];
6212
6238
  case 15:
6213
- e_14_1 = _v.sent();
6239
+ e_14_1 = _y.sent();
6214
6240
  e_14 = { error: e_14_1 };
6215
6241
  return [3 /*break*/, 17];
6216
6242
  case 16:
6217
6243
  try {
6218
- if (_q && !_q.done && (_u = _p.return)) _u.call(_p);
6244
+ if (_t && !_t.done && (_x = _s.return)) _x.call(_s);
6219
6245
  }
6220
6246
  finally { if (e_14) throw e_14.error; }
6221
6247
  return [7 /*endfinally*/];
@@ -6237,7 +6263,7 @@
6237
6263
  data: kwikidToolkit.mergeObjects(formData, this.popupFormData, this.taskData),
6238
6264
  extendedData: extendedFormData
6239
6265
  });
6240
- _v.label = 19;
6266
+ _y.label = 19;
6241
6267
  case 19: return [2 /*return*/];
6242
6268
  }
6243
6269
  });
@@ -6256,17 +6282,17 @@
6256
6282
  this.formGroup.updateValueAndValidity();
6257
6283
  };
6258
6284
  KwikIDFormViewComponent.prototype.fieldGroupHide = function (fieldGroup) {
6259
- var e_17, _k;
6285
+ var e_17, _o;
6260
6286
  try {
6261
- for (var _l = __values(this.fieldGroups[fieldGroup]), _m = _l.next(); !_m.done; _m = _l.next()) {
6262
- var fieldKey = _m.value;
6287
+ for (var _p = __values(this.fieldGroups[fieldGroup]), _q = _p.next(); !_q.done; _q = _p.next()) {
6288
+ var fieldKey = _q.value;
6263
6289
  this.fieldHide(fieldKey);
6264
6290
  }
6265
6291
  }
6266
6292
  catch (e_17_1) { e_17 = { error: e_17_1 }; }
6267
6293
  finally {
6268
6294
  try {
6269
- if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
6295
+ if (_q && !_q.done && (_o = _p.return)) _o.call(_p);
6270
6296
  }
6271
6297
  finally { if (e_17) throw e_17.error; }
6272
6298
  }
@@ -6280,17 +6306,17 @@
6280
6306
  this.formGroup.updateValueAndValidity();
6281
6307
  };
6282
6308
  KwikIDFormViewComponent.prototype.fieldGroupShow = function (fieldGroup) {
6283
- var e_18, _k;
6309
+ var e_18, _o;
6284
6310
  try {
6285
- for (var _l = __values(this.fieldGroups[fieldGroup]), _m = _l.next(); !_m.done; _m = _l.next()) {
6286
- var fieldKey = _m.value;
6311
+ for (var _p = __values(this.fieldGroups[fieldGroup]), _q = _p.next(); !_q.done; _q = _p.next()) {
6312
+ var fieldKey = _q.value;
6287
6313
  this.fieldShow(fieldKey);
6288
6314
  }
6289
6315
  }
6290
6316
  catch (e_18_1) { e_18 = { error: e_18_1 }; }
6291
6317
  finally {
6292
6318
  try {
6293
- if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
6319
+ if (_q && !_q.done && (_o = _p.return)) _o.call(_p);
6294
6320
  }
6295
6321
  finally { if (e_18) throw e_18.error; }
6296
6322
  }
@@ -6314,17 +6340,17 @@
6314
6340
  }
6315
6341
  };
6316
6342
  KwikIDFormViewComponent.prototype.fieldGroupDisable = function (fieldGroup) {
6317
- var e_19, _k;
6343
+ var e_19, _o;
6318
6344
  try {
6319
- for (var _l = __values(this.fieldGroups[fieldGroup]), _m = _l.next(); !_m.done; _m = _l.next()) {
6320
- var fieldKey = _m.value;
6345
+ for (var _p = __values(this.fieldGroups[fieldGroup]), _q = _p.next(); !_q.done; _q = _p.next()) {
6346
+ var fieldKey = _q.value;
6321
6347
  this.fieldDisable(fieldKey);
6322
6348
  }
6323
6349
  }
6324
6350
  catch (e_19_1) { e_19 = { error: e_19_1 }; }
6325
6351
  finally {
6326
6352
  try {
6327
- if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
6353
+ if (_q && !_q.done && (_o = _p.return)) _o.call(_p);
6328
6354
  }
6329
6355
  finally { if (e_19) throw e_19.error; }
6330
6356
  }
@@ -6348,23 +6374,23 @@
6348
6374
  }
6349
6375
  };
6350
6376
  KwikIDFormViewComponent.prototype.fieldGroupEnable = function (fieldGroup) {
6351
- var e_20, _k;
6377
+ var e_20, _o;
6352
6378
  try {
6353
- for (var _l = __values(this.fieldGroups[fieldGroup]), _m = _l.next(); !_m.done; _m = _l.next()) {
6354
- var fieldKey = _m.value;
6379
+ for (var _p = __values(this.fieldGroups[fieldGroup]), _q = _p.next(); !_q.done; _q = _p.next()) {
6380
+ var fieldKey = _q.value;
6355
6381
  this.fieldEnable(fieldKey);
6356
6382
  }
6357
6383
  }
6358
6384
  catch (e_20_1) { e_20 = { error: e_20_1 }; }
6359
6385
  finally {
6360
6386
  try {
6361
- if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
6387
+ if (_q && !_q.done && (_o = _p.return)) _o.call(_p);
6362
6388
  }
6363
6389
  finally { if (e_20) throw e_20.error; }
6364
6390
  }
6365
6391
  };
6366
6392
  KwikIDFormViewComponent.prototype.fieldReset = function (fieldKey) {
6367
- var _k;
6393
+ var _o;
6368
6394
  // Find the field and its index in the formFields array
6369
6395
  var field = getFormFieldByKey(this.formFields, fieldKey);
6370
6396
  var fieldIndex = getFormFieldIndexByKey(this.formFields, fieldKey);
@@ -6375,9 +6401,9 @@
6375
6401
  emitEvent: false,
6376
6402
  onlySelf: true
6377
6403
  });
6378
- this.formGroup.patchValue((_k = {},
6379
- _k[field.key] = resetValue,
6380
- _k), { emitEvent: false });
6404
+ this.formGroup.patchValue((_o = {},
6405
+ _o[field.key] = resetValue,
6406
+ _o), { emitEvent: false });
6381
6407
  this.formGroup.controls[field.key].updateValueAndValidity({
6382
6408
  emitEvent: true
6383
6409
  });
@@ -6408,6 +6434,14 @@
6408
6434
  break;
6409
6435
  }
6410
6436
  };
6437
+ KwikIDFormViewComponent.prototype.setHtml = function (fieldKey, message) {
6438
+ var field = getFormFieldByKey(this.formFields, fieldKey);
6439
+ var fieldIndex = this.formFields.findIndex(function (_) {
6440
+ return field.key === _.key;
6441
+ });
6442
+ field = appendHtmlMessage(field, message);
6443
+ this.formFields[fieldIndex] = field;
6444
+ };
6411
6445
  KwikIDFormViewComponent.prototype.fieldErrorShow = function (fieldKey, message) {
6412
6446
  var field = getFormFieldByKey(this.formFields, fieldKey);
6413
6447
  var fieldIndex = this.formFields.findIndex(function (_) {
@@ -6445,13 +6479,13 @@
6445
6479
  KwikIDFormViewComponent.prototype.setValue = function (action, object) {
6446
6480
  return __awaiter(this, void 0, void 0, function () {
6447
6481
  var source, sourceValue;
6448
- return __generator(this, function (_k) {
6449
- switch (_k.label) {
6482
+ return __generator(this, function (_o) {
6483
+ switch (_o.label) {
6450
6484
  case 0:
6451
6485
  source = new kwikidToolkit.Source(object);
6452
6486
  return [4 /*yield*/, source.getValueFromSource(action.props.value.source)];
6453
6487
  case 1:
6454
- sourceValue = _k.sent();
6488
+ sourceValue = _o.sent();
6455
6489
  source.setValueToSource(action.props.value.destination, sourceValue);
6456
6490
  object.FIELD_CONFIG = source.object.FIELD_CONFIG;
6457
6491
  this.formData = source.object.FORM_DATA;
@@ -6466,13 +6500,13 @@
6466
6500
  KwikIDFormViewComponent.prototype.setFieldDefaultValue = function (action, object) {
6467
6501
  return __awaiter(this, void 0, void 0, function () {
6468
6502
  var source, sourceValue;
6469
- return __generator(this, function (_k) {
6470
- switch (_k.label) {
6503
+ return __generator(this, function (_o) {
6504
+ switch (_o.label) {
6471
6505
  case 0:
6472
6506
  source = new kwikidToolkit.Source(object);
6473
6507
  return [4 /*yield*/, source.getValueFromSource(action.props.value.source)];
6474
6508
  case 1:
6475
- sourceValue = _k.sent();
6509
+ sourceValue = _o.sent();
6476
6510
  source.setValueToSource({
6477
6511
  key: kwikidToolkit.ESourceKey.OBJECT,
6478
6512
  props: {
@@ -6504,7 +6538,7 @@
6504
6538
  KwikIDFormViewComponent.prototype.setApiStatus = function (action, object) {
6505
6539
  return __awaiter(this, void 0, void 0, function () {
6506
6540
  var source, sourceValue;
6507
- return __generator(this, function (_k) {
6541
+ return __generator(this, function (_o) {
6508
6542
  source = new kwikidToolkit.Source(object);
6509
6543
  sourceValue = action.props.status;
6510
6544
  source.setValueToSource({
@@ -6524,13 +6558,13 @@
6524
6558
  KwikIDFormViewComponent.prototype.setApiHeaderValue = function (action, object) {
6525
6559
  return __awaiter(this, void 0, void 0, function () {
6526
6560
  var source, sourceValue;
6527
- return __generator(this, function (_k) {
6528
- switch (_k.label) {
6561
+ return __generator(this, function (_o) {
6562
+ switch (_o.label) {
6529
6563
  case 0:
6530
6564
  source = new kwikidToolkit.Source(object);
6531
6565
  return [4 /*yield*/, source.getValueFromSource(action.props.source)];
6532
6566
  case 1:
6533
- sourceValue = _k.sent();
6567
+ sourceValue = _o.sent();
6534
6568
  source.setValueToSource({
6535
6569
  key: kwikidToolkit.ESourceKey.OBJECT,
6536
6570
  props: {
@@ -6549,7 +6583,7 @@
6549
6583
  KwikIDFormViewComponent.prototype.setApiHeaderValidity = function (action, object) {
6550
6584
  return __awaiter(this, void 0, void 0, function () {
6551
6585
  var source, sourceValue;
6552
- return __generator(this, function (_k) {
6586
+ return __generator(this, function (_o) {
6553
6587
  source = new kwikidToolkit.Source(object);
6554
6588
  sourceValue = action.props.valid;
6555
6589
  source.setValueToSource({
@@ -6569,13 +6603,13 @@
6569
6603
  KwikIDFormViewComponent.prototype.setApiBodyValue = function (action, object) {
6570
6604
  return __awaiter(this, void 0, void 0, function () {
6571
6605
  var source, sourceValue;
6572
- return __generator(this, function (_k) {
6573
- switch (_k.label) {
6606
+ return __generator(this, function (_o) {
6607
+ switch (_o.label) {
6574
6608
  case 0:
6575
6609
  source = new kwikidToolkit.Source(object);
6576
6610
  return [4 /*yield*/, source.getValueFromSource(action.props.source)];
6577
6611
  case 1:
6578
- sourceValue = _k.sent();
6612
+ sourceValue = _o.sent();
6579
6613
  source.setValueToSource({
6580
6614
  key: kwikidToolkit.ESourceKey.OBJECT,
6581
6615
  props: {
@@ -6594,7 +6628,7 @@
6594
6628
  KwikIDFormViewComponent.prototype.setApiBodyValidity = function (action, object) {
6595
6629
  return __awaiter(this, void 0, void 0, function () {
6596
6630
  var source, sourceValue;
6597
- return __generator(this, function (_k) {
6631
+ return __generator(this, function (_o) {
6598
6632
  source = new kwikidToolkit.Source(object);
6599
6633
  sourceValue = action.props.valid;
6600
6634
  source.setValueToSource({
@@ -6614,7 +6648,7 @@
6614
6648
  KwikIDFormViewComponent.prototype.setFieldValidity = function (action, object) {
6615
6649
  return __awaiter(this, void 0, void 0, function () {
6616
6650
  var source, sourceValue;
6617
- return __generator(this, function (_k) {
6651
+ return __generator(this, function (_o) {
6618
6652
  source = new kwikidToolkit.Source(object);
6619
6653
  sourceValue = action.props.valid;
6620
6654
  source.setValueToSource({
@@ -6634,18 +6668,18 @@
6634
6668
  KwikIDFormViewComponent.prototype.setDropdownOptions = function (action, object) {
6635
6669
  return __awaiter(this, void 0, void 0, function () {
6636
6670
  var source, sourceValue, appendToPath, appendToPathStr, optionsPath;
6637
- return __generator(this, function (_k) {
6638
- switch (_k.label) {
6671
+ return __generator(this, function (_o) {
6672
+ switch (_o.label) {
6639
6673
  case 0:
6640
6674
  source = new kwikidToolkit.Source(object);
6641
6675
  return [4 /*yield*/, source.getValueFromSource(action.props.value.source)];
6642
6676
  case 1:
6643
- sourceValue = _k.sent();
6677
+ sourceValue = _o.sent();
6644
6678
  if (!kwikidToolkit.checkObjectKeyExists(action.props, "options")) return [3 /*break*/, 4];
6645
6679
  if (!kwikidToolkit.checkObjectKeyExists(action.props.options, "appendToPath")) return [3 /*break*/, 3];
6646
6680
  return [4 /*yield*/, source.getValueFromSource(action.props.options.appendToPath.source)];
6647
6681
  case 2:
6648
- appendToPath = _k.sent();
6682
+ appendToPath = _o.sent();
6649
6683
  if (kwikidToolkit.isNotEmptyValue(appendToPath)) {
6650
6684
  appendToPathStr = kwikidToolkit.replaceString(appendToPath.match("" + action.props.options.appendToPath.filterSourceValue)[0], "[^a-zA-Z0-9_]", "_");
6651
6685
  optionsPath = "" + action.props.options.path + appendToPathStr;
@@ -6654,7 +6688,7 @@
6654
6688
  return [3 /*break*/, 4];
6655
6689
  case 3:
6656
6690
  sourceValue = kwikidToolkit.getObjectValueFromPath(sourceValue, action.props.options.path);
6657
- _k.label = 4;
6691
+ _o.label = 4;
6658
6692
  case 4:
6659
6693
  source.setValueToSource(action.props.value.destination, sourceValue);
6660
6694
  object.FIELD_CONFIG = source.object.FIELD_CONFIG;
@@ -6669,19 +6703,19 @@
6669
6703
  KwikIDFormViewComponent.prototype.apiCall = function (action, object) {
6670
6704
  return __awaiter(this, void 0, void 0, function () {
6671
6705
  var apiConfig, response;
6672
- var _k;
6673
- return __generator(this, function (_l) {
6674
- switch (_l.label) {
6706
+ var _o;
6707
+ return __generator(this, function (_p) {
6708
+ switch (_p.label) {
6675
6709
  case 0:
6676
6710
  apiConfig = this.formConfig.apis[action.props.formApiKey];
6677
6711
  return [4 /*yield*/, this.handleApiCall(apiConfig)];
6678
6712
  case 1:
6679
- response = _l.sent();
6713
+ response = _p.sent();
6680
6714
  apiConfig = response.api;
6681
6715
  this.formConfig = kwikidToolkit.setValueToObjectPath(this.formConfig, "apis." + action.props.formApiKey, apiConfig);
6682
- this.formData = kwikidToolkit.mergeObjects(this.formData, (_k = {},
6683
- _k[action.props.formApiKey] = apiConfig.response.value,
6684
- _k));
6716
+ this.formData = kwikidToolkit.mergeObjects(this.formData, (_o = {},
6717
+ _o[action.props.formApiKey] = apiConfig.response.value,
6718
+ _o));
6685
6719
  return [2 /*return*/, apiConfig];
6686
6720
  }
6687
6721
  });
@@ -6690,13 +6724,13 @@
6690
6724
  KwikIDFormViewComponent.prototype.fieldApiCall = function (action, object) {
6691
6725
  return __awaiter(this, void 0, void 0, function () {
6692
6726
  var apiConfig;
6693
- return __generator(this, function (_k) {
6694
- switch (_k.label) {
6727
+ return __generator(this, function (_o) {
6728
+ switch (_o.label) {
6695
6729
  case 0:
6696
6730
  this.showApiLoader();
6697
6731
  return [4 /*yield*/, this.apiCall(action, object)];
6698
6732
  case 1:
6699
- apiConfig = _k.sent();
6733
+ apiConfig = _o.sent();
6700
6734
  this.hideApiLoader();
6701
6735
  return [2 /*return*/];
6702
6736
  }
@@ -6706,8 +6740,8 @@
6706
6740
  KwikIDFormViewComponent.prototype.fieldMultipleApiCalls = function (action, object) {
6707
6741
  return __awaiter(this, void 0, void 0, function () {
6708
6742
  var entrypointApiKey, field, endpoints, nextApiIndex, apiConfig, response;
6709
- return __generator(this, function (_k) {
6710
- switch (_k.label) {
6743
+ return __generator(this, function (_o) {
6744
+ switch (_o.label) {
6711
6745
  case 0:
6712
6746
  entrypointApiKey = action.props.apiKey;
6713
6747
  field = getFormFieldByKey(this.formFields, action.props.fieldKey);
@@ -6716,7 +6750,7 @@
6716
6750
  apiConfig = endpoints[nextApiIndex];
6717
6751
  return [4 /*yield*/, this.handleFieldApiCall(field, apiConfig)];
6718
6752
  case 1:
6719
- response = _k.sent();
6753
+ response = _o.sent();
6720
6754
  field = response.field;
6721
6755
  field.api.endpoints[nextApiIndex] = response.api;
6722
6756
  return [2 /*return*/];
@@ -6727,15 +6761,15 @@
6727
6761
  KwikIDFormViewComponent.prototype.fieldMultipleApiCallsEnd = function (action, object) {
6728
6762
  return __awaiter(this, void 0, void 0, function () {
6729
6763
  var field, multipleApiCallResponses;
6730
- var _k;
6731
- return __generator(this, function (_l) {
6764
+ var _o;
6765
+ return __generator(this, function (_p) {
6732
6766
  field = getFormFieldByKey(this.formFields, action.props.fieldKey);
6733
6767
  multipleApiCallResponses = {};
6734
6768
  field.api.endpoints.map(function (api) {
6735
6769
  if (kwikidToolkit.checkObjectKeyExists(api.response, "value"))
6736
6770
  multipleApiCallResponses = kwikidToolkit.setValueToObjectPath(multipleApiCallResponses, "" + api.apiKey, api.response.value);
6737
6771
  });
6738
- this.formData = Object.assign(Object.assign({}, this.formData), (_k = {}, _k[field.key] = multipleApiCallResponses, _k));
6772
+ this.formData = Object.assign(Object.assign({}, this.formData), (_o = {}, _o[field.key] = multipleApiCallResponses, _o));
6739
6773
  this.patchFormGroup(this.formData);
6740
6774
  return [2 /*return*/];
6741
6775
  });
@@ -6744,17 +6778,17 @@
6744
6778
  KwikIDFormViewComponent.prototype.taskApiCall = function (action, object) {
6745
6779
  return __awaiter(this, void 0, void 0, function () {
6746
6780
  var apiConfig;
6747
- var _k;
6748
- return __generator(this, function (_l) {
6749
- switch (_l.label) {
6781
+ var _o;
6782
+ return __generator(this, function (_p) {
6783
+ switch (_p.label) {
6750
6784
  case 0:
6751
6785
  this.showApiLoader();
6752
6786
  return [4 /*yield*/, this.apiCall(action, object)];
6753
6787
  case 1:
6754
- apiConfig = _l.sent();
6755
- this.taskData = kwikidToolkit.mergeObjects(this.taskData, (_k = {},
6756
- _k[action.props.formApiKey] = apiConfig.response.value,
6757
- _k));
6788
+ apiConfig = _p.sent();
6789
+ this.taskData = kwikidToolkit.mergeObjects(this.taskData, (_o = {},
6790
+ _o[action.props.formApiKey] = apiConfig.response.value,
6791
+ _o));
6758
6792
  this.waitingForChanges = false;
6759
6793
  this.hideApiLoader();
6760
6794
  return [2 /*return*/];
@@ -6765,8 +6799,8 @@
6765
6799
  KwikIDFormViewComponent.prototype.taskMultipleApiCalls = function (action, object) {
6766
6800
  return __awaiter(this, void 0, void 0, function () {
6767
6801
  var multipleApiConfig, entrypointApiKey_1, endpoints, nextApiIndex, apiConfig, response, apis;
6768
- return __generator(this, function (_k) {
6769
- switch (_k.label) {
6802
+ return __generator(this, function (_o) {
6803
+ switch (_o.label) {
6770
6804
  case 0:
6771
6805
  this.showApiLoader();
6772
6806
  multipleApiConfig = this.formConfig.apis[action.props.formApiKey];
@@ -6777,7 +6811,7 @@
6777
6811
  apiConfig = endpoints[nextApiIndex];
6778
6812
  return [4 /*yield*/, this.handleApiCall(apiConfig)];
6779
6813
  case 1:
6780
- response = _k.sent();
6814
+ response = _o.sent();
6781
6815
  multipleApiConfig.endpoints[nextApiIndex] = response.api;
6782
6816
  this.formConfig = kwikidToolkit.setValueToObjectPath(this.formConfig, "apis." + action.props.formApiKey, multipleApiConfig);
6783
6817
  this.hideApiLoader();
@@ -6794,8 +6828,8 @@
6794
6828
  }, this.takeAction.bind(this));
6795
6829
  return [4 /*yield*/, apis.callNextApi(multipleApiConfig.entrypoint)];
6796
6830
  case 3:
6797
- _k.sent();
6798
- _k.label = 4;
6831
+ _o.sent();
6832
+ _o.label = 4;
6799
6833
  case 4: return [2 /*return*/];
6800
6834
  }
6801
6835
  });
@@ -6804,15 +6838,15 @@
6804
6838
  KwikIDFormViewComponent.prototype.taskMultipleApiCallsEnd = function (action, object) {
6805
6839
  return __awaiter(this, void 0, void 0, function () {
6806
6840
  var multipleApiConfig, multipleApiCallResponses;
6807
- var _k;
6808
- return __generator(this, function (_l) {
6841
+ var _o;
6842
+ return __generator(this, function (_p) {
6809
6843
  multipleApiConfig = this.formConfig.apis[action.props.formApiKey];
6810
6844
  multipleApiCallResponses = {};
6811
6845
  multipleApiConfig.endpoints.map(function (api) {
6812
6846
  if (kwikidToolkit.checkObjectKeyExists(api.response, "value"))
6813
6847
  multipleApiCallResponses = kwikidToolkit.setValueToObjectPath(multipleApiCallResponses, "" + api.apiKey, api.response.value);
6814
6848
  });
6815
- this.taskData = Object.assign(Object.assign({}, this.taskData), (_k = {}, _k[action.props.formApiKey] = multipleApiCallResponses, _k));
6849
+ this.taskData = Object.assign(Object.assign({}, this.taskData), (_o = {}, _o[action.props.formApiKey] = multipleApiCallResponses, _o));
6816
6850
  this.waitingForChanges = false;
6817
6851
  this.hideApiLoader();
6818
6852
  return [2 /*return*/];
@@ -6994,7 +7028,7 @@
6994
7028
  };
6995
7029
  KwikIDFormViewComponent.prototype.takeActionOnFieldGroup = function (action, object) {
6996
7030
  return __awaiter(this, void 0, void 0, function () {
6997
- return __generator(this, function (_k) {
7031
+ return __generator(this, function (_o) {
6998
7032
  switch (action.key) {
6999
7033
  case EActionKey.FIELD_GROUP_HIDE:
7000
7034
  this.fieldGroupHide(action.props.groupKey);
@@ -7018,12 +7052,12 @@
7018
7052
  KwikIDFormViewComponent.prototype.takeAction = function (action, object) {
7019
7053
  var _a, _b, _c, _d, _e, _f;
7020
7054
  return __awaiter(this, void 0, void 0, function () {
7021
- var _k, fieldErrorShow_Source, fieldErrorShowSourceValue, fieldErrorHide_Source, fieldErrorHideSourceValue, redirectToUrl_Source, redirectToUrlSourceValue, previewErrorShow_Source, previewErrorShowSourceValue;
7022
- return __generator(this, function (_l) {
7023
- switch (_l.label) {
7055
+ var _o, fieldErrorShow_Source, fieldErrorShowSourceValue, fieldErrorHide_Source, fieldErrorHideSourceValue, redirectToUrl_Source, redirectToUrlSourceValue, previewErrorShow_Source, previewErrorShowSourceValue, fieldHtmlMessage_Source, fieldHtmlMessageSourceValue;
7056
+ return __generator(this, function (_p) {
7057
+ switch (_p.label) {
7024
7058
  case 0:
7025
- _k = action.key;
7026
- switch (_k) {
7059
+ _o = action.key;
7060
+ switch (_o) {
7027
7061
  case EActionKey.FIELD_HIDE: return [3 /*break*/, 1];
7028
7062
  case EActionKey.FIELD_SHOW: return [3 /*break*/, 2];
7029
7063
  case EActionKey.FIELD_DISABLE: return [3 /*break*/, 3];
@@ -7062,29 +7096,30 @@
7062
7096
  case EActionKey.DIALOG_HIDE: return [3 /*break*/, 59];
7063
7097
  case EActionKey.SAVE_FORM: return [3 /*break*/, 60];
7064
7098
  case EActionKey.ALERT_SHOW: return [3 /*break*/, 61];
7099
+ case EActionKey.SET_HTML: return [3 /*break*/, 62];
7065
7100
  }
7066
- return [3 /*break*/, 62];
7101
+ return [3 /*break*/, 65];
7067
7102
  case 1:
7068
7103
  this.fieldHide(action.props.fieldKey);
7069
- return [3 /*break*/, 63];
7104
+ return [3 /*break*/, 66];
7070
7105
  case 2:
7071
7106
  this.fieldShow(action.props.fieldKey);
7072
- return [3 /*break*/, 63];
7107
+ return [3 /*break*/, 66];
7073
7108
  case 3:
7074
7109
  this.fieldDisable(action.props.fieldKey);
7075
- return [3 /*break*/, 63];
7110
+ return [3 /*break*/, 66];
7076
7111
  case 4:
7077
7112
  this.fieldEnable(action.props.fieldKey);
7078
- return [3 /*break*/, 63];
7113
+ return [3 /*break*/, 66];
7079
7114
  case 5:
7080
7115
  this.fieldReset(action.props.fieldKey);
7081
- return [3 /*break*/, 63];
7116
+ return [3 /*break*/, 66];
7082
7117
  case 6:
7083
7118
  if (!kwikidToolkit.checkObjectKeyExists(action.props.message, "source")) return [3 /*break*/, 8];
7084
7119
  fieldErrorShow_Source = new kwikidToolkit.Source(object);
7085
7120
  return [4 /*yield*/, fieldErrorShow_Source.getValueFromSource(action.props.message.source)];
7086
7121
  case 7:
7087
- fieldErrorShowSourceValue = _l.sent();
7122
+ fieldErrorShowSourceValue = _p.sent();
7088
7123
  if (typeof fieldErrorShowSourceValue == "string" ||
7089
7124
  typeof fieldErrorShowSourceValue == "number") {
7090
7125
  fieldErrorShowSourceValue = String(fieldErrorShowSourceValue);
@@ -7093,17 +7128,17 @@
7093
7128
  fieldErrorShowSourceValue = "";
7094
7129
  }
7095
7130
  action = kwikidToolkit.setValueToObjectPath(action, "props.message.message", fieldErrorShowSourceValue);
7096
- _l.label = 8;
7131
+ _p.label = 8;
7097
7132
  case 8:
7098
7133
  action.props.message.message = updateLanguage(action.props.message.message, getLanguage());
7099
7134
  this.fieldErrorShow(action.props.fieldKey, action.props.message);
7100
- return [3 /*break*/, 63];
7135
+ return [3 /*break*/, 66];
7101
7136
  case 9:
7102
7137
  if (!kwikidToolkit.checkObjectKeyExists(action.props.message, "source")) return [3 /*break*/, 11];
7103
7138
  fieldErrorHide_Source = new kwikidToolkit.Source(object);
7104
7139
  return [4 /*yield*/, fieldErrorHide_Source.getValueFromSource(action.props.message.source)];
7105
7140
  case 10:
7106
- fieldErrorHideSourceValue = _l.sent();
7141
+ fieldErrorHideSourceValue = _p.sent();
7107
7142
  if (typeof fieldErrorHideSourceValue == "string" ||
7108
7143
  typeof fieldErrorHideSourceValue == "number") {
7109
7144
  fieldErrorHideSourceValue = String(fieldErrorHideSourceValue);
@@ -7112,102 +7147,102 @@
7112
7147
  fieldErrorHideSourceValue = "";
7113
7148
  }
7114
7149
  action = kwikidToolkit.setValueToObjectPath(action, "props.message.message", fieldErrorHideSourceValue);
7115
- _l.label = 11;
7150
+ _p.label = 11;
7116
7151
  case 11:
7117
7152
  this.fieldErrorHide(action.props.fieldKey, action.props.message);
7118
- return [3 /*break*/, 63];
7153
+ return [3 /*break*/, 66];
7119
7154
  case 12:
7120
7155
  this.fieldMessageShow(action.props.fieldKey, action.props.message);
7121
- return [3 /*break*/, 63];
7156
+ return [3 /*break*/, 66];
7122
7157
  case 13:
7123
7158
  this.fieldMessageHide(action.props.fieldKey, action.props.message);
7124
- return [3 /*break*/, 63];
7159
+ return [3 /*break*/, 66];
7125
7160
  case 14: return [4 /*yield*/, this.setValue(action, object)];
7126
7161
  case 15:
7127
- _l.sent();
7128
- return [3 /*break*/, 63];
7162
+ _p.sent();
7163
+ return [3 /*break*/, 66];
7129
7164
  case 16: return [4 /*yield*/, this.setFieldDefaultValue(action, object)];
7130
7165
  case 17:
7131
- _l.sent();
7132
- return [3 /*break*/, 63];
7166
+ _p.sent();
7167
+ return [3 /*break*/, 66];
7133
7168
  case 18: return [4 /*yield*/, this.setApiStatus(action, object)];
7134
7169
  case 19:
7135
- _l.sent();
7136
- return [3 /*break*/, 63];
7170
+ _p.sent();
7171
+ return [3 /*break*/, 66];
7137
7172
  case 20: return [4 /*yield*/, this.setApiHeaderValue(action, object)];
7138
7173
  case 21:
7139
- _l.sent();
7140
- return [3 /*break*/, 63];
7174
+ _p.sent();
7175
+ return [3 /*break*/, 66];
7141
7176
  case 22: return [4 /*yield*/, this.setApiHeaderValidity(action, object)];
7142
7177
  case 23:
7143
- _l.sent();
7144
- return [3 /*break*/, 63];
7178
+ _p.sent();
7179
+ return [3 /*break*/, 66];
7145
7180
  case 24: return [4 /*yield*/, this.setApiBodyValue(action, object)];
7146
7181
  case 25:
7147
- _l.sent();
7148
- return [3 /*break*/, 63];
7182
+ _p.sent();
7183
+ return [3 /*break*/, 66];
7149
7184
  case 26: return [4 /*yield*/, this.setApiBodyValidity(action, object)];
7150
7185
  case 27:
7151
- _l.sent();
7152
- return [3 /*break*/, 63];
7186
+ _p.sent();
7187
+ return [3 /*break*/, 66];
7153
7188
  case 28: return [4 /*yield*/, this.setDropdownOptions(action, object)];
7154
7189
  case 29:
7155
- _l.sent();
7156
- return [3 /*break*/, 63];
7190
+ _p.sent();
7191
+ return [3 /*break*/, 66];
7157
7192
  case 30: return [4 /*yield*/, this.setFieldValidity(action, object)];
7158
7193
  case 31:
7159
- _l.sent();
7160
- return [3 /*break*/, 63];
7194
+ _p.sent();
7195
+ return [3 /*break*/, 66];
7161
7196
  case 32:
7162
7197
  this.handleConnectedElements({ key: action.props.fieldKey }, "ON_ACTION");
7163
- return [3 /*break*/, 63];
7198
+ return [3 /*break*/, 66];
7164
7199
  case 33: return [4 /*yield*/, this.fieldApiCall(action, object)];
7165
7200
  case 34:
7166
- _l.sent();
7167
- return [3 /*break*/, 63];
7201
+ _p.sent();
7202
+ return [3 /*break*/, 66];
7168
7203
  case 35: return [4 /*yield*/, this.fieldMultipleApiCalls(action, object)];
7169
7204
  case 36:
7170
- _l.sent();
7171
- return [3 /*break*/, 63];
7205
+ _p.sent();
7206
+ return [3 /*break*/, 66];
7172
7207
  case 37: return [4 /*yield*/, this.fieldMultipleApiCallsEnd(action, object)];
7173
7208
  case 38:
7174
- _l.sent();
7175
- return [3 /*break*/, 63];
7209
+ _p.sent();
7210
+ return [3 /*break*/, 66];
7176
7211
  case 39: return [4 /*yield*/, this.taskApiCall(action, object)];
7177
7212
  case 40:
7178
- _l.sent();
7179
- return [3 /*break*/, 63];
7213
+ _p.sent();
7214
+ return [3 /*break*/, 66];
7180
7215
  case 41: return [4 /*yield*/, this.taskMultipleApiCalls(action, object)];
7181
7216
  case 42:
7182
- _l.sent();
7183
- return [3 /*break*/, 63];
7217
+ _p.sent();
7218
+ return [3 /*break*/, 66];
7184
7219
  case 43: return [4 /*yield*/, this.taskMultipleApiCallsEnd(action, object)];
7185
7220
  case 44:
7186
- _l.sent();
7187
- return [3 /*break*/, 63];
7221
+ _p.sent();
7222
+ return [3 /*break*/, 66];
7188
7223
  case 45:
7189
7224
  if (!kwikidToolkit.checkObjectKeyExists(action.props.url, "source")) return [3 /*break*/, 47];
7190
7225
  redirectToUrl_Source = new kwikidToolkit.Source(object);
7191
7226
  return [4 /*yield*/, redirectToUrl_Source.getValueFromSource(action.props.url.source)];
7192
7227
  case 46:
7193
- redirectToUrlSourceValue = _l.sent();
7228
+ redirectToUrlSourceValue = _p.sent();
7194
7229
  if (kwikidToolkit.isEmptyString(redirectToUrlSourceValue)) {
7195
7230
  redirectToUrlSourceValue = "";
7196
7231
  }
7197
7232
  action = kwikidToolkit.setValueToObjectPath(action, "props.url.url", redirectToUrlSourceValue);
7198
- _l.label = 47;
7233
+ _p.label = 47;
7199
7234
  case 47:
7200
7235
  this.redirectToUrl(action);
7201
- _l.label = 48;
7236
+ _p.label = 48;
7202
7237
  case 48:
7203
7238
  this.showPreview(action.props);
7204
- return [3 /*break*/, 63];
7239
+ return [3 /*break*/, 66];
7205
7240
  case 49:
7206
7241
  if (!kwikidToolkit.checkObjectKeyExists(action.props.message, "source")) return [3 /*break*/, 51];
7207
7242
  previewErrorShow_Source = new kwikidToolkit.Source(object);
7208
7243
  return [4 /*yield*/, previewErrorShow_Source.getValueFromSource(action.props.message.source)];
7209
7244
  case 50:
7210
- previewErrorShowSourceValue = _l.sent();
7245
+ previewErrorShowSourceValue = _p.sent();
7211
7246
  if (typeof previewErrorShowSourceValue == "string" ||
7212
7247
  typeof previewErrorShowSourceValue == "number") {
7213
7248
  previewErrorShowSourceValue = String(previewErrorShowSourceValue);
@@ -7216,28 +7251,28 @@
7216
7251
  previewErrorShowSourceValue = "";
7217
7252
  }
7218
7253
  action = kwikidToolkit.setValueToObjectPath(action, "props.message.message", previewErrorShowSourceValue);
7219
- _l.label = 51;
7254
+ _p.label = 51;
7220
7255
  case 51:
7221
7256
  this.showErrorPreview(action.props);
7222
- return [3 /*break*/, 63];
7257
+ return [3 /*break*/, 66];
7223
7258
  case 52:
7224
7259
  this.showPopupForm(action.props.popupFormKey, (_b = (_a = action.props) === null || _a === void 0 ? void 0 : _a.popupType) !== null && _b !== void 0 ? _b : "DIALOG");
7225
- return [3 /*break*/, 63];
7260
+ return [3 /*break*/, 66];
7226
7261
  case 53:
7227
7262
  this.waitingForChanges = false;
7228
- return [3 /*break*/, 63];
7263
+ return [3 /*break*/, 66];
7229
7264
  case 54:
7230
7265
  this.toggleErrorNotification(true);
7231
- return [3 /*break*/, 63];
7266
+ return [3 /*break*/, 66];
7232
7267
  case 55:
7233
7268
  this.toggleErrorNotification(false);
7234
- return [3 /*break*/, 63];
7269
+ return [3 /*break*/, 66];
7235
7270
  case 56:
7236
7271
  this.stopTaskExecution = false;
7237
- return [3 /*break*/, 63];
7272
+ return [3 /*break*/, 66];
7238
7273
  case 57:
7239
7274
  this.stopTaskExecution = true;
7240
- return [3 /*break*/, 63];
7275
+ return [3 /*break*/, 66];
7241
7276
  case 58:
7242
7277
  this.dialogShow({
7243
7278
  html: (_c = action.props) === null || _c === void 0 ? void 0 : _c.html,
@@ -7245,18 +7280,37 @@
7245
7280
  size: (_e = action.props) === null || _e === void 0 ? void 0 : _e.size,
7246
7281
  button: (_f = action.props) === null || _f === void 0 ? void 0 : _f.button
7247
7282
  });
7248
- return [3 /*break*/, 63];
7283
+ return [3 /*break*/, 66];
7249
7284
  case 59:
7250
7285
  this.dialogHide();
7251
- return [3 /*break*/, 63];
7286
+ return [3 /*break*/, 66];
7252
7287
  case 60:
7253
7288
  this.handleOnClickSaveForm(undefined);
7254
- return [3 /*break*/, 63];
7289
+ return [3 /*break*/, 66];
7255
7290
  case 61:
7256
7291
  this.alertShow(action.props.type, action.props.message);
7257
- return [3 /*break*/, 63];
7258
- case 62: return [3 /*break*/, 63];
7259
- case 63: return [2 /*return*/];
7292
+ return [3 /*break*/, 66];
7293
+ case 62:
7294
+ if (!kwikidToolkit.checkObjectKeyExists(action.props.message, "source")) return [3 /*break*/, 64];
7295
+ fieldHtmlMessage_Source = new kwikidToolkit.Source(object);
7296
+ return [4 /*yield*/, fieldHtmlMessage_Source.getValueFromSource(action.props.message.source)];
7297
+ case 63:
7298
+ fieldHtmlMessageSourceValue = _p.sent();
7299
+ if (typeof fieldHtmlMessageSourceValue == "string" ||
7300
+ typeof fieldHtmlMessageSourceValue == "number") {
7301
+ fieldHtmlMessageSourceValue = String(fieldHtmlMessageSourceValue);
7302
+ }
7303
+ else {
7304
+ fieldHtmlMessageSourceValue = "";
7305
+ }
7306
+ action = kwikidToolkit.setValueToObjectPath(action, "props.message.message", fieldHtmlMessageSourceValue);
7307
+ _p.label = 64;
7308
+ case 64:
7309
+ action.props.message.message = updateLanguage(action.props.message.message, getLanguage());
7310
+ this.setHtml(action.props.fieldKey, action.props.message);
7311
+ return [3 /*break*/, 66];
7312
+ case 65: return [3 /*break*/, 66];
7313
+ case 66: return [2 /*return*/];
7260
7314
  }
7261
7315
  });
7262
7316
  });
@@ -7403,6 +7457,9 @@
7403
7457
  __decorate([
7404
7458
  kwikidToolkit.logMethod
7405
7459
  ], KwikIDFormViewComponent.prototype, "fieldReset", null);
7460
+ __decorate([
7461
+ kwikidToolkit.logMethod
7462
+ ], KwikIDFormViewComponent.prototype, "setHtml", null);
7406
7463
  __decorate([
7407
7464
  kwikidToolkit.logMethod
7408
7465
  ], KwikIDFormViewComponent.prototype, "fieldErrorShow", null);
@@ -7568,7 +7625,7 @@
7568
7625
  type: i0.Output
7569
7626
  }], onClickViewForms: [{
7570
7627
  type: i0.Output
7571
- }], resetCamera: [], ngOnInit: [], ngAfterViewInit: [], ngOnChanges: [], ngOnDestroy: [], initFormConfig: [], setFormFieldsFromFormConfig: [], setFormFieldGroupsFromFormConfig: [], setFormDataFromAllFormsData: [], handleConnectedElementFieldGroupActions: [], handleConnectedElementFieldGroup: [], handleConnectedElementFieldActions: [], handleConnectedElementFields: [], handleConnectedElements: [], handleRemovedFile: [], handleGetKeyValueFile: [], handleOnClickGetRemovedMediaFile: [], handleOnClickInputCamera: [], setCameraMedia: [], handleGetCameraMedia: [], handleOnClickSaveCameraMedia: [], handleOnClickCameraBack: [], handleOnClickCameraClose: [], updateFiles: [], uploadFile: [], handleOnClickFormFieldButton: [], handleGetKeyValue: [], handleOnClickResetFormFields: [], handleFieldApiCall: [], handleApiCall: [], executeApiCall: [], isValidRequestHeadersAndBody: [], handleOnClickApiCall: [], handleOnClickGoBack: [], handleOnClickViewForms: [], handleOnClickSaveForm: [], toggleErrorNotification: [], fieldHide: [], fieldGroupHide: [], fieldShow: [], fieldGroupShow: [], fieldDisable: [], fieldGroupDisable: [], fieldEnable: [], fieldGroupEnable: [], fieldReset: [], fieldErrorShow: [], fieldErrorHide: [], fieldMessageShow: [], fieldMessageHide: [], setValue: [], setFieldDefaultValue: [], setApiStatus: [], setApiHeaderValue: [], setApiHeaderValidity: [], setApiBodyValue: [], setApiBodyValidity: [], setFieldValidity: [], setDropdownOptions: [], apiCall: [], fieldApiCall: [], fieldMultipleApiCalls: [], fieldMultipleApiCallsEnd: [], taskApiCall: [], taskMultipleApiCalls: [], taskMultipleApiCallsEnd: [], dialogShow: [], dialogHide: [], redirectToUrl: [], patchFieldControlValue: [], setFieldControlValue: [], patchFormGroup: [], isFieldValid: [], isFieldEnabled: [], getFormGroupRawValues: [], showPreview: [], showErrorPreview: [], showPopupForm: [], alertShow: [], takeActionOnFieldGroup: [], takeAction: [] } });
7628
+ }], resetCamera: [], ngOnInit: [], ngAfterViewInit: [], ngOnChanges: [], ngOnDestroy: [], initFormConfig: [], setFormFieldsFromFormConfig: [], setFormFieldGroupsFromFormConfig: [], setFormDataFromAllFormsData: [], handleConnectedElementFieldGroupActions: [], handleConnectedElementFieldGroup: [], handleConnectedElementFieldActions: [], handleConnectedElementFields: [], handleConnectedElements: [], handleRemovedFile: [], handleGetKeyValueFile: [], handleOnClickGetRemovedMediaFile: [], handleOnClickInputCamera: [], setCameraMedia: [], handleGetCameraMedia: [], handleOnClickSaveCameraMedia: [], handleOnClickCameraBack: [], handleOnClickCameraClose: [], updateFiles: [], uploadFile: [], handleOnClickFormFieldButton: [], handleGetKeyValue: [], handleOnClickResetFormFields: [], handleFieldApiCall: [], handleApiCall: [], executeApiCall: [], isValidRequestHeadersAndBody: [], handleOnClickApiCall: [], handleOnClickGoBack: [], handleOnClickViewForms: [], handleOnClickSaveForm: [], toggleErrorNotification: [], fieldHide: [], fieldGroupHide: [], fieldShow: [], fieldGroupShow: [], fieldDisable: [], fieldGroupDisable: [], fieldEnable: [], fieldGroupEnable: [], fieldReset: [], setHtml: [], fieldErrorShow: [], fieldErrorHide: [], fieldMessageShow: [], fieldMessageHide: [], setValue: [], setFieldDefaultValue: [], setApiStatus: [], setApiHeaderValue: [], setApiHeaderValidity: [], setApiBodyValue: [], setApiBodyValidity: [], setFieldValidity: [], setDropdownOptions: [], apiCall: [], fieldApiCall: [], fieldMultipleApiCalls: [], fieldMultipleApiCallsEnd: [], taskApiCall: [], taskMultipleApiCalls: [], taskMultipleApiCallsEnd: [], dialogShow: [], dialogHide: [], redirectToUrl: [], patchFieldControlValue: [], setFieldControlValue: [], patchFormGroup: [], isFieldValid: [], isFieldEnabled: [], getFormGroupRawValues: [], showPreview: [], showErrorPreview: [], showPopupForm: [], alertShow: [], takeActionOnFieldGroup: [], takeAction: [] } });
7572
7629
 
7573
7630
  var EFormType;
7574
7631
  (function (EFormType) {