kwikid-forms 0.6.43 → 0.6.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/kwikid-forms.umd.js +1020 -835
- package/bundles/kwikid-forms.umd.js.map +1 -1
- package/esm2015/lib/builder/builder-form-editor/builder-form-editor.component.js +22 -32
- package/esm2015/lib/builder/builder-form-editor/builder-form-editor.definitions.js +2 -1
- package/esm2015/lib/builder/builder-form-editor/builder-form-editor.helper.js +2 -4
- package/esm2015/lib/builder/builder-form-editor/builder.form-editor.constants.js +5 -5
- package/esm2015/lib/builder/builder-form-editor/builder.form-editor.service.js +6 -5
- package/esm2015/lib/builder/builder-form-list/builder-forms-list.component.js +4 -6
- package/esm2015/lib/builder/builder.component.js +43 -53
- package/esm2015/lib/builder/builder.helper.js +11 -13
- package/esm2015/lib/renderer/config-converter/config-converter.constants.js +22 -7
- package/esm2015/lib/renderer/config-converter/config-converter.helper.js +9 -10
- package/esm2015/lib/renderer/config-converter/config-converter.js +61 -37
- package/esm2015/lib/renderer/form-view/definitions/form-view.actions.definition.js +1 -1
- package/esm2015/lib/renderer/form-view/definitions/form-view.apis.definition.js +1 -1
- package/esm2015/lib/renderer/form-view/definitions/form-view.commons.definition.js +2 -1
- package/esm2015/lib/renderer/form-view/definitions/form-view.fields.definition.js +2 -1
- package/esm2015/lib/renderer/form-view/definitions/form-view.logs.definition.js +2 -1
- package/esm2015/lib/renderer/form-view/form-view.api.service.js +25 -24
- package/esm2015/lib/renderer/form-view/form-view.component.js +456 -292
- package/esm2015/lib/renderer/form-view/form-view.constants.js +17 -0
- package/esm2015/lib/renderer/form-view/form-view.module.js +15 -3
- package/esm2015/lib/renderer/form-view/form-view.service.js +6 -7
- package/esm2015/lib/renderer/form-view/helpers/form-view.apis.helper.js +44 -58
- package/esm2015/lib/renderer/form-view/helpers/form-view.camera.helper.js +16 -20
- package/esm2015/lib/renderer/form-view/helpers/form-view.defaults.helper.js +36 -97
- package/esm2015/lib/renderer/form-view/helpers/form-view.fields.helper.js +95 -92
- package/esm2015/lib/renderer/form-view/helpers/form-view.form-validations.helper.js +23 -22
- package/esm2015/lib/renderer/form-view/helpers/form-view.tasks.helper.js +5 -5
- package/esm2015/lib/renderer/form-view/pipes/filter-image-url-or-base64-from-object.pipe.js +34 -0
- package/esm2015/lib/renderer/form-view/pipes/filter-video-url-or-base64-from-object.pipe.js +30 -0
- package/esm2015/lib/renderer/forms-list/forms-list.component.js +31 -39
- package/esm2015/lib/renderer/forms-list/forms-list.definitions.js +2 -1
- package/esm2015/lib/renderer/renderer.actions.definitions.js +1 -1
- package/esm2015/lib/renderer/renderer.component.js +87 -113
- package/esm2015/lib/renderer/renderer.definitions.js +2 -1
- package/esm2015/lib/renderer/renderer.helper.js +2 -4
- package/fesm2015/kwikid-forms.js +1063 -922
- package/fesm2015/kwikid-forms.js.map +1 -1
- package/lib/builder/builder-form-editor/builder-form-editor.component.d.ts +4 -5
- package/lib/builder/builder-form-editor/builder.form-editor.service.d.ts +0 -1
- package/lib/builder/builder-form-list/builder-forms-list.component.d.ts +3 -5
- package/lib/renderer/config-converter/config-converter.constants.d.ts +21 -6
- package/lib/renderer/config-converter/config-converter.helper.d.ts +1 -0
- package/lib/renderer/form-view/definitions/form-view.fields.definition.d.ts +45 -25
- package/lib/renderer/form-view/form-view.api.service.d.ts +0 -1
- package/lib/renderer/form-view/form-view.component.d.ts +13 -13
- package/lib/renderer/form-view/form-view.constants.d.ts +16 -0
- package/lib/renderer/form-view/form-view.module.d.ts +10 -8
- package/lib/renderer/form-view/form-view.service.d.ts +1 -2
- package/lib/renderer/form-view/helpers/form-view.camera.helper.d.ts +5 -7
- package/lib/renderer/form-view/helpers/form-view.defaults.helper.d.ts +4 -6
- package/lib/renderer/form-view/helpers/form-view.fields.helper.d.ts +1 -1
- package/lib/renderer/form-view/helpers/form-view.form-validations.helper.d.ts +1 -2
- package/lib/renderer/form-view/helpers/form-view.tasks.helper.d.ts +1 -1
- package/lib/renderer/form-view/pipes/filter-image-url-or-base64-from-object.pipe.d.ts +7 -0
- package/lib/renderer/form-view/pipes/filter-video-url-or-base64-from-object.pipe.d.ts +7 -0
- package/lib/renderer/forms-list/forms-list.component.d.ts +1 -2
- package/package.json +1 -1
package/fesm2015/kwikid-forms.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __awaiter } from 'tslib';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { EventEmitter, Component, Input, Output, ChangeDetectionStrategy, Pipe, Inject, ViewChild, ViewChildren, HostListener, NgModule } from '@angular/core';
|
|
4
|
-
import { checkObjectKeyExists, setValueToObjectPath, isEmptyValue, getObjectDeepCopy, logMethod, isNotEmptyValue, setMissingKeyValue, isObject, mergeObjects, checkObjectPathExists, getObjectValueFromPath, getObjectFromLocalStorage, encryptWithAES, decryptWithAES, Rule, Condition, Action, Source,
|
|
4
|
+
import { checkObjectKeyExists, setValueToObjectPath, isEmptyValue, getObjectDeepCopy, logMethod, isNotEmptyValue, setMissingKeyValue, isObject, mergeObjects, checkObjectPathExists, getObjectValueFromPath, getObjectFromLocalStorage, encryptWithAES, decryptWithAES, Rule, Condition, Action, Source, hasWhitespacesOnly, PATTERNS, RuleEngine, mergeObjectsDeep, ESourceKey, replaceString, isUndefined, isNull, isEmptyString } from 'kwikid-toolkit';
|
|
5
5
|
import * as i3 from 'kwikui';
|
|
6
6
|
import { KwikUIModule, KwikUIPipeModule, KwikUIInputEmailModule } from 'kwikui';
|
|
7
7
|
import * as i3$1 from '@angular/forms';
|
|
@@ -32,19 +32,19 @@ function convertFormListConfig(formsList) {
|
|
|
32
32
|
if (checkObjectKeyExists(form, "formContent")) {
|
|
33
33
|
if (checkObjectKeyExists(form.formContent, "url")) {
|
|
34
34
|
form = setValueToObjectPath(form, "props.url", form.formContent.url);
|
|
35
|
-
delete form
|
|
35
|
+
delete form.formContent.url;
|
|
36
36
|
}
|
|
37
37
|
if (checkObjectKeyExists(form.formContent, "path")) {
|
|
38
38
|
form = setValueToObjectPath(form, "props.path", form.formContent.path);
|
|
39
|
-
delete form
|
|
39
|
+
delete form.formContent.path;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
if (isEmptyValue(form.formContent)) {
|
|
43
|
-
delete form
|
|
43
|
+
delete form.formContent;
|
|
44
44
|
}
|
|
45
45
|
if (checkObjectKeyExists(form, "title")) {
|
|
46
46
|
form = setValueToObjectPath(form, "props.title", form.title);
|
|
47
|
-
delete form
|
|
47
|
+
delete form.title;
|
|
48
48
|
}
|
|
49
49
|
if (!checkObjectKeyExists(form, "hidden")) {
|
|
50
50
|
form.hidden = false;
|
|
@@ -70,18 +70,16 @@ function convertFormListConfig(formsList) {
|
|
|
70
70
|
htmlContent: form.htmlContent
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
-
delete form
|
|
73
|
+
delete form.htmlContent;
|
|
74
74
|
}
|
|
75
|
-
else {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
};
|
|
80
|
-
}
|
|
75
|
+
else if (!checkObjectKeyExists(form, "props")) {
|
|
76
|
+
form.props = {
|
|
77
|
+
htmlContent: ""
|
|
78
|
+
};
|
|
81
79
|
}
|
|
82
80
|
if (checkObjectKeyExists(form, "title")) {
|
|
83
81
|
form = setValueToObjectPath(form, "props.title", form.title);
|
|
84
|
-
delete form
|
|
82
|
+
delete form.title;
|
|
85
83
|
}
|
|
86
84
|
if (!checkObjectKeyExists(form, "hidden")) {
|
|
87
85
|
form.hidden = false;
|
|
@@ -116,10 +114,9 @@ class KwikIDBuilderFormsListComponent {
|
|
|
116
114
|
title: new FormControl("", Validators.required)
|
|
117
115
|
});
|
|
118
116
|
}
|
|
119
|
-
setSelectedForm(
|
|
120
|
-
this.selectedForm =
|
|
117
|
+
setSelectedForm(selectedForm) {
|
|
118
|
+
this.selectedForm = selectedForm;
|
|
121
119
|
}
|
|
122
|
-
ngOnInit() { }
|
|
123
120
|
ngOnChanges(changes) {
|
|
124
121
|
const verifyChange = (key) => {
|
|
125
122
|
return checkObjectKeyExists(changes, key) && !changes[key].firstChange;
|
|
@@ -140,7 +137,6 @@ class KwikIDBuilderFormsListComponent {
|
|
|
140
137
|
handleOnClickAddForm() {
|
|
141
138
|
if (this.addForm.invalid) {
|
|
142
139
|
alert("Please fill all the fields");
|
|
143
|
-
return;
|
|
144
140
|
}
|
|
145
141
|
else {
|
|
146
142
|
if (isEmptyValue(this.activeFormConfig)) {
|
|
@@ -182,7 +178,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
182
178
|
templateUrl: "./builder-forms-list.component.html",
|
|
183
179
|
styleUrls: ["../shared.scss", "./builder-forms-list.component.scss"]
|
|
184
180
|
}]
|
|
185
|
-
}],
|
|
181
|
+
}], propDecorators: { activeFormConfig: [{
|
|
186
182
|
type: Input
|
|
187
183
|
}], formsList: [{
|
|
188
184
|
type: Input
|
|
@@ -221,6 +217,7 @@ var EFieldType;
|
|
|
221
217
|
EFieldType["RECORD"] = "record";
|
|
222
218
|
EFieldType["STAR_RATING"] = "star-rating";
|
|
223
219
|
EFieldType["LIVE_LOCATION"] = "live-location";
|
|
220
|
+
EFieldType["DATA_HOLDER"] = "data-holder";
|
|
224
221
|
EFieldType["CURRENCY"] = "currency";
|
|
225
222
|
})(EFieldType || (EFieldType = {}));
|
|
226
223
|
|
|
@@ -369,14 +366,31 @@ const FIELD_PROPERTIES = {
|
|
|
369
366
|
uploadFileToServer: true
|
|
370
367
|
},
|
|
371
368
|
capture: {
|
|
372
|
-
containerStyles: "",
|
|
373
369
|
buttonText: "Camera",
|
|
370
|
+
containerStyles: "",
|
|
374
371
|
icon: "tuiIconCameraLarge",
|
|
375
|
-
showMediaFiles: true,
|
|
376
|
-
uploadFileToServer: false,
|
|
377
372
|
isCroppedImage: false,
|
|
378
373
|
isMaskedImage: false,
|
|
379
|
-
|
|
374
|
+
showMediaFiles: true,
|
|
375
|
+
uploadFileToServer: false,
|
|
376
|
+
features: {
|
|
377
|
+
ocr: {
|
|
378
|
+
isEnabled: false,
|
|
379
|
+
documentType: "",
|
|
380
|
+
documentSide: "",
|
|
381
|
+
isOcrFromServer: false
|
|
382
|
+
},
|
|
383
|
+
facematch: {
|
|
384
|
+
isEnabled: false,
|
|
385
|
+
isFacematchFromServer: false,
|
|
386
|
+
sources: []
|
|
387
|
+
},
|
|
388
|
+
watermark: {
|
|
389
|
+
isEnabled: false,
|
|
390
|
+
isWatermarkFromServer: false,
|
|
391
|
+
sources: []
|
|
392
|
+
}
|
|
393
|
+
},
|
|
380
394
|
cameraConfig: {
|
|
381
395
|
header: {
|
|
382
396
|
title: "Camera",
|
|
@@ -391,8 +405,6 @@ const FIELD_PROPERTIES = {
|
|
|
391
405
|
},
|
|
392
406
|
others: {
|
|
393
407
|
isFrontCamera: false,
|
|
394
|
-
isWatermark: false,
|
|
395
|
-
isWatermarkForImageUpload: false,
|
|
396
408
|
flipHorizontal: false,
|
|
397
409
|
mask: {
|
|
398
410
|
shape: ""
|
|
@@ -471,16 +483,10 @@ const FIELD_PROPERTIES = {
|
|
|
471
483
|
};
|
|
472
484
|
|
|
473
485
|
const getFormFieldByKey = (fields, key) => {
|
|
474
|
-
|
|
475
|
-
if (field.key === key) {
|
|
476
|
-
return field;
|
|
477
|
-
}
|
|
478
|
-
});
|
|
479
|
-
return field;
|
|
486
|
+
return fields.find((field) => field.key === key);
|
|
480
487
|
};
|
|
481
488
|
const getFormFieldIndexByKey = (fields, key) => {
|
|
482
|
-
|
|
483
|
-
fieldIndex = fields.findIndex((_) => {
|
|
489
|
+
const fieldIndex = fields.findIndex((_) => {
|
|
484
490
|
return key === _.key;
|
|
485
491
|
});
|
|
486
492
|
return fieldIndex;
|
|
@@ -506,17 +512,17 @@ const appendFormFieldMessage = (field, message) => {
|
|
|
506
512
|
fieldMessage.message === message.message);
|
|
507
513
|
});
|
|
508
514
|
};
|
|
509
|
-
field
|
|
515
|
+
field.messages = [];
|
|
510
516
|
if (checkObjectKeyExists(field, "messages")) {
|
|
511
|
-
if (!hasDuplicateMessage(field
|
|
512
|
-
field
|
|
517
|
+
if (!hasDuplicateMessage(field.messages, message)) {
|
|
518
|
+
field.messages.push({
|
|
513
519
|
type: message.type,
|
|
514
520
|
message: message.message
|
|
515
521
|
});
|
|
516
522
|
}
|
|
517
523
|
}
|
|
518
524
|
else {
|
|
519
|
-
field
|
|
525
|
+
field.messages = [{ type: message.type, message: message.message }];
|
|
520
526
|
}
|
|
521
527
|
return field;
|
|
522
528
|
};
|
|
@@ -543,21 +549,21 @@ const filterDuplicatesFiles = (array) => {
|
|
|
543
549
|
};
|
|
544
550
|
const removeFormFieldMessage = (field, message) => {
|
|
545
551
|
if (isNotEmptyValue(field === null || field === void 0 ? void 0 : field.messages)) {
|
|
546
|
-
field
|
|
552
|
+
field.messages = field.messages.filter((fieldMessage) => {
|
|
547
553
|
return fieldMessage.type !== message.type;
|
|
548
554
|
});
|
|
549
555
|
}
|
|
550
556
|
else {
|
|
551
|
-
field
|
|
557
|
+
field.messages = [];
|
|
552
558
|
}
|
|
553
559
|
return field;
|
|
554
560
|
};
|
|
555
561
|
const setApiTimerMessage = (field, timer = {}) => {
|
|
556
562
|
if (checkObjectKeyExists(field, "api")) {
|
|
557
|
-
field
|
|
563
|
+
field.api.timer = timer;
|
|
558
564
|
}
|
|
559
565
|
else {
|
|
560
|
-
setMissingKeyValue(field, "api", { timer
|
|
566
|
+
setMissingKeyValue(field, "api", { timer });
|
|
561
567
|
}
|
|
562
568
|
return field;
|
|
563
569
|
};
|
|
@@ -614,7 +620,7 @@ function showFormFieldError(fields, errors, key, error) {
|
|
|
614
620
|
fields[fieldIndex] = setErrorMessages(fields[fieldIndex], errors);
|
|
615
621
|
}
|
|
616
622
|
else {
|
|
617
|
-
fields[fieldIndex]
|
|
623
|
+
fields[fieldIndex].messages = [];
|
|
618
624
|
}
|
|
619
625
|
fields[fieldIndex] = highlightFormFieldError(fields[fieldIndex], error);
|
|
620
626
|
return fields;
|
|
@@ -629,37 +635,35 @@ const convertFormFieldTypeDateToKwikUIFormat = (date) => {
|
|
|
629
635
|
};
|
|
630
636
|
const convertFormFieldTypeTimeToKwikUIFormat = (time) => {
|
|
631
637
|
const timeParts = time.split(/[.:]/);
|
|
632
|
-
let hours = 0
|
|
638
|
+
let hours = 0;
|
|
639
|
+
let minutes = 0;
|
|
640
|
+
let seconds = 0;
|
|
641
|
+
let milliseconds = 0;
|
|
633
642
|
if (timeParts.length >= 2) {
|
|
634
|
-
hours = parseInt(timeParts[0]);
|
|
635
|
-
minutes = parseInt(timeParts[1]);
|
|
643
|
+
hours = parseInt(timeParts[0], 10);
|
|
644
|
+
minutes = parseInt(timeParts[1], 10);
|
|
636
645
|
if (timeParts.length >= 3) {
|
|
637
|
-
seconds = parseInt(timeParts[2]);
|
|
646
|
+
seconds = parseInt(timeParts[2], 10);
|
|
638
647
|
if (timeParts.length === 4) {
|
|
639
|
-
milliseconds = parseInt(timeParts[3]);
|
|
648
|
+
milliseconds = parseInt(timeParts[3], 10);
|
|
640
649
|
}
|
|
641
650
|
}
|
|
642
651
|
}
|
|
643
|
-
|
|
652
|
+
const tuiTime = new TuiTime(hours, minutes, seconds, milliseconds);
|
|
644
653
|
return tuiTime;
|
|
645
654
|
};
|
|
646
655
|
const convertFormFieldTypeDateToStandardFormat = (date) => {
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
let month = date.month;
|
|
650
|
-
let day = date.day;
|
|
651
|
-
formattedDate = `${day.toString().padStart(2, "0")}-${(month + 1)
|
|
656
|
+
const { day, month, year } = date;
|
|
657
|
+
const formattedDate = `${day.toString().padStart(2, "0")}-${(month + 1)
|
|
652
658
|
.toString()
|
|
653
659
|
.padStart(2, "0")}-${year}`;
|
|
654
660
|
return formattedDate;
|
|
655
661
|
};
|
|
656
662
|
const convertFormFieldTypeTimeToStandardFormat = (time) => {
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
let milliseconds = time.ms;
|
|
662
|
-
formattedDate = `${hour.toString().padStart(2, "0")}:${minutes
|
|
663
|
+
const hour = time.hours;
|
|
664
|
+
const { seconds, minutes } = time;
|
|
665
|
+
const milliseconds = time.ms;
|
|
666
|
+
const formattedDate = `${hour.toString().padStart(2, "0")}:${minutes
|
|
663
667
|
.toString()
|
|
664
668
|
.padStart(2, "0")}${seconds > 0 ? `:${seconds.toString().padStart(2, "0")}` : ""}${seconds > 0 && milliseconds > 0
|
|
665
669
|
? `:${milliseconds.toString().padStart(2, "0")}`
|
|
@@ -685,23 +689,23 @@ const convertFormFieldValueToStandardFormat = (field, value) => {
|
|
|
685
689
|
break;
|
|
686
690
|
case EFieldType.SELECT:
|
|
687
691
|
if (Array.isArray(field.options)) {
|
|
688
|
-
field.options.find((item) => {
|
|
689
|
-
|
|
690
|
-
if (item.title == value) {
|
|
691
|
-
convertedValue = item.value;
|
|
692
|
-
}
|
|
693
|
-
}
|
|
692
|
+
const foundItem = field.options.find((item) => {
|
|
693
|
+
return isObject(item) && item.title === value;
|
|
694
694
|
});
|
|
695
|
+
if (foundItem) {
|
|
696
|
+
convertedValue = foundItem.value;
|
|
697
|
+
}
|
|
695
698
|
}
|
|
696
699
|
break;
|
|
697
|
-
case EFieldType.PHONE:
|
|
698
|
-
|
|
700
|
+
case EFieldType.PHONE: {
|
|
701
|
+
const phoneField = field;
|
|
699
702
|
if (phoneField.properties.removeCountryCodeFromValue) {
|
|
700
703
|
convertedValue = value
|
|
701
704
|
.toString()
|
|
702
705
|
.replace(phoneField.properties.countryCode, "");
|
|
703
706
|
}
|
|
704
707
|
break;
|
|
708
|
+
}
|
|
705
709
|
case EFieldType.CAPTURE:
|
|
706
710
|
if (Array.isArray(value) && isNotEmptyValue(value[0])) {
|
|
707
711
|
convertedValue = value[0];
|
|
@@ -729,6 +733,40 @@ const convertFormFieldValueToStandardFormat = (field, value) => {
|
|
|
729
733
|
}
|
|
730
734
|
return convertedValue;
|
|
731
735
|
};
|
|
736
|
+
const convertFormFieldEmptyValueToKwikUIFormat = (field) => {
|
|
737
|
+
const fieldType = field.type;
|
|
738
|
+
let value;
|
|
739
|
+
switch (fieldType) {
|
|
740
|
+
case EFieldType.CHECKBOX:
|
|
741
|
+
value = false;
|
|
742
|
+
break;
|
|
743
|
+
case EFieldType.NUMBER:
|
|
744
|
+
value = null;
|
|
745
|
+
break;
|
|
746
|
+
case EFieldType.DATE:
|
|
747
|
+
value = null;
|
|
748
|
+
break;
|
|
749
|
+
case EFieldType.FILE:
|
|
750
|
+
value = [];
|
|
751
|
+
break;
|
|
752
|
+
case EFieldType.CAPTURE:
|
|
753
|
+
value = [];
|
|
754
|
+
break;
|
|
755
|
+
case EFieldType.RECORD:
|
|
756
|
+
value = [];
|
|
757
|
+
break;
|
|
758
|
+
case EFieldType.SELECT:
|
|
759
|
+
value = null;
|
|
760
|
+
break;
|
|
761
|
+
case EFieldType.DROPDOWN_WITH_SEARCH:
|
|
762
|
+
value = null;
|
|
763
|
+
break;
|
|
764
|
+
default:
|
|
765
|
+
value = "";
|
|
766
|
+
break;
|
|
767
|
+
}
|
|
768
|
+
return value;
|
|
769
|
+
};
|
|
732
770
|
const convertFormFieldValueToKwikUIFormat = (field, value) => {
|
|
733
771
|
let convertedValue = value;
|
|
734
772
|
if (isNotEmptyValue(value)) {
|
|
@@ -744,13 +782,12 @@ const convertFormFieldValueToKwikUIFormat = (field, value) => {
|
|
|
744
782
|
break;
|
|
745
783
|
case EFieldType.SELECT:
|
|
746
784
|
if (Array.isArray(field.options)) {
|
|
747
|
-
field.options.find((item) => {
|
|
748
|
-
|
|
749
|
-
if (item.value == value) {
|
|
750
|
-
convertedValue = item.title;
|
|
751
|
-
}
|
|
752
|
-
}
|
|
785
|
+
const foundItem = field.options.find((item) => {
|
|
786
|
+
return isObject(item) && item.value === value;
|
|
753
787
|
});
|
|
788
|
+
if (foundItem) {
|
|
789
|
+
convertedValue = foundItem.title;
|
|
790
|
+
}
|
|
754
791
|
}
|
|
755
792
|
break;
|
|
756
793
|
case EFieldType.DATE:
|
|
@@ -763,25 +800,37 @@ const convertFormFieldValueToKwikUIFormat = (field, value) => {
|
|
|
763
800
|
convertedValue = value;
|
|
764
801
|
break;
|
|
765
802
|
case EFieldType.CAPTURE:
|
|
766
|
-
if (
|
|
803
|
+
if (Array.isArray(value)) {
|
|
804
|
+
convertedValue = value.filter((item) => {
|
|
805
|
+
return (typeof item === "string" ||
|
|
806
|
+
(isObject(item) && checkObjectKeyExists(item, "image")));
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
else if (typeof value === "string") {
|
|
767
810
|
convertedValue = [value];
|
|
768
811
|
}
|
|
769
|
-
else if (
|
|
770
|
-
convertedValue = [];
|
|
812
|
+
else if (isObject(value) && checkObjectKeyExists(value, "image")) {
|
|
813
|
+
convertedValue = [value];
|
|
771
814
|
}
|
|
772
815
|
else {
|
|
773
|
-
convertedValue =
|
|
816
|
+
convertedValue = [];
|
|
774
817
|
}
|
|
775
818
|
break;
|
|
776
819
|
case EFieldType.RECORD:
|
|
777
|
-
if (
|
|
820
|
+
if (Array.isArray(value)) {
|
|
821
|
+
convertedValue = value.filter((item) => {
|
|
822
|
+
return (typeof item === "string" ||
|
|
823
|
+
(isObject(item) && checkObjectKeyExists(item, "video")));
|
|
824
|
+
});
|
|
825
|
+
}
|
|
826
|
+
else if (typeof value === "string") {
|
|
778
827
|
convertedValue = [value];
|
|
779
828
|
}
|
|
780
|
-
else if (
|
|
781
|
-
convertedValue = [];
|
|
829
|
+
else if (isObject(value) && checkObjectKeyExists(value, "video")) {
|
|
830
|
+
convertedValue = [value];
|
|
782
831
|
}
|
|
783
832
|
else {
|
|
784
|
-
convertedValue =
|
|
833
|
+
convertedValue = [];
|
|
785
834
|
}
|
|
786
835
|
break;
|
|
787
836
|
default:
|
|
@@ -793,40 +842,6 @@ const convertFormFieldValueToKwikUIFormat = (field, value) => {
|
|
|
793
842
|
}
|
|
794
843
|
return convertedValue;
|
|
795
844
|
};
|
|
796
|
-
const convertFormFieldEmptyValueToKwikUIFormat = (field) => {
|
|
797
|
-
const fieldType = field.type;
|
|
798
|
-
let value;
|
|
799
|
-
switch (fieldType) {
|
|
800
|
-
case EFieldType.CHECKBOX:
|
|
801
|
-
value = false;
|
|
802
|
-
break;
|
|
803
|
-
case EFieldType.NUMBER:
|
|
804
|
-
value = null;
|
|
805
|
-
break;
|
|
806
|
-
case EFieldType.DATE:
|
|
807
|
-
value = null;
|
|
808
|
-
break;
|
|
809
|
-
case EFieldType.FILE:
|
|
810
|
-
value = [];
|
|
811
|
-
break;
|
|
812
|
-
case EFieldType.CAPTURE:
|
|
813
|
-
value = [];
|
|
814
|
-
break;
|
|
815
|
-
case EFieldType.RECORD:
|
|
816
|
-
value = [];
|
|
817
|
-
break;
|
|
818
|
-
case EFieldType.SELECT:
|
|
819
|
-
value = null;
|
|
820
|
-
break;
|
|
821
|
-
case EFieldType.DROPDOWN_WITH_SEARCH:
|
|
822
|
-
value = null;
|
|
823
|
-
break;
|
|
824
|
-
default:
|
|
825
|
-
value = "";
|
|
826
|
-
break;
|
|
827
|
-
}
|
|
828
|
-
return value;
|
|
829
|
-
};
|
|
830
845
|
|
|
831
846
|
const getFormFields = (formConfig) => {
|
|
832
847
|
let fields = [];
|
|
@@ -851,6 +866,9 @@ const setFieldKeyValue = (field, key, value) => {
|
|
|
851
866
|
const setFieldKeyHidden = (field) => {
|
|
852
867
|
return setMissingFieldKeyValue(field, "hidden", false);
|
|
853
868
|
};
|
|
869
|
+
const setFieldKeyDisabled = (field) => {
|
|
870
|
+
return setMissingFieldKeyValue(field, "disabled", true);
|
|
871
|
+
};
|
|
854
872
|
const setFieldAsFormElement = (field, value) => {
|
|
855
873
|
return setFieldKeyValue(field, "isFormElement", value);
|
|
856
874
|
};
|
|
@@ -860,11 +878,9 @@ const getMinDate = (field) => {
|
|
|
860
878
|
* This is to handler old version of config.
|
|
861
879
|
* Please don't add "min" at field level, add it insider field.properties only.
|
|
862
880
|
*/
|
|
863
|
-
return convertFormFieldTypeDateToKwikUIFormat(field
|
|
864
|
-
}
|
|
865
|
-
else {
|
|
866
|
-
return {};
|
|
881
|
+
return convertFormFieldTypeDateToKwikUIFormat(field.min);
|
|
867
882
|
}
|
|
883
|
+
return {};
|
|
868
884
|
};
|
|
869
885
|
const getMaxDate = (field) => {
|
|
870
886
|
if (checkObjectKeyExists(field, "max")) {
|
|
@@ -872,11 +888,9 @@ const getMaxDate = (field) => {
|
|
|
872
888
|
* This is to handler old version of config.
|
|
873
889
|
* Please don't add "max" at field level, add it insider field.properties only.
|
|
874
890
|
*/
|
|
875
|
-
return convertFormFieldTypeDateToKwikUIFormat(field
|
|
876
|
-
}
|
|
877
|
-
else {
|
|
878
|
-
return {};
|
|
891
|
+
return convertFormFieldTypeDateToKwikUIFormat(field.max);
|
|
879
892
|
}
|
|
893
|
+
return {};
|
|
880
894
|
};
|
|
881
895
|
const updateLanguage = (object, language) => {
|
|
882
896
|
if (isObject(object)) {
|
|
@@ -884,7 +898,7 @@ const updateLanguage = (object, language) => {
|
|
|
884
898
|
object = object[language];
|
|
885
899
|
}
|
|
886
900
|
else {
|
|
887
|
-
object = object
|
|
901
|
+
object = object.en;
|
|
888
902
|
}
|
|
889
903
|
}
|
|
890
904
|
return object;
|
|
@@ -1085,20 +1099,18 @@ class Converter {
|
|
|
1085
1099
|
if (typeof x === "string" || typeof x === "number") {
|
|
1086
1100
|
return { label: x, disabled: false, description: "" };
|
|
1087
1101
|
}
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
checkObjectKeyExists(x, "description")) {
|
|
1092
|
-
return x;
|
|
1093
|
-
}
|
|
1094
|
-
if (!checkObjectKeyExists(x, "disabled")) {
|
|
1095
|
-
x = Object.assign(Object.assign({}, x), { disabled: false });
|
|
1096
|
-
}
|
|
1097
|
-
if (!checkObjectKeyExists(x, "description")) {
|
|
1098
|
-
x = Object.assign(Object.assign({}, x), { description: false });
|
|
1099
|
-
}
|
|
1102
|
+
if (checkObjectKeyExists(x, "label") &&
|
|
1103
|
+
checkObjectKeyExists(x, "disabled") &&
|
|
1104
|
+
checkObjectKeyExists(x, "description")) {
|
|
1100
1105
|
return x;
|
|
1101
1106
|
}
|
|
1107
|
+
if (!checkObjectKeyExists(x, "disabled")) {
|
|
1108
|
+
x = Object.assign(Object.assign({}, x), { disabled: false });
|
|
1109
|
+
}
|
|
1110
|
+
if (!checkObjectKeyExists(x, "description")) {
|
|
1111
|
+
x = Object.assign(Object.assign({}, x), { description: false });
|
|
1112
|
+
}
|
|
1113
|
+
return x;
|
|
1102
1114
|
});
|
|
1103
1115
|
return field;
|
|
1104
1116
|
};
|
|
@@ -1185,6 +1197,13 @@ class Converter {
|
|
|
1185
1197
|
}
|
|
1186
1198
|
return field;
|
|
1187
1199
|
};
|
|
1200
|
+
const formatFieldTypeDataHolder = (field) => {
|
|
1201
|
+
field = setFieldKeyHidden(field);
|
|
1202
|
+
field = setFieldKeyDisabled(field);
|
|
1203
|
+
field = setFieldAsFormElement(field, true);
|
|
1204
|
+
field = updateFormFieldProperties(field);
|
|
1205
|
+
return field;
|
|
1206
|
+
};
|
|
1188
1207
|
const formatFieldTypeOtp = (field) => {
|
|
1189
1208
|
var _a, _b;
|
|
1190
1209
|
field = setFieldKeyHidden(field);
|
|
@@ -1209,9 +1228,22 @@ class Converter {
|
|
|
1209
1228
|
return field;
|
|
1210
1229
|
};
|
|
1211
1230
|
const formatFieldTypeCapture = (field) => {
|
|
1231
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1212
1232
|
field = setFieldKeyHidden(field);
|
|
1213
1233
|
field = setFieldAsFormElement(field, true);
|
|
1214
1234
|
field = updateFormFieldProperties(field);
|
|
1235
|
+
field.properties = getObjectDeepCopy(Object.assign(Object.assign({}, field.properties), { features: Object.assign(Object.assign({}, field.properties.features), { watermark: {
|
|
1236
|
+
isEnabled: (_d = (_c = (_b = (_a = field === null || field === void 0 ? void 0 : field.properties) === null || _a === void 0 ? void 0 : _a.cameraConfig) === null || _b === void 0 ? void 0 : _b.others) === null || _c === void 0 ? void 0 : _c.isWatermark) !== null && _d !== void 0 ? _d : field.properties.features.watermark.isWatermark,
|
|
1237
|
+
isWatermarkFromServer: (_h = (_g = (_f = (_e = field === null || field === void 0 ? void 0 : field.properties) === null || _e === void 0 ? void 0 : _e.cameraConfig) === null || _f === void 0 ? void 0 : _f.others) === null || _g === void 0 ? void 0 : _g.isWatermarkFromServer) !== null && _h !== void 0 ? _h : field.properties.features.watermark.isWatermarkFromServer,
|
|
1238
|
+
sources: (_k = (_j = field === null || field === void 0 ? void 0 : field.properties) === null || _j === void 0 ? void 0 : _j.watermarkDataSources) !== null && _k !== void 0 ? _k : field.properties.features.watermark.sources
|
|
1239
|
+
} }) }));
|
|
1240
|
+
delete field.properties.watermarkDataSources;
|
|
1241
|
+
/**
|
|
1242
|
+
* Current commented because in kwikid-camera new config structure is not handled
|
|
1243
|
+
* Will uncomment once handled here and modify the structure a little bit here as well.
|
|
1244
|
+
*/
|
|
1245
|
+
// delete field.properties.cameraConfig.others.isWatermark;
|
|
1246
|
+
// delete field.properties.cameraConfig.others.isWatermarkForImageUpload;
|
|
1215
1247
|
return field;
|
|
1216
1248
|
};
|
|
1217
1249
|
const formatFieldTypeRecord = (field) => {
|
|
@@ -1288,11 +1320,11 @@ class Converter {
|
|
|
1288
1320
|
case EFieldType.LIVE_LOCATION:
|
|
1289
1321
|
field = formatFieldTypeLiveLocation(field);
|
|
1290
1322
|
break;
|
|
1323
|
+
case EFieldType.DATA_HOLDER:
|
|
1324
|
+
field = formatFieldTypeDataHolder(field);
|
|
1325
|
+
break;
|
|
1291
1326
|
case EFieldType.API:
|
|
1292
1327
|
field = formatFieldTypeApi(field);
|
|
1293
|
-
case EFieldType.LIVE_LOCATION:
|
|
1294
|
-
field = formatFieldTypeLiveLocation(field);
|
|
1295
|
-
break;
|
|
1296
1328
|
break;
|
|
1297
1329
|
case EFieldType.OTP:
|
|
1298
1330
|
field = formatFieldTypeOtp(field);
|
|
@@ -1327,7 +1359,7 @@ class Converter {
|
|
|
1327
1359
|
? field.validators
|
|
1328
1360
|
: {};
|
|
1329
1361
|
field = setMissingFieldKeyValue(field, "validators", {});
|
|
1330
|
-
field = setFieldKeyValue(field, "validators", Object.assign(Object.assign({}, field
|
|
1362
|
+
field = setFieldKeyValue(field, "validators", Object.assign(Object.assign({}, field.validators), { min: checkObjectKeyExists(validators, "min")
|
|
1331
1363
|
? isNotEmptyValue(validators.min)
|
|
1332
1364
|
? Number(validators.min)
|
|
1333
1365
|
: null
|
|
@@ -1379,6 +1411,10 @@ class Converter {
|
|
|
1379
1411
|
delete field.validators.min;
|
|
1380
1412
|
delete field.validators.max;
|
|
1381
1413
|
break;
|
|
1414
|
+
case EFieldType.DATA_HOLDER:
|
|
1415
|
+
delete field.validators.min;
|
|
1416
|
+
delete field.validators.max;
|
|
1417
|
+
break;
|
|
1382
1418
|
case EFieldType.CHECKBOX:
|
|
1383
1419
|
delete field.validators.min;
|
|
1384
1420
|
delete field.validators.max;
|
|
@@ -1438,18 +1474,18 @@ class Converter {
|
|
|
1438
1474
|
if (checkObjectKeyExists(field, "defaultValue")) {
|
|
1439
1475
|
return field;
|
|
1440
1476
|
}
|
|
1441
|
-
|
|
1477
|
+
if (checkObjectPathExists(field, "default.value.sources")) {
|
|
1442
1478
|
return field;
|
|
1443
1479
|
}
|
|
1444
|
-
|
|
1480
|
+
if (checkObjectPathExists(field, "default.value.rules") &&
|
|
1445
1481
|
checkObjectPathExists(field, "default.value.actions")) {
|
|
1446
1482
|
return field;
|
|
1447
1483
|
}
|
|
1448
|
-
|
|
1484
|
+
if (checkObjectPathExists(field, "default.value.value") &&
|
|
1449
1485
|
isNotEmptyValue(field.default.value.value)) {
|
|
1450
1486
|
return field;
|
|
1451
1487
|
}
|
|
1452
|
-
|
|
1488
|
+
if (!checkObjectPathExists(field, "default.value.sources")) {
|
|
1453
1489
|
const defaultValue = {
|
|
1454
1490
|
value: "",
|
|
1455
1491
|
triggers: ["ON_INIT"],
|
|
@@ -1478,8 +1514,8 @@ class Converter {
|
|
|
1478
1514
|
field = setValueToObjectPath(field, "default.value", defaultValue);
|
|
1479
1515
|
return field;
|
|
1480
1516
|
}
|
|
1481
|
-
delete field
|
|
1482
|
-
delete field
|
|
1517
|
+
delete field.defaultVal;
|
|
1518
|
+
delete field.defaultValue;
|
|
1483
1519
|
}
|
|
1484
1520
|
return field;
|
|
1485
1521
|
};
|
|
@@ -1507,21 +1543,21 @@ class Converter {
|
|
|
1507
1543
|
};
|
|
1508
1544
|
const setFormFields = (formConfig, fields) => {
|
|
1509
1545
|
if (checkObjectKeyExists(formConfig, "multiForm")) {
|
|
1510
|
-
formConfig.multiForm
|
|
1546
|
+
formConfig.multiForm.fields = fields;
|
|
1511
1547
|
}
|
|
1512
1548
|
else {
|
|
1513
|
-
formConfig
|
|
1549
|
+
formConfig.fields = fields;
|
|
1514
1550
|
}
|
|
1515
1551
|
return formConfig;
|
|
1516
1552
|
};
|
|
1517
1553
|
const setFormFieldGroups = (formConfig, groups) => {
|
|
1518
|
-
formConfig
|
|
1554
|
+
formConfig.fieldGroups = groups;
|
|
1519
1555
|
return formConfig;
|
|
1520
1556
|
};
|
|
1521
1557
|
const updateFieldGroupKey = (field) => {
|
|
1522
1558
|
if (checkObjectKeyExists(field, "groupKey") &&
|
|
1523
1559
|
!Array.isArray(field.groupKey)) {
|
|
1524
|
-
field
|
|
1560
|
+
field.groupKey = [field.groupKey];
|
|
1525
1561
|
}
|
|
1526
1562
|
return field;
|
|
1527
1563
|
};
|
|
@@ -1543,26 +1579,28 @@ class Converter {
|
|
|
1543
1579
|
field.label = updateLanguage(field.label, language);
|
|
1544
1580
|
}
|
|
1545
1581
|
if (checkObjectPathExists(field, "properties.placeholder")) {
|
|
1546
|
-
field.properties
|
|
1582
|
+
field.properties.placeholder = updateLanguage(field.properties.placeholder, language);
|
|
1547
1583
|
}
|
|
1548
1584
|
if (checkObjectPathExists(field, "properties.label")) {
|
|
1549
|
-
field.properties
|
|
1585
|
+
field.properties.label = updateLanguage(field.properties.label, language);
|
|
1550
1586
|
}
|
|
1551
1587
|
const updateApiStatus = (fieldApiStatus) => {
|
|
1552
1588
|
for (const status in fieldApiStatus) {
|
|
1553
|
-
|
|
1589
|
+
if (isNotEmptyValue(status)) {
|
|
1590
|
+
fieldApiStatus[status] = updateLanguage(fieldApiStatus[status], language);
|
|
1591
|
+
}
|
|
1554
1592
|
}
|
|
1555
1593
|
return fieldApiStatus;
|
|
1556
1594
|
};
|
|
1557
1595
|
switch (field.type) {
|
|
1558
1596
|
case EFieldType.HTML:
|
|
1559
|
-
field
|
|
1597
|
+
field.html = updateLanguage(field.html, language);
|
|
1560
1598
|
break;
|
|
1561
1599
|
case EFieldType.CAPTURE:
|
|
1562
|
-
field.properties
|
|
1600
|
+
field.properties.cameraConfig.header.title = updateLanguage(field.properties.cameraConfig.header.title, language);
|
|
1563
1601
|
break;
|
|
1564
1602
|
case EFieldType.RECORD:
|
|
1565
|
-
field.properties
|
|
1603
|
+
field.properties.cameraConfig.header.title = updateLanguage(field.properties.cameraConfig.header.title, language);
|
|
1566
1604
|
break;
|
|
1567
1605
|
case EFieldType.SELECT:
|
|
1568
1606
|
field.options = field.options.map((option) => {
|
|
@@ -1604,17 +1642,17 @@ class Converter {
|
|
|
1604
1642
|
});
|
|
1605
1643
|
break;
|
|
1606
1644
|
case EFieldType.API_CALL:
|
|
1607
|
-
field
|
|
1645
|
+
field.api.status.labels = updateApiStatus(field.api.status.labels);
|
|
1608
1646
|
break;
|
|
1609
1647
|
case EFieldType.LIVE_LOCATION:
|
|
1610
|
-
field
|
|
1648
|
+
field.api.status.labels = updateApiStatus(field.api.status.labels);
|
|
1611
1649
|
break;
|
|
1612
1650
|
default:
|
|
1613
1651
|
break;
|
|
1614
1652
|
}
|
|
1615
1653
|
return field;
|
|
1616
1654
|
};
|
|
1617
|
-
|
|
1655
|
+
const fields = getFormFields(formConfig);
|
|
1618
1656
|
let fieldGroups = {};
|
|
1619
1657
|
for (let field of fields) {
|
|
1620
1658
|
field = updateFieldLanguage(field, getLanguage());
|
|
@@ -1645,6 +1683,7 @@ __decorate([
|
|
|
1645
1683
|
logMethod
|
|
1646
1684
|
], Converter.prototype, "convertFormConfig", null);
|
|
1647
1685
|
|
|
1686
|
+
/* eslint-disable no-unused-vars */
|
|
1648
1687
|
var EFormEditorType;
|
|
1649
1688
|
(function (EFormEditorType) {
|
|
1650
1689
|
EFormEditorType["FIELDS"] = "FIELDS";
|
|
@@ -1653,9 +1692,7 @@ var EFormEditorType;
|
|
|
1653
1692
|
|
|
1654
1693
|
const removeField = (fields, fieldKey) => {
|
|
1655
1694
|
fields = fields.filter((row) => {
|
|
1656
|
-
|
|
1657
|
-
return row;
|
|
1658
|
-
}
|
|
1695
|
+
return row.key !== fieldKey;
|
|
1659
1696
|
});
|
|
1660
1697
|
return fields;
|
|
1661
1698
|
};
|
|
@@ -1887,16 +1924,16 @@ const FIELD_CONFIG = {
|
|
|
1887
1924
|
number: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "number", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.number) }),
|
|
1888
1925
|
date: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "date", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.date) }),
|
|
1889
1926
|
phone: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "phone", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.phone) }),
|
|
1890
|
-
radio: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "radio", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG
|
|
1927
|
+
radio: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "radio", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.radio), options: [] }),
|
|
1891
1928
|
"radio-list": Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "radio-list", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["radio-list"]), options: [] }),
|
|
1892
|
-
select: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "select", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG
|
|
1929
|
+
select: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "select", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.select), options: [] }),
|
|
1893
1930
|
slider: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "slider", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.slider) }),
|
|
1894
1931
|
otp: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "otp", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.otp) }),
|
|
1895
|
-
api: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "api", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG
|
|
1932
|
+
api: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "api", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.api) }),
|
|
1896
1933
|
"api-call": Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "api-call", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["api-call"]) }),
|
|
1897
1934
|
"aadhaar-number": Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "aadhaar-number", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["aadhaar-number"]) }),
|
|
1898
1935
|
"input-aadhaar": Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "input-aadhaar", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["input-aadhaar"]) }),
|
|
1899
|
-
image: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "image", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG
|
|
1936
|
+
image: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "image", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.image) }),
|
|
1900
1937
|
"preview-image": Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "preview-image", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG["preview-image"]) }),
|
|
1901
1938
|
html: Object.assign(Object.assign({}, FIELD_COMMON_CONFIG), { type: "html", properties: Object.assign({}, FIELD_PROPERTIES_CONFIG.html), html: {
|
|
1902
1939
|
before: "",
|
|
@@ -1937,11 +1974,12 @@ const NOFIELD_CONFIG = {
|
|
|
1937
1974
|
};
|
|
1938
1975
|
|
|
1939
1976
|
class KwikIDFormBuilderFormEditorService {
|
|
1940
|
-
constructor() { }
|
|
1941
1977
|
createNestedFormGroup(object) {
|
|
1942
1978
|
const formGroup = {};
|
|
1943
|
-
for (
|
|
1944
|
-
|
|
1979
|
+
for (const index in object) {
|
|
1980
|
+
if (isNotEmptyValue(index)) {
|
|
1981
|
+
formGroup[index] = new FormControl(object[index]);
|
|
1982
|
+
}
|
|
1945
1983
|
}
|
|
1946
1984
|
return new FormGroup(formGroup);
|
|
1947
1985
|
}
|
|
@@ -2008,7 +2046,7 @@ class KwikIDBuilderFormEditorComponent {
|
|
|
2008
2046
|
];
|
|
2009
2047
|
this.activeEditorType = EFormEditorType.FIELDS;
|
|
2010
2048
|
this.activeFormConfig_Fields = [];
|
|
2011
|
-
this.
|
|
2049
|
+
this.activeFormConfigNoFields = {};
|
|
2012
2050
|
this.showConfigPreview = false;
|
|
2013
2051
|
// Forms
|
|
2014
2052
|
this.formGroup = new FormGroup({});
|
|
@@ -2040,7 +2078,6 @@ class KwikIDBuilderFormEditorComponent {
|
|
|
2040
2078
|
/**
|
|
2041
2079
|
* Angular Lifecycle Methods
|
|
2042
2080
|
*/
|
|
2043
|
-
ngOnInit() { }
|
|
2044
2081
|
ngOnChanges(changes) {
|
|
2045
2082
|
const verifyChange = (key) => {
|
|
2046
2083
|
return checkObjectKeyExists(changes, key) && !changes[key].firstChange;
|
|
@@ -2055,8 +2092,8 @@ class KwikIDBuilderFormEditorComponent {
|
|
|
2055
2092
|
initFormEditor(activeFormConfig) {
|
|
2056
2093
|
this.toggleLoader(true);
|
|
2057
2094
|
this.activeFormConfig_Fields = getObjectDeepCopy(activeFormConfig.fields);
|
|
2058
|
-
this.
|
|
2059
|
-
delete this.
|
|
2095
|
+
this.activeFormConfigNoFields = getObjectDeepCopy(activeFormConfig);
|
|
2096
|
+
delete this.activeFormConfigNoFields.fields;
|
|
2060
2097
|
this.rows = this.activeFormConfig_Fields.map((field) => {
|
|
2061
2098
|
var _a;
|
|
2062
2099
|
return {
|
|
@@ -2106,21 +2143,21 @@ class KwikIDBuilderFormEditorComponent {
|
|
|
2106
2143
|
*/
|
|
2107
2144
|
handleOnClickEditValidators(e) {
|
|
2108
2145
|
const fieldConfig = this.formGroup.getRawValue()[e.index];
|
|
2109
|
-
const fieldConfigValidators = fieldConfig
|
|
2146
|
+
const fieldConfigValidators = fieldConfig.validators;
|
|
2110
2147
|
this.activeFieldConfigValidatorsConfig = mergeObjects(FIELD_VALIDATORS_CONFIG, fieldConfigValidators);
|
|
2111
2148
|
this.showFieldConfigValidatorsConfigEditor = true;
|
|
2112
2149
|
this.activeFieldConfigEditing = fieldConfig;
|
|
2113
2150
|
}
|
|
2114
2151
|
handleOnClickEditProperties(e) {
|
|
2115
2152
|
const fieldConfig = this.formGroup.getRawValue()[e.index];
|
|
2116
|
-
const fieldConfigProperties = fieldConfig
|
|
2153
|
+
const fieldConfigProperties = fieldConfig.properties;
|
|
2117
2154
|
this.activeFieldConfigPropertiesConfig = mergeObjects(FIELD_PROPERTIES_CONFIG[e.type], fieldConfigProperties);
|
|
2118
2155
|
this.showFieldConfigPropertiesConfigEditor = true;
|
|
2119
2156
|
this.activeFieldConfigEditing = fieldConfig;
|
|
2120
2157
|
}
|
|
2121
2158
|
handleOnClickEditOptions(e) {
|
|
2122
2159
|
const fieldConfig = this.formGroup.getRawValue()[e.index];
|
|
2123
|
-
const fieldConfigOptions = fieldConfig
|
|
2160
|
+
const fieldConfigOptions = fieldConfig.options;
|
|
2124
2161
|
this.activeFieldConfigOptionsConfig = mergeObjects([], fieldConfigOptions);
|
|
2125
2162
|
this.showFieldConfigOptionsConfigEditor = true;
|
|
2126
2163
|
this.activeFieldConfigEditing = fieldConfig;
|
|
@@ -2218,8 +2255,8 @@ class KwikIDBuilderFormEditorComponent {
|
|
|
2218
2255
|
/**
|
|
2219
2256
|
* Non Fields Editor Related Methods
|
|
2220
2257
|
*/
|
|
2221
|
-
|
|
2222
|
-
this.
|
|
2258
|
+
handleOnClickSaveActiveFormConfigNoFields(e) {
|
|
2259
|
+
this.activeFormConfigNoFields = JSON.parse(e);
|
|
2223
2260
|
}
|
|
2224
2261
|
/**
|
|
2225
2262
|
* Other Component Methods
|
|
@@ -2252,12 +2289,12 @@ class KwikIDBuilderFormEditorComponent {
|
|
|
2252
2289
|
}
|
|
2253
2290
|
convertToMinifiedJson() {
|
|
2254
2291
|
const fields = [];
|
|
2255
|
-
for (
|
|
2256
|
-
fields.push(setValueToObjectPath(findModifiedKeys(FIELD_CONFIG[field
|
|
2292
|
+
for (const field of Object.values(getObjectDeepCopy(this.formGroup.getRawValue()))) {
|
|
2293
|
+
fields.push(setValueToObjectPath(findModifiedKeys(FIELD_CONFIG[field.type], field, ""), "type", field.type));
|
|
2257
2294
|
}
|
|
2258
|
-
const
|
|
2259
|
-
this.activeFormConfig = mergeObjects({},
|
|
2260
|
-
fields
|
|
2295
|
+
const activeFormConfigNoFieldsMinified = findModifiedKeys(NOFIELD_CONFIG, getObjectDeepCopy(this.activeFormConfigNoFields), "");
|
|
2296
|
+
this.activeFormConfig = mergeObjects({}, activeFormConfigNoFieldsMinified, {
|
|
2297
|
+
fields
|
|
2261
2298
|
});
|
|
2262
2299
|
}
|
|
2263
2300
|
convertToCompleteJson() {
|
|
@@ -2277,10 +2314,8 @@ class KwikIDBuilderFormEditorComponent {
|
|
|
2277
2314
|
const finalPath = `${path}['${fieldType}'].${key}`;
|
|
2278
2315
|
return getObjectValueFromPath(OPTIONS, finalPath);
|
|
2279
2316
|
}
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
return getObjectValueFromPath(OPTIONS, finalPath);
|
|
2283
|
-
}
|
|
2317
|
+
const finalPath = path !== "" ? `${path}.${key}` : key;
|
|
2318
|
+
return getObjectValueFromPath(OPTIONS, finalPath);
|
|
2284
2319
|
}
|
|
2285
2320
|
isOptions(index, value, key, path) {
|
|
2286
2321
|
if (path.includes("properties")) {
|
|
@@ -2288,10 +2323,8 @@ class KwikIDBuilderFormEditorComponent {
|
|
|
2288
2323
|
const finalPath = `${path}['${fieldType}'].${key}`;
|
|
2289
2324
|
return Array.isArray(getObjectValueFromPath(OPTIONS, finalPath));
|
|
2290
2325
|
}
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
return Array.isArray(getObjectValueFromPath(OPTIONS, finalPath));
|
|
2294
|
-
}
|
|
2326
|
+
const finalPath = path !== "" ? `${path}.${key}` : key;
|
|
2327
|
+
return Array.isArray(getObjectValueFromPath(OPTIONS, finalPath));
|
|
2295
2328
|
}
|
|
2296
2329
|
isBoolean(value) {
|
|
2297
2330
|
return typeof value === "boolean";
|
|
@@ -2314,13 +2347,11 @@ class KwikIDBuilderFormEditorComponent {
|
|
|
2314
2347
|
if (typeof item === "string") {
|
|
2315
2348
|
return `${String(index)}_${item}_${new Date().getTime()}`;
|
|
2316
2349
|
}
|
|
2317
|
-
|
|
2318
|
-
return `${String(index)}_${key}_${value}_${new Date().getTime()}`;
|
|
2319
|
-
}
|
|
2350
|
+
return `${String(index)}_${key}_${value}_${new Date().getTime()}`;
|
|
2320
2351
|
}
|
|
2321
2352
|
}
|
|
2322
2353
|
/** @nocollapse */ KwikIDBuilderFormEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDBuilderFormEditorComponent, deps: [{ token: i3.KwikUILoaderService }, { token: KwikIDFormBuilderFormEditorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2323
|
-
/** @nocollapse */ KwikIDBuilderFormEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDBuilderFormEditorComponent, selector: "kwikid-builder-form-editor", inputs: { activeFormConfig: "activeFormConfig" }, outputs: { onClickSaveActiveFormConfig: "onClickSaveActiveFormConfig" }, usesOnChanges: true, ngImport: i0, template: "<!-- Component Loader -->\n<kwikui-loader></kwikui-loader>\n\n<!-- Component Main View -->\n<div class=\"container\">\n <ng-container *ngIf=\"activeFormConfig; else noFormSelectedTemplate\">\n <header>\n <div>\n Editing Config of Form: <b>{{ activeFormConfig.props.title }}</b>\n </div>\n <div class=\"header-form-editor-btns\">\n <button (click)=\"handleOnClickPreview()\">preview</button>\n <div>Editor Type:</div>\n <select (change)=\"handleOnClickChangeActiveEditor($event.target.value)\">\n <option\n *ngFor=\"let option of editorTypeOptions\"\n [value]=\"option.key\"\n [selected]=\"option.key === activeEditorType\"\n >\n {{ option.label }}\n </option>\n </select>\n </div>\n </header>\n <main>\n <div\n class=\"form-config-fields\"\n *ngIf=\"activeEditorType == 'FIELDS'; else nonFieldsEditorTemplate\"\n >\n <ng-container *ngIf=\"rows.length <= 0\">\n <div class=\"no-fields disclaimer\">\n <div><p>Please add field to get started</p></div>\n <div class=\"icon\"><h1>+</h1></div>\n <button (click)=\"handleOnClickAddField()\">add field</button>\n </div>\n </ng-container>\n <table>\n <thead>\n <tr>\n <th *ngFor=\"let column of columns\">\n {{ column }}\n </th>\n </tr>\n </thead>\n <tbody>\n <ng-container\n *ngFor=\"let row of rows; let i = index; trackBy: trackByFn\"\n >\n <tr>\n <ng-container *ngFor=\"let column of columns; let j = index\">\n <td>\n <div [class]=\"column\">\n <ng-container\n *ngIf=\"\n column !== 'delete' &&\n column !== 'validators' &&\n column !== 'properties' &&\n column !== 'type' &&\n column !== 'disabled' &&\n column !== 'options'\n \"\n [ngTemplateOutlet]=\"getFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: i,\n fieldValue: row[column],\n fieldKey: column,\n parentPath: ''\n }\"\n ></ng-container>\n <ng-container *ngIf=\"column === 'type'\">\n <ng-container\n [ngTemplateOutlet]=\"optionFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: i,\n key: column,\n value: row[column],\n path: '',\n options: memoizedGetOptions(\n i,\n row[column],\n column,\n ''\n )\n }\"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"column === 'disabled'\">\n <ng-container\n [ngTemplateOutlet]=\"booleanFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: i,\n key: column,\n value: row[column],\n path: '',\n options: memoizedGetOptions(\n i,\n row[column],\n column,\n ''\n )\n }\"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"column === 'delete'\">\n <button\n (click)=\"\n handleOnClickDeleteField({\n index: i,\n key: row['key']\n })\n \"\n [disabled]=\"rows.length === 1\"\n >\n delete\n </button>\n </ng-container>\n <ng-container *ngIf=\"column === 'validators'\">\n <button\n (click)=\"\n handleOnClickEditValidators({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n edit\n </button>\n </ng-container>\n <ng-container *ngIf=\"column === 'properties'\">\n <button\n (click)=\"\n handleOnClickEditProperties({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n edit\n </button>\n </ng-container>\n <ng-container\n *ngIf=\"row['type'] === 'radio' && column === 'options'\"\n >\n <button\n (click)=\"\n handleOnClickEditOptions({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n add\n </button>\n </ng-container>\n <ng-container\n *ngIf=\"row['type'] === 'select' && column === 'options'\"\n >\n <button\n (click)=\"\n handleOnClickEditOptions({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n add\n </button>\n </ng-container>\n </div>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n </tbody>\n </table>\n <div class=\"add-field-btn-container\"> </div>\n </div>\n <ng-template #nonFieldsEditorTemplate>\n <div class=\"form-config-no-fields\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnClickSaveActiveFormConfig_NoFields(\n $event.target.innerHTML\n )\n \"\n >\n {{ activeFormConfig_NoFields | json }}\n </div>\n </div>\n </ng-template>\n </main>\n <footer>\n <button\n *ngIf=\"rows.length > 0\"\n (click)=\"handleOnClickAddField()\"\n >\n add field\n </button>\n <button\n (click)=\"handleOnClickSaveActiveFormConfig()\"\n [class.secondary]=\"!savedConfig\"\n >\n {{ savedConfig ? \"saved\" : \"unsaved\" }}\n </button>\n </footer>\n </ng-container>\n <ng-template #noFormSelectedTemplate>\n <div class=\"no-form-selected disclaimer\">\n <div class=\"icon\"><h1>➦</h1></div>\n <div><p>Please select a form to edit it's fields</p></div>\n </div>\n </ng-template>\n</div>\n\n<!-- Component Dialog -->\n<div\n class=\"modal\"\n [class.error]=\"dialogError === true\"\n *ngIf=\"\n dialogOpen ||\n showFieldConfigValidatorsConfigEditor ||\n showFieldConfigPropertiesConfigEditor ||\n showFieldConfigOptionsConfigEditor\n \"\n [@panelInOut]\n>\n <div class=\"modal-box\">\n <div\n class=\"modal-content\"\n *ngIf=\"dialogOpen\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Config Preview\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"convertToMinifiedJson()\">minify</button>\n <button (click)=\"convertToCompleteJson()\">full</button>\n <button (click)=\"downloadJSON()\">download</button>\n <button (click)=\"copyToClipboard()\">copy</button>\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div class=\"json-editor\">\n <code>{{ activeFormConfig | json }}</code>\n </div>\n </div>\n </div>\n <div\n class=\"modal-content\"\n *ngIf=\"showFieldConfigValidatorsConfigEditor\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Validator Config Editor\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnInputFieldConfigValidatorsConfig($event.target.innerHTML)\n \"\n >\n {{ this.activeFieldConfigValidatorsConfig | json }}\n </div>\n </div>\n </div>\n <div\n class=\"modal-content\"\n *ngIf=\"showFieldConfigPropertiesConfigEditor\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Properties Config Editor\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnInputFieldConfigPropertiesConfig($event.target.innerHTML)\n \"\n >\n {{ this.activeFieldConfigPropertiesConfig | json }}\n </div>\n </div>\n </div>\n <div\n class=\"modal-content\"\n *ngIf=\"showFieldConfigOptionsConfigEditor\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Options Config Editor\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnInputFieldConfigOptionsConfig($event.target.innerHTML)\n \"\n >\n {{ this.activeFieldConfigOptionsConfig | json }}\n </div>\n </div>\n </div>\n </div>\n</div>\n<!-- END -->\n\n<!-- Template for rendering different field types -->\n<!-- General Field Template -->\n<ng-template\n #getFieldTemplate\n let-index=\"index\"\n let-value=\"fieldValue\"\n let-key=\"fieldKey\"\n let-path=\"parentPath\"\n>\n <div>\n <ng-container\n [ngTemplateOutlet]=\"\n isObject(value) ? objectFieldTemplate : notObjectFieldTemplate\n \"\n [ngTemplateOutletContext]=\"{\n index: index,\n fieldValue: value,\n fieldKey: key,\n parentPath: path\n }\"\n >\n </ng-container>\n </div>\n</ng-template>\n\n<!-- Object Type Field Template -->\n<ng-template\n #objectFieldTemplate\n let-index=\"index\"\n let-value=\"fieldValue\"\n let-key=\"fieldKey\"\n let-path=\"parentPath\"\n>\n <ng-container *ngFor=\"let item of value | keyvalue\">\n <ng-container\n [ngTemplateOutlet]=\"getFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: index,\n fieldValue: item.value,\n fieldKey: item.key,\n parentPath: path === '' ? key : path + '.' + key\n }\"\n >\n </ng-container>\n </ng-container>\n</ng-template>\n\n<!-- Non Object Type Field Template -->\n<ng-template\n #notObjectFieldTemplate\n let-index=\"index\"\n let-value=\"fieldValue\"\n let-key=\"fieldKey\"\n let-path=\"parentPath\"\n>\n <div>\n <ng-container *ngIf=\"isOptions(index, value, key, path)\">\n <ng-container\n [ngTemplateOutlet]=\"optionFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: index,\n key: key,\n value: value,\n path: path,\n options: memoizedGetOptions(index, value, key, path)\n }\"\n ></ng-container>\n </ng-container>\n <ng-container\n *ngIf=\"!isOptions(index, value, key, path) && isString(value)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n textFieldTemplate;\n context: { index: index, key: key, value: value, path: path }\n \"\n ></ng-container>\n </ng-container>\n <ng-container\n *ngIf=\"!isOptions(index, value, key, path) && isNumber(value)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n numberFieldTemplate;\n context: { index: index, key: key, value: value, path: path }\n \"\n ></ng-container>\n </ng-container>\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Options Field Template -->\n<ng-template\n #optionFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n let-options=\"options\"\n>\n <div class=\"field-container options\">\n <select\n (change)=\"handleOnInput({ index, key, value: { previous: value, new: $event.target.value }, path })\"\n >\n <option\n *ngFor=\"let option of options\"\n [value]=\"option\"\n [selected]=\"option === value\"\n >{{ option }}</option\n >\n </select>\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Boolean Field Template -->\n<ng-template\n #booleanFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n>\n <div class=\"field-container checkbox\">\n <input\n type=\"checkbox\"\n [checked]=\"value\"\n (change)=\"handleOnInput({ index, key, value: { previous: value, new: $event.target.checked }, path })\"\n />\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Text Field Template -->\n<ng-template\n #textFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n>\n <div class=\"field-container text\">\n <input\n placeholder=\"Enter {{ key }}\"\n type=\"text\"\n [value]=\"value\"\n (blur)=\"handleOnInput({ index, key, value: { previous: value, new: $event.target.value }, path })\"\n />\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Number Field Template -->\n<ng-template\n #numberFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n>\n <div class=\"field-container number\">\n <input\n placeholder=\"Enter {{ key }}\"\n type=\"number\"\n [value]=\"value\"\n (blur)=\"handleOnInput({ index, key, value: { previous: value, new: $event.target.value }, path })\"\n />\n </div>\n</ng-template>\n<!-- END -->\n", styles: ["::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}input[type=text],input[type=number]{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box;appearance:auto!important}input[type=checkbox]{appearance:auto!important;width:1rem;height:1rem}select{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box}textarea{overflow-wrap:anywhere;resize:none;unicode-bidi:embed;white-space:pre-wrap}button{display:inline-block;padding:8px 12px;background-color:#007bff;color:#fff;text-decoration:none;border-radius:4px;border:none;cursor:pointer}button:hover{background-color:#0069d9}button:active{background-color:#0056b3}button:focus{outline:none}button.secondary{padding:7px 11px;border:1px solid #007bff;background-color:#fff;color:#007bff}button.secondary:hover{background-color:#b7daff}button.secondary:active{background-color:#b7daff}button.secondary:focus{outline:none}.field-container{display:flex}.field-container label{color:gray}.field-container.checkbox{flex-direction:row;align-items:center;justify-content:center;padding:8px 12px;margin:auto}.field-container.options,.field-container.number,.field-container.text{flex-direction:column}.disclaimer{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;color:#121212;width:100%;height:100%}.disclaimer>*:not(:last-child){margin-bottom:1.5rem}.disclaimer .icon{width:3rem;height:3rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.disclaimer.no-form-selected h1{transform:scaleX(-1)}.disclaimer h1{font-size:5rem;font-weight:100}.disclaimer p{font-size:1rem}\n", ":host{all:unset;position:relative;width:100%;height:100%;overflow:auto}.container{display:flex;flex-direction:column;justify-content:space-between;align-items:stretch;height:100%;border:1px solid #ccc}.container header{padding:.5rem;display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;border-bottom:1px solid #ccc}.container header .header-form-editor-btns{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center}.container header .header-form-editor-btns>*:not(:last-child){margin-right:1rem}.container main{padding:.5rem;flex-grow:1;overflow:auto;display:flex;flex-direction:row;justify-content:flex-start;align-items:stretch;white-space:nowrap;position:relative}.container main>*:not(:last-child){margin-right:1rem}.container main .no-fields{position:absolute;top:0;left:0;background:white}.container main .form-config-no-fields{overflow:auto;width:100%}.container main .form-config-fields{overflow:auto;width:100%}.container main .form-config-fields .add-field-btn-container{width:100%;text-align:center}.container main .validators,.container main .properties{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch}.container main .validators>*:not(:last-child),.container main .properties>*:not(:last-child){margin-bottom:.5rem}.container main .input-checkbox-container{display:flex;flex-direction:row}.container footer{padding:.5rem;display:flex;flex-direction:row;justify-content:flex-end;align-items:stretch;border-top:1px solid lightgray}.container footer>*:not(:last-child){margin-right:1rem}.modal{position:absolute;top:0;background-color:#0000004d;width:100%;height:100%;display:flex;justify-content:center;align-items:center;left:0;flex-direction:row}.modal.error{background-color:#ff00004d}.modal-box{width:75%;height:75%;margin:auto;background-color:#fff;border-radius:1rem;box-shadow:#64646f33 0 7px 29px}.modal-content{display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;width:100%;height:100%}.modal-heading{padding:.5rem 1rem;width:100%;display:flex;flex-direction:row;justify-content:space-between;border-bottom:1px solid lightgray;align-items:center}.modal-title{font-weight:bold;font-size:1rem}.modal-actions{display:flex;flex-direction:row;cursor:pointer}.modal-actions>*:not(:last-child){margin-right:1rem}.modal-body{overflow:auto;flex:1}.modal-body .json-editor{font-family:monospace;white-space:pre-wrap;border:none;padding:0;background-color:#f5f5f5;height:100%;outline:none;overflow:auto}.json-editor{font-family:monospace;white-space:pre-wrap;border:none;padding:0;background-color:#f5f5f5;height:100%;outline:none;overflow:auto}table{width:100%;border-collapse:collapse;margin-bottom:20px}table th,table td{padding:8px;text-align:left;border:1px solid #ccc;vertical-align:top}table th{background-color:#f2f2f2}table tr:nth-child(even){background-color:#f9f9f9}table tr:hover{background-color:#eaeaea}\n"], components: [{ type: i3.KwikUILoaderComponent, selector: "kwikui-loader" }], directives: [{ type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "json": i3$2.JsonPipe, "keyvalue": i3$2.KeyValuePipe }, animations: [
|
|
2354
|
+
/** @nocollapse */ KwikIDBuilderFormEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDBuilderFormEditorComponent, selector: "kwikid-builder-form-editor", inputs: { activeFormConfig: "activeFormConfig" }, outputs: { onClickSaveActiveFormConfig: "onClickSaveActiveFormConfig" }, usesOnChanges: true, ngImport: i0, template: "<!-- Component Loader -->\n<kwikui-loader></kwikui-loader>\n\n<!-- Component Main View -->\n<div class=\"container\">\n <ng-container *ngIf=\"activeFormConfig; else noFormSelectedTemplate\">\n <header>\n <div>\n Editing Config of Form: <b>{{ activeFormConfig.props.title }}</b>\n </div>\n <div class=\"header-form-editor-btns\">\n <button (click)=\"handleOnClickPreview()\">preview</button>\n <div>Editor Type:</div>\n <select (change)=\"handleOnClickChangeActiveEditor($event.target.value)\">\n <option\n *ngFor=\"let option of editorTypeOptions\"\n [value]=\"option.key\"\n [selected]=\"option.key === activeEditorType\"\n >\n {{ option.label }}\n </option>\n </select>\n </div>\n </header>\n <main>\n <div\n class=\"form-config-fields\"\n *ngIf=\"activeEditorType == 'FIELDS'; else nonFieldsEditorTemplate\"\n >\n <ng-container *ngIf=\"rows.length <= 0\">\n <div class=\"no-fields disclaimer\">\n <div><p>Please add field to get started</p></div>\n <div class=\"icon\"><h1>+</h1></div>\n <button (click)=\"handleOnClickAddField()\">add field</button>\n </div>\n </ng-container>\n <table>\n <thead>\n <tr>\n <th *ngFor=\"let column of columns\">\n {{ column }}\n </th>\n </tr>\n </thead>\n <tbody>\n <ng-container\n *ngFor=\"let row of rows; let i = index; trackBy: trackByFn\"\n >\n <tr>\n <ng-container *ngFor=\"let column of columns; let j = index\">\n <td>\n <div [class]=\"column\">\n <ng-container\n *ngIf=\"\n column !== 'delete' &&\n column !== 'validators' &&\n column !== 'properties' &&\n column !== 'type' &&\n column !== 'disabled' &&\n column !== 'options'\n \"\n [ngTemplateOutlet]=\"getFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: i,\n fieldValue: row[column],\n fieldKey: column,\n parentPath: ''\n }\"\n ></ng-container>\n <ng-container *ngIf=\"column === 'type'\">\n <ng-container\n [ngTemplateOutlet]=\"optionFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: i,\n key: column,\n value: row[column],\n path: '',\n options: memoizedGetOptions(\n i,\n row[column],\n column,\n ''\n )\n }\"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"column === 'disabled'\">\n <ng-container\n [ngTemplateOutlet]=\"booleanFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: i,\n key: column,\n value: row[column],\n path: '',\n options: memoizedGetOptions(\n i,\n row[column],\n column,\n ''\n )\n }\"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"column === 'delete'\">\n <button\n (click)=\"\n handleOnClickDeleteField({\n index: i,\n key: row['key']\n })\n \"\n [disabled]=\"rows.length === 1\"\n >\n delete\n </button>\n </ng-container>\n <ng-container *ngIf=\"column === 'validators'\">\n <button\n (click)=\"\n handleOnClickEditValidators({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n edit\n </button>\n </ng-container>\n <ng-container *ngIf=\"column === 'properties'\">\n <button\n (click)=\"\n handleOnClickEditProperties({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n edit\n </button>\n </ng-container>\n <ng-container\n *ngIf=\"row['type'] === 'radio' && column === 'options'\"\n >\n <button\n (click)=\"\n handleOnClickEditOptions({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n add\n </button>\n </ng-container>\n <ng-container\n *ngIf=\"row['type'] === 'select' && column === 'options'\"\n >\n <button\n (click)=\"\n handleOnClickEditOptions({\n index: i,\n key: row['key'],\n type: row['type']\n })\n \"\n >\n add\n </button>\n </ng-container>\n </div>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n </tbody>\n </table>\n <div class=\"add-field-btn-container\"> </div>\n </div>\n <ng-template #nonFieldsEditorTemplate>\n <div class=\"form-config-no-fields\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnClickSaveActiveFormConfigNoFields($event.target.innerHTML)\n \"\n >\n {{ activeFormConfigNoFields | json }}\n </div>\n </div>\n </ng-template>\n </main>\n <footer>\n <button\n *ngIf=\"rows.length > 0\"\n (click)=\"handleOnClickAddField()\"\n >\n add field\n </button>\n <button\n (click)=\"handleOnClickSaveActiveFormConfig()\"\n [class.secondary]=\"!savedConfig\"\n >\n {{ savedConfig ? \"saved\" : \"unsaved\" }}\n </button>\n </footer>\n </ng-container>\n <ng-template #noFormSelectedTemplate>\n <div class=\"no-form-selected disclaimer\">\n <div class=\"icon\"><h1>➦</h1></div>\n <div><p>Please select a form to edit it's fields</p></div>\n </div>\n </ng-template>\n</div>\n\n<!-- Component Dialog -->\n<div\n class=\"modal\"\n [class.error]=\"dialogError === true\"\n *ngIf=\"\n dialogOpen ||\n showFieldConfigValidatorsConfigEditor ||\n showFieldConfigPropertiesConfigEditor ||\n showFieldConfigOptionsConfigEditor\n \"\n [@panelInOut]\n>\n <div class=\"modal-box\">\n <div\n class=\"modal-content\"\n *ngIf=\"dialogOpen\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Config Preview\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"convertToMinifiedJson()\">minify</button>\n <button (click)=\"convertToCompleteJson()\">full</button>\n <button (click)=\"downloadJSON()\">download</button>\n <button (click)=\"copyToClipboard()\">copy</button>\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div class=\"json-editor\">\n <code>{{ activeFormConfig | json }}</code>\n </div>\n </div>\n </div>\n <div\n class=\"modal-content\"\n *ngIf=\"showFieldConfigValidatorsConfigEditor\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Validator Config Editor\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnInputFieldConfigValidatorsConfig($event.target.innerHTML)\n \"\n >\n {{ this.activeFieldConfigValidatorsConfig | json }}\n </div>\n </div>\n </div>\n <div\n class=\"modal-content\"\n *ngIf=\"showFieldConfigPropertiesConfigEditor\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Properties Config Editor\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnInputFieldConfigPropertiesConfig($event.target.innerHTML)\n \"\n >\n {{ this.activeFieldConfigPropertiesConfig | json }}\n </div>\n </div>\n </div>\n <div\n class=\"modal-content\"\n *ngIf=\"showFieldConfigOptionsConfigEditor\"\n >\n <div class=\"modal-heading\">\n <div class=\"modal-title\">\n {{ activeFormConfig.props.title }}'s Options Config Editor\n </div>\n <div class=\"modal-actions\">\n <button (click)=\"closeJSONPopup()\">close</button>\n </div>\n </div>\n <div class=\"modal-body\">\n <div\n class=\"json-editor\"\n contenteditable=\"true\"\n (keyup)=\"\n handleOnInputFieldConfigOptionsConfig($event.target.innerHTML)\n \"\n >\n {{ this.activeFieldConfigOptionsConfig | json }}\n </div>\n </div>\n </div>\n </div>\n</div>\n<!-- END -->\n\n<!-- Template for rendering different field types -->\n<!-- General Field Template -->\n<ng-template\n #getFieldTemplate\n let-index=\"index\"\n let-value=\"fieldValue\"\n let-key=\"fieldKey\"\n let-path=\"parentPath\"\n>\n <div>\n <ng-container\n [ngTemplateOutlet]=\"\n isObject(value) ? objectFieldTemplate : notObjectFieldTemplate\n \"\n [ngTemplateOutletContext]=\"{\n index: index,\n fieldValue: value,\n fieldKey: key,\n parentPath: path\n }\"\n >\n </ng-container>\n </div>\n</ng-template>\n\n<!-- Object Type Field Template -->\n<ng-template\n #objectFieldTemplate\n let-index=\"index\"\n let-value=\"fieldValue\"\n let-key=\"fieldKey\"\n let-path=\"parentPath\"\n>\n <ng-container *ngFor=\"let item of value | keyvalue\">\n <ng-container\n [ngTemplateOutlet]=\"getFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: index,\n fieldValue: item.value,\n fieldKey: item.key,\n parentPath: path === '' ? key : path + '.' + key\n }\"\n >\n </ng-container>\n </ng-container>\n</ng-template>\n\n<!-- Non Object Type Field Template -->\n<ng-template\n #notObjectFieldTemplate\n let-index=\"index\"\n let-value=\"fieldValue\"\n let-key=\"fieldKey\"\n let-path=\"parentPath\"\n>\n <div>\n <ng-container *ngIf=\"isOptions(index, value, key, path)\">\n <ng-container\n [ngTemplateOutlet]=\"optionFieldTemplate\"\n [ngTemplateOutletContext]=\"{\n index: index,\n key: key,\n value: value,\n path: path,\n options: memoizedGetOptions(index, value, key, path)\n }\"\n ></ng-container>\n </ng-container>\n <ng-container\n *ngIf=\"!isOptions(index, value, key, path) && isString(value)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n textFieldTemplate;\n context: { index: index, key: key, value: value, path: path }\n \"\n ></ng-container>\n </ng-container>\n <ng-container\n *ngIf=\"!isOptions(index, value, key, path) && isNumber(value)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n numberFieldTemplate;\n context: { index: index, key: key, value: value, path: path }\n \"\n ></ng-container>\n </ng-container>\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Options Field Template -->\n<ng-template\n #optionFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n let-options=\"options\"\n>\n <div class=\"field-container options\">\n <select\n (change)=\"\n handleOnInput({\n index,\n key,\n value: { previous: value, new: $event.target.value },\n path\n })\n \"\n >\n <option\n *ngFor=\"let option of options\"\n [value]=\"option\"\n [selected]=\"option === value\"\n >{{ option }}</option\n >\n </select>\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Boolean Field Template -->\n<ng-template\n #booleanFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n>\n <div class=\"field-container checkbox\">\n <input\n type=\"checkbox\"\n [checked]=\"value\"\n (change)=\"\n handleOnInput({\n index,\n key,\n value: { previous: value, new: $event.target.checked },\n path\n })\n \"\n />\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Text Field Template -->\n<ng-template\n #textFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n>\n <div class=\"field-container text\">\n <input\n placeholder=\"Enter {{ key }}\"\n type=\"text\"\n [value]=\"value\"\n (blur)=\"\n handleOnInput({\n index,\n key,\n value: { previous: value, new: $event.target.value },\n path\n })\n \"\n />\n </div>\n</ng-template>\n\n<!-- Non Object Type Field :: Number Field Template -->\n<ng-template\n #numberFieldTemplate\n let-index=\"index\"\n let-key=\"key\"\n let-value=\"value\"\n let-path=\"path\"\n>\n <div class=\"field-container number\">\n <input\n placeholder=\"Enter {{ key }}\"\n type=\"number\"\n [value]=\"value\"\n (blur)=\"\n handleOnInput({\n index,\n key,\n value: { previous: value, new: $event.target.value },\n path\n })\n \"\n />\n </div>\n</ng-template>\n<!-- END -->\n", styles: ["::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}input[type=text],input[type=number]{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box;appearance:auto!important}input[type=checkbox]{appearance:auto!important;width:1rem;height:1rem}select{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box}textarea{overflow-wrap:anywhere;resize:none;unicode-bidi:embed;white-space:pre-wrap}button{display:inline-block;padding:8px 12px;background-color:#007bff;color:#fff;text-decoration:none;border-radius:4px;border:none;cursor:pointer}button:hover{background-color:#0069d9}button:active{background-color:#0056b3}button:focus{outline:none}button.secondary{padding:7px 11px;border:1px solid #007bff;background-color:#fff;color:#007bff}button.secondary:hover{background-color:#b7daff}button.secondary:active{background-color:#b7daff}button.secondary:focus{outline:none}.field-container{display:flex}.field-container label{color:gray}.field-container.checkbox{flex-direction:row;align-items:center;justify-content:center;padding:8px 12px;margin:auto}.field-container.options,.field-container.number,.field-container.text{flex-direction:column}.disclaimer{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;color:#121212;width:100%;height:100%}.disclaimer>*:not(:last-child){margin-bottom:1.5rem}.disclaimer .icon{width:3rem;height:3rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.disclaimer.no-form-selected h1{transform:scaleX(-1)}.disclaimer h1{font-size:5rem;font-weight:100}.disclaimer p{font-size:1rem}\n", ":host{all:unset;position:relative;width:100%;height:100%;overflow:auto}.container{display:flex;flex-direction:column;justify-content:space-between;align-items:stretch;height:100%;border:1px solid #ccc}.container header{padding:.5rem;display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;border-bottom:1px solid #ccc}.container header .header-form-editor-btns{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center}.container header .header-form-editor-btns>*:not(:last-child){margin-right:1rem}.container main{padding:.5rem;flex-grow:1;overflow:auto;display:flex;flex-direction:row;justify-content:flex-start;align-items:stretch;white-space:nowrap;position:relative}.container main>*:not(:last-child){margin-right:1rem}.container main .no-fields{position:absolute;top:0;left:0;background:white}.container main .form-config-no-fields{overflow:auto;width:100%}.container main .form-config-fields{overflow:auto;width:100%}.container main .form-config-fields .add-field-btn-container{width:100%;text-align:center}.container main .validators,.container main .properties{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch}.container main .validators>*:not(:last-child),.container main .properties>*:not(:last-child){margin-bottom:.5rem}.container main .input-checkbox-container{display:flex;flex-direction:row}.container footer{padding:.5rem;display:flex;flex-direction:row;justify-content:flex-end;align-items:stretch;border-top:1px solid lightgray}.container footer>*:not(:last-child){margin-right:1rem}.modal{position:absolute;top:0;background-color:#0000004d;width:100%;height:100%;display:flex;justify-content:center;align-items:center;left:0;flex-direction:row}.modal.error{background-color:#ff00004d}.modal-box{width:75%;height:75%;margin:auto;background-color:#fff;border-radius:1rem;box-shadow:#64646f33 0 7px 29px}.modal-content{display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;width:100%;height:100%}.modal-heading{padding:.5rem 1rem;width:100%;display:flex;flex-direction:row;justify-content:space-between;border-bottom:1px solid lightgray;align-items:center}.modal-title{font-weight:bold;font-size:1rem}.modal-actions{display:flex;flex-direction:row;cursor:pointer}.modal-actions>*:not(:last-child){margin-right:1rem}.modal-body{overflow:auto;flex:1}.modal-body .json-editor{font-family:monospace;white-space:pre-wrap;border:none;padding:0;background-color:#f5f5f5;height:100%;outline:none;overflow:auto}.json-editor{font-family:monospace;white-space:pre-wrap;border:none;padding:0;background-color:#f5f5f5;height:100%;outline:none;overflow:auto}table{width:100%;border-collapse:collapse;margin-bottom:20px}table th,table td{padding:8px;text-align:left;border:1px solid #ccc;vertical-align:top}table th{background-color:#f2f2f2}table tr:nth-child(even){background-color:#f9f9f9}table tr:hover{background-color:#eaeaea}\n"], components: [{ type: i3.KwikUILoaderComponent, selector: "kwikui-loader" }], directives: [{ type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "json": i3$2.JsonPipe, "keyvalue": i3$2.KeyValuePipe }, animations: [
|
|
2324
2355
|
trigger("panelInOut", [
|
|
2325
2356
|
transition(":enter", [
|
|
2326
2357
|
style({ transform: "translateY(100%)" }),
|
|
@@ -2331,9 +2362,6 @@ class KwikIDBuilderFormEditorComponent {
|
|
|
2331
2362
|
])
|
|
2332
2363
|
])
|
|
2333
2364
|
], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2334
|
-
__decorate([
|
|
2335
|
-
logMethod
|
|
2336
|
-
], KwikIDBuilderFormEditorComponent.prototype, "ngOnInit", null);
|
|
2337
2365
|
__decorate([
|
|
2338
2366
|
logMethod
|
|
2339
2367
|
], KwikIDBuilderFormEditorComponent.prototype, "ngOnChanges", null);
|
|
@@ -2375,7 +2403,7 @@ __decorate([
|
|
|
2375
2403
|
], KwikIDBuilderFormEditorComponent.prototype, "handleOnClickDeleteField", null);
|
|
2376
2404
|
__decorate([
|
|
2377
2405
|
logMethod
|
|
2378
|
-
], KwikIDBuilderFormEditorComponent.prototype, "
|
|
2406
|
+
], KwikIDBuilderFormEditorComponent.prototype, "handleOnClickSaveActiveFormConfigNoFields", null);
|
|
2379
2407
|
__decorate([
|
|
2380
2408
|
logMethod
|
|
2381
2409
|
], KwikIDBuilderFormEditorComponent.prototype, "handleOnClickPreview", null);
|
|
@@ -2420,7 +2448,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
2420
2448
|
type: Input
|
|
2421
2449
|
}], onClickSaveActiveFormConfig: [{
|
|
2422
2450
|
type: Output
|
|
2423
|
-
}],
|
|
2451
|
+
}], ngOnChanges: [], initFormEditor: [], handleOnClickChangeActiveEditor: [], handleOnClickSaveActiveFormConfig: [], handleOnClickAddField: [], handleOnClickEditValidators: [], handleOnClickEditProperties: [], handleOnClickEditOptions: [], handleOnInput: [], handleOnInputFieldConfigValidatorsConfig: [], handleOnInputFieldConfigPropertiesConfig: [], handleOnInputFieldConfigOptionsConfig: [], handleOnClickDeleteField: [], handleOnClickSaveActiveFormConfigNoFields: [], handleOnClickPreview: [], toggleLoader: [], closeJSONPopup: [], copyToClipboard: [], convertToMinifiedJson: [], convertToCompleteJson: [], downloadJSON: [] } });
|
|
2424
2452
|
|
|
2425
2453
|
class KwikIDFormsBuilderComponent {
|
|
2426
2454
|
constructor(loaderService) {
|
|
@@ -2460,65 +2488,55 @@ class KwikIDFormsBuilderComponent {
|
|
|
2460
2488
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2461
2489
|
this.toggleLoader(true);
|
|
2462
2490
|
const activeFormConfig = this.formsList.find((form) => {
|
|
2463
|
-
|
|
2464
|
-
return form;
|
|
2465
|
-
}
|
|
2491
|
+
return form.key === selectedFormKey;
|
|
2466
2492
|
});
|
|
2467
|
-
let formConfig
|
|
2493
|
+
let formConfig;
|
|
2468
2494
|
if (getObjectFromLocalStorage(activeFormConfig.key)) {
|
|
2469
2495
|
formConfig = getObjectFromLocalStorage(activeFormConfig.key);
|
|
2470
2496
|
}
|
|
2471
|
-
else {
|
|
2472
|
-
if (checkObjectKeyExists(activeFormConfig, "
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromUrl);
|
|
2476
|
-
}
|
|
2477
|
-
else if (checkObjectKeyExists(activeFormConfig["props"], "path") &&
|
|
2478
|
-
checkObjectKeyExists(this.userConfig, "backend") &&
|
|
2479
|
-
checkObjectKeyExists(this.userConfig.backend, "CONFIG_BASE_URL")) {
|
|
2480
|
-
const url = `${(_b = (_a = this.userConfig) === null || _a === void 0 ? void 0 : _a.backend) === null || _b === void 0 ? void 0 : _b.CONFIG_BASE_URL}${activeFormConfig["props"].path}`;
|
|
2481
|
-
const formConfigFromPath = yield this.fetchFormConfig(url);
|
|
2482
|
-
formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromPath);
|
|
2483
|
-
}
|
|
2484
|
-
else {
|
|
2485
|
-
if (checkObjectKeyExists(activeFormConfig, "fields")) {
|
|
2486
|
-
formConfig = activeFormConfig;
|
|
2487
|
-
}
|
|
2488
|
-
else {
|
|
2489
|
-
console.error("No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!");
|
|
2490
|
-
}
|
|
2491
|
-
}
|
|
2497
|
+
else if (checkObjectKeyExists(activeFormConfig, "props")) {
|
|
2498
|
+
if (checkObjectKeyExists(activeFormConfig.props, "url")) {
|
|
2499
|
+
const formConfigFromUrl = yield this.fetchFormConfig(activeFormConfig.props.url);
|
|
2500
|
+
formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromUrl);
|
|
2492
2501
|
}
|
|
2493
|
-
else if (checkObjectKeyExists(activeFormConfig, "
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
const formConfigFromPath = yield this.fetchFormConfig(url);
|
|
2503
|
-
formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromPath);
|
|
2504
|
-
}
|
|
2505
|
-
else {
|
|
2506
|
-
if (checkObjectKeyExists(activeFormConfig, "fields")) {
|
|
2507
|
-
formConfig = activeFormConfig;
|
|
2508
|
-
}
|
|
2509
|
-
else {
|
|
2510
|
-
console.error("No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!");
|
|
2511
|
-
}
|
|
2512
|
-
}
|
|
2502
|
+
else if (checkObjectKeyExists(activeFormConfig.props, "path") &&
|
|
2503
|
+
checkObjectKeyExists(this.userConfig, "backend") &&
|
|
2504
|
+
checkObjectKeyExists(this.userConfig.backend, "CONFIG_BASE_URL")) {
|
|
2505
|
+
const url = `${(_b = (_a = this.userConfig) === null || _a === void 0 ? void 0 : _a.backend) === null || _b === void 0 ? void 0 : _b.CONFIG_BASE_URL}${activeFormConfig.props.path}`;
|
|
2506
|
+
const formConfigFromPath = yield this.fetchFormConfig(url);
|
|
2507
|
+
formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromPath);
|
|
2508
|
+
}
|
|
2509
|
+
else if (checkObjectKeyExists(activeFormConfig, "fields")) {
|
|
2510
|
+
formConfig = activeFormConfig;
|
|
2513
2511
|
}
|
|
2514
2512
|
else {
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2513
|
+
console.error("No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!");
|
|
2514
|
+
}
|
|
2515
|
+
}
|
|
2516
|
+
else if (checkObjectKeyExists(activeFormConfig, "formContent")) {
|
|
2517
|
+
if (checkObjectKeyExists(activeFormConfig.formContent, "url")) {
|
|
2518
|
+
const formConfigFromUrl = yield this.fetchFormConfig(activeFormConfig.formContent.url);
|
|
2519
|
+
formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromUrl);
|
|
2520
|
+
}
|
|
2521
|
+
else if (checkObjectKeyExists(activeFormConfig.formContent, "path") &&
|
|
2522
|
+
checkObjectKeyExists(this.userConfig, "backend") &&
|
|
2523
|
+
checkObjectKeyExists(this.userConfig.backend, "CONFIG_BASE_URL")) {
|
|
2524
|
+
const url = `${(_d = (_c = this.userConfig) === null || _c === void 0 ? void 0 : _c.backend) === null || _d === void 0 ? void 0 : _d.CONFIG_BASE_URL}${activeFormConfig.props.path}`;
|
|
2525
|
+
const formConfigFromPath = yield this.fetchFormConfig(url);
|
|
2526
|
+
formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromPath);
|
|
2521
2527
|
}
|
|
2528
|
+
else if (checkObjectKeyExists(activeFormConfig, "fields")) {
|
|
2529
|
+
formConfig = activeFormConfig;
|
|
2530
|
+
}
|
|
2531
|
+
else {
|
|
2532
|
+
console.error("No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!");
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
else if (checkObjectKeyExists(activeFormConfig, "fields")) {
|
|
2536
|
+
formConfig = activeFormConfig;
|
|
2537
|
+
}
|
|
2538
|
+
else {
|
|
2539
|
+
console.error("No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!");
|
|
2522
2540
|
}
|
|
2523
2541
|
this.activeFormConfig = Object.assign(Object.assign({}, activeFormConfig), formConfig);
|
|
2524
2542
|
this.toggleLoader(false);
|
|
@@ -2549,7 +2567,7 @@ class KwikIDFormsBuilderComponent {
|
|
|
2549
2567
|
}
|
|
2550
2568
|
}
|
|
2551
2569
|
/** @nocollapse */ KwikIDFormsBuilderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormsBuilderComponent, deps: [{ token: i3.KwikUILoaderService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2552
|
-
/** @nocollapse */ KwikIDFormsBuilderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormsBuilderComponent, selector: "kwikid-forms-builder", inputs: { userConfig: "userConfig" }, ngImport: i0, template: "<div class=\"container\">\n <kwikid-builder-forms-list\n [activeFormConfig]=\"this.activeFormConfig\"\n [formsList]=\"this.formsList\"\n (getFormsList)=\"this.handleGetFormsList($event)\"\n (onClickSetActiveForm)=\"this.handleOnClickSetActiveForm($event)\"\n ></kwikid-builder-forms-list>\n <kwikid-builder-form-editor\n [activeFormConfig]=\"activeFormConfig\"\n (onClickSaveActiveFormConfig)=\"\n this.handleOnClickSaveActiveFormConfig($event)\n \"\n ></kwikid-builder-form-editor>\n</div>\n\n<kwikui-loader
|
|
2570
|
+
/** @nocollapse */ KwikIDFormsBuilderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormsBuilderComponent, selector: "kwikid-forms-builder", inputs: { userConfig: "userConfig" }, ngImport: i0, template: "<div class=\"container\">\n <kwikid-builder-forms-list\n [activeFormConfig]=\"this.activeFormConfig\"\n [formsList]=\"this.formsList\"\n (getFormsList)=\"this.handleGetFormsList($event)\"\n (onClickSetActiveForm)=\"this.handleOnClickSetActiveForm($event)\"\n ></kwikid-builder-forms-list>\n <kwikid-builder-form-editor\n [activeFormConfig]=\"activeFormConfig\"\n (onClickSaveActiveFormConfig)=\"\n this.handleOnClickSaveActiveFormConfig($event)\n \"\n ></kwikid-builder-form-editor>\n</div>\n\n<kwikui-loader></kwikui-loader>\n", styles: ["::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}input[type=text],input[type=number]{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box;appearance:auto!important}input[type=checkbox]{appearance:auto!important;width:1rem;height:1rem}select{width:100%;padding:8px 12px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box}textarea{overflow-wrap:anywhere;resize:none;unicode-bidi:embed;white-space:pre-wrap}button{display:inline-block;padding:8px 12px;background-color:#007bff;color:#fff;text-decoration:none;border-radius:4px;border:none;cursor:pointer}button:hover{background-color:#0069d9}button:active{background-color:#0056b3}button:focus{outline:none}button.secondary{padding:7px 11px;border:1px solid #007bff;background-color:#fff;color:#007bff}button.secondary:hover{background-color:#b7daff}button.secondary:active{background-color:#b7daff}button.secondary:focus{outline:none}.field-container{display:flex}.field-container label{color:gray}.field-container.checkbox{flex-direction:row;align-items:center;justify-content:center;padding:8px 12px;margin:auto}.field-container.options,.field-container.number,.field-container.text{flex-direction:column}.disclaimer{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;color:#121212;width:100%;height:100%}.disclaimer>*:not(:last-child){margin-bottom:1.5rem}.disclaimer .icon{width:3rem;height:3rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.disclaimer.no-form-selected h1{transform:scaleX(-1)}.disclaimer h1{font-size:5rem;font-weight:100}.disclaimer p{font-size:1rem}\n", ":host{all:unset;position:relative;width:100%;height:100%}.container{width:100%;height:100%;display:flex;flex-direction:row;justify-content:space-between;align-items:stretch;padding:1rem}.container>*:not(:last-child){margin-right:1rem}\n"], components: [{ type: KwikIDBuilderFormsListComponent, selector: "kwikid-builder-forms-list", inputs: ["activeFormConfig", "formsList"], outputs: ["onClickSetActiveForm", "getFormsList"] }, { type: KwikIDBuilderFormEditorComponent, selector: "kwikid-builder-form-editor", inputs: ["activeFormConfig"], outputs: ["onClickSaveActiveFormConfig"] }, { type: i3.KwikUILoaderComponent, selector: "kwikui-loader" }] });
|
|
2553
2571
|
__decorate([
|
|
2554
2572
|
logMethod
|
|
2555
2573
|
], KwikIDFormsBuilderComponent.prototype, "fetchFormConfig", null);
|
|
@@ -2576,6 +2594,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
2576
2594
|
type: Input
|
|
2577
2595
|
}], fetchFormConfig: [], handleGetFormsList: [], handleOnClickSetActiveForm: [], handleOnClickSaveActiveFormConfig: [], toggleLoader: [] } });
|
|
2578
2596
|
|
|
2597
|
+
/* eslint-disable no-unused-vars */
|
|
2579
2598
|
var EFormsListStatus;
|
|
2580
2599
|
(function (EFormsListStatus) {
|
|
2581
2600
|
EFormsListStatus["COMPLETED"] = "completed";
|
|
@@ -2659,6 +2678,7 @@ var EApiRequestUrlType;
|
|
|
2659
2678
|
EApiRequestUrlType["CALCULATED"] = "CALCULATED";
|
|
2660
2679
|
})(EApiRequestUrlType || (EApiRequestUrlType = {}));
|
|
2661
2680
|
|
|
2681
|
+
/* eslint-disable no-unused-vars */
|
|
2662
2682
|
var EMessageType;
|
|
2663
2683
|
(function (EMessageType) {
|
|
2664
2684
|
EMessageType["DEFAULT"] = "default";
|
|
@@ -2672,6 +2692,7 @@ var EFormViewGoBackMode;
|
|
|
2672
2692
|
EFormViewGoBackMode["TABBED"] = "TABBED";
|
|
2673
2693
|
})(EFormViewGoBackMode || (EFormViewGoBackMode = {}));
|
|
2674
2694
|
|
|
2695
|
+
/* eslint-disable no-unused-vars */
|
|
2675
2696
|
var ELogEventType$1;
|
|
2676
2697
|
(function (ELogEventType) {
|
|
2677
2698
|
ELogEventType["FORM__ACTION_EXECUTE"] = "FORM__ACTION_EXECUTE";
|
|
@@ -2751,24 +2772,23 @@ class KwikIDFormViewApiService {
|
|
|
2751
2772
|
.join("");
|
|
2752
2773
|
return outputString;
|
|
2753
2774
|
}
|
|
2754
|
-
|
|
2755
|
-
return undefined;
|
|
2756
|
-
}
|
|
2775
|
+
return undefined;
|
|
2757
2776
|
}
|
|
2758
2777
|
// Function to preprocess header data
|
|
2759
2778
|
preProcessHeader(headerData, isVerifySignature) {
|
|
2760
2779
|
if (!headerData)
|
|
2761
2780
|
headerData = {};
|
|
2762
2781
|
if (!headerData.headers)
|
|
2763
|
-
headerData
|
|
2782
|
+
headerData.headers = {};
|
|
2764
2783
|
// Generate a unique identifier if signature verification is required
|
|
2765
2784
|
if (isVerifySignature) {
|
|
2766
|
-
headerData
|
|
2785
|
+
headerData.headers.xrid = v4();
|
|
2767
2786
|
}
|
|
2768
2787
|
// Retrieve session ID from local storage and add it to headers
|
|
2769
|
-
|
|
2770
|
-
if (
|
|
2771
|
-
headerData
|
|
2788
|
+
const sessionId = localStorage.getItem("session_id");
|
|
2789
|
+
if (sessionId) {
|
|
2790
|
+
headerData.headers.ses = sessionId;
|
|
2791
|
+
}
|
|
2772
2792
|
return headerData;
|
|
2773
2793
|
}
|
|
2774
2794
|
// Function to verify the signature
|
|
@@ -2778,30 +2798,30 @@ class KwikIDFormViewApiService {
|
|
|
2778
2798
|
if (!isVerifySignature) {
|
|
2779
2799
|
resolve(true);
|
|
2780
2800
|
}
|
|
2781
|
-
// Check if data is invalid
|
|
2782
2801
|
else if (!data) {
|
|
2802
|
+
// Check if data is invalid
|
|
2783
2803
|
resolve(true);
|
|
2784
2804
|
}
|
|
2785
|
-
// Check if the signature is missing in headers when authentication is not skipped
|
|
2786
2805
|
else if (isVerifySignature && header && !(header === null || header === void 0 ? void 0 : header.sig)) {
|
|
2806
|
+
// Check if the signature is missing in headers when authentication is not skipped
|
|
2787
2807
|
reject(false);
|
|
2788
2808
|
}
|
|
2789
|
-
// Verify the signature when public key and header with signature are present and authentication is not skipped
|
|
2790
2809
|
else if (isVerifySignature && header && (header === null || header === void 0 ? void 0 : header.sig)) {
|
|
2810
|
+
// Verify the signature when public key and header with signature are present and authentication is not skipped
|
|
2791
2811
|
// Extract the signature and decode it
|
|
2792
2812
|
let signature = header.sig.split(".")[0];
|
|
2793
|
-
|
|
2813
|
+
const rawSignature = atob(signature);
|
|
2794
2814
|
// Split the decoded signature to get the parts
|
|
2795
2815
|
signature = rawSignature.split(".")[0];
|
|
2796
|
-
|
|
2797
|
-
|
|
2816
|
+
const exp = `${rawSignature.split(".")[1]}000`; // Expiration time in milliseconds
|
|
2817
|
+
const iat = `${rawSignature.split(".")[2]}000`; // Issued at time in milliseconds
|
|
2798
2818
|
// Check if the signature is valid
|
|
2799
2819
|
if (signature) {
|
|
2800
2820
|
// Check if the current time is before the expiration time
|
|
2801
2821
|
const dateValue = new Date().valueOf();
|
|
2802
|
-
|
|
2822
|
+
const dateCheck = dateValue < parseInt(exp, 10);
|
|
2803
2823
|
// Check if the signature matches the data
|
|
2804
|
-
|
|
2824
|
+
const res = signature === data;
|
|
2805
2825
|
// Resolve the promise if the signature is valid and the date check passes
|
|
2806
2826
|
if (res && dateCheck) {
|
|
2807
2827
|
resolve(res);
|
|
@@ -2830,7 +2850,7 @@ class KwikIDFormViewApiService {
|
|
|
2830
2850
|
preProcessedHeader = this.preProcessHeader(headerData, isVerifySignature);
|
|
2831
2851
|
}
|
|
2832
2852
|
else {
|
|
2833
|
-
preProcessedHeader
|
|
2853
|
+
preProcessedHeader.observe = "response";
|
|
2834
2854
|
}
|
|
2835
2855
|
// Encrypt body if required
|
|
2836
2856
|
if (isEncrypt) {
|
|
@@ -2838,7 +2858,7 @@ class KwikIDFormViewApiService {
|
|
|
2838
2858
|
}
|
|
2839
2859
|
return new Observable((subscriber) => {
|
|
2840
2860
|
axios.post(url, body, headerData).then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
2841
|
-
let data = res
|
|
2861
|
+
let { data } = res;
|
|
2842
2862
|
// Decrypt response if required
|
|
2843
2863
|
if (data && isDecrypt) {
|
|
2844
2864
|
const encryptedResponse = data;
|
|
@@ -2884,11 +2904,11 @@ class KwikIDFormViewApiService {
|
|
|
2884
2904
|
preProcessedHeader = this.preProcessHeader(headerData, isVerifySignature);
|
|
2885
2905
|
}
|
|
2886
2906
|
else {
|
|
2887
|
-
preProcessedHeader
|
|
2907
|
+
preProcessedHeader.observe = "response";
|
|
2888
2908
|
}
|
|
2889
2909
|
return new Observable((subscriber) => {
|
|
2890
2910
|
axios.get(url, preProcessedHeader).then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
2891
|
-
let data = res
|
|
2911
|
+
let { data } = res;
|
|
2892
2912
|
// Decrypt response if required
|
|
2893
2913
|
if (isDecrypt) {
|
|
2894
2914
|
const encryptedResponse = data;
|
|
@@ -2929,15 +2949,15 @@ class KwikIDFormViewApiService {
|
|
|
2929
2949
|
// Function to execute API call based on method type
|
|
2930
2950
|
executeApiCall(url, method, body, headers, isEncrypt, isDecrypt, isVerifySignature) {
|
|
2931
2951
|
return new Promise((resolve) => {
|
|
2932
|
-
if (method
|
|
2933
|
-
this.get(url, { headers
|
|
2952
|
+
if (method === "GET") {
|
|
2953
|
+
this.get(url, { headers }, isDecrypt, isVerifySignature).subscribe((res) => {
|
|
2934
2954
|
resolve(res);
|
|
2935
2955
|
}, (err) => {
|
|
2936
2956
|
resolve(err);
|
|
2937
2957
|
});
|
|
2938
2958
|
}
|
|
2939
2959
|
else {
|
|
2940
|
-
this.post(url, body, { headers
|
|
2960
|
+
this.post(url, body, { headers }, isEncrypt, isDecrypt, isVerifySignature).subscribe((res) => {
|
|
2941
2961
|
resolve(res);
|
|
2942
2962
|
}, (err) => {
|
|
2943
2963
|
resolve(err);
|
|
@@ -2962,16 +2982,35 @@ __decorate([
|
|
|
2962
2982
|
logMethod
|
|
2963
2983
|
], KwikIDFormViewApiService.prototype, "get", null);
|
|
2964
2984
|
|
|
2985
|
+
const FORM_VIEW_TIMERS = {
|
|
2986
|
+
WAIT_FOR_CHANGES_BEFORE_MOVING_TO_NEXT_TASK: 10,
|
|
2987
|
+
WAIT_FOR_FILE_METADATA_DEEPCOPY: 300,
|
|
2988
|
+
WAIT_FOR_KWIKID_CAMERA_TO_LOAD: 500,
|
|
2989
|
+
WAIT_FOR_KWIKID_CAMERA_MEDIA_TO_BE_SET: 500,
|
|
2990
|
+
LOCATION_PERMISSION_ERROR_TOGGLE: 3000,
|
|
2991
|
+
LOCATION_PERMISSION_RESET_BUTTON_STATUS: 500,
|
|
2992
|
+
INVALID_FIELDS_SAVE_FORM_ERROR_TOGGLE: 3000,
|
|
2993
|
+
TIMER_300: 300,
|
|
2994
|
+
TIMER_500: 500,
|
|
2995
|
+
TIMER_1000: 1000,
|
|
2996
|
+
TIMER_3000: 3000,
|
|
2997
|
+
WAIT_FOR_API_MOCK_DATA: 1000,
|
|
2998
|
+
API_MOCK_SUCCESS_STATUS_CODE: 200,
|
|
2999
|
+
API_MOCK_ERROR_STATUS_CODE: 200
|
|
3000
|
+
};
|
|
3001
|
+
|
|
2965
3002
|
class Defaults {
|
|
2966
|
-
constructor(field,
|
|
3003
|
+
constructor(field, object, takeAction) {
|
|
2967
3004
|
this._field = field;
|
|
2968
|
-
this.
|
|
2969
|
-
this._allFormsData = allFormsData;
|
|
2970
|
-
this._formData = formData;
|
|
2971
|
-
this._previousFormData = previousFormData;
|
|
2972
|
-
this._extraData = extraData;
|
|
3005
|
+
this._object = object;
|
|
2973
3006
|
this._takeAction = takeAction;
|
|
2974
3007
|
}
|
|
3008
|
+
get object() {
|
|
3009
|
+
return this._object;
|
|
3010
|
+
}
|
|
3011
|
+
set object(value) {
|
|
3012
|
+
this._object = value;
|
|
3013
|
+
}
|
|
2975
3014
|
getFormFieldValue() {
|
|
2976
3015
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2977
3016
|
let defaultValue;
|
|
@@ -2984,28 +3023,12 @@ class Defaults {
|
|
|
2984
3023
|
}
|
|
2985
3024
|
else if (!checkObjectKeyExists(this._field.default.value, "sources")) {
|
|
2986
3025
|
const engine = this._field.default.value;
|
|
2987
|
-
const triggers = engine
|
|
2988
|
-
const
|
|
2989
|
-
const
|
|
2990
|
-
const rulesMapping = new Rule(rules, {
|
|
2991
|
-
FIELD_CONFIG: this._field,
|
|
2992
|
-
FORM_FIELDS: this._formFields,
|
|
2993
|
-
FORM_DATA: this._formData,
|
|
2994
|
-
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
2995
|
-
ALL_FORMS_DATA: this._allFormsData,
|
|
2996
|
-
EXTRA_DATA: this._extraData
|
|
2997
|
-
}).mapping();
|
|
2998
|
-
for (let action of actions) {
|
|
3026
|
+
const { triggers, rules, actions } = engine;
|
|
3027
|
+
const rulesMapping = new Rule(rules, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field })).mapping();
|
|
3028
|
+
for (const action of actions) {
|
|
2999
3029
|
const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
|
|
3000
3030
|
if (conditionEvaluation) {
|
|
3001
|
-
const actions = new Action(action, rulesMapping, {
|
|
3002
|
-
FIELD_CONFIG: this._field,
|
|
3003
|
-
FORM_FIELDS: this._formFields,
|
|
3004
|
-
FORM_DATA: this._formData,
|
|
3005
|
-
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
3006
|
-
ALL_FORMS_DATA: this._allFormsData,
|
|
3007
|
-
EXTRA_DATA: this._extraData
|
|
3008
|
-
}, this._takeAction);
|
|
3031
|
+
const actions = new Action(action, rulesMapping, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field }), this._takeAction);
|
|
3009
3032
|
yield actions.execute();
|
|
3010
3033
|
}
|
|
3011
3034
|
}
|
|
@@ -3015,47 +3038,26 @@ class Defaults {
|
|
|
3015
3038
|
}
|
|
3016
3039
|
}
|
|
3017
3040
|
else {
|
|
3018
|
-
const sources = this._field.default.value
|
|
3041
|
+
const { sources } = this._field.default.value;
|
|
3019
3042
|
let sourceIndex = 0;
|
|
3020
|
-
for (
|
|
3021
|
-
const sources = new Source({
|
|
3022
|
-
FIELD_CONFIG: this._field,
|
|
3023
|
-
FORM_FIELDS: this._formFields,
|
|
3024
|
-
FORM_DATA: this._formData,
|
|
3025
|
-
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
3026
|
-
ALL_FORMS_DATA: this._allFormsData,
|
|
3027
|
-
EXTRA_DATA: this._extraData
|
|
3028
|
-
});
|
|
3043
|
+
for (const source of sources) {
|
|
3044
|
+
const sources = new Source(Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field }));
|
|
3029
3045
|
const value = sources.getValueFromSource(source);
|
|
3030
3046
|
// Set the Value of current source.
|
|
3031
3047
|
this._field = setValueToObjectPath(this._field, `default.value.sources.[${sourceIndex}].value`, value);
|
|
3032
|
-
const validation = source
|
|
3033
|
-
const triggers = validation
|
|
3034
|
-
const rules = validation
|
|
3035
|
-
const actions = validation
|
|
3036
|
-
const rulesMapping = new Rule(rules, {
|
|
3037
|
-
|
|
3038
|
-
FORM_FIELDS: this._formFields,
|
|
3039
|
-
FORM_DATA: this._formData,
|
|
3040
|
-
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
3041
|
-
ALL_FORMS_DATA: this._allFormsData,
|
|
3042
|
-
EXTRA_DATA: this._extraData
|
|
3043
|
-
}).mapping();
|
|
3044
|
-
for (let action of actions) {
|
|
3048
|
+
const { validation } = source;
|
|
3049
|
+
const { triggers } = validation;
|
|
3050
|
+
const { rules } = validation;
|
|
3051
|
+
const { actions } = validation;
|
|
3052
|
+
const rulesMapping = new Rule(rules, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field })).mapping();
|
|
3053
|
+
for (const action of actions) {
|
|
3045
3054
|
const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
|
|
3046
3055
|
if (conditionEvaluation) {
|
|
3047
|
-
const actions = new Action(action, rulesMapping, {
|
|
3048
|
-
FIELD_CONFIG: this._field,
|
|
3049
|
-
FORM_FIELDS: this._formFields,
|
|
3050
|
-
FORM_DATA: this._formData,
|
|
3051
|
-
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
3052
|
-
ALL_FORMS_DATA: this._allFormsData,
|
|
3053
|
-
EXTRA_DATA: this._extraData
|
|
3054
|
-
}, this._takeAction);
|
|
3056
|
+
const actions = new Action(action, rulesMapping, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field }), this._takeAction);
|
|
3055
3057
|
yield actions.execute();
|
|
3056
3058
|
}
|
|
3057
3059
|
}
|
|
3058
|
-
sourceIndex
|
|
3060
|
+
sourceIndex += 1;
|
|
3059
3061
|
}
|
|
3060
3062
|
defaultValue = this._field.default.value.value;
|
|
3061
3063
|
if (isEmptyValue(defaultValue)) {
|
|
@@ -3068,27 +3070,13 @@ class Defaults {
|
|
|
3068
3070
|
getFormFieldApiValue() {
|
|
3069
3071
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3070
3072
|
const apiConfig = this._field.default.api;
|
|
3071
|
-
const rules = apiConfig
|
|
3072
|
-
const actions = apiConfig
|
|
3073
|
-
const rulesMapping = new Rule(rules, {
|
|
3074
|
-
|
|
3075
|
-
FORM_FIELDS: this._formFields,
|
|
3076
|
-
FORM_DATA: this._formData,
|
|
3077
|
-
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
3078
|
-
ALL_FORMS_DATA: this._allFormsData,
|
|
3079
|
-
EXTRA_DATA: this._extraData
|
|
3080
|
-
}).mapping();
|
|
3081
|
-
for (let action of actions) {
|
|
3073
|
+
const { rules } = apiConfig;
|
|
3074
|
+
const { actions } = apiConfig;
|
|
3075
|
+
const rulesMapping = new Rule(rules, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field })).mapping();
|
|
3076
|
+
for (const action of actions) {
|
|
3082
3077
|
const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
|
|
3083
3078
|
if (conditionEvaluation) {
|
|
3084
|
-
const actions = new Action(action, rulesMapping, {
|
|
3085
|
-
FIELD_CONFIG: this._field,
|
|
3086
|
-
FORM_FIELDS: this._formFields,
|
|
3087
|
-
FORM_DATA: this._formData,
|
|
3088
|
-
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
3089
|
-
ALL_FORMS_DATA: this._allFormsData,
|
|
3090
|
-
EXTRA_DATA: this._extraData
|
|
3091
|
-
}, this._takeAction);
|
|
3079
|
+
const actions = new Action(action, rulesMapping, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field }), this._takeAction);
|
|
3092
3080
|
yield actions.execute();
|
|
3093
3081
|
}
|
|
3094
3082
|
}
|
|
@@ -3097,27 +3085,13 @@ class Defaults {
|
|
|
3097
3085
|
getFormFieldOptions() {
|
|
3098
3086
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3099
3087
|
const optionsConfig = this._field.default.options;
|
|
3100
|
-
const rules = optionsConfig
|
|
3101
|
-
const actions = optionsConfig
|
|
3102
|
-
const rulesMapping = new Rule(rules, {
|
|
3103
|
-
|
|
3104
|
-
FORM_FIELDS: this._formFields,
|
|
3105
|
-
FORM_DATA: this._formData,
|
|
3106
|
-
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
3107
|
-
ALL_FORMS_DATA: this._allFormsData,
|
|
3108
|
-
EXTRA_DATA: this._extraData
|
|
3109
|
-
}).mapping();
|
|
3110
|
-
for (let action of actions) {
|
|
3088
|
+
const { rules } = optionsConfig;
|
|
3089
|
+
const { actions } = optionsConfig;
|
|
3090
|
+
const rulesMapping = new Rule(rules, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field })).mapping();
|
|
3091
|
+
for (const action of actions) {
|
|
3111
3092
|
const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
|
|
3112
3093
|
if (conditionEvaluation) {
|
|
3113
|
-
const actions = new Action(action, rulesMapping, {
|
|
3114
|
-
FIELD_CONFIG: this._field,
|
|
3115
|
-
FORM_FIELDS: this._formFields,
|
|
3116
|
-
FORM_DATA: this._formData,
|
|
3117
|
-
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
3118
|
-
ALL_FORMS_DATA: this._allFormsData,
|
|
3119
|
-
EXTRA_DATA: this._extraData
|
|
3120
|
-
}, this._takeAction);
|
|
3094
|
+
const actions = new Action(action, rulesMapping, Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field }), this._takeAction);
|
|
3121
3095
|
yield actions.execute();
|
|
3122
3096
|
}
|
|
3123
3097
|
}
|
|
@@ -3134,10 +3108,18 @@ __decorate([
|
|
|
3134
3108
|
logMethod
|
|
3135
3109
|
], Defaults.prototype, "getFormFieldOptions", null);
|
|
3136
3110
|
|
|
3111
|
+
function NoWhitespacesValidator() {
|
|
3112
|
+
return (control) => {
|
|
3113
|
+
const { value } = control;
|
|
3114
|
+
if (!value || typeof value !== "string") {
|
|
3115
|
+
return null;
|
|
3116
|
+
}
|
|
3117
|
+
return hasWhitespacesOnly(value) ? { onlyWhitespaces: true } : null;
|
|
3118
|
+
};
|
|
3119
|
+
}
|
|
3137
3120
|
class FormValidation {
|
|
3138
|
-
constructor() { }
|
|
3139
3121
|
getFormFieldValidators(field) {
|
|
3140
|
-
|
|
3122
|
+
const validators = [];
|
|
3141
3123
|
if (checkObjectKeyExists(field, "validators") &&
|
|
3142
3124
|
checkObjectKeyExists(field.validators, "min") &&
|
|
3143
3125
|
isNotEmptyValue(field.validators.min)) {
|
|
@@ -3184,23 +3166,25 @@ class FormValidation {
|
|
|
3184
3166
|
return validators;
|
|
3185
3167
|
}
|
|
3186
3168
|
getFormFieldsValidationErrors(formGroup) {
|
|
3187
|
-
|
|
3169
|
+
const errors = [];
|
|
3188
3170
|
for (const key in formGroup.controls) {
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3171
|
+
if (isNotEmptyValue(key)) {
|
|
3172
|
+
const controlErrors = formGroup.controls[key].errors;
|
|
3173
|
+
if (controlErrors !== null && controlErrors !== undefined) {
|
|
3174
|
+
Object.keys(controlErrors).forEach((keyError) => {
|
|
3175
|
+
errors.push({
|
|
3176
|
+
name: keyError,
|
|
3177
|
+
value: controlErrors[keyError]
|
|
3178
|
+
});
|
|
3195
3179
|
});
|
|
3196
|
-
}
|
|
3180
|
+
}
|
|
3197
3181
|
}
|
|
3198
3182
|
}
|
|
3199
3183
|
return errors;
|
|
3200
3184
|
}
|
|
3201
3185
|
getFormFieldsInvalidControls(formToInvestigate) {
|
|
3202
|
-
|
|
3203
|
-
|
|
3186
|
+
const controls = [];
|
|
3187
|
+
const recursiveFunc = (form) => {
|
|
3204
3188
|
Object.keys(form.controls).forEach((field) => {
|
|
3205
3189
|
const control = form.get(field);
|
|
3206
3190
|
if (control.invalid) {
|
|
@@ -3236,25 +3220,15 @@ __decorate([
|
|
|
3236
3220
|
__decorate([
|
|
3237
3221
|
logMethod
|
|
3238
3222
|
], FormValidation.prototype, "getFormFieldsInvalidControls", null);
|
|
3239
|
-
function NoWhitespacesValidator() {
|
|
3240
|
-
return (control) => {
|
|
3241
|
-
const value = control.value;
|
|
3242
|
-
if (!value || typeof value !== "string") {
|
|
3243
|
-
return null;
|
|
3244
|
-
}
|
|
3245
|
-
return hasWhitespacesOnly(value) ? { onlyWhitespaces: true } : null;
|
|
3246
|
-
};
|
|
3247
|
-
}
|
|
3248
3223
|
|
|
3249
3224
|
class KwikIDFormViewService {
|
|
3250
|
-
constructor() { }
|
|
3251
3225
|
// 'init' stage of the form
|
|
3252
|
-
createFormGroup(fields,
|
|
3226
|
+
createFormGroup(fields, object, takeAction) {
|
|
3253
3227
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3254
|
-
|
|
3255
|
-
for (
|
|
3228
|
+
const formGroup = new FormGroup({});
|
|
3229
|
+
for (const field of fields) {
|
|
3256
3230
|
if (field.isFormElement) {
|
|
3257
|
-
const defaults = new Defaults(field,
|
|
3231
|
+
const defaults = new Defaults(field, Object.assign(Object.assign({}, object), { FORM_FIELDS: fields }), takeAction);
|
|
3258
3232
|
let value = "";
|
|
3259
3233
|
if (checkObjectKeyExists(field, "default")) {
|
|
3260
3234
|
if (checkObjectKeyExists(field.default, "value")) {
|
|
@@ -3275,7 +3249,7 @@ class KwikIDFormViewService {
|
|
|
3275
3249
|
}
|
|
3276
3250
|
value = convertFormFieldValueToKwikUIFormat(field, value);
|
|
3277
3251
|
const validators = new FormValidation().getFormFieldValidators(field);
|
|
3278
|
-
formGroup.addControl(field.key, new FormControl({ value
|
|
3252
|
+
formGroup.addControl(field.key, new FormControl({ value, disabled: field.disabled }, { validators }));
|
|
3279
3253
|
}
|
|
3280
3254
|
}
|
|
3281
3255
|
return formGroup;
|
|
@@ -3301,7 +3275,7 @@ class Apis {
|
|
|
3301
3275
|
}
|
|
3302
3276
|
setUrl() {
|
|
3303
3277
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3304
|
-
if (this._request.url
|
|
3278
|
+
if (checkObjectKeyExists(this._request.url, "type") &&
|
|
3305
3279
|
this._request.url.type === EApiRequestUrlType.CALCULATED) {
|
|
3306
3280
|
const source = new Source(this._object);
|
|
3307
3281
|
const url = yield source.getValueFromSource(this._request.url.props.value.source);
|
|
@@ -3318,41 +3292,41 @@ class Apis {
|
|
|
3318
3292
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3319
3293
|
if (checkObjectKeyExists(this._request, "body")) {
|
|
3320
3294
|
if (checkObjectKeyExists(this._request.body, "params")) {
|
|
3321
|
-
|
|
3295
|
+
const { params } = this._request.body;
|
|
3322
3296
|
let paramIndex = 0;
|
|
3323
|
-
for (
|
|
3324
|
-
|
|
3297
|
+
for (const param of params) {
|
|
3298
|
+
const { sources } = param;
|
|
3325
3299
|
let sourceIndex = 0;
|
|
3326
|
-
for (
|
|
3300
|
+
for (const source of sources) {
|
|
3327
3301
|
const sources = new Source(this._object);
|
|
3328
3302
|
const value = sources.getValueFromSource(source);
|
|
3329
3303
|
// Set the Value of current source.
|
|
3330
3304
|
this._object.API_CONFIG = setValueToObjectPath(this._object.API_CONFIG, `request.body.params[${paramIndex}].sources[${sourceIndex}].value`, value);
|
|
3331
|
-
const validation = source
|
|
3305
|
+
const { validation } = source;
|
|
3332
3306
|
const triggers = (_a = validation === null || validation === void 0 ? void 0 : validation.triggers) !== null && _a !== void 0 ? _a : [];
|
|
3333
3307
|
const rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
|
|
3334
3308
|
const actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
|
|
3335
3309
|
const rulesMapping = new Rule(rules, this._object).mapping();
|
|
3336
|
-
for (
|
|
3310
|
+
for (const action of actions) {
|
|
3337
3311
|
const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
|
|
3338
3312
|
if (conditionEvaluation) {
|
|
3339
3313
|
const actions = new Action(action, rulesMapping, this._object, this._takeAction);
|
|
3340
3314
|
yield actions.execute();
|
|
3341
3315
|
}
|
|
3342
3316
|
}
|
|
3343
|
-
sourceIndex
|
|
3317
|
+
sourceIndex += 1;
|
|
3344
3318
|
}
|
|
3345
|
-
paramIndex
|
|
3319
|
+
paramIndex += 1;
|
|
3346
3320
|
}
|
|
3347
3321
|
return this._object.API_CONFIG;
|
|
3348
3322
|
}
|
|
3349
|
-
|
|
3323
|
+
if (checkObjectKeyExists(this._request.body, "rules") &&
|
|
3350
3324
|
checkObjectKeyExists(this._request.body, "actions")) {
|
|
3351
3325
|
const triggers = (_f = (_e = this._request.body) === null || _e === void 0 ? void 0 : _e.triggers) !== null && _f !== void 0 ? _f : [];
|
|
3352
3326
|
const rules = (_h = (_g = this._request.body) === null || _g === void 0 ? void 0 : _g.rules) !== null && _h !== void 0 ? _h : [];
|
|
3353
3327
|
const actions = (_k = (_j = this._request.body) === null || _j === void 0 ? void 0 : _j.actions) !== null && _k !== void 0 ? _k : [];
|
|
3354
3328
|
const rulesMapping = new Rule(rules, this._object).mapping();
|
|
3355
|
-
for (
|
|
3329
|
+
for (const action of actions) {
|
|
3356
3330
|
const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
|
|
3357
3331
|
if (conditionEvaluation) {
|
|
3358
3332
|
const actions = new Action(action, rulesMapping, this._object, this._takeAction);
|
|
@@ -3361,13 +3335,9 @@ class Apis {
|
|
|
3361
3335
|
}
|
|
3362
3336
|
return this._object.API_CONFIG;
|
|
3363
3337
|
}
|
|
3364
|
-
else {
|
|
3365
|
-
return this._object.API_CONFIG;
|
|
3366
|
-
}
|
|
3367
|
-
}
|
|
3368
|
-
else {
|
|
3369
3338
|
return this._object.API_CONFIG;
|
|
3370
3339
|
}
|
|
3340
|
+
return this._object.API_CONFIG;
|
|
3371
3341
|
});
|
|
3372
3342
|
}
|
|
3373
3343
|
validateRequestBody() {
|
|
@@ -3375,13 +3345,13 @@ class Apis {
|
|
|
3375
3345
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3376
3346
|
if (checkObjectKeyExists(this._request, "body")) {
|
|
3377
3347
|
if (checkObjectKeyExists(this._request.body, "validation")) {
|
|
3378
|
-
const body = this._request
|
|
3379
|
-
const validation = body
|
|
3348
|
+
const { body } = this._request;
|
|
3349
|
+
const { validation } = body;
|
|
3380
3350
|
const triggers = (_a = validation === null || validation === void 0 ? void 0 : validation.triggers) !== null && _a !== void 0 ? _a : [];
|
|
3381
3351
|
const rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
|
|
3382
3352
|
const actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
|
|
3383
3353
|
const rulesMapping = new Rule(rules, this._object).mapping();
|
|
3384
|
-
for (
|
|
3354
|
+
for (const action of actions) {
|
|
3385
3355
|
const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
|
|
3386
3356
|
if (conditionSuccess) {
|
|
3387
3357
|
const actions = new Action(action, rulesMapping, this._object, this._takeAction);
|
|
@@ -3390,13 +3360,13 @@ class Apis {
|
|
|
3390
3360
|
}
|
|
3391
3361
|
return this._object.API_CONFIG;
|
|
3392
3362
|
}
|
|
3393
|
-
|
|
3363
|
+
if (checkObjectPathExists(this._request.body, "rules") &&
|
|
3394
3364
|
checkObjectPathExists(this._request.body, "actions")) {
|
|
3395
3365
|
const triggers = (_f = (_e = this._request.body) === null || _e === void 0 ? void 0 : _e.triggers) !== null && _f !== void 0 ? _f : [];
|
|
3396
3366
|
const rules = (_h = (_g = this._request.body) === null || _g === void 0 ? void 0 : _g.rules) !== null && _h !== void 0 ? _h : [];
|
|
3397
3367
|
const actions = (_k = (_j = this._request.body) === null || _j === void 0 ? void 0 : _j.actions) !== null && _k !== void 0 ? _k : [];
|
|
3398
3368
|
const rulesMapping = new Rule(rules, this._object).mapping();
|
|
3399
|
-
for (
|
|
3369
|
+
for (const action of actions) {
|
|
3400
3370
|
const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
|
|
3401
3371
|
if (conditionSuccess) {
|
|
3402
3372
|
const actions = new Action(action, rulesMapping, this._object, this._takeAction);
|
|
@@ -3405,15 +3375,11 @@ class Apis {
|
|
|
3405
3375
|
}
|
|
3406
3376
|
return this._object.API_CONFIG;
|
|
3407
3377
|
}
|
|
3408
|
-
else {
|
|
3409
|
-
this._object = setValueToObjectPath(this._object, "API_CONFIG.request.body.is_valid", true);
|
|
3410
|
-
return this._object.API_CONFIG;
|
|
3411
|
-
}
|
|
3412
|
-
}
|
|
3413
|
-
else {
|
|
3414
3378
|
this._object = setValueToObjectPath(this._object, "API_CONFIG.request.body.is_valid", true);
|
|
3415
3379
|
return this._object.API_CONFIG;
|
|
3416
3380
|
}
|
|
3381
|
+
this._object = setValueToObjectPath(this._object, "API_CONFIG.request.body.is_valid", true);
|
|
3382
|
+
return this._object.API_CONFIG;
|
|
3417
3383
|
});
|
|
3418
3384
|
}
|
|
3419
3385
|
setRequestHeaders() {
|
|
@@ -3421,41 +3387,41 @@ class Apis {
|
|
|
3421
3387
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3422
3388
|
if (checkObjectKeyExists(this._request, "headers")) {
|
|
3423
3389
|
if (checkObjectKeyExists(this._request.headers, "params")) {
|
|
3424
|
-
|
|
3390
|
+
const { params } = this._request.headers;
|
|
3425
3391
|
let paramIndex = 0;
|
|
3426
|
-
for (
|
|
3427
|
-
|
|
3392
|
+
for (const param of params) {
|
|
3393
|
+
const { sources } = param;
|
|
3428
3394
|
let sourceIndex = 0;
|
|
3429
|
-
for (
|
|
3395
|
+
for (const source of sources) {
|
|
3430
3396
|
const sources = new Source(this._object);
|
|
3431
3397
|
const value = sources.getValueFromSource(source);
|
|
3432
3398
|
// Set the Value of current source.
|
|
3433
3399
|
this._object.API_CONFIG = setValueToObjectPath(this._object.API_CONFIG, `request.headers.params[${paramIndex}].sources[${sourceIndex}].value`, value);
|
|
3434
|
-
const validation = source
|
|
3400
|
+
const { validation } = source;
|
|
3435
3401
|
const triggers = (_a = validation === null || validation === void 0 ? void 0 : validation.triggers) !== null && _a !== void 0 ? _a : [];
|
|
3436
3402
|
const rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
|
|
3437
3403
|
const actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
|
|
3438
3404
|
const rulesMapping = new Rule(rules, this._object).mapping();
|
|
3439
|
-
for (
|
|
3405
|
+
for (const action of actions) {
|
|
3440
3406
|
const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
|
|
3441
3407
|
if (conditionEvaluation) {
|
|
3442
3408
|
const actions = new Action(action, rulesMapping, this._object, this._takeAction);
|
|
3443
3409
|
yield actions.execute();
|
|
3444
3410
|
}
|
|
3445
3411
|
}
|
|
3446
|
-
sourceIndex
|
|
3412
|
+
sourceIndex += 1;
|
|
3447
3413
|
}
|
|
3448
|
-
paramIndex
|
|
3414
|
+
paramIndex += 1;
|
|
3449
3415
|
}
|
|
3450
3416
|
return this._object.API_CONFIG;
|
|
3451
3417
|
}
|
|
3452
|
-
|
|
3418
|
+
if (checkObjectKeyExists(this._request.headers, "rules") &&
|
|
3453
3419
|
checkObjectKeyExists(this._request.headers, "actions")) {
|
|
3454
3420
|
const triggers = (_f = (_e = this._request.headers) === null || _e === void 0 ? void 0 : _e.triggers) !== null && _f !== void 0 ? _f : [];
|
|
3455
3421
|
const rules = (_h = (_g = this._request.headers) === null || _g === void 0 ? void 0 : _g.rules) !== null && _h !== void 0 ? _h : [];
|
|
3456
3422
|
const actions = (_k = (_j = this._request.headers) === null || _j === void 0 ? void 0 : _j.actions) !== null && _k !== void 0 ? _k : [];
|
|
3457
3423
|
const rulesMapping = new Rule(rules, this._object).mapping();
|
|
3458
|
-
for (
|
|
3424
|
+
for (const action of actions) {
|
|
3459
3425
|
const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
|
|
3460
3426
|
if (conditionEvaluation) {
|
|
3461
3427
|
const actions = new Action(action, rulesMapping, this._object, this._takeAction);
|
|
@@ -3464,27 +3430,23 @@ class Apis {
|
|
|
3464
3430
|
}
|
|
3465
3431
|
return this._object.API_CONFIG;
|
|
3466
3432
|
}
|
|
3467
|
-
else {
|
|
3468
|
-
return this._object.API_CONFIG;
|
|
3469
|
-
}
|
|
3470
|
-
}
|
|
3471
|
-
else {
|
|
3472
3433
|
return this._object.API_CONFIG;
|
|
3473
3434
|
}
|
|
3435
|
+
return this._object.API_CONFIG;
|
|
3474
3436
|
});
|
|
3475
3437
|
}
|
|
3476
3438
|
validateRequestHeaders() {
|
|
3477
3439
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3478
3440
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3479
|
-
const headers = this._request
|
|
3441
|
+
const { headers } = this._request;
|
|
3480
3442
|
if (checkObjectKeyExists(this._request, "headers")) {
|
|
3481
3443
|
if (checkObjectKeyExists(this._request.headers, "validation")) {
|
|
3482
|
-
const validation = headers
|
|
3444
|
+
const { validation } = headers;
|
|
3483
3445
|
const triggers = (_a = validation === null || validation === void 0 ? void 0 : validation.triggers) !== null && _a !== void 0 ? _a : [];
|
|
3484
3446
|
const rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
|
|
3485
3447
|
const actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
|
|
3486
3448
|
const rulesMapping = new Rule(rules, this._object).mapping();
|
|
3487
|
-
for (
|
|
3449
|
+
for (const action of actions) {
|
|
3488
3450
|
const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
|
|
3489
3451
|
if (conditionSuccess) {
|
|
3490
3452
|
const actions = new Action(action, rulesMapping, this._object, this._takeAction);
|
|
@@ -3493,13 +3455,13 @@ class Apis {
|
|
|
3493
3455
|
}
|
|
3494
3456
|
return this._object.API_CONFIG;
|
|
3495
3457
|
}
|
|
3496
|
-
|
|
3458
|
+
if (checkObjectPathExists(this._request.headers, "rules") &&
|
|
3497
3459
|
checkObjectPathExists(this._request.headers, "actions")) {
|
|
3498
3460
|
const triggers = (_e = headers === null || headers === void 0 ? void 0 : headers.triggers) !== null && _e !== void 0 ? _e : [];
|
|
3499
3461
|
const rules = (_f = headers === null || headers === void 0 ? void 0 : headers.rules) !== null && _f !== void 0 ? _f : [];
|
|
3500
3462
|
const actions = (_h = (_g = headers) === null || _g === void 0 ? void 0 : _g.actions) !== null && _h !== void 0 ? _h : [];
|
|
3501
3463
|
const rulesMapping = new Rule(rules, this._object).mapping();
|
|
3502
|
-
for (
|
|
3464
|
+
for (const action of actions) {
|
|
3503
3465
|
const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
|
|
3504
3466
|
if (conditionSuccess) {
|
|
3505
3467
|
const actions = new Action(action, rulesMapping, this._object, this._takeAction);
|
|
@@ -3508,27 +3470,23 @@ class Apis {
|
|
|
3508
3470
|
}
|
|
3509
3471
|
return this._object.API_CONFIG;
|
|
3510
3472
|
}
|
|
3511
|
-
else {
|
|
3512
|
-
this._object = setValueToObjectPath(this._object, "API_CONFIG.request.headers.is_valid", true);
|
|
3513
|
-
return this._object.API_CONFIG;
|
|
3514
|
-
}
|
|
3515
|
-
}
|
|
3516
|
-
else {
|
|
3517
3473
|
this._object = setValueToObjectPath(this._object, "API_CONFIG.request.headers.is_valid", true);
|
|
3518
3474
|
return this._object.API_CONFIG;
|
|
3519
3475
|
}
|
|
3476
|
+
this._object = setValueToObjectPath(this._object, "API_CONFIG.request.headers.is_valid", true);
|
|
3477
|
+
return this._object.API_CONFIG;
|
|
3520
3478
|
});
|
|
3521
3479
|
}
|
|
3522
3480
|
validateResponse() {
|
|
3523
3481
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3524
3482
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3525
3483
|
if (checkObjectKeyExists(this._response, "validation")) {
|
|
3526
|
-
const validation = this._response
|
|
3484
|
+
const { validation } = this._response;
|
|
3527
3485
|
const triggers = (_a = validation === null || validation === void 0 ? void 0 : validation.triggers) !== null && _a !== void 0 ? _a : [];
|
|
3528
3486
|
const rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
|
|
3529
3487
|
const actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
|
|
3530
3488
|
const rulesMapping = new Rule(rules, this._object).mapping();
|
|
3531
|
-
for (
|
|
3489
|
+
for (const action of actions) {
|
|
3532
3490
|
const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
|
|
3533
3491
|
if (conditionSuccess) {
|
|
3534
3492
|
const actions = new Action(action, rulesMapping, this._object, this._takeAction);
|
|
@@ -3542,7 +3500,7 @@ class Apis {
|
|
|
3542
3500
|
const rules = (_h = (_g = this._response) === null || _g === void 0 ? void 0 : _g.rules) !== null && _h !== void 0 ? _h : [];
|
|
3543
3501
|
const actions = (_k = (_j = this._response) === null || _j === void 0 ? void 0 : _j.actions) !== null && _k !== void 0 ? _k : [];
|
|
3544
3502
|
const rulesMapping = new Rule(rules, this._object).mapping();
|
|
3545
|
-
for (
|
|
3503
|
+
for (const action of actions) {
|
|
3546
3504
|
const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
|
|
3547
3505
|
if (conditionSuccess) {
|
|
3548
3506
|
const actions = new Action(action, rulesMapping, this._object, this._takeAction);
|
|
@@ -3560,7 +3518,7 @@ class Apis {
|
|
|
3560
3518
|
const rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
|
|
3561
3519
|
const actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
|
|
3562
3520
|
const rulesMapping = new Rule(rules, this._object).mapping();
|
|
3563
|
-
for (
|
|
3521
|
+
for (const action of actions) {
|
|
3564
3522
|
const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
|
|
3565
3523
|
if (conditionSuccess) {
|
|
3566
3524
|
const actions = new Action(action, rulesMapping, this._object, this._takeAction);
|
|
@@ -3593,33 +3551,29 @@ __decorate([
|
|
|
3593
3551
|
], Apis.prototype, "callNextApi", null);
|
|
3594
3552
|
|
|
3595
3553
|
class CameraHelper {
|
|
3596
|
-
constructor(field,
|
|
3597
|
-
this.
|
|
3554
|
+
constructor(field, object) {
|
|
3555
|
+
this.activeCameraData = {};
|
|
3598
3556
|
this._field = field;
|
|
3599
|
-
this.
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
this.
|
|
3603
|
-
|
|
3557
|
+
this._object = object;
|
|
3558
|
+
}
|
|
3559
|
+
get object() {
|
|
3560
|
+
return this._object;
|
|
3561
|
+
}
|
|
3562
|
+
set object(value) {
|
|
3563
|
+
this._object = value;
|
|
3604
3564
|
}
|
|
3605
3565
|
getCameraWatermarkData() {
|
|
3566
|
+
var _a, _b;
|
|
3606
3567
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3607
|
-
const sources = this._field.properties
|
|
3608
|
-
for (
|
|
3609
|
-
const sources = new Source({
|
|
3610
|
-
FIELD_CONFIG: this._field,
|
|
3611
|
-
FORM_FIELDS: this._formFields,
|
|
3612
|
-
FORM_DATA: this._formData,
|
|
3613
|
-
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
3614
|
-
ALL_FORMS_DATA: this._allFormsData,
|
|
3615
|
-
EXTRA_DATA: this._extraData
|
|
3616
|
-
});
|
|
3568
|
+
const sources = (_b = (_a = this._field.properties.features) === null || _a === void 0 ? void 0 : _a.watermark) === null || _b === void 0 ? void 0 : _b.sources;
|
|
3569
|
+
for (const source of sources) {
|
|
3570
|
+
const sources = new Source(Object.assign(Object.assign({}, this._object), { FIELD_CONFIG: this._field }));
|
|
3617
3571
|
const value = yield sources.getValueFromSource(source);
|
|
3618
3572
|
if (checkObjectKeyExists(source, "id")) {
|
|
3619
|
-
this.
|
|
3573
|
+
this.activeCameraData[source.id] = value;
|
|
3620
3574
|
}
|
|
3621
3575
|
}
|
|
3622
|
-
return this.
|
|
3576
|
+
return this.activeCameraData;
|
|
3623
3577
|
});
|
|
3624
3578
|
}
|
|
3625
3579
|
}
|
|
@@ -3653,11 +3607,9 @@ class Tasks {
|
|
|
3653
3607
|
}
|
|
3654
3608
|
execute() {
|
|
3655
3609
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3656
|
-
const triggers = this._task
|
|
3657
|
-
const rules = this._task.rules;
|
|
3658
|
-
const actions = this._task.actions;
|
|
3610
|
+
const { triggers, rules, actions } = this._task;
|
|
3659
3611
|
const rulesMapping = new Rule(rules, this._object).mapping();
|
|
3660
|
-
for (
|
|
3612
|
+
for (const action of actions) {
|
|
3661
3613
|
const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
|
|
3662
3614
|
if (conditionEvaluation) {
|
|
3663
3615
|
const actions = new Action(action, rulesMapping, this._object, this._takeAction);
|
|
@@ -3688,6 +3640,63 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
3688
3640
|
}]
|
|
3689
3641
|
}], ctorParameters: function () { return [{ type: i1.DomSanitizer }]; } });
|
|
3690
3642
|
|
|
3643
|
+
class FilterImageUrlOrBase64FromObjectPipe {
|
|
3644
|
+
transform(mediaFiles) {
|
|
3645
|
+
if (isEmptyValue(mediaFiles)) {
|
|
3646
|
+
return [];
|
|
3647
|
+
}
|
|
3648
|
+
return mediaFiles
|
|
3649
|
+
.map((item) => {
|
|
3650
|
+
if (isObject(item) && checkObjectKeyExists(item, "image")) {
|
|
3651
|
+
return item.image;
|
|
3652
|
+
}
|
|
3653
|
+
if (isNotEmptyValue(item)) {
|
|
3654
|
+
return item;
|
|
3655
|
+
}
|
|
3656
|
+
return null; // Use null to filter out unwanted items
|
|
3657
|
+
})
|
|
3658
|
+
.filter((item) => isNotEmptyValue(item));
|
|
3659
|
+
}
|
|
3660
|
+
}
|
|
3661
|
+
/** @nocollapse */ FilterImageUrlOrBase64FromObjectPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FilterImageUrlOrBase64FromObjectPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3662
|
+
/** @nocollapse */ FilterImageUrlOrBase64FromObjectPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FilterImageUrlOrBase64FromObjectPipe, name: "filterImageUrlOrBase64FromObject" });
|
|
3663
|
+
__decorate([
|
|
3664
|
+
logMethod
|
|
3665
|
+
], FilterImageUrlOrBase64FromObjectPipe.prototype, "transform", null);
|
|
3666
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FilterImageUrlOrBase64FromObjectPipe, decorators: [{
|
|
3667
|
+
type: Pipe,
|
|
3668
|
+
args: [{
|
|
3669
|
+
name: "filterImageUrlOrBase64FromObject"
|
|
3670
|
+
}]
|
|
3671
|
+
}], propDecorators: { transform: [] } });
|
|
3672
|
+
|
|
3673
|
+
class FilterVideoUrlOrBase64FromObjectPipe {
|
|
3674
|
+
transform(mediaFiles) {
|
|
3675
|
+
if (isEmptyValue(mediaFiles)) {
|
|
3676
|
+
return [];
|
|
3677
|
+
}
|
|
3678
|
+
return mediaFiles
|
|
3679
|
+
.map((item) => {
|
|
3680
|
+
if (isObject(item) && checkObjectKeyExists(item, "video")) {
|
|
3681
|
+
return item.video;
|
|
3682
|
+
}
|
|
3683
|
+
if (isNotEmptyValue(item)) {
|
|
3684
|
+
return item;
|
|
3685
|
+
}
|
|
3686
|
+
return null; // Use null to filter out unwanted items
|
|
3687
|
+
})
|
|
3688
|
+
.filter((item) => isNotEmptyValue(item));
|
|
3689
|
+
}
|
|
3690
|
+
}
|
|
3691
|
+
/** @nocollapse */ FilterVideoUrlOrBase64FromObjectPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FilterVideoUrlOrBase64FromObjectPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3692
|
+
/** @nocollapse */ FilterVideoUrlOrBase64FromObjectPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FilterVideoUrlOrBase64FromObjectPipe, name: "filterVideoUrlOrBase64FromObject" });
|
|
3693
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FilterVideoUrlOrBase64FromObjectPipe, decorators: [{
|
|
3694
|
+
type: Pipe,
|
|
3695
|
+
args: [{
|
|
3696
|
+
name: "filterVideoUrlOrBase64FromObject"
|
|
3697
|
+
}]
|
|
3698
|
+
}] });
|
|
3699
|
+
|
|
3691
3700
|
class TimerPipe {
|
|
3692
3701
|
transform(value) {
|
|
3693
3702
|
const minutes = Math.floor(value / 60);
|
|
@@ -3734,18 +3743,19 @@ class KwikIDFormViewComponent {
|
|
|
3734
3743
|
this.fieldGroups = {};
|
|
3735
3744
|
this.formFields = [];
|
|
3736
3745
|
this.previousFormData = {};
|
|
3746
|
+
this.cameraData = {};
|
|
3737
3747
|
this.isShowCamera = false;
|
|
3738
3748
|
this.isShowCameraFullscreen = false;
|
|
3739
|
-
this.
|
|
3740
|
-
this.
|
|
3741
|
-
this.
|
|
3742
|
-
this.
|
|
3743
|
-
this.
|
|
3744
|
-
this.
|
|
3745
|
-
this.
|
|
3746
|
-
this.
|
|
3747
|
-
this.
|
|
3748
|
-
this.
|
|
3749
|
+
this.activeCameraFieldKey = "";
|
|
3750
|
+
this.activeCameraData = {};
|
|
3751
|
+
this.activeCameraType = undefined;
|
|
3752
|
+
this.activeCameraImage = "";
|
|
3753
|
+
this.activeCameraVideo = "";
|
|
3754
|
+
this.activeCameraConfig = undefined;
|
|
3755
|
+
this.activeCameraRecordingTime = 0;
|
|
3756
|
+
this.activeCameraRecordingTimerSubcription = undefined;
|
|
3757
|
+
this.activeCameraRecordingState = "NONE";
|
|
3758
|
+
this.activeCameraRecordingStateSubcription = undefined;
|
|
3749
3759
|
this.previewProperties = {
|
|
3750
3760
|
html: {
|
|
3751
3761
|
before: "",
|
|
@@ -3792,30 +3802,30 @@ class KwikIDFormViewComponent {
|
|
|
3792
3802
|
resetCamera() {
|
|
3793
3803
|
this.isShowCamera = false;
|
|
3794
3804
|
this.isShowCameraFullscreen = false;
|
|
3795
|
-
this.
|
|
3796
|
-
this.
|
|
3797
|
-
this.
|
|
3798
|
-
this.
|
|
3799
|
-
this.
|
|
3800
|
-
this.
|
|
3801
|
-
this.
|
|
3802
|
-
this.
|
|
3805
|
+
this.activeCameraFieldKey = "";
|
|
3806
|
+
this.activeCameraData = undefined;
|
|
3807
|
+
this.activeCameraType = undefined;
|
|
3808
|
+
this.activeCameraImage = "";
|
|
3809
|
+
this.activeCameraVideo = "";
|
|
3810
|
+
this.activeCameraConfig = undefined;
|
|
3811
|
+
this.activeCameraRecordingTime = 0;
|
|
3812
|
+
this.activeCameraRecordingState = "NONE";
|
|
3803
3813
|
}
|
|
3804
3814
|
ngOnInit() {
|
|
3805
3815
|
(() => __awaiter(this, void 0, void 0, function* () {
|
|
3806
3816
|
const res = yield this.initFormConfig(this.formConfig);
|
|
3807
3817
|
if (res) {
|
|
3808
3818
|
this.loading = false;
|
|
3809
|
-
this.
|
|
3819
|
+
this.activeCameraRecordingTimerSubcription = this.cameraRecordService
|
|
3810
3820
|
.getTimerUpdate()
|
|
3811
3821
|
.subscribe((time) => {
|
|
3812
|
-
this.
|
|
3822
|
+
this.activeCameraRecordingTime = time;
|
|
3813
3823
|
this.ref.detectChanges();
|
|
3814
3824
|
});
|
|
3815
|
-
this.
|
|
3825
|
+
this.activeCameraRecordingStateSubcription = this.cameraRecordService
|
|
3816
3826
|
.getRecordingState()
|
|
3817
3827
|
.subscribe((state) => {
|
|
3818
|
-
this.
|
|
3828
|
+
this.activeCameraRecordingState = state;
|
|
3819
3829
|
this.ref.detectChanges();
|
|
3820
3830
|
});
|
|
3821
3831
|
}
|
|
@@ -3838,7 +3848,7 @@ class KwikIDFormViewComponent {
|
|
|
3838
3848
|
if (verifyChange("formData")) {
|
|
3839
3849
|
if (checkObjectKeyExists(changes.formData.currentValue, "data") &&
|
|
3840
3850
|
checkObjectKeyExists(changes.formData.currentValue, "extendedData")) {
|
|
3841
|
-
this.formData = Object.assign(Object.assign({}, this.formData), changes.formData.currentValue
|
|
3851
|
+
this.formData = Object.assign(Object.assign({}, this.formData), changes.formData.currentValue.data);
|
|
3842
3852
|
}
|
|
3843
3853
|
else {
|
|
3844
3854
|
this.formData = Object.assign(Object.assign({}, this.formData), changes.formData.currentValue);
|
|
@@ -3848,9 +3858,9 @@ class KwikIDFormViewComponent {
|
|
|
3848
3858
|
if (isNotEmptyValue(changes.popupFormCallback.currentValue)) {
|
|
3849
3859
|
const popupFormData = checkObjectKeyExists(changes.popupFormCallback.currentValue.popupFormData, "data") &&
|
|
3850
3860
|
checkObjectKeyExists(changes.popupFormCallback.currentValue.popupFormData, "extendedData")
|
|
3851
|
-
? changes.popupFormCallback.currentValue.popupFormData
|
|
3861
|
+
? changes.popupFormCallback.currentValue.popupFormData.data
|
|
3852
3862
|
: changes.popupFormCallback.currentValue.popupFormData;
|
|
3853
|
-
const popupFormConfig = changes.popupFormCallback.currentValue
|
|
3863
|
+
const { popupFormConfig } = changes.popupFormCallback.currentValue;
|
|
3854
3864
|
this.popupFormData = mergeObjects(this.popupFormData, {
|
|
3855
3865
|
[popupFormConfig.key]: popupFormData
|
|
3856
3866
|
});
|
|
@@ -3870,7 +3880,7 @@ class KwikIDFormViewComponent {
|
|
|
3870
3880
|
}
|
|
3871
3881
|
if (verifyChange("apiCallResponse")) {
|
|
3872
3882
|
this.apiCallResponse = changes.apiCallResponse.currentValue;
|
|
3873
|
-
|
|
3883
|
+
const field = getFormFieldByKey(this.formFields, this.apiCallResponse.key);
|
|
3874
3884
|
const response = (_a = this.apiCallResponse) === null || _a === void 0 ? void 0 : _a.response;
|
|
3875
3885
|
switch (field.type) {
|
|
3876
3886
|
case EFieldType.FILE:
|
|
@@ -3880,7 +3890,7 @@ class KwikIDFormViewComponent {
|
|
|
3880
3890
|
api_key: this.apiCallResponse.key,
|
|
3881
3891
|
field_key: this.apiCallResponse.key,
|
|
3882
3892
|
response_type: "FILE_UPLOAD_API_SUCCESS",
|
|
3883
|
-
response
|
|
3893
|
+
response
|
|
3884
3894
|
});
|
|
3885
3895
|
this.updateFiles(updatedFile, "NORMAL", this.apiCallResponse.key);
|
|
3886
3896
|
}
|
|
@@ -3899,14 +3909,20 @@ class KwikIDFormViewComponent {
|
|
|
3899
3909
|
if (response) {
|
|
3900
3910
|
this.resetCamera();
|
|
3901
3911
|
const image = response === null || response === void 0 ? void 0 : response.image_url;
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3912
|
+
const imageOcr = response === null || response === void 0 ? void 0 : response.image_ocr;
|
|
3913
|
+
const imageFacematch = response === null || response === void 0 ? void 0 : response.image_facematch;
|
|
3914
|
+
const imageWatermark = response === null || response === void 0 ? void 0 : response.image_watermark;
|
|
3915
|
+
const imageData = imageOcr || imageFacematch || imageWatermark
|
|
3916
|
+
? Object.assign(Object.assign(Object.assign({ image }, (imageOcr && { ocr: imageOcr })), (imageFacematch && { facematch: imageFacematch })), (imageWatermark && { watermark: imageWatermark })) : image;
|
|
3917
|
+
this.formData[field.key] = getObjectDeepCopy([imageData]);
|
|
3918
|
+
this.cameraData[field.key] = getObjectDeepCopy(imageData);
|
|
3919
|
+
this.mediaFiles[field.key] = getObjectDeepCopy([imageData]);
|
|
3920
|
+
this.formGroup.controls[field.key].patchValue(getObjectDeepCopy([imageData]), {
|
|
3905
3921
|
emitEvent: false,
|
|
3906
3922
|
onlySelf: false
|
|
3907
3923
|
});
|
|
3908
3924
|
this.formGroup.patchValue({
|
|
3909
|
-
[field.key]: getObjectDeepCopy([
|
|
3925
|
+
[field.key]: getObjectDeepCopy([imageData])
|
|
3910
3926
|
}, { emitEvent: false });
|
|
3911
3927
|
this.formGroup.controls[field.key].updateValueAndValidity({
|
|
3912
3928
|
emitEvent: false
|
|
@@ -3922,6 +3938,7 @@ class KwikIDFormViewComponent {
|
|
|
3922
3938
|
FIELD_CONFIG: field,
|
|
3923
3939
|
FORM_FIELDS: this.formFields,
|
|
3924
3940
|
FORM_DATA: this.formData,
|
|
3941
|
+
CAMERA_DATA: this.cameraData,
|
|
3925
3942
|
TASK_DATA: this.taskData,
|
|
3926
3943
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
3927
3944
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -3942,7 +3959,7 @@ class KwikIDFormViewComponent {
|
|
|
3942
3959
|
api_key: this.apiCallResponse.key,
|
|
3943
3960
|
field_key: this.apiCallResponse.key,
|
|
3944
3961
|
response_type: "IMAGE_UPLOAD_API_SUCCESS",
|
|
3945
|
-
response
|
|
3962
|
+
response
|
|
3946
3963
|
});
|
|
3947
3964
|
}
|
|
3948
3965
|
else {
|
|
@@ -3960,6 +3977,7 @@ class KwikIDFormViewComponent {
|
|
|
3960
3977
|
this.resetCamera();
|
|
3961
3978
|
const video = response === null || response === void 0 ? void 0 : response.video_url;
|
|
3962
3979
|
this.formData[field.key] = getObjectDeepCopy([video]);
|
|
3980
|
+
this.cameraData[field.key] = getObjectDeepCopy(video);
|
|
3963
3981
|
this.mediaFiles[field.key] = getObjectDeepCopy([video]);
|
|
3964
3982
|
this.formGroup.controls[field.key].patchValue(getObjectDeepCopy([video]), {
|
|
3965
3983
|
emitEvent: false,
|
|
@@ -3982,6 +4000,7 @@ class KwikIDFormViewComponent {
|
|
|
3982
4000
|
FIELD_CONFIG: field,
|
|
3983
4001
|
FORM_FIELDS: this.formFields,
|
|
3984
4002
|
FORM_DATA: this.formData,
|
|
4003
|
+
CAMERA_DATA: this.cameraData,
|
|
3985
4004
|
TASK_DATA: this.taskData,
|
|
3986
4005
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
3987
4006
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -4002,7 +4021,7 @@ class KwikIDFormViewComponent {
|
|
|
4002
4021
|
api_key: this.apiCallResponse.key,
|
|
4003
4022
|
field_key: this.apiCallResponse.key,
|
|
4004
4023
|
response_type: "VIDEO_UPLOAD_API_SUCCESS",
|
|
4005
|
-
response
|
|
4024
|
+
response
|
|
4006
4025
|
});
|
|
4007
4026
|
}
|
|
4008
4027
|
else {
|
|
@@ -4018,7 +4037,6 @@ class KwikIDFormViewComponent {
|
|
|
4018
4037
|
case EFieldType.LIVE_LOCATION:
|
|
4019
4038
|
if (response) {
|
|
4020
4039
|
this.formData[field.key] = getObjectDeepCopy(response);
|
|
4021
|
-
this.mediaFiles[field.key] = getObjectDeepCopy(response);
|
|
4022
4040
|
this.formGroup.controls[field.key].patchValue(getObjectDeepCopy(response), {
|
|
4023
4041
|
emitEvent: false,
|
|
4024
4042
|
onlySelf: false
|
|
@@ -4039,6 +4057,7 @@ class KwikIDFormViewComponent {
|
|
|
4039
4057
|
API_RESPONSE: response,
|
|
4040
4058
|
FORM_FIELDS: this.formFields,
|
|
4041
4059
|
FORM_DATA: this.formData,
|
|
4060
|
+
CAMERA_DATA: this.cameraData,
|
|
4042
4061
|
TASK_DATA: this.taskData,
|
|
4043
4062
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4044
4063
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -4055,6 +4074,7 @@ class KwikIDFormViewComponent {
|
|
|
4055
4074
|
FIELD_CONFIG: field,
|
|
4056
4075
|
FORM_FIELDS: this.formFields,
|
|
4057
4076
|
FORM_DATA: this.formData,
|
|
4077
|
+
CAMERA_DATA: this.cameraData,
|
|
4058
4078
|
TASK_DATA: this.taskData,
|
|
4059
4079
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4060
4080
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -4076,7 +4096,7 @@ class KwikIDFormViewComponent {
|
|
|
4076
4096
|
api_key: this.apiCallResponse.key,
|
|
4077
4097
|
field_key: this.apiCallResponse.key,
|
|
4078
4098
|
response_type: "REVERSE_LAT_LONG_API_SUCCESS",
|
|
4079
|
-
response
|
|
4099
|
+
response
|
|
4080
4100
|
});
|
|
4081
4101
|
}
|
|
4082
4102
|
else {
|
|
@@ -4091,6 +4111,7 @@ class KwikIDFormViewComponent {
|
|
|
4091
4111
|
API_RESPONSE: {},
|
|
4092
4112
|
FORM_FIELDS: this.formFields,
|
|
4093
4113
|
FORM_DATA: this.formData,
|
|
4114
|
+
CAMERA_DATA: this.cameraData,
|
|
4094
4115
|
TASK_DATA: this.taskData,
|
|
4095
4116
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4096
4117
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -4114,15 +4135,15 @@ class KwikIDFormViewComponent {
|
|
|
4114
4135
|
let field = getFormFieldByKey(this.formFields, (_d = this.buttonClickResponse) === null || _d === void 0 ? void 0 : _d.key);
|
|
4115
4136
|
if (checkObjectKeyExists(this.buttonClickResponse, "default")) {
|
|
4116
4137
|
field.default = getObjectDeepCopy(this.buttonClickResponse.default);
|
|
4117
|
-
delete this.buttonClickResponse
|
|
4138
|
+
delete this.buttonClickResponse.default;
|
|
4118
4139
|
}
|
|
4119
4140
|
if (checkObjectKeyExists(this.buttonClickResponse, "messages")) {
|
|
4120
4141
|
field.messages = getObjectDeepCopy(this.buttonClickResponse.messages);
|
|
4121
|
-
delete this.buttonClickResponse
|
|
4142
|
+
delete this.buttonClickResponse.messages;
|
|
4122
4143
|
}
|
|
4123
4144
|
if (checkObjectKeyExists(this.buttonClickResponse, "validation")) {
|
|
4124
4145
|
field.validation = getObjectDeepCopy(this.buttonClickResponse.validation);
|
|
4125
|
-
delete this.buttonClickResponse
|
|
4146
|
+
delete this.buttonClickResponse.validation;
|
|
4126
4147
|
}
|
|
4127
4148
|
field = getObjectDeepCopy(mergeObjects(field, this.buttonClickResponse));
|
|
4128
4149
|
if (checkObjectKeyExists(field, "validation")) {
|
|
@@ -4132,6 +4153,7 @@ class KwikIDFormViewComponent {
|
|
|
4132
4153
|
FIELD_CONFIG: field,
|
|
4133
4154
|
FORM_FIELDS: this.formFields,
|
|
4134
4155
|
FORM_DATA: this.formData,
|
|
4156
|
+
CAMERA_DATA: this.cameraData,
|
|
4135
4157
|
TASK_DATA: this.taskData,
|
|
4136
4158
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4137
4159
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -4155,11 +4177,11 @@ class KwikIDFormViewComponent {
|
|
|
4155
4177
|
}
|
|
4156
4178
|
}
|
|
4157
4179
|
ngOnDestroy() {
|
|
4158
|
-
if (this.
|
|
4159
|
-
this.
|
|
4180
|
+
if (this.activeCameraRecordingTimerSubcription) {
|
|
4181
|
+
this.activeCameraRecordingTimerSubcription.unsubscribe();
|
|
4160
4182
|
}
|
|
4161
|
-
if (this.
|
|
4162
|
-
this.
|
|
4183
|
+
if (this.activeCameraRecordingStateSubcription) {
|
|
4184
|
+
this.activeCameraRecordingStateSubcription.unsubscribe();
|
|
4163
4185
|
}
|
|
4164
4186
|
}
|
|
4165
4187
|
triggerLogs(eventType, logs) {
|
|
@@ -4185,11 +4207,12 @@ class KwikIDFormViewComponent {
|
|
|
4185
4207
|
if (checkObjectKeyExists(this.formConfig, "tasks") &&
|
|
4186
4208
|
checkObjectKeyExists(this.formConfig.tasks, "pre")) {
|
|
4187
4209
|
this.triggerLogs(ELogEventType$1.FORM__TASK_PRE, {});
|
|
4188
|
-
for (
|
|
4210
|
+
for (const preTask of this.formConfig.tasks.pre) {
|
|
4189
4211
|
const task = new Tasks(preTask, {
|
|
4190
4212
|
FORM_CONFIG: this.formConfig,
|
|
4191
4213
|
FORM_FIELDS: this.formFields,
|
|
4192
4214
|
FORM_DATA: this.formData,
|
|
4215
|
+
CAMERA_DATA: this.cameraData,
|
|
4193
4216
|
TASK_DATA: this.taskData,
|
|
4194
4217
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4195
4218
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -4210,7 +4233,7 @@ class KwikIDFormViewComponent {
|
|
|
4210
4233
|
clearInterval(intervalId);
|
|
4211
4234
|
resolve();
|
|
4212
4235
|
}
|
|
4213
|
-
},
|
|
4236
|
+
}, FORM_VIEW_TIMERS.WAIT_FOR_CHANGES_BEFORE_MOVING_TO_NEXT_TASK);
|
|
4214
4237
|
});
|
|
4215
4238
|
if (this.stopTaskExecution) {
|
|
4216
4239
|
break;
|
|
@@ -4221,16 +4244,24 @@ class KwikIDFormViewComponent {
|
|
|
4221
4244
|
if (this.stopTaskExecution) {
|
|
4222
4245
|
return false;
|
|
4223
4246
|
}
|
|
4224
|
-
this.formGroup = yield this.formViewService.createFormGroup(this.formFields,
|
|
4247
|
+
this.formGroup = yield this.formViewService.createFormGroup(this.formFields, {
|
|
4248
|
+
FORM_CONFIG: this.formConfig,
|
|
4249
|
+
FORM_DATA: this.formData,
|
|
4250
|
+
CAMERA_DATA: this.cameraData,
|
|
4251
|
+
TASK_DATA: this.taskData,
|
|
4252
|
+
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4253
|
+
ALL_FORMS_DATA: this.allFormsData,
|
|
4254
|
+
EXTRA_DATA: this.extraData
|
|
4255
|
+
}, this.takeAction.bind(this));
|
|
4225
4256
|
/**
|
|
4226
4257
|
* For some reason if their a field of type 'IMAGE' then
|
|
4227
4258
|
* formData is adding a 'undefined' key with last image's value from the array.
|
|
4228
4259
|
* Below piece of code is to remove that redundent value from formData.
|
|
4229
4260
|
*/
|
|
4230
4261
|
if (checkObjectKeyExists(this.formData, "undefined")) {
|
|
4231
|
-
delete this.formData
|
|
4262
|
+
delete this.formData.undefined;
|
|
4232
4263
|
}
|
|
4233
|
-
for (
|
|
4264
|
+
for (const field of this.formFields) {
|
|
4234
4265
|
if (field.isFormElement) {
|
|
4235
4266
|
this.previousFormData = Object.assign(Object.assign({}, this.previousFormData), { [field.key]: convertFormFieldValueToStandardFormat(field, this.formGroup.controls[field.key].value) });
|
|
4236
4267
|
this.formData = Object.assign(Object.assign({}, this.formData), { [field.key]: convertFormFieldValueToStandardFormat(field, this.formGroup.controls[field.key].value) });
|
|
@@ -4239,10 +4270,12 @@ class KwikIDFormViewComponent {
|
|
|
4239
4270
|
}
|
|
4240
4271
|
if (field.type === EFieldType.CAPTURE) {
|
|
4241
4272
|
this.resetCamera();
|
|
4273
|
+
this.cameraData = Object.assign(Object.assign({}, this.cameraData), { [field.key]: convertFormFieldValueToStandardFormat(field, this.formGroup.controls[field.key].value) });
|
|
4242
4274
|
this.mediaFiles[field.key] = this.formGroup.controls[field.key].value;
|
|
4243
4275
|
}
|
|
4244
4276
|
if (field.type === EFieldType.RECORD) {
|
|
4245
4277
|
this.resetCamera();
|
|
4278
|
+
this.cameraData = Object.assign(Object.assign({}, this.cameraData), { [field.key]: convertFormFieldValueToStandardFormat(field, this.formGroup.controls[field.key].value) });
|
|
4246
4279
|
this.mediaFiles[field.key] = this.formGroup.controls[field.key].value;
|
|
4247
4280
|
}
|
|
4248
4281
|
this.formGroup.controls[field.key].valueChanges
|
|
@@ -4255,16 +4288,18 @@ class KwikIDFormViewComponent {
|
|
|
4255
4288
|
}
|
|
4256
4289
|
if (field.type === EFieldType.CAPTURE) {
|
|
4257
4290
|
this.resetCamera();
|
|
4291
|
+
this.cameraData = Object.assign(Object.assign({}, this.cameraData), { [field.key]: convertFormFieldValueToStandardFormat(field, currentValue) });
|
|
4258
4292
|
this.mediaFiles[field.key] = currentValue;
|
|
4259
4293
|
}
|
|
4260
4294
|
if (field.type === EFieldType.RECORD) {
|
|
4261
4295
|
this.resetCamera();
|
|
4296
|
+
this.cameraData = Object.assign(Object.assign({}, this.cameraData), { [field.key]: convertFormFieldValueToStandardFormat(field, currentValue) });
|
|
4262
4297
|
this.mediaFiles[field.key] = currentValue;
|
|
4263
4298
|
}
|
|
4264
4299
|
});
|
|
4265
4300
|
}
|
|
4266
4301
|
}
|
|
4267
|
-
for (
|
|
4302
|
+
for (const field of this.formFields) {
|
|
4268
4303
|
if (field.isFormElement) {
|
|
4269
4304
|
if (checkObjectKeyExists(field, "validation")) {
|
|
4270
4305
|
if (field.validation.triggers.includes("ON_INIT")) {
|
|
@@ -4272,6 +4307,7 @@ class KwikIDFormViewComponent {
|
|
|
4272
4307
|
FIELD_CONFIG: field,
|
|
4273
4308
|
FORM_FIELDS: this.formFields,
|
|
4274
4309
|
FORM_DATA: this.formData,
|
|
4310
|
+
CAMERA_DATA: this.cameraData,
|
|
4275
4311
|
TASK_DATA: this.taskData,
|
|
4276
4312
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4277
4313
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -4308,7 +4344,7 @@ class KwikIDFormViewComponent {
|
|
|
4308
4344
|
const formData = this.allFormsData[this.formConfig.key];
|
|
4309
4345
|
if (checkObjectKeyExists(formData, "data") &&
|
|
4310
4346
|
checkObjectKeyExists(formData, "extendedData")) {
|
|
4311
|
-
this.formData = Object.assign(Object.assign({}, this.formData), formData
|
|
4347
|
+
this.formData = Object.assign(Object.assign({}, this.formData), formData.data);
|
|
4312
4348
|
}
|
|
4313
4349
|
else {
|
|
4314
4350
|
this.formData = Object.assign(Object.assign({}, this.formData), formData);
|
|
@@ -4324,18 +4360,20 @@ class KwikIDFormViewComponent {
|
|
|
4324
4360
|
const rulesMapping = new Rule(childFieldGroupConfig.rules, {
|
|
4325
4361
|
FIELD_CONFIG: parentField,
|
|
4326
4362
|
FORM_DATA: this.formData,
|
|
4363
|
+
CAMERA_DATA: this.cameraData,
|
|
4327
4364
|
TASK_DATA: this.taskData,
|
|
4328
4365
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4329
4366
|
ALL_FORMS_DATA: this.allFormsData,
|
|
4330
4367
|
EXTRA_DATA: this.extraData
|
|
4331
4368
|
}).mapping();
|
|
4332
|
-
for (
|
|
4369
|
+
for (const action of childFieldGroupConfig.actions) {
|
|
4333
4370
|
const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
|
|
4334
4371
|
if (conditionSuccess) {
|
|
4335
4372
|
const actions = new Action(action, rulesMapping, {
|
|
4336
4373
|
FIELD_CONFIG: parentField,
|
|
4337
4374
|
FORM_FIELDS: this.formFields,
|
|
4338
4375
|
FORM_DATA: this.formData,
|
|
4376
|
+
CAMERA_DATA: this.cameraData,
|
|
4339
4377
|
TASK_DATA: this.taskData,
|
|
4340
4378
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4341
4379
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -4362,18 +4400,20 @@ class KwikIDFormViewComponent {
|
|
|
4362
4400
|
const rulesMapping = new Rule(connectedFieldConfig.rules, {
|
|
4363
4401
|
FIELD_CONFIG: connectedField,
|
|
4364
4402
|
FORM_DATA: this.formData,
|
|
4403
|
+
CAMERA_DATA: this.cameraData,
|
|
4365
4404
|
TASK_DATA: this.taskData,
|
|
4366
4405
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4367
4406
|
ALL_FORMS_DATA: this.allFormsData,
|
|
4368
4407
|
EXTRA_DATA: this.extraData
|
|
4369
4408
|
}).mapping();
|
|
4370
|
-
for (
|
|
4409
|
+
for (const action of connectedFieldConfig.actions) {
|
|
4371
4410
|
const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
|
|
4372
4411
|
if (conditionSuccess) {
|
|
4373
4412
|
const actions = new Action(action, rulesMapping, {
|
|
4374
4413
|
FORM_FIELDS: this.formFields,
|
|
4375
4414
|
FIELD_CONFIG: connectedField,
|
|
4376
4415
|
FORM_DATA: this.formData,
|
|
4416
|
+
CAMERA_DATA: this.cameraData,
|
|
4377
4417
|
TASK_DATA: this.taskData,
|
|
4378
4418
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4379
4419
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -4388,7 +4428,7 @@ class KwikIDFormViewComponent {
|
|
|
4388
4428
|
}
|
|
4389
4429
|
handleConnectedElementFields(currentField, connectedFieldConfig, eventType, nested) {
|
|
4390
4430
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4391
|
-
let connectedField = getFormFieldByKey(this.formFields, connectedFieldConfig
|
|
4431
|
+
let connectedField = getFormFieldByKey(this.formFields, connectedFieldConfig.key);
|
|
4392
4432
|
if (checkObjectKeyExists(connectedFieldConfig, "triggers")) {
|
|
4393
4433
|
if (connectedFieldConfig.triggers.includes(eventType)) {
|
|
4394
4434
|
connectedField = yield this.handleConnectedElementFieldActions(connectedFieldConfig, connectedField);
|
|
@@ -4408,14 +4448,14 @@ class KwikIDFormViewComponent {
|
|
|
4408
4448
|
if (currentField !== undefined) {
|
|
4409
4449
|
if (checkObjectKeyExists(currentField, "connectedElements")) {
|
|
4410
4450
|
if (checkObjectKeyExists(currentField.connectedElements, "connectedFieldGroups")) {
|
|
4411
|
-
|
|
4412
|
-
for (
|
|
4451
|
+
const { connectedFieldGroups } = currentField.connectedElements;
|
|
4452
|
+
for (const connectedFieldGroupConfig of connectedFieldGroups) {
|
|
4413
4453
|
yield this.handleConnectedElementFieldGroup(currentField, connectedFieldGroupConfig, eventType);
|
|
4414
4454
|
}
|
|
4415
4455
|
}
|
|
4416
4456
|
if (checkObjectKeyExists(currentField.connectedElements, "connectedFields")) {
|
|
4417
|
-
|
|
4418
|
-
for (
|
|
4457
|
+
const { connectedFields } = currentField.connectedElements;
|
|
4458
|
+
for (const connectedFieldConfig of connectedFields) {
|
|
4419
4459
|
currentField = yield this.handleConnectedElementFields(currentField, connectedFieldConfig, eventType, eventType);
|
|
4420
4460
|
}
|
|
4421
4461
|
}
|
|
@@ -4429,7 +4469,7 @@ class KwikIDFormViewComponent {
|
|
|
4429
4469
|
handleRemovedFile(e) {
|
|
4430
4470
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
4431
4471
|
this.showApiLoader();
|
|
4432
|
-
if (this.formGroup
|
|
4472
|
+
if (this.formGroup.controls[e.key].enabled) {
|
|
4433
4473
|
this.files[e.key] = e.files;
|
|
4434
4474
|
this.formData[e.key] = filterDuplicatesFiles(this.files[e.key]);
|
|
4435
4475
|
this.formGroup.patchValue({
|
|
@@ -4444,7 +4484,7 @@ class KwikIDFormViewComponent {
|
|
|
4444
4484
|
key: field === null || field === void 0 ? void 0 : field.key,
|
|
4445
4485
|
type: field === null || field === void 0 ? void 0 : field.type,
|
|
4446
4486
|
payload: {
|
|
4447
|
-
field
|
|
4487
|
+
field,
|
|
4448
4488
|
event: e
|
|
4449
4489
|
}
|
|
4450
4490
|
});
|
|
@@ -4454,7 +4494,7 @@ class KwikIDFormViewComponent {
|
|
|
4454
4494
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4455
4495
|
this.showApiLoader();
|
|
4456
4496
|
const field = getFormFieldByKey(this.formFields, e.key);
|
|
4457
|
-
|
|
4497
|
+
const values = Array.isArray(e.value) ? e.value : [e.value];
|
|
4458
4498
|
if (checkObjectKeyExists(field, "properties") &&
|
|
4459
4499
|
checkObjectKeyExists(field.properties, "uploadFileToServer") &&
|
|
4460
4500
|
field.properties.uploadFileToServer) {
|
|
@@ -4476,7 +4516,7 @@ class KwikIDFormViewComponent {
|
|
|
4476
4516
|
lastModified: value.lastModified,
|
|
4477
4517
|
webkitRelativePath: value.webkitRelativePath
|
|
4478
4518
|
});
|
|
4479
|
-
},
|
|
4519
|
+
}, FORM_VIEW_TIMERS.WAIT_FOR_FILE_METADATA_DEEPCOPY); // 1000 ms = 1 sec
|
|
4480
4520
|
}));
|
|
4481
4521
|
this.updateFiles(updatedFile, "NORMAL", e.key);
|
|
4482
4522
|
}
|
|
@@ -4487,17 +4527,46 @@ class KwikIDFormViewComponent {
|
|
|
4487
4527
|
/** Methods for Camera related fields like 'CAPTURE' or 'RECORD' */
|
|
4488
4528
|
handleOnClickGetRemovedMediaFile(e) {
|
|
4489
4529
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
4490
|
-
this.
|
|
4491
|
-
|
|
4530
|
+
if (this.formGroup.controls[e.key].enabled) {
|
|
4531
|
+
this.showApiLoader();
|
|
4532
|
+
const field = getFormFieldByKey(this.formFields, e.key);
|
|
4492
4533
|
this.resetCamera();
|
|
4493
4534
|
this.mediaFiles[e.key] = e.mediaFiles;
|
|
4494
4535
|
this.formData[e.key] = filterDuplicatesMediaFiles(this.mediaFiles[e.key]);
|
|
4536
|
+
this.cameraData[e.key] = convertFormFieldValueToStandardFormat(field, this.formData[e.key]);
|
|
4495
4537
|
this.formGroup.patchValue({
|
|
4496
4538
|
[e.key]: this.formData[e.key]
|
|
4497
4539
|
}, { emitEvent: false });
|
|
4498
4540
|
this.triggerLogs(ELogEventType$1.FORM__FIELD_MEDIA_FILE_REMOVE, Object.assign(Object.assign(Object.assign({ field_key: e.key }, ((_b = (_a = e.file) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : { file_name: (_c = e.file) === null || _c === void 0 ? void 0 : _c.name })), ((_e = (_d = e.file) === null || _d === void 0 ? void 0 : _d.size) !== null && _e !== void 0 ? _e : { file_size: (_f = e.file) === null || _f === void 0 ? void 0 : _f.size })), ((_h = (_g = e.file) === null || _g === void 0 ? void 0 : _g.type) !== null && _h !== void 0 ? _h : { file_type: (_j = e.file) === null || _j === void 0 ? void 0 : _j.type })));
|
|
4541
|
+
this.getUnsavedDataState.emit(true);
|
|
4542
|
+
if (field.isFormElement &&
|
|
4543
|
+
checkObjectKeyExists(field, "validation") &&
|
|
4544
|
+
field.validation.triggers.includes("ON_CHANGE")) {
|
|
4545
|
+
const ruleEngine = new RuleEngine({
|
|
4546
|
+
FIELD_CONFIG: field,
|
|
4547
|
+
FORM_FIELDS: this.formFields,
|
|
4548
|
+
FORM_DATA: this.formData,
|
|
4549
|
+
CAMERA_DATA: this.cameraData,
|
|
4550
|
+
TASK_DATA: this.taskData,
|
|
4551
|
+
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4552
|
+
ALL_FORMS_DATA: this.allFormsData,
|
|
4553
|
+
EXTRA_DATA: this.extraData
|
|
4554
|
+
}, this.takeAction.bind(this));
|
|
4555
|
+
(() => __awaiter(this, void 0, void 0, function* () {
|
|
4556
|
+
yield ruleEngine.run(field.validation);
|
|
4557
|
+
}))();
|
|
4558
|
+
}
|
|
4559
|
+
if (field.isFormElement &&
|
|
4560
|
+
checkObjectKeyExists(field, "connectedElements")) {
|
|
4561
|
+
this.handleConnectedElements({
|
|
4562
|
+
key: field.key,
|
|
4563
|
+
value: this.formGroup.controls[field.key].value
|
|
4564
|
+
}, "ON_CHANGE");
|
|
4565
|
+
}
|
|
4566
|
+
setTimeout(() => {
|
|
4567
|
+
this.hideApiLoader();
|
|
4568
|
+
}, 500);
|
|
4499
4569
|
}
|
|
4500
|
-
this.hideApiLoader();
|
|
4501
4570
|
}
|
|
4502
4571
|
handleOnClickInputCamera(e, field) {
|
|
4503
4572
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -4507,35 +4576,42 @@ class KwikIDFormViewComponent {
|
|
|
4507
4576
|
fullscreen: true
|
|
4508
4577
|
});
|
|
4509
4578
|
const fieldKey = field.key;
|
|
4510
|
-
const
|
|
4511
|
-
this.
|
|
4512
|
-
this.
|
|
4579
|
+
const fieldCameraConfig = (_a = field === null || field === void 0 ? void 0 : field.properties) !== null && _a !== void 0 ? _a : {};
|
|
4580
|
+
this.activeCameraType = (field === null || field === void 0 ? void 0 : field.type.toUpperCase()) || "";
|
|
4581
|
+
this.activeCameraFieldKey = fieldKey;
|
|
4513
4582
|
this.triggerLogs(ELogEventType$1.FORM__FIELD_CAMERA_BUTTON_CLICK, {
|
|
4514
4583
|
field_key: field.key,
|
|
4515
4584
|
field_type: field.type,
|
|
4516
|
-
camera_type: this.
|
|
4585
|
+
camera_type: this.activeCameraType
|
|
4517
4586
|
});
|
|
4518
|
-
switch (this.
|
|
4587
|
+
switch (this.activeCameraType) {
|
|
4519
4588
|
case "CAPTURE":
|
|
4520
|
-
this.
|
|
4521
|
-
FIELD_PROPERTIES.capture
|
|
4522
|
-
|
|
4589
|
+
this.activeCameraConfig = mergeObjectsDeep([
|
|
4590
|
+
FIELD_PROPERTIES.capture,
|
|
4591
|
+
fieldCameraConfig
|
|
4523
4592
|
]);
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4593
|
+
this.activeCameraData = {};
|
|
4594
|
+
if (((_d = (_c = (_b = this.activeCameraConfig) === null || _b === void 0 ? void 0 : _b.features) === null || _c === void 0 ? void 0 : _c.watermark) === null || _d === void 0 ? void 0 : _d.isEnabled) &&
|
|
4595
|
+
!((_f = (_e = this.activeCameraConfig.features) === null || _e === void 0 ? void 0 : _e.watermark) === null || _f === void 0 ? void 0 : _f.isWatermarkFromServer)) {
|
|
4596
|
+
const cameraHelper = new CameraHelper(field, {
|
|
4597
|
+
FORM_FIELDS: this.formFields,
|
|
4598
|
+
FIELD_CONFIG: field,
|
|
4599
|
+
FORM_DATA: this.formData,
|
|
4600
|
+
CAMERA_DATA: this.cameraData,
|
|
4601
|
+
TASK_DATA: this.taskData,
|
|
4602
|
+
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4603
|
+
ALL_FORMS_DATA: this.allFormsData,
|
|
4604
|
+
EXTRA_DATA: this.extraData
|
|
4605
|
+
});
|
|
4606
|
+
this.activeCameraData = {
|
|
4528
4607
|
watermark: yield cameraHelper.getCameraWatermarkData()
|
|
4529
4608
|
};
|
|
4530
4609
|
}
|
|
4531
|
-
else {
|
|
4532
|
-
this.cameraData = undefined;
|
|
4533
|
-
}
|
|
4534
4610
|
break;
|
|
4535
4611
|
case "RECORD":
|
|
4536
|
-
this.
|
|
4537
|
-
FIELD_PROPERTIES.record
|
|
4538
|
-
|
|
4612
|
+
this.activeCameraConfig = mergeObjectsDeep([
|
|
4613
|
+
FIELD_PROPERTIES.record,
|
|
4614
|
+
fieldCameraConfig
|
|
4539
4615
|
]);
|
|
4540
4616
|
break;
|
|
4541
4617
|
default:
|
|
@@ -4553,22 +4629,35 @@ class KwikIDFormViewComponent {
|
|
|
4553
4629
|
/** CameraType = CAPTURE */
|
|
4554
4630
|
setCameraMedia(media) {
|
|
4555
4631
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4556
|
-
const field = getFormFieldByKey(this.formFields, this.
|
|
4632
|
+
const field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
|
|
4557
4633
|
if (checkObjectKeyExists(field, "properties") &&
|
|
4558
4634
|
checkObjectKeyExists(field.properties, "uploadFileToServer") &&
|
|
4559
4635
|
field.properties.uploadFileToServer) {
|
|
4560
4636
|
yield this.uploadFile(field, media);
|
|
4561
4637
|
}
|
|
4562
4638
|
else {
|
|
4639
|
+
const activeCameraData = this.activeCameraData;
|
|
4563
4640
|
this.resetCamera();
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4641
|
+
let updatedMedia = {};
|
|
4642
|
+
switch (field.type) {
|
|
4643
|
+
case EFieldType.CAPTURE:
|
|
4644
|
+
updatedMedia = Object.assign(Object.assign({}, (isNotEmptyValue(activeCameraData) ? activeCameraData : {})), { image: media });
|
|
4645
|
+
break;
|
|
4646
|
+
case EFieldType.RECORD:
|
|
4647
|
+
updatedMedia = Object.assign(Object.assign({}, (isNotEmptyValue(activeCameraData) ? activeCameraData : {})), { video: media });
|
|
4648
|
+
break;
|
|
4649
|
+
default:
|
|
4650
|
+
break;
|
|
4651
|
+
}
|
|
4652
|
+
this.formData[field.key] = getObjectDeepCopy([updatedMedia]);
|
|
4653
|
+
this.cameraData[field.key] = getObjectDeepCopy(updatedMedia);
|
|
4654
|
+
this.mediaFiles[field.key] = getObjectDeepCopy([updatedMedia]);
|
|
4655
|
+
this.formGroup.controls[field.key].patchValue(getObjectDeepCopy([updatedMedia]), {
|
|
4567
4656
|
emitEvent: false,
|
|
4568
4657
|
onlySelf: false
|
|
4569
4658
|
});
|
|
4570
4659
|
this.formGroup.patchValue({
|
|
4571
|
-
[field.key]: getObjectDeepCopy([
|
|
4660
|
+
[field.key]: getObjectDeepCopy([updatedMedia])
|
|
4572
4661
|
}, { emitEvent: false });
|
|
4573
4662
|
this.formGroup.controls[field.key].updateValueAndValidity({
|
|
4574
4663
|
emitEvent: false
|
|
@@ -4584,6 +4673,7 @@ class KwikIDFormViewComponent {
|
|
|
4584
4673
|
FIELD_CONFIG: field,
|
|
4585
4674
|
FORM_FIELDS: this.formFields,
|
|
4586
4675
|
FORM_DATA: this.formData,
|
|
4676
|
+
CAMERA_DATA: this.cameraData,
|
|
4587
4677
|
TASK_DATA: this.taskData,
|
|
4588
4678
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4589
4679
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -4608,13 +4698,13 @@ class KwikIDFormViewComponent {
|
|
|
4608
4698
|
});
|
|
4609
4699
|
}
|
|
4610
4700
|
/** Camera Common Methods */
|
|
4611
|
-
handleGetCameraMedia(e,
|
|
4612
|
-
switch (
|
|
4701
|
+
handleGetCameraMedia(e, activeCameraType) {
|
|
4702
|
+
switch (activeCameraType) {
|
|
4613
4703
|
case "CAPTURE":
|
|
4614
4704
|
this.showApiLoader();
|
|
4615
|
-
this.
|
|
4705
|
+
this.activeCameraImage = "";
|
|
4616
4706
|
setTimeout(() => {
|
|
4617
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
4707
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4618
4708
|
/**
|
|
4619
4709
|
* Priority of Image to Set for Config Based
|
|
4620
4710
|
* 1. Masked
|
|
@@ -4623,76 +4713,97 @@ class KwikIDFormViewComponent {
|
|
|
4623
4713
|
*
|
|
4624
4714
|
* If no masked or cropped image is available then directly set Original Image
|
|
4625
4715
|
*/
|
|
4626
|
-
const field = getFormFieldByKey(this.formFields, this.
|
|
4716
|
+
const field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
|
|
4627
4717
|
const image = ((_a = field.properties) === null || _a === void 0 ? void 0 : _a.isMaskedImage)
|
|
4628
4718
|
? (_b = e === null || e === void 0 ? void 0 : e.maskedImage) !== null && _b !== void 0 ? _b : e === null || e === void 0 ? void 0 : e.originalImage
|
|
4629
4719
|
: ((_c = field.properties) === null || _c === void 0 ? void 0 : _c.isCroppedImage)
|
|
4630
4720
|
? (_d = e === null || e === void 0 ? void 0 : e.croppedImage) !== null && _d !== void 0 ? _d : e === null || e === void 0 ? void 0 : e.originalImage
|
|
4631
4721
|
: e === null || e === void 0 ? void 0 : e.originalImage;
|
|
4632
|
-
const isShowImagePreview = (_g = (_f = (_e = this.
|
|
4722
|
+
const isShowImagePreview = (_h = (_g = (_f = (_e = this.activeCameraConfig) === null || _e === void 0 ? void 0 : _e.cameraConfig) === null || _f === void 0 ? void 0 : _f.others) === null || _g === void 0 ? void 0 : _g.preview) === null || _h === void 0 ? void 0 : _h.show;
|
|
4633
4723
|
if (isShowImagePreview) {
|
|
4634
|
-
this.
|
|
4724
|
+
this.activeCameraImage = image;
|
|
4635
4725
|
}
|
|
4636
4726
|
else {
|
|
4637
4727
|
this.setCameraMedia(image);
|
|
4638
4728
|
}
|
|
4639
4729
|
this.hideApiLoader();
|
|
4640
|
-
},
|
|
4730
|
+
}, FORM_VIEW_TIMERS.WAIT_FOR_KWIKID_CAMERA_TO_LOAD); // Delay is added due to issus with KwikID Camera not being able to handle to fast processing.
|
|
4641
4731
|
break;
|
|
4642
4732
|
case "RECORD":
|
|
4643
4733
|
this.showApiLoader();
|
|
4644
|
-
this.
|
|
4734
|
+
this.activeCameraVideo = "";
|
|
4645
4735
|
setTimeout(() => {
|
|
4646
4736
|
var _a, _b, _c;
|
|
4647
4737
|
/**
|
|
4648
4738
|
* Priority of Image to Set for Config Based
|
|
4649
4739
|
* 1. Original
|
|
4650
4740
|
*/
|
|
4651
|
-
const field = getFormFieldByKey(this.formFields, this.
|
|
4741
|
+
const field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
|
|
4652
4742
|
const video = e === null || e === void 0 ? void 0 : e.originalVideo;
|
|
4653
|
-
const isShowVideoPreview = (_c = (_b = (_a = this.
|
|
4743
|
+
const isShowVideoPreview = (_c = (_b = (_a = this.activeCameraConfig) === null || _a === void 0 ? void 0 : _a.others) === null || _b === void 0 ? void 0 : _b.preview) === null || _c === void 0 ? void 0 : _c.show;
|
|
4654
4744
|
if (isShowVideoPreview) {
|
|
4655
|
-
this.
|
|
4745
|
+
this.activeCameraVideo = video;
|
|
4656
4746
|
}
|
|
4657
4747
|
else {
|
|
4658
4748
|
this.setCameraMedia(video);
|
|
4659
4749
|
}
|
|
4660
4750
|
this.hideApiLoader();
|
|
4661
|
-
},
|
|
4751
|
+
}, FORM_VIEW_TIMERS.WAIT_FOR_KWIKID_CAMERA_TO_LOAD); // Delay is added due to issus with KwikID Camera not being able to handle to fast processing.
|
|
4662
4752
|
break;
|
|
4663
4753
|
default:
|
|
4664
4754
|
break;
|
|
4665
4755
|
}
|
|
4666
4756
|
}
|
|
4667
|
-
handleOnClickSaveCameraMedia(e,
|
|
4757
|
+
handleOnClickSaveCameraMedia(e, activeCameraType) {
|
|
4668
4758
|
this.showApiLoader();
|
|
4669
|
-
const field = getFormFieldByKey(this.formFields, this.
|
|
4759
|
+
const field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
|
|
4670
4760
|
this.triggerLogs(ELogEventType$1.FORM__CAMERA_SAVE_BUTTON_CLICK, {
|
|
4671
4761
|
field_key: field.key,
|
|
4672
4762
|
field_type: field.type,
|
|
4673
|
-
camera_type:
|
|
4763
|
+
camera_type: activeCameraType
|
|
4674
4764
|
});
|
|
4675
|
-
switch (
|
|
4765
|
+
switch (activeCameraType) {
|
|
4676
4766
|
case "CAPTURE":
|
|
4677
|
-
this.
|
|
4767
|
+
this.activeCameraImage = "";
|
|
4678
4768
|
setTimeout(() => {
|
|
4679
|
-
|
|
4769
|
+
var _a, _b, _c, _d;
|
|
4770
|
+
/**
|
|
4771
|
+
* Priority of Image to Set for Config Based
|
|
4772
|
+
* 1. Masked
|
|
4773
|
+
* 2. Cropped
|
|
4774
|
+
* 3. Original
|
|
4775
|
+
*
|
|
4776
|
+
* If no masked or cropped image is available then directly set Original Image
|
|
4777
|
+
*/
|
|
4778
|
+
const field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
|
|
4779
|
+
const image = ((_a = field.properties) === null || _a === void 0 ? void 0 : _a.isMaskedImage)
|
|
4780
|
+
? (_b = e === null || e === void 0 ? void 0 : e.maskedImage) !== null && _b !== void 0 ? _b : e === null || e === void 0 ? void 0 : e.originalImage
|
|
4781
|
+
: ((_c = field.properties) === null || _c === void 0 ? void 0 : _c.isCroppedImage)
|
|
4782
|
+
? (_d = e === null || e === void 0 ? void 0 : e.croppedImage) !== null && _d !== void 0 ? _d : e === null || e === void 0 ? void 0 : e.originalImage
|
|
4783
|
+
: e === null || e === void 0 ? void 0 : e.originalImage;
|
|
4680
4784
|
this.setCameraMedia(image);
|
|
4681
4785
|
this.hideApiLoader();
|
|
4682
|
-
},
|
|
4786
|
+
}, FORM_VIEW_TIMERS.WAIT_FOR_KWIKID_CAMERA_TO_LOAD); // Delay is added due to issus with KwikID Camera not being able to handle to fast processing.
|
|
4683
4787
|
break;
|
|
4684
4788
|
case "RECORD":
|
|
4685
|
-
this.
|
|
4789
|
+
this.activeCameraVideo = "";
|
|
4686
4790
|
setTimeout(() => {
|
|
4791
|
+
/**
|
|
4792
|
+
* Priority of Image to Set for Config Based
|
|
4793
|
+
* 1. Original
|
|
4794
|
+
*/
|
|
4795
|
+
const field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
|
|
4687
4796
|
const video = e === null || e === void 0 ? void 0 : e.originalVideo;
|
|
4688
4797
|
this.setCameraMedia(video);
|
|
4689
4798
|
this.hideApiLoader();
|
|
4690
|
-
},
|
|
4799
|
+
}, FORM_VIEW_TIMERS.WAIT_FOR_KWIKID_CAMERA_TO_LOAD); // Delay is added due to issus with KwikID Camera not being able to handle to fast processing.
|
|
4800
|
+
break;
|
|
4801
|
+
default:
|
|
4691
4802
|
break;
|
|
4692
4803
|
}
|
|
4693
4804
|
}
|
|
4694
4805
|
handleOnClickCameraBack(e) {
|
|
4695
|
-
const field = getFormFieldByKey(this.formFields, this.
|
|
4806
|
+
const field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
|
|
4696
4807
|
this.triggerLogs(ELogEventType$1.FORM__CAMERA_BACK_BUTTON_CLICK, {
|
|
4697
4808
|
field_key: field.key,
|
|
4698
4809
|
field_type: field.type
|
|
@@ -4700,7 +4811,7 @@ class KwikIDFormViewComponent {
|
|
|
4700
4811
|
this.resetCamera();
|
|
4701
4812
|
}
|
|
4702
4813
|
handleOnClickCameraClose(e) {
|
|
4703
|
-
const field = getFormFieldByKey(this.formFields, this.
|
|
4814
|
+
const field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
|
|
4704
4815
|
this.triggerLogs(ELogEventType$1.FORM__CAMERA_CLOSE_BUTTON_CLICK, {
|
|
4705
4816
|
field_key: field.key,
|
|
4706
4817
|
field_type: field.type
|
|
@@ -4712,7 +4823,7 @@ class KwikIDFormViewComponent {
|
|
|
4712
4823
|
*/
|
|
4713
4824
|
updateFiles(file, state, key) {
|
|
4714
4825
|
var _a;
|
|
4715
|
-
const fileWithState = mergeObjects(file, { state
|
|
4826
|
+
const fileWithState = mergeObjects(file, { state });
|
|
4716
4827
|
const field = getFormFieldByKey(this.formFields, key);
|
|
4717
4828
|
if ((_a = field.properties) === null || _a === void 0 ? void 0 : _a.multiple) {
|
|
4718
4829
|
// If field.properties?.multiple is true, it means multiple files are allowed for this field.
|
|
@@ -4749,6 +4860,7 @@ class KwikIDFormViewComponent {
|
|
|
4749
4860
|
FIELD_CONFIG: field,
|
|
4750
4861
|
FORM_FIELDS: this.formFields,
|
|
4751
4862
|
FORM_DATA: this.formData,
|
|
4863
|
+
CAMERA_DATA: this.cameraData,
|
|
4752
4864
|
TASK_DATA: this.taskData,
|
|
4753
4865
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4754
4866
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -4770,6 +4882,7 @@ class KwikIDFormViewComponent {
|
|
|
4770
4882
|
* This is a api upload mocking method. Set's to loading at first at point when API is called and then changes the status to random status after 2 seconds of delay showing a mocked response from API.
|
|
4771
4883
|
*/
|
|
4772
4884
|
uploadFile(field, file) {
|
|
4885
|
+
var _a, _b, _c, _d, _e, _f;
|
|
4773
4886
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4774
4887
|
switch (field.type) {
|
|
4775
4888
|
case EFieldType.FILE:
|
|
@@ -4791,7 +4904,7 @@ class KwikIDFormViewComponent {
|
|
|
4791
4904
|
key: field.key,
|
|
4792
4905
|
type: field.type,
|
|
4793
4906
|
payload: {
|
|
4794
|
-
file
|
|
4907
|
+
file,
|
|
4795
4908
|
metadata: {
|
|
4796
4909
|
name: file.name,
|
|
4797
4910
|
type: file.type,
|
|
@@ -4806,28 +4919,91 @@ class KwikIDFormViewComponent {
|
|
|
4806
4919
|
this.updateFiles(file, "ERROR", field.key);
|
|
4807
4920
|
}
|
|
4808
4921
|
break;
|
|
4809
|
-
case EFieldType.CAPTURE:
|
|
4922
|
+
case EFieldType.CAPTURE: {
|
|
4810
4923
|
// Actual API Call
|
|
4924
|
+
let ocrPayload = {};
|
|
4925
|
+
if (isNotEmptyValue((_b = (_a = field === null || field === void 0 ? void 0 : field.properties) === null || _a === void 0 ? void 0 : _a.features) === null || _b === void 0 ? void 0 : _b.ocr)) {
|
|
4926
|
+
ocrPayload = field.properties.features.ocr;
|
|
4927
|
+
}
|
|
4928
|
+
const facematchPayload = {};
|
|
4929
|
+
if (isNotEmptyValue((_d = (_c = field === null || field === void 0 ? void 0 : field.properties) === null || _c === void 0 ? void 0 : _c.features) === null || _d === void 0 ? void 0 : _d.facematch)) {
|
|
4930
|
+
facematchPayload.isEnabled =
|
|
4931
|
+
field.properties.features.facematch.isEnabled;
|
|
4932
|
+
facematchPayload.isFacematchFromServer =
|
|
4933
|
+
field.properties.features.facematch.isFacematchFromServer;
|
|
4934
|
+
facematchPayload.images = [];
|
|
4935
|
+
const facematchSources = field.properties.features.facematch.sources;
|
|
4936
|
+
for (const facematchSourceConfig of facematchSources) {
|
|
4937
|
+
const source = new Source({
|
|
4938
|
+
FIELD_CONFIG: field,
|
|
4939
|
+
FORM_FIELDS: this.formFields,
|
|
4940
|
+
FORM_DATA: this.formData,
|
|
4941
|
+
CAMERA_DATA: this.cameraData,
|
|
4942
|
+
TASK_DATA: this.taskData,
|
|
4943
|
+
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4944
|
+
ALL_FORMS_DATA: this.allFormsData,
|
|
4945
|
+
EXTRA_DATA: this.extraData
|
|
4946
|
+
});
|
|
4947
|
+
const sourceValue = yield source.getValueFromSource(facematchSourceConfig);
|
|
4948
|
+
const facematchSource = {
|
|
4949
|
+
key: facematchSourceConfig.id,
|
|
4950
|
+
value: sourceValue
|
|
4951
|
+
};
|
|
4952
|
+
facematchPayload.images.push(facematchSource);
|
|
4953
|
+
}
|
|
4954
|
+
}
|
|
4955
|
+
const watermarkPayload = {};
|
|
4956
|
+
if (isNotEmptyValue((_f = (_e = field === null || field === void 0 ? void 0 : field.properties) === null || _e === void 0 ? void 0 : _e.features) === null || _f === void 0 ? void 0 : _f.watermark)) {
|
|
4957
|
+
watermarkPayload.isEnabled =
|
|
4958
|
+
field.properties.features.watermark.isEnabled;
|
|
4959
|
+
watermarkPayload.isWatermarkFromServer =
|
|
4960
|
+
field.properties.features.watermark.isWatermarkFromServer;
|
|
4961
|
+
watermarkPayload.data = [];
|
|
4962
|
+
const watermarkSources = field.properties.features.watermark.sources;
|
|
4963
|
+
watermarkPayload.config = field.properties.features.watermark.sources;
|
|
4964
|
+
for (const watermarkSourceConfig of watermarkSources) {
|
|
4965
|
+
const source = new Source({
|
|
4966
|
+
FIELD_CONFIG: field,
|
|
4967
|
+
FORM_FIELDS: this.formFields,
|
|
4968
|
+
FORM_DATA: this.formData,
|
|
4969
|
+
CAMERA_DATA: this.cameraData,
|
|
4970
|
+
TASK_DATA: this.taskData,
|
|
4971
|
+
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4972
|
+
ALL_FORMS_DATA: this.allFormsData,
|
|
4973
|
+
EXTRA_DATA: this.extraData
|
|
4974
|
+
});
|
|
4975
|
+
const sourceValue = yield source.getValueFromSource(watermarkSourceConfig);
|
|
4976
|
+
const watermarkSource = {
|
|
4977
|
+
key: watermarkSourceConfig.id,
|
|
4978
|
+
value: sourceValue
|
|
4979
|
+
};
|
|
4980
|
+
watermarkPayload.data.push(watermarkSource);
|
|
4981
|
+
}
|
|
4982
|
+
}
|
|
4983
|
+
const imageUploadPayload = Object.assign(Object.assign(Object.assign({ image: file }, ((ocrPayload === null || ocrPayload === void 0 ? void 0 : ocrPayload.isEnabled) && {
|
|
4984
|
+
ocr: ocrPayload
|
|
4985
|
+
})), ((facematchPayload === null || facematchPayload === void 0 ? void 0 : facematchPayload.isEnabled) && {
|
|
4986
|
+
facematch: facematchPayload
|
|
4987
|
+
})), ((watermarkPayload === null || watermarkPayload === void 0 ? void 0 : watermarkPayload.isEnabled) && {
|
|
4988
|
+
watermark: watermarkPayload
|
|
4989
|
+
}));
|
|
4811
4990
|
this.triggerLogs(ELogEventType$1.FORM__API_REQUEST_UPLOAD_IMAGE, {
|
|
4812
4991
|
field_key: field.key,
|
|
4813
4992
|
field_type: field.type,
|
|
4814
|
-
request:
|
|
4815
|
-
image: file
|
|
4816
|
-
}
|
|
4993
|
+
request: imageUploadPayload
|
|
4817
4994
|
});
|
|
4818
4995
|
try {
|
|
4819
4996
|
this.onClickApiCall.emit({
|
|
4820
4997
|
key: field.key,
|
|
4821
4998
|
type: field.type,
|
|
4822
|
-
payload:
|
|
4823
|
-
image: file
|
|
4824
|
-
}
|
|
4999
|
+
payload: imageUploadPayload
|
|
4825
5000
|
});
|
|
4826
5001
|
}
|
|
4827
5002
|
catch (err) {
|
|
4828
5003
|
console.log("Failed to upload image to server!");
|
|
4829
5004
|
}
|
|
4830
5005
|
break;
|
|
5006
|
+
}
|
|
4831
5007
|
case EFieldType.RECORD:
|
|
4832
5008
|
// Actual API Call
|
|
4833
5009
|
this.triggerLogs(ELogEventType$1.FORM__API_REQUEST_UPLOAD_VIDEO, {
|
|
@@ -4850,12 +5026,14 @@ class KwikIDFormViewComponent {
|
|
|
4850
5026
|
console.log("Failed to upload video to server!");
|
|
4851
5027
|
}
|
|
4852
5028
|
break;
|
|
5029
|
+
default:
|
|
5030
|
+
break;
|
|
4853
5031
|
}
|
|
4854
5032
|
});
|
|
4855
5033
|
}
|
|
4856
5034
|
handleOnClickFormFieldButton(field) {
|
|
4857
|
-
|
|
4858
|
-
for (
|
|
5035
|
+
const formData = this.formGroup.getRawValue();
|
|
5036
|
+
for (const field of this.formFields) {
|
|
4859
5037
|
if (field.isFormElement) {
|
|
4860
5038
|
if (field.hidden) {
|
|
4861
5039
|
delete formData[field.key];
|
|
@@ -4873,7 +5051,7 @@ class KwikIDFormViewComponent {
|
|
|
4873
5051
|
label: field.label,
|
|
4874
5052
|
value: isEmptyValue(formData[field.key]) ? "" : formData[field.key],
|
|
4875
5053
|
type: field.type,
|
|
4876
|
-
index
|
|
5054
|
+
index
|
|
4877
5055
|
}
|
|
4878
5056
|
};
|
|
4879
5057
|
result[field.key] = fieldData[field.key];
|
|
@@ -4897,8 +5075,8 @@ class KwikIDFormViewComponent {
|
|
|
4897
5075
|
return field.key === _.key;
|
|
4898
5076
|
});
|
|
4899
5077
|
// set button status to default
|
|
4900
|
-
field
|
|
4901
|
-
field
|
|
5078
|
+
field.api.status.value = EApiStatusType.LOADING;
|
|
5079
|
+
field.showLoader = true;
|
|
4902
5080
|
this.formFields[fieldIndex] = field;
|
|
4903
5081
|
this.showApiLoader();
|
|
4904
5082
|
this.fieldShowApiLoader(field.key);
|
|
@@ -4910,7 +5088,7 @@ class KwikIDFormViewComponent {
|
|
|
4910
5088
|
this.togglePermissionErrorNotification(true);
|
|
4911
5089
|
setTimeout(() => {
|
|
4912
5090
|
this.togglePermissionErrorNotification(false);
|
|
4913
|
-
},
|
|
5091
|
+
}, FORM_VIEW_TIMERS.LOCATION_PERMISSION_ERROR_TOGGLE);
|
|
4914
5092
|
}
|
|
4915
5093
|
else {
|
|
4916
5094
|
this.triggerLogs(ELogEventType$1.FORM__LIVE_LOCATION_PERMISSION_SUCCESS, {
|
|
@@ -4920,12 +5098,12 @@ class KwikIDFormViewComponent {
|
|
|
4920
5098
|
}
|
|
4921
5099
|
setTimeout(() => {
|
|
4922
5100
|
// set button status to default
|
|
4923
|
-
field
|
|
4924
|
-
field
|
|
5101
|
+
field.api.status.value = EApiStatusType.DEFAULT;
|
|
5102
|
+
field.showLoader = false;
|
|
4925
5103
|
this.formFields[fieldIndex] = field;
|
|
4926
5104
|
this.hideApiLoader();
|
|
4927
5105
|
this.fieldHideApiLoader(field.key);
|
|
4928
|
-
},
|
|
5106
|
+
}, FORM_VIEW_TIMERS.LOCATION_PERMISSION_RESET_BUTTON_STATUS);
|
|
4929
5107
|
}
|
|
4930
5108
|
handleOnClickLiveLocation(e) {
|
|
4931
5109
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -4935,8 +5113,8 @@ class KwikIDFormViewComponent {
|
|
|
4935
5113
|
field_type: field.type
|
|
4936
5114
|
});
|
|
4937
5115
|
// set button status to loading
|
|
4938
|
-
field
|
|
4939
|
-
field
|
|
5116
|
+
field.api.status.value = EApiStatusType.LOADING;
|
|
5117
|
+
field.showLoader = true;
|
|
4940
5118
|
this.showApiLoader();
|
|
4941
5119
|
this.formGroup.patchValue({
|
|
4942
5120
|
[e.key]: e.value
|
|
@@ -4956,11 +5134,11 @@ class KwikIDFormViewComponent {
|
|
|
4956
5134
|
yield new Promise((resolve) => {
|
|
4957
5135
|
setTimeout(() => {
|
|
4958
5136
|
resolve(true);
|
|
4959
|
-
},
|
|
5137
|
+
}, FORM_VIEW_TIMERS.TIMER_300); // 1000 ms = 1 sec
|
|
4960
5138
|
});
|
|
4961
5139
|
// set button status to success
|
|
4962
|
-
field
|
|
4963
|
-
field
|
|
5140
|
+
field.api.status.value = EApiStatusType.SUCCESS;
|
|
5141
|
+
field.showLoader = false;
|
|
4964
5142
|
if (field.isFormElement &&
|
|
4965
5143
|
checkObjectKeyExists(field, "validation") &&
|
|
4966
5144
|
field.validation.triggers.includes("ON_CHANGE")) {
|
|
@@ -4968,6 +5146,7 @@ class KwikIDFormViewComponent {
|
|
|
4968
5146
|
FIELD_CONFIG: field,
|
|
4969
5147
|
FORM_FIELDS: this.formFields,
|
|
4970
5148
|
FORM_DATA: this.formData,
|
|
5149
|
+
CAMERA_DATA: this.cameraData,
|
|
4971
5150
|
TASK_DATA: this.taskData,
|
|
4972
5151
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4973
5152
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -5003,6 +5182,7 @@ class KwikIDFormViewComponent {
|
|
|
5003
5182
|
FIELD_CONFIG: field,
|
|
5004
5183
|
FORM_FIELDS: this.formFields,
|
|
5005
5184
|
FORM_DATA: this.formData,
|
|
5185
|
+
CAMERA_DATA: this.cameraData,
|
|
5006
5186
|
TASK_DATA: this.taskData,
|
|
5007
5187
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
5008
5188
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -5020,41 +5200,6 @@ class KwikIDFormViewComponent {
|
|
|
5020
5200
|
}, "ON_CHANGE");
|
|
5021
5201
|
}
|
|
5022
5202
|
}
|
|
5023
|
-
handleOnClickResetFormFields2(e, field) {
|
|
5024
|
-
var _a;
|
|
5025
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
5026
|
-
this.triggerLogs(ELogEventType$1.FORM__FIELD_RESET_BUTTON_CLICK, {
|
|
5027
|
-
field_key: field.key
|
|
5028
|
-
});
|
|
5029
|
-
const resetFormFields = () => __awaiter(this, void 0, void 0, function* () {
|
|
5030
|
-
for (let f of field.reset.fields) {
|
|
5031
|
-
for (let action of f.actions) {
|
|
5032
|
-
const resetField = getFormFieldByKey(this.formFields, action.props.fieldKey);
|
|
5033
|
-
const actions = new Action(action, {}, {
|
|
5034
|
-
FIELD_CONFIG: resetField,
|
|
5035
|
-
FORM_FIELDS: this.formFields,
|
|
5036
|
-
FORM_DATA: this.formData,
|
|
5037
|
-
TASK_DATA: this.taskData,
|
|
5038
|
-
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
5039
|
-
ALL_FORMS_DATA: this.allFormsData,
|
|
5040
|
-
EXTRA_DATA: this.extraData
|
|
5041
|
-
}, this.takeAction.bind(this));
|
|
5042
|
-
yield actions.execute();
|
|
5043
|
-
}
|
|
5044
|
-
}
|
|
5045
|
-
});
|
|
5046
|
-
const BYPASS_RESET_CONFIRM = (_a = field === null || field === void 0 ? void 0 : field.properties) === null || _a === void 0 ? void 0 : _a.bypassResetConfirmation;
|
|
5047
|
-
if (!BYPASS_RESET_CONFIRM) {
|
|
5048
|
-
const CONFIRM_RESET = window.confirm("This action will reset all the fields. Do you still want to continue?");
|
|
5049
|
-
if (CONFIRM_RESET) {
|
|
5050
|
-
resetFormFields();
|
|
5051
|
-
}
|
|
5052
|
-
}
|
|
5053
|
-
else {
|
|
5054
|
-
resetFormFields();
|
|
5055
|
-
}
|
|
5056
|
-
});
|
|
5057
|
-
}
|
|
5058
5203
|
handleOnClickResetFormFields(e, field) {
|
|
5059
5204
|
var _a;
|
|
5060
5205
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -5063,13 +5208,14 @@ class KwikIDFormViewComponent {
|
|
|
5063
5208
|
});
|
|
5064
5209
|
const resetFormFields = () => __awaiter(this, void 0, void 0, function* () {
|
|
5065
5210
|
if (checkObjectPathExists(field, "reset.fields")) {
|
|
5066
|
-
for (
|
|
5067
|
-
for (
|
|
5211
|
+
for (const f of field.reset.fields) {
|
|
5212
|
+
for (const action of f.actions) {
|
|
5068
5213
|
const resetField = getFormFieldByKey(this.formFields, action.props.fieldKey);
|
|
5069
5214
|
const actions = new Action(action, {}, {
|
|
5070
5215
|
FIELD_CONFIG: resetField,
|
|
5071
5216
|
FORM_FIELDS: this.formFields,
|
|
5072
5217
|
FORM_DATA: this.formData,
|
|
5218
|
+
CAMERA_DATA: this.cameraData,
|
|
5073
5219
|
TASK_DATA: this.taskData,
|
|
5074
5220
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
5075
5221
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -5080,14 +5226,15 @@ class KwikIDFormViewComponent {
|
|
|
5080
5226
|
}
|
|
5081
5227
|
}
|
|
5082
5228
|
if (checkObjectPathExists(field, "reset.fieldGroups")) {
|
|
5083
|
-
for (
|
|
5084
|
-
for (
|
|
5085
|
-
for (
|
|
5229
|
+
for (const fg of field.reset.fieldGroups) {
|
|
5230
|
+
for (const action of fg.actions) {
|
|
5231
|
+
for (const fieldKey of this.fieldGroups[fg.groupKey]) {
|
|
5086
5232
|
const resetField = getFormFieldByKey(this.formFields, fieldKey);
|
|
5087
5233
|
const actions = new Action(action, {}, {
|
|
5088
5234
|
FIELD_CONFIG: resetField,
|
|
5089
5235
|
FORM_FIELDS: this.formFields,
|
|
5090
5236
|
FORM_DATA: this.formData,
|
|
5237
|
+
CAMERA_DATA: this.cameraData,
|
|
5091
5238
|
TASK_DATA: this.taskData,
|
|
5092
5239
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
5093
5240
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -5118,6 +5265,7 @@ class KwikIDFormViewComponent {
|
|
|
5118
5265
|
API_CONFIG: api,
|
|
5119
5266
|
FORM_FIELDS: this.formFields,
|
|
5120
5267
|
FORM_DATA: this.formData,
|
|
5268
|
+
CAMERA_DATA: this.cameraData,
|
|
5121
5269
|
TASK_DATA: this.taskData,
|
|
5122
5270
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
5123
5271
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -5136,6 +5284,7 @@ class KwikIDFormViewComponent {
|
|
|
5136
5284
|
API_RESPONSE: api.response,
|
|
5137
5285
|
FORM_FIELDS: this.formFields,
|
|
5138
5286
|
FORM_DATA: this.formData,
|
|
5287
|
+
CAMERA_DATA: this.cameraData,
|
|
5139
5288
|
TASK_DATA: this.taskData,
|
|
5140
5289
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
5141
5290
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -5145,11 +5294,11 @@ class KwikIDFormViewComponent {
|
|
|
5145
5294
|
}
|
|
5146
5295
|
else {
|
|
5147
5296
|
setTimeout(() => {
|
|
5148
|
-
field
|
|
5149
|
-
field
|
|
5150
|
-
},
|
|
5297
|
+
field.api.status.value = EApiStatusType.FAILED;
|
|
5298
|
+
field.showLoader = false;
|
|
5299
|
+
}, FORM_VIEW_TIMERS.TIMER_500);
|
|
5151
5300
|
}
|
|
5152
|
-
return { field
|
|
5301
|
+
return { field, api };
|
|
5153
5302
|
});
|
|
5154
5303
|
}
|
|
5155
5304
|
handleApiCall(api) {
|
|
@@ -5159,6 +5308,7 @@ class KwikIDFormViewComponent {
|
|
|
5159
5308
|
API_CONFIG: api,
|
|
5160
5309
|
FORM_FIELDS: this.formFields,
|
|
5161
5310
|
FORM_DATA: this.formData,
|
|
5311
|
+
CAMERA_DATA: this.cameraData,
|
|
5162
5312
|
TASK_DATA: this.taskData,
|
|
5163
5313
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
5164
5314
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -5169,6 +5319,7 @@ class KwikIDFormViewComponent {
|
|
|
5169
5319
|
API_CONFIG: api,
|
|
5170
5320
|
FORM_FIELDS: this.formFields,
|
|
5171
5321
|
FORM_DATA: this.formData,
|
|
5322
|
+
CAMERA_DATA: this.cameraData,
|
|
5172
5323
|
TASK_DATA: this.taskData,
|
|
5173
5324
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
5174
5325
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -5177,7 +5328,7 @@ class KwikIDFormViewComponent {
|
|
|
5177
5328
|
if (this.isValidRequestHeadersAndBody(api)) {
|
|
5178
5329
|
api = yield apis.validateResponse();
|
|
5179
5330
|
}
|
|
5180
|
-
return { api
|
|
5331
|
+
return { api };
|
|
5181
5332
|
});
|
|
5182
5333
|
}
|
|
5183
5334
|
executeApiCall(api, object) {
|
|
@@ -5192,14 +5343,15 @@ class KwikIDFormViewComponent {
|
|
|
5192
5343
|
let apiCallResponse = {};
|
|
5193
5344
|
let apiCallResponseStatusCode;
|
|
5194
5345
|
if (this.isValidRequestHeadersAndBody(api)) {
|
|
5195
|
-
if (api.request.url
|
|
5346
|
+
if (checkObjectKeyExists(api.request.url, "type") &&
|
|
5196
5347
|
api.request.url.type === EApiRequestUrlType.MOCK) {
|
|
5197
5348
|
apiCallResponse = yield new Promise((resolve) => {
|
|
5198
5349
|
setTimeout(() => {
|
|
5199
5350
|
resolve(api.request.url.props.mockedData);
|
|
5200
|
-
},
|
|
5351
|
+
}, FORM_VIEW_TIMERS.WAIT_FOR_API_MOCK_DATA); // 1000 ms = 1 sec
|
|
5201
5352
|
});
|
|
5202
|
-
apiCallResponseStatusCode =
|
|
5353
|
+
apiCallResponseStatusCode =
|
|
5354
|
+
(_b = (_a = api.request.url.props) === null || _a === void 0 ? void 0 : _a.statusCode) !== null && _b !== void 0 ? _b : FORM_VIEW_TIMERS.API_MOCK_SUCCESS_STATUS_CODE; // Default Status Code for Mocked APIs
|
|
5203
5355
|
}
|
|
5204
5356
|
else {
|
|
5205
5357
|
const url = api.request.url.value;
|
|
@@ -5226,12 +5378,13 @@ class KwikIDFormViewComponent {
|
|
|
5226
5378
|
catch (_13) {
|
|
5227
5379
|
// Handle any errors
|
|
5228
5380
|
apiCallResponse = {};
|
|
5229
|
-
apiCallResponseStatusCode =
|
|
5381
|
+
apiCallResponseStatusCode =
|
|
5382
|
+
FORM_VIEW_TIMERS.API_MOCK_ERROR_STATUS_CODE; // Internal Server Error
|
|
5230
5383
|
}
|
|
5231
5384
|
}
|
|
5232
5385
|
else {
|
|
5233
5386
|
// Extract the request body from the API configuration
|
|
5234
|
-
|
|
5387
|
+
const body = (_p = (_o = (_m = api === null || api === void 0 ? void 0 : api.request) === null || _m === void 0 ? void 0 : _m.body) === null || _o === void 0 ? void 0 : _o.value) !== null && _p !== void 0 ? _p : {};
|
|
5235
5388
|
// Check if the request body needs to be encrypted
|
|
5236
5389
|
const isEncryptRequestBody = (_s = (_r = (_q = api === null || api === void 0 ? void 0 : api.request) === null || _q === void 0 ? void 0 : _q.body) === null || _r === void 0 ? void 0 : _r.isSecure) !== null && _s !== void 0 ? _s : false;
|
|
5237
5390
|
// Check if the response needs to be decrypted
|
|
@@ -5251,7 +5404,8 @@ class KwikIDFormViewComponent {
|
|
|
5251
5404
|
catch (_14) {
|
|
5252
5405
|
// Handle any errors
|
|
5253
5406
|
apiCallResponse = {};
|
|
5254
|
-
apiCallResponseStatusCode =
|
|
5407
|
+
apiCallResponseStatusCode =
|
|
5408
|
+
FORM_VIEW_TIMERS.API_MOCK_ERROR_STATUS_CODE; // Internal Server Error
|
|
5255
5409
|
}
|
|
5256
5410
|
}
|
|
5257
5411
|
}
|
|
@@ -5286,29 +5440,29 @@ class KwikIDFormViewComponent {
|
|
|
5286
5440
|
fullscreen: true,
|
|
5287
5441
|
loaderText: "Please wait"
|
|
5288
5442
|
});
|
|
5289
|
-
this.viewFormsButton
|
|
5290
|
-
this.viewFormsButton
|
|
5291
|
-
this.saveFormButton
|
|
5292
|
-
this.saveFormButton
|
|
5443
|
+
this.viewFormsButton.disabled = true;
|
|
5444
|
+
this.viewFormsButton.showLoader = true;
|
|
5445
|
+
this.saveFormButton.disabled = true;
|
|
5446
|
+
this.saveFormButton.showLoader = true;
|
|
5293
5447
|
}
|
|
5294
5448
|
hideApiLoader() {
|
|
5295
5449
|
this.loaderService.hide();
|
|
5296
|
-
this.viewFormsButton
|
|
5297
|
-
this.viewFormsButton
|
|
5298
|
-
this.saveFormButton
|
|
5299
|
-
this.saveFormButton
|
|
5450
|
+
this.viewFormsButton.disabled = false;
|
|
5451
|
+
this.viewFormsButton.showLoader = false;
|
|
5452
|
+
this.saveFormButton.disabled = false;
|
|
5453
|
+
this.saveFormButton.showLoader = false;
|
|
5300
5454
|
}
|
|
5301
5455
|
handleOnClickApiCall(e) {
|
|
5302
5456
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5303
|
-
|
|
5457
|
+
const field = getFormFieldByKey(this.formFields, e.key);
|
|
5304
5458
|
if (field.type === EFieldType.API) {
|
|
5305
5459
|
this.triggerLogs(ELogEventType$1.FORM__API_BUTTON_CLICK, {
|
|
5306
5460
|
field_key: field.key,
|
|
5307
5461
|
field_type: field.type
|
|
5308
5462
|
});
|
|
5309
5463
|
// set button status to loading
|
|
5310
|
-
field
|
|
5311
|
-
field
|
|
5464
|
+
field.api.status.value = EApiStatusType.LOADING;
|
|
5465
|
+
field.showLoader = true;
|
|
5312
5466
|
this.showApiLoader();
|
|
5313
5467
|
// Determine API Call time
|
|
5314
5468
|
if (checkObjectKeyExists(field.api, "request")) {
|
|
@@ -5320,6 +5474,7 @@ class KwikIDFormViewComponent {
|
|
|
5320
5474
|
API_CONFIG: {},
|
|
5321
5475
|
FORM_FIELDS: this.formFields,
|
|
5322
5476
|
FORM_DATA: this.formData,
|
|
5477
|
+
CAMERA_DATA: this.cameraData,
|
|
5323
5478
|
TASK_DATA: this.taskData,
|
|
5324
5479
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
5325
5480
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -5344,14 +5499,14 @@ class KwikIDFormViewComponent {
|
|
|
5344
5499
|
if (this.formConfig.status === EFormsListStatus.COMPLETED) {
|
|
5345
5500
|
this.onClickGoBack.emit({
|
|
5346
5501
|
clicked: true,
|
|
5347
|
-
mode
|
|
5502
|
+
mode
|
|
5348
5503
|
});
|
|
5349
5504
|
}
|
|
5350
5505
|
else if (this.formConfig.properties.header.backButton.bypassConfirmation ||
|
|
5351
5506
|
window.confirm("Your data will be lost if you leave this page! Continue?")) {
|
|
5352
5507
|
this.onClickGoBack.emit({
|
|
5353
5508
|
clicked: true,
|
|
5354
|
-
mode
|
|
5509
|
+
mode
|
|
5355
5510
|
});
|
|
5356
5511
|
}
|
|
5357
5512
|
}
|
|
@@ -5379,7 +5534,7 @@ class KwikIDFormViewComponent {
|
|
|
5379
5534
|
}
|
|
5380
5535
|
const controls = new FormValidation().getFormFieldsInvalidControls(this.formGroup);
|
|
5381
5536
|
let firstFieldWithError = "";
|
|
5382
|
-
for (
|
|
5537
|
+
for (const control of controls) {
|
|
5383
5538
|
if (control.invalid) {
|
|
5384
5539
|
const field = getFormFieldByKey(this.formFields, control.key);
|
|
5385
5540
|
this.triggerLogs(ELogEventType$1.FORM__FIELD_ERROR_SHOW, {
|
|
@@ -5401,7 +5556,7 @@ class KwikIDFormViewComponent {
|
|
|
5401
5556
|
// }, 3000);
|
|
5402
5557
|
return;
|
|
5403
5558
|
}
|
|
5404
|
-
for (
|
|
5559
|
+
for (const field of this.formFields) {
|
|
5405
5560
|
if (field.isFormElement &&
|
|
5406
5561
|
!field.hidden &&
|
|
5407
5562
|
checkObjectKeyExists(field, "validation") &&
|
|
@@ -5410,6 +5565,7 @@ class KwikIDFormViewComponent {
|
|
|
5410
5565
|
FIELD_CONFIG: field,
|
|
5411
5566
|
FORM_FIELDS: this.formFields,
|
|
5412
5567
|
FORM_DATA: this.formData,
|
|
5568
|
+
CAMERA_DATA: this.cameraData,
|
|
5413
5569
|
TASK_DATA: this.taskData,
|
|
5414
5570
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
5415
5571
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -5420,13 +5576,13 @@ class KwikIDFormViewComponent {
|
|
|
5420
5576
|
this.toggleErrorNotification(true);
|
|
5421
5577
|
setTimeout(() => {
|
|
5422
5578
|
this.toggleErrorNotification(false);
|
|
5423
|
-
},
|
|
5579
|
+
}, FORM_VIEW_TIMERS.INVALID_FIELDS_SAVE_FORM_ERROR_TOGGLE);
|
|
5424
5580
|
return;
|
|
5425
5581
|
}
|
|
5426
5582
|
}
|
|
5427
5583
|
}
|
|
5428
|
-
|
|
5429
|
-
for (
|
|
5584
|
+
const formData = this.formGroup.getRawValue();
|
|
5585
|
+
for (const field of this.formFields) {
|
|
5430
5586
|
if (field.isFormElement) {
|
|
5431
5587
|
if (field.hidden) {
|
|
5432
5588
|
delete formData[field.key];
|
|
@@ -5444,7 +5600,7 @@ class KwikIDFormViewComponent {
|
|
|
5444
5600
|
label: field.label,
|
|
5445
5601
|
value: isEmptyValue(formData[field.key]) ? "" : formData[field.key],
|
|
5446
5602
|
type: field.type,
|
|
5447
|
-
index
|
|
5603
|
+
index
|
|
5448
5604
|
}
|
|
5449
5605
|
};
|
|
5450
5606
|
result[field.key] = fieldData[field.key];
|
|
@@ -5455,6 +5611,7 @@ class KwikIDFormViewComponent {
|
|
|
5455
5611
|
if (isEmptyValue(formData[key])) {
|
|
5456
5612
|
formData[key] = "";
|
|
5457
5613
|
}
|
|
5614
|
+
return null;
|
|
5458
5615
|
});
|
|
5459
5616
|
/**
|
|
5460
5617
|
* POST Tasks
|
|
@@ -5466,11 +5623,12 @@ class KwikIDFormViewComponent {
|
|
|
5466
5623
|
if (checkObjectKeyExists(this.formConfig, "tasks") &&
|
|
5467
5624
|
checkObjectKeyExists(this.formConfig.tasks, "post")) {
|
|
5468
5625
|
this.triggerLogs(ELogEventType$1.FORM__TASK_POST, {});
|
|
5469
|
-
for (
|
|
5626
|
+
for (const postTask of this.formConfig.tasks.post) {
|
|
5470
5627
|
const task = new Tasks(postTask, {
|
|
5471
5628
|
FORM_CONFIG: this.formConfig,
|
|
5472
5629
|
FORM_FIELDS: this.formFields,
|
|
5473
5630
|
FORM_DATA: this.formData,
|
|
5631
|
+
CAMERA_DATA: this.cameraData,
|
|
5474
5632
|
TASK_DATA: this.taskData,
|
|
5475
5633
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
5476
5634
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -5491,7 +5649,7 @@ class KwikIDFormViewComponent {
|
|
|
5491
5649
|
clearInterval(intervalId);
|
|
5492
5650
|
resolve();
|
|
5493
5651
|
}
|
|
5494
|
-
},
|
|
5652
|
+
}, FORM_VIEW_TIMERS.WAIT_FOR_CHANGES_BEFORE_MOVING_TO_NEXT_TASK);
|
|
5495
5653
|
});
|
|
5496
5654
|
if (this.stopTaskExecution) {
|
|
5497
5655
|
break;
|
|
@@ -5540,11 +5698,11 @@ class KwikIDFormViewComponent {
|
|
|
5540
5698
|
}
|
|
5541
5699
|
// Component Helpers
|
|
5542
5700
|
fieldHide(fieldKey) {
|
|
5543
|
-
|
|
5544
|
-
|
|
5701
|
+
const field = getFormFieldByKey(this.formFields, fieldKey);
|
|
5702
|
+
const fieldIndex = this.formFields.findIndex((_) => {
|
|
5545
5703
|
return field.key === _.key;
|
|
5546
5704
|
});
|
|
5547
|
-
this.formFields[fieldIndex]
|
|
5705
|
+
this.formFields[fieldIndex].hidden = true;
|
|
5548
5706
|
this.formGroup.updateValueAndValidity();
|
|
5549
5707
|
this.triggerLogs(ELogEventType$1.FORM__FIELD_HIDE, {
|
|
5550
5708
|
field_key: fieldKey,
|
|
@@ -5552,16 +5710,16 @@ class KwikIDFormViewComponent {
|
|
|
5552
5710
|
});
|
|
5553
5711
|
}
|
|
5554
5712
|
fieldGroupHide(fieldGroup) {
|
|
5555
|
-
for (
|
|
5713
|
+
for (const fieldKey of this.fieldGroups[fieldGroup]) {
|
|
5556
5714
|
this.fieldHide(fieldKey);
|
|
5557
5715
|
}
|
|
5558
5716
|
}
|
|
5559
5717
|
fieldShow(fieldKey) {
|
|
5560
|
-
|
|
5561
|
-
|
|
5718
|
+
const field = getFormFieldByKey(this.formFields, fieldKey);
|
|
5719
|
+
const fieldIndex = this.formFields.findIndex((_) => {
|
|
5562
5720
|
return field.key === _.key;
|
|
5563
5721
|
});
|
|
5564
|
-
this.formFields[fieldIndex]
|
|
5722
|
+
this.formFields[fieldIndex].hidden = false;
|
|
5565
5723
|
this.formGroup.updateValueAndValidity();
|
|
5566
5724
|
this.triggerLogs(ELogEventType$1.FORM__FIELD_SHOW, {
|
|
5567
5725
|
field_key: fieldKey,
|
|
@@ -5569,27 +5727,26 @@ class KwikIDFormViewComponent {
|
|
|
5569
5727
|
});
|
|
5570
5728
|
}
|
|
5571
5729
|
fieldGroupShow(fieldGroup) {
|
|
5572
|
-
for (
|
|
5730
|
+
for (const fieldKey of this.fieldGroups[fieldGroup]) {
|
|
5573
5731
|
this.fieldShow(fieldKey);
|
|
5574
5732
|
}
|
|
5575
5733
|
}
|
|
5576
5734
|
fieldDisable(fieldKey) {
|
|
5577
|
-
|
|
5578
|
-
|
|
5735
|
+
const field = getFormFieldByKey(this.formFields, fieldKey);
|
|
5736
|
+
const fieldIndex = this.formFields.findIndex((_) => {
|
|
5579
5737
|
return field.key === _.key;
|
|
5580
5738
|
});
|
|
5581
5739
|
if (field.isFormElement) {
|
|
5582
|
-
this.formFields[fieldIndex]
|
|
5740
|
+
this.formFields[fieldIndex].disabled = true;
|
|
5583
5741
|
if (isNotEmptyValue(this.formGroup.controls)) {
|
|
5584
5742
|
this.formGroup.controls[field.key].disable({
|
|
5585
5743
|
emitEvent: false
|
|
5586
5744
|
});
|
|
5587
5745
|
}
|
|
5588
5746
|
this.formGroup.updateValueAndValidity();
|
|
5589
|
-
console.log("YES DISABLING THE FIELD");
|
|
5590
5747
|
}
|
|
5591
5748
|
else if (field.type === EFieldType.BUTTON) {
|
|
5592
|
-
this.formFields[fieldIndex]
|
|
5749
|
+
this.formFields[fieldIndex].disabled = true;
|
|
5593
5750
|
}
|
|
5594
5751
|
this.triggerLogs(ELogEventType$1.FORM__FIELD_DISABLE, {
|
|
5595
5752
|
field_key: fieldKey,
|
|
@@ -5597,17 +5754,17 @@ class KwikIDFormViewComponent {
|
|
|
5597
5754
|
});
|
|
5598
5755
|
}
|
|
5599
5756
|
fieldGroupDisable(fieldGroup) {
|
|
5600
|
-
for (
|
|
5757
|
+
for (const fieldKey of this.fieldGroups[fieldGroup]) {
|
|
5601
5758
|
this.fieldDisable(fieldKey);
|
|
5602
5759
|
}
|
|
5603
5760
|
}
|
|
5604
5761
|
fieldEnable(fieldKey) {
|
|
5605
|
-
|
|
5606
|
-
|
|
5762
|
+
const field = getFormFieldByKey(this.formFields, fieldKey);
|
|
5763
|
+
const fieldIndex = this.formFields.findIndex((_) => {
|
|
5607
5764
|
return field.key === _.key;
|
|
5608
5765
|
});
|
|
5609
5766
|
if (field.isFormElement) {
|
|
5610
|
-
this.formFields[fieldIndex]
|
|
5767
|
+
this.formFields[fieldIndex].disabled = false;
|
|
5611
5768
|
if (isNotEmptyValue(this.formGroup.controls)) {
|
|
5612
5769
|
this.formGroup.controls[field.key].enable({
|
|
5613
5770
|
emitEvent: false
|
|
@@ -5616,7 +5773,7 @@ class KwikIDFormViewComponent {
|
|
|
5616
5773
|
this.formGroup.updateValueAndValidity();
|
|
5617
5774
|
}
|
|
5618
5775
|
else if (field.type === EFieldType.BUTTON) {
|
|
5619
|
-
this.formFields[fieldIndex]
|
|
5776
|
+
this.formFields[fieldIndex].disabled = false;
|
|
5620
5777
|
}
|
|
5621
5778
|
this.triggerLogs(ELogEventType$1.FORM__FIELD_ENABLE, {
|
|
5622
5779
|
field_key: fieldKey,
|
|
@@ -5624,14 +5781,14 @@ class KwikIDFormViewComponent {
|
|
|
5624
5781
|
});
|
|
5625
5782
|
}
|
|
5626
5783
|
fieldGroupEnable(fieldGroup) {
|
|
5627
|
-
for (
|
|
5784
|
+
for (const fieldKey of this.fieldGroups[fieldGroup]) {
|
|
5628
5785
|
this.fieldEnable(fieldKey);
|
|
5629
5786
|
}
|
|
5630
5787
|
}
|
|
5631
5788
|
fieldReset(fieldKey) {
|
|
5632
5789
|
// Find the field and its index in the formFields array
|
|
5633
5790
|
let field = getFormFieldByKey(this.formFields, fieldKey);
|
|
5634
|
-
|
|
5791
|
+
const fieldIndex = getFormFieldIndexByKey(this.formFields, fieldKey);
|
|
5635
5792
|
// Reset the value of the field in the formGroup
|
|
5636
5793
|
const resetValue = convertFormFieldEmptyValueToKwikUIFormat(field);
|
|
5637
5794
|
this.formData[fieldKey] = resetValue;
|
|
@@ -5660,23 +5817,24 @@ class KwikIDFormViewComponent {
|
|
|
5660
5817
|
});
|
|
5661
5818
|
// Reset the value of the field in the formFields array
|
|
5662
5819
|
switch (field.type) {
|
|
5663
|
-
case EFieldType.API:
|
|
5820
|
+
case EFieldType.API: {
|
|
5664
5821
|
const fieldApiCall = field;
|
|
5665
5822
|
fieldApiCall.api.status.value = EApiStatusType.DEFAULT;
|
|
5666
5823
|
this.formFields[fieldIndex] = fieldApiCall;
|
|
5667
5824
|
break;
|
|
5668
|
-
|
|
5825
|
+
}
|
|
5826
|
+
case EFieldType.LIVE_LOCATION: {
|
|
5669
5827
|
const fieldLiveLocation = field;
|
|
5670
5828
|
fieldLiveLocation.api.status.value = EApiStatusType.DEFAULT;
|
|
5671
5829
|
this.formFields[fieldIndex] = fieldLiveLocation;
|
|
5672
5830
|
break;
|
|
5673
|
-
|
|
5674
|
-
|
|
5831
|
+
}
|
|
5832
|
+
default: {
|
|
5675
5833
|
field.focus = false;
|
|
5676
5834
|
field.invalid = false;
|
|
5677
5835
|
this.formFields[fieldIndex] = field;
|
|
5678
|
-
console.log("BAIJU AFTER", getObjectDeepCopy(field), getObjectDeepCopy(this.formFields));
|
|
5679
5836
|
break;
|
|
5837
|
+
}
|
|
5680
5838
|
}
|
|
5681
5839
|
this.triggerLogs(ELogEventType$1.FORM__FIELD_RESET, {
|
|
5682
5840
|
field_key: fieldKey,
|
|
@@ -5684,55 +5842,61 @@ class KwikIDFormViewComponent {
|
|
|
5684
5842
|
});
|
|
5685
5843
|
}
|
|
5686
5844
|
fieldGroupReset(fieldGroup) {
|
|
5687
|
-
for (
|
|
5845
|
+
for (const fieldKey of this.fieldGroups[fieldGroup]) {
|
|
5688
5846
|
this.fieldReset(fieldKey);
|
|
5689
5847
|
}
|
|
5690
5848
|
}
|
|
5691
5849
|
fieldHideApiLoader(fieldKey) {
|
|
5692
|
-
|
|
5693
|
-
|
|
5850
|
+
const field = getFormFieldByKey(this.formFields, fieldKey);
|
|
5851
|
+
const fieldIndex = this.formFields.findIndex((_) => {
|
|
5694
5852
|
return field.key === _.key;
|
|
5695
5853
|
});
|
|
5696
5854
|
// Reset the value of the field in the formFields array
|
|
5697
5855
|
switch (field.type) {
|
|
5698
|
-
case EFieldType.API:
|
|
5856
|
+
case EFieldType.API: {
|
|
5699
5857
|
const fieldApiCall = field;
|
|
5700
5858
|
fieldApiCall.disabled = false;
|
|
5701
5859
|
this.formFields[fieldIndex] = fieldApiCall;
|
|
5702
5860
|
break;
|
|
5703
|
-
|
|
5861
|
+
}
|
|
5862
|
+
case EFieldType.LIVE_LOCATION: {
|
|
5704
5863
|
const fieldLiveLocation = field;
|
|
5705
5864
|
fieldLiveLocation.disabled = false;
|
|
5706
5865
|
this.formFields[fieldIndex] = fieldLiveLocation;
|
|
5707
5866
|
break;
|
|
5708
|
-
|
|
5867
|
+
}
|
|
5868
|
+
default: {
|
|
5709
5869
|
break;
|
|
5870
|
+
}
|
|
5710
5871
|
}
|
|
5711
5872
|
}
|
|
5712
5873
|
fieldShowApiLoader(fieldKey) {
|
|
5713
|
-
|
|
5714
|
-
|
|
5874
|
+
const field = getFormFieldByKey(this.formFields, fieldKey);
|
|
5875
|
+
const fieldIndex = this.formFields.findIndex((_) => {
|
|
5715
5876
|
return field.key === _.key;
|
|
5716
5877
|
});
|
|
5717
5878
|
// Reset the value of the field in the formFields array
|
|
5718
5879
|
switch (field.type) {
|
|
5719
|
-
case EFieldType.API:
|
|
5880
|
+
case EFieldType.API: {
|
|
5720
5881
|
const fieldApiCall = field;
|
|
5721
5882
|
fieldApiCall.disabled = true;
|
|
5722
5883
|
this.formFields[fieldIndex] = fieldApiCall;
|
|
5723
5884
|
break;
|
|
5724
|
-
|
|
5885
|
+
}
|
|
5886
|
+
case EFieldType.LIVE_LOCATION: {
|
|
5725
5887
|
const fieldLiveLocation = field;
|
|
5726
5888
|
fieldLiveLocation.disabled = true;
|
|
5727
5889
|
this.formFields[fieldIndex] = fieldLiveLocation;
|
|
5728
5890
|
break;
|
|
5729
|
-
|
|
5891
|
+
}
|
|
5892
|
+
default: {
|
|
5730
5893
|
break;
|
|
5894
|
+
}
|
|
5731
5895
|
}
|
|
5732
5896
|
}
|
|
5733
5897
|
setHtml(fieldKey, message) {
|
|
5734
5898
|
let field = getFormFieldByKey(this.formFields, fieldKey);
|
|
5735
|
-
|
|
5899
|
+
const fieldIndex = this.formFields.findIndex((_) => {
|
|
5736
5900
|
return field.key === _.key;
|
|
5737
5901
|
});
|
|
5738
5902
|
field = appendHtmlMessage(field, message);
|
|
@@ -5740,7 +5904,7 @@ class KwikIDFormViewComponent {
|
|
|
5740
5904
|
}
|
|
5741
5905
|
fieldErrorShow(fieldKey, message) {
|
|
5742
5906
|
let field = getFormFieldByKey(this.formFields, fieldKey);
|
|
5743
|
-
|
|
5907
|
+
const fieldIndex = this.formFields.findIndex((_) => {
|
|
5744
5908
|
return field.key === _.key;
|
|
5745
5909
|
});
|
|
5746
5910
|
field = highlightFormFieldError(field, true);
|
|
@@ -5754,7 +5918,7 @@ class KwikIDFormViewComponent {
|
|
|
5754
5918
|
}
|
|
5755
5919
|
fieldErrorHide(fieldKey, message) {
|
|
5756
5920
|
let field = getFormFieldByKey(this.formFields, fieldKey);
|
|
5757
|
-
|
|
5921
|
+
const fieldIndex = this.formFields.findIndex((_) => {
|
|
5758
5922
|
return field.key === _.key;
|
|
5759
5923
|
});
|
|
5760
5924
|
field = highlightFormFieldError(field, false);
|
|
@@ -5768,7 +5932,7 @@ class KwikIDFormViewComponent {
|
|
|
5768
5932
|
}
|
|
5769
5933
|
fieldMessageShow(fieldKey, message) {
|
|
5770
5934
|
let field = getFormFieldByKey(this.formFields, fieldKey);
|
|
5771
|
-
|
|
5935
|
+
const fieldIndex = this.formFields.findIndex((_) => {
|
|
5772
5936
|
return field.key === _.key;
|
|
5773
5937
|
});
|
|
5774
5938
|
field = appendFormFieldMessage(field, message);
|
|
@@ -5781,7 +5945,7 @@ class KwikIDFormViewComponent {
|
|
|
5781
5945
|
}
|
|
5782
5946
|
fieldMessageHide(fieldKey, message) {
|
|
5783
5947
|
let field = getFormFieldByKey(this.formFields, fieldKey);
|
|
5784
|
-
|
|
5948
|
+
const fieldIndex = this.formFields.findIndex((_) => {
|
|
5785
5949
|
return field.key === _.key;
|
|
5786
5950
|
});
|
|
5787
5951
|
field = removeFormFieldMessage(field, message);
|
|
@@ -5795,7 +5959,7 @@ class KwikIDFormViewComponent {
|
|
|
5795
5959
|
fieldApiTimerMessageShow(fieldKey, timer) {
|
|
5796
5960
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5797
5961
|
let field = getFormFieldByKey(this.formFields, fieldKey);
|
|
5798
|
-
|
|
5962
|
+
const fieldIndex = this.formFields.findIndex((_) => {
|
|
5799
5963
|
return field.key === _.key;
|
|
5800
5964
|
});
|
|
5801
5965
|
field = setApiTimerMessage(field, timer);
|
|
@@ -5811,7 +5975,7 @@ class KwikIDFormViewComponent {
|
|
|
5811
5975
|
fieldApiTimerMessageHide(fieldKey) {
|
|
5812
5976
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5813
5977
|
let field = getFormFieldByKey(this.formFields, fieldKey);
|
|
5814
|
-
|
|
5978
|
+
const fieldIndex = this.formFields.findIndex((_) => {
|
|
5815
5979
|
return field.key === _.key;
|
|
5816
5980
|
});
|
|
5817
5981
|
field = setApiTimerMessage(field, undefined);
|
|
@@ -5822,6 +5986,7 @@ class KwikIDFormViewComponent {
|
|
|
5822
5986
|
FIELD_CONFIG: field,
|
|
5823
5987
|
FORM_FIELDS: this.formFields,
|
|
5824
5988
|
FORM_DATA: this.formData,
|
|
5989
|
+
CAMERA_DATA: this.cameraData,
|
|
5825
5990
|
TASK_DATA: this.taskData,
|
|
5826
5991
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
5827
5992
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -5991,7 +6156,7 @@ class KwikIDFormViewComponent {
|
|
|
5991
6156
|
let sourceValue = yield source.getValueFromSource(action.props.value.source);
|
|
5992
6157
|
if (checkObjectKeyExists(action.props, "options")) {
|
|
5993
6158
|
if (checkObjectKeyExists(action.props.options, "appendToPath")) {
|
|
5994
|
-
|
|
6159
|
+
const appendToPath = yield source.getValueFromSource(action.props.options.appendToPath.source);
|
|
5995
6160
|
if (isNotEmptyValue(appendToPath)) {
|
|
5996
6161
|
const appendToPathStr = replaceString(appendToPath.match(`${action.props.options.appendToPath.filterSourceValue}`)[0], "[^a-zA-Z0-9_]", "_");
|
|
5997
6162
|
const optionsPath = `${action.props.options.path}${appendToPathStr}`;
|
|
@@ -6033,10 +6198,11 @@ class KwikIDFormViewComponent {
|
|
|
6033
6198
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6034
6199
|
const entrypointApiKey = action.props.apiKey;
|
|
6035
6200
|
let field = getFormFieldByKey(this.formFields, action.props.fieldKey);
|
|
6036
|
-
const endpoints = field.api
|
|
6037
|
-
const nextApiIndex = endpoints.findIndex((api) => api.apiKey
|
|
6201
|
+
const { endpoints } = field.api;
|
|
6202
|
+
const nextApiIndex = endpoints.findIndex((api) => api.apiKey === entrypointApiKey);
|
|
6038
6203
|
const apiConfig = endpoints[nextApiIndex];
|
|
6039
6204
|
const response = yield this.handleFieldApiCall(field, apiConfig);
|
|
6205
|
+
// eslint-disable-next-line prefer-destructuring
|
|
6040
6206
|
field = response.field;
|
|
6041
6207
|
field.api.endpoints[nextApiIndex] = response.api;
|
|
6042
6208
|
});
|
|
@@ -6045,7 +6211,7 @@ class KwikIDFormViewComponent {
|
|
|
6045
6211
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6046
6212
|
const field = getFormFieldByKey(this.formFields, action.props.fieldKey);
|
|
6047
6213
|
let multipleApiCallResponses = {};
|
|
6048
|
-
field.api.endpoints.
|
|
6214
|
+
field.api.endpoints.forEach((api) => {
|
|
6049
6215
|
if (checkObjectKeyExists(api.response, "value"))
|
|
6050
6216
|
multipleApiCallResponses = setValueToObjectPath(multipleApiCallResponses, `${api.apiKey}`, api.response.value);
|
|
6051
6217
|
});
|
|
@@ -6067,11 +6233,11 @@ class KwikIDFormViewComponent {
|
|
|
6067
6233
|
taskMultipleApiCalls(action, object) {
|
|
6068
6234
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6069
6235
|
this.showApiLoader();
|
|
6070
|
-
|
|
6236
|
+
const multipleApiConfig = this.formConfig.apis[action.props.formApiKey];
|
|
6071
6237
|
if (checkObjectKeyExists(action.props, "apiKey")) {
|
|
6072
6238
|
const entrypointApiKey = action.props.apiKey;
|
|
6073
|
-
const endpoints = multipleApiConfig
|
|
6074
|
-
const nextApiIndex = endpoints.findIndex((api) => api.apiKey
|
|
6239
|
+
const { endpoints } = multipleApiConfig;
|
|
6240
|
+
const nextApiIndex = endpoints.findIndex((api) => api.apiKey === entrypointApiKey);
|
|
6075
6241
|
const apiConfig = endpoints[nextApiIndex];
|
|
6076
6242
|
const response = yield this.handleApiCall(apiConfig);
|
|
6077
6243
|
multipleApiConfig.endpoints[nextApiIndex] = response.api;
|
|
@@ -6084,6 +6250,7 @@ class KwikIDFormViewComponent {
|
|
|
6084
6250
|
API_CONFIG: multipleApiConfig,
|
|
6085
6251
|
FORM_FIELDS: this.formFields,
|
|
6086
6252
|
FORM_DATA: this.formData,
|
|
6253
|
+
CAMERA_DATA: this.cameraData,
|
|
6087
6254
|
TASK_DATA: this.taskData,
|
|
6088
6255
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
6089
6256
|
ALL_FORMS_DATA: this.allFormsData,
|
|
@@ -6097,7 +6264,7 @@ class KwikIDFormViewComponent {
|
|
|
6097
6264
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6098
6265
|
const multipleApiConfig = this.formConfig.apis[action.props.formApiKey];
|
|
6099
6266
|
let multipleApiCallResponses = {};
|
|
6100
|
-
multipleApiConfig.endpoints.
|
|
6267
|
+
multipleApiConfig.endpoints.forEach((api) => {
|
|
6101
6268
|
if (checkObjectKeyExists(api.response, "value"))
|
|
6102
6269
|
multipleApiCallResponses = setValueToObjectPath(multipleApiCallResponses, `${api.apiKey}`, api.response.value);
|
|
6103
6270
|
});
|
|
@@ -6136,11 +6303,12 @@ class KwikIDFormViewComponent {
|
|
|
6136
6303
|
if (checkObjectKeyExists(action.props.url, "url")) {
|
|
6137
6304
|
let timeout = 2000;
|
|
6138
6305
|
if (checkObjectKeyExists(action.props.url, "timeout") &&
|
|
6139
|
-
typeof action.props.url.timeout
|
|
6306
|
+
typeof action.props.url.timeout === "number") {
|
|
6307
|
+
// eslint-disable-next-line prefer-destructuring
|
|
6140
6308
|
timeout = action.props.url.timeout;
|
|
6141
6309
|
}
|
|
6142
6310
|
this.triggerLogs(ELogEventType$1.FORM__REDIRECT_URL, {
|
|
6143
|
-
timeout
|
|
6311
|
+
timeout,
|
|
6144
6312
|
redirect_url: action.props.url
|
|
6145
6313
|
});
|
|
6146
6314
|
setTimeout(() => {
|
|
@@ -6165,12 +6333,14 @@ class KwikIDFormViewComponent {
|
|
|
6165
6333
|
throw new Error(`formGroup or formData is 'undefined'.`);
|
|
6166
6334
|
}
|
|
6167
6335
|
else {
|
|
6168
|
-
|
|
6169
|
-
for (
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6336
|
+
const formDataInKwikUIFormat = {};
|
|
6337
|
+
for (const fieldKey in formData) {
|
|
6338
|
+
if (isNotEmptyValue(fieldKey)) {
|
|
6339
|
+
const field = getFormFieldByKey(this.formFields, fieldKey);
|
|
6340
|
+
if (!isUndefined(field) && !isNull(field)) {
|
|
6341
|
+
formDataInKwikUIFormat[fieldKey] =
|
|
6342
|
+
convertFormFieldValueToKwikUIFormat(field, formData[fieldKey]);
|
|
6343
|
+
}
|
|
6174
6344
|
}
|
|
6175
6345
|
}
|
|
6176
6346
|
this.formGroup.patchValue(formDataInKwikUIFormat, { emitEvent: false });
|
|
@@ -6268,7 +6438,7 @@ class KwikIDFormViewComponent {
|
|
|
6268
6438
|
showErrorPreview(previewProperties) {
|
|
6269
6439
|
this.showPreview({
|
|
6270
6440
|
html: {
|
|
6271
|
-
after: `<div style
|
|
6441
|
+
after: `<div style="padding-bottom:0.25rem;padding-top: 0.25rem;position: absolute;margin-top: calc(50vh);font-size: 1.4rem;background: white;padding: 2rem;border-radius: 1rem;box-shadow: 0px 0px 10px -3px black;overflow: auto;height: fit-content;max-height: 90vh; width: 70vw; margin-left: calc(15vw); line-height: 2rem;">Error: ${previewProperties.message.message}</div>`
|
|
6272
6442
|
},
|
|
6273
6443
|
type: "popup"
|
|
6274
6444
|
});
|
|
@@ -6277,8 +6447,8 @@ class KwikIDFormViewComponent {
|
|
|
6277
6447
|
const popupFormConfig = this.formConfig.popupForms[popupFormKey];
|
|
6278
6448
|
this.onActionShowPopupForm.emit({
|
|
6279
6449
|
activeFormData: mergeObjects(this.formData, this.taskData),
|
|
6280
|
-
popupFormConfig
|
|
6281
|
-
popupType
|
|
6450
|
+
popupFormConfig,
|
|
6451
|
+
popupType
|
|
6282
6452
|
});
|
|
6283
6453
|
}
|
|
6284
6454
|
alertShow(type, message) {
|
|
@@ -6382,10 +6552,10 @@ class KwikIDFormViewComponent {
|
|
|
6382
6552
|
break;
|
|
6383
6553
|
case EActionKey.FIELD_ERROR_SHOW:
|
|
6384
6554
|
if (checkObjectKeyExists(action.props.message, "source")) {
|
|
6385
|
-
const
|
|
6386
|
-
let fieldErrorShowSourceValue = yield
|
|
6387
|
-
if (typeof fieldErrorShowSourceValue
|
|
6388
|
-
typeof fieldErrorShowSourceValue
|
|
6555
|
+
const fieldErrorShowSource = new Source(object);
|
|
6556
|
+
let fieldErrorShowSourceValue = yield fieldErrorShowSource.getValueFromSource(action.props.message.source);
|
|
6557
|
+
if (typeof fieldErrorShowSourceValue === "string" ||
|
|
6558
|
+
typeof fieldErrorShowSourceValue === "number") {
|
|
6389
6559
|
fieldErrorShowSourceValue = String(fieldErrorShowSourceValue);
|
|
6390
6560
|
}
|
|
6391
6561
|
else {
|
|
@@ -6398,10 +6568,10 @@ class KwikIDFormViewComponent {
|
|
|
6398
6568
|
break;
|
|
6399
6569
|
case EActionKey.FIELD_ERROR_HIDE:
|
|
6400
6570
|
if (checkObjectKeyExists(action.props.message, "source")) {
|
|
6401
|
-
const
|
|
6402
|
-
let fieldErrorHideSourceValue = yield
|
|
6403
|
-
if (typeof fieldErrorHideSourceValue
|
|
6404
|
-
typeof fieldErrorHideSourceValue
|
|
6571
|
+
const fieldErrorHideSource = new Source(object);
|
|
6572
|
+
let fieldErrorHideSourceValue = yield fieldErrorHideSource.getValueFromSource(action.props.message.source);
|
|
6573
|
+
if (typeof fieldErrorHideSourceValue === "string" ||
|
|
6574
|
+
typeof fieldErrorHideSourceValue === "number") {
|
|
6405
6575
|
fieldErrorHideSourceValue = String(fieldErrorHideSourceValue);
|
|
6406
6576
|
}
|
|
6407
6577
|
else {
|
|
@@ -6473,23 +6643,24 @@ class KwikIDFormViewComponent {
|
|
|
6473
6643
|
break;
|
|
6474
6644
|
case EActionKey.REDIRECT_TO_URL:
|
|
6475
6645
|
if (checkObjectKeyExists(action.props.url, "source")) {
|
|
6476
|
-
const
|
|
6477
|
-
let redirectToUrlSourceValue = yield
|
|
6646
|
+
const redirectToUrlSource = new Source(object);
|
|
6647
|
+
let redirectToUrlSourceValue = yield redirectToUrlSource.getValueFromSource(action.props.url.source);
|
|
6478
6648
|
if (isEmptyString(redirectToUrlSourceValue)) {
|
|
6479
6649
|
redirectToUrlSourceValue = "";
|
|
6480
6650
|
}
|
|
6481
6651
|
action = setValueToObjectPath(action, "props.url.url", redirectToUrlSourceValue);
|
|
6482
6652
|
}
|
|
6483
6653
|
this.redirectToUrl(action);
|
|
6654
|
+
break;
|
|
6484
6655
|
case EActionKey.PREVIEW_DIALOG_SHOW:
|
|
6485
6656
|
this.showPreview(action.props);
|
|
6486
6657
|
break;
|
|
6487
6658
|
case EActionKey.PREVIEW_ERROR_SHOW:
|
|
6488
6659
|
if (checkObjectKeyExists(action.props.message, "source")) {
|
|
6489
|
-
const
|
|
6490
|
-
let previewErrorShowSourceValue = yield
|
|
6491
|
-
if (typeof previewErrorShowSourceValue
|
|
6492
|
-
typeof previewErrorShowSourceValue
|
|
6660
|
+
const previewErrorShowSource = new Source(object);
|
|
6661
|
+
let previewErrorShowSourceValue = yield previewErrorShowSource.getValueFromSource(action.props.message.source);
|
|
6662
|
+
if (typeof previewErrorShowSourceValue === "string" ||
|
|
6663
|
+
typeof previewErrorShowSourceValue === "number") {
|
|
6493
6664
|
previewErrorShowSourceValue = String(previewErrorShowSourceValue);
|
|
6494
6665
|
}
|
|
6495
6666
|
else {
|
|
@@ -6539,10 +6710,10 @@ class KwikIDFormViewComponent {
|
|
|
6539
6710
|
break;
|
|
6540
6711
|
case EActionKey.SET_HTML:
|
|
6541
6712
|
if (checkObjectKeyExists(action.props.message, "source")) {
|
|
6542
|
-
const
|
|
6543
|
-
let fieldHtmlMessageSourceValue = yield
|
|
6544
|
-
if (typeof fieldHtmlMessageSourceValue
|
|
6545
|
-
typeof fieldHtmlMessageSourceValue
|
|
6713
|
+
const fieldHtmlMessageSource = new Source(object);
|
|
6714
|
+
let fieldHtmlMessageSourceValue = yield fieldHtmlMessageSource.getValueFromSource(action.props.message.source);
|
|
6715
|
+
if (typeof fieldHtmlMessageSourceValue === "string" ||
|
|
6716
|
+
typeof fieldHtmlMessageSourceValue === "number") {
|
|
6546
6717
|
fieldHtmlMessageSourceValue = String(fieldHtmlMessageSourceValue);
|
|
6547
6718
|
}
|
|
6548
6719
|
else {
|
|
@@ -6560,7 +6731,7 @@ class KwikIDFormViewComponent {
|
|
|
6560
6731
|
}
|
|
6561
6732
|
}
|
|
6562
6733
|
/** @nocollapse */ KwikIDFormViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormViewComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: KwikIDFormViewService }, { token: KwikIDFormViewApiService }, { token: TuiPushService }, { token: TuiAlertService }, { token: TuiPreviewDialogService }, { token: TuiDialogService }, { token: i3.KwikUILoaderService }, { token: i4.KwikIDCameraRecordService }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
6563
|
-
/** @nocollapse */ KwikIDFormViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: { allFormsData: "allFormsData", extraData: "extraData", apiCallResponse: "apiCallResponse", buttonClickResponse: "buttonClickResponse", formConfig: "formConfig", formData: "formData", isMobileView: "isMobileView", popupFormCallback: "popupFormCallback", userConfig: "userConfig", stepConfig: "stepConfig" }, outputs: { getLogs: "getLogs", getUnsavedDataState: "getUnsavedDataState", onActionShowPopupForm: "onActionShowPopupForm", onClickApiCall: "onClickApiCall", onClickViewFile: "onClickViewFile", onClickFormFieldButton: "onClickFormFieldButton", onClickGoBack: "onClickGoBack", onClickSaveForm: "onClickSaveForm", onClickViewForms: "onClickViewForms" }, providers: [KwikIDFormViewService, KwikIDFormViewApiService], viewQueries: [{ propertyName: "formFieldContainerRef", first: true, predicate: ["formFieldContainerRef"], descendants: true }, { propertyName: "dialog", first: true, predicate: ["dialog"], descendants: true }, { propertyName: "preview", first: true, predicate: ["preview"], descendants: true }, { propertyName: "formFieldsRef", predicate: ["formFieldsRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"kwikid-form-container\"\n *ngIf=\"!loading\"\n>\n <div\n id=\"uf-form-fields-header-container\"\n *ngIf=\"\n !formConfig.properties?.header?.title?.hidden ||\n !formConfig.properties?.header?.logo?.hidden ||\n !formConfig.properties?.header?.steps?.hidden ||\n !formConfig.properties?.header?.backButton?.hidden\n \"\n >\n <img\n id=\"uf-header-logo\"\n *ngIf=\"!formConfig.properties?.header?.logo?.hidden && isMobileView\"\n [src]=\"formConfig.properties?.header?.logo?.src\"\n [alt]=\"formConfig.properties?.header?.logo?.alt\"\n [style]=\"\n formConfig.properties?.header?.logo?.styles ?? '' | styleSanitizer\n \"\n />\n <div id=\"uf-form-fields-header-main\">\n <div id=\"uf-form-fields-header-left\">\n <kwikui-button\n *ngIf=\"\n !formConfig.properties?.header.backButton.hidden && isMobileView\n \"\n [disabled]=\"backButton.disabled\"\n [showLoader]=\"backButton.showLoader\"\n appearance=\"mono\"\n icon=\"tuiIconArrowLeft\"\n shape=\"rounded\"\n (onClick)=\"\n handleOnClickGoBack(\n $event,\n formConfig.properties?.header.backButton.mode\n )\n \"\n ></kwikui-button>\n </div>\n <div id=\"uf-form-fields-header-right\">\n <div\n id=\"uf-form-fields-title\"\n *ngIf=\"!formConfig.properties?.header.title.hidden\"\n >{{ formConfig.properties?.header.title.label }}</div\n >\n <div\n id=\"uf-form-fields-steps\"\n *ngIf=\"!formConfig.properties?.header.steps.hidden\"\n >\n Step {{ formConfig.sequenceNo }} of {{ formConfig.formsListLength }}\n </div>\n </div>\n </div>\n <hr\n *ngIf=\"\n !formConfig.properties?.header.title.hidden ||\n !formConfig.properties?.header.steps.hidden ||\n !formConfig.properties?.header.backButton.hidden\n \"\n />\n </div>\n <form\n #formFieldContainerRef\n class=\"kwikid-form show\"\n [style]=\"formConfig.properties?.main?.styles ?? '' | styleSanitizer\"\n [formGroup]=\"formGroup\"\n >\n <ng-container\n *ngFor=\"\n let field of formFields;\n let i = index;\n trackBy: getUniqueIdentifier\n \"\n >\n <ng-container [ngSwitch]=\"field.type\">\n <!-- HTML Content -->\n <ng-container *ngSwitchCase=\"'html'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <div [innerHtml]=\"field.html | kwikuiSafeHtml\"></div>\n </div>\n </ng-container>\n <!-- Form Title -->\n <ng-container *ngSwitchCase=\"'title'\">\n <div\n #formFieldsRef\n class=\"title\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n [class.hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <div>\n {{ field.label }}\n </div>\n <kwikui-button\n *ngIf=\"field?.reset\"\n appearance=\"whiteblock\"\n size=\"s\"\n [label]=\"field?.properties?.resetButtonLabel ?? 'Reset'\"\n (onClick)=\"handleOnClickResetFormFields($event, field)\"\n ></kwikui-button>\n </div>\n </ng-container>\n <!-- Button -->\n <ng-container *ngSwitchCase=\"'button'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button\n [appearance]=\"field?.properties?.appearance ?? 'primary'\"\n [class]=\"field?.properties?.class\"\n [disabled]=\"field?.disabled\"\n [icon]=\"field?.properties?.icon\"\n [iconRight]=\"field?.properties?.iconRight\"\n [id]=\"field?.key\"\n [label]=\"field?.label\"\n [shape]=\"field?.properties?.shape\"\n [showLoader]=\"field?.properties?.loading ?? false\"\n [size]=\"field?.properties?.size\"\n [styles]=\"field?.properties?.styles\"\n [type]=\"'button'\"\n (onClick)=\"handleOnClickFormFieldButton(field)\"\n ></kwikui-button>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Text -->\n <ng-container *ngSwitchCase=\"'text'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input\n [case]=\"field?.properties?.case\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [type]=\"'text'\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Currency -->\n <ng-container *ngSwitchCase=\"'currency'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-currency\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [currencyType]=\"field?.properties?.currencyType\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n [value]=\"formGroup.controls[field.key].value\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-currency>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Email -->\n <ng-container *ngSwitchCase=\"'email'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-email\n [case]=\"field?.properties?.case\"\n [disabled]=\"field?.disabled\"\n [domains]=\"field?.properties?.domains\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-email>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Password -->\n <ng-container *ngSwitchCase=\"'password'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-password\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [hintContent]=\"field?.properties?.hintContent\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-password>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Textarea -->\n <ng-container *ngSwitchCase=\"'textarea'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-textarea\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-textarea>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Checkbox -->\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-checkbox\n [contentAlign]=\"field?.properties?.contentAlign ?? 'left'\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.properties?.placeholder\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size ?? 'l'\"\n [validators]=\"field?.validators\"\n [variant]=\"field?.properties?.variant ?? 'block'\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-checkbox>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Number -->\n <ng-container *ngSwitchCase=\"'number'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-number\n [decimal]=\"field?.properties?.decimal\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix ?? ''\"\n [precision]=\"field?.properties?.precision\"\n [prefix]=\"field?.properties?.prefix ?? ''\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-number>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Date -->\n <ng-container *ngSwitchCase=\"'date'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-date\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [maxCalculatedFromToday]=\"\n field?.properties?.maxCalculatedFromToday\n \"\n [min]=\"field?.properties?.min\"\n [minCalculatedFromToday]=\"\n field?.properties?.minCalculatedFromToday\n \"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-date>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Time -->\n <ng-container *ngSwitchCase=\"'time'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-time\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [items]=\"field?.properties?.items\"\n [label]=\"field?.label\"\n [mode]=\"field?.properties?.mode\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-time>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Phone -->\n <ng-container *ngSwitchCase=\"'phone'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-phone\n [countryCode]=\"field?.properties?.countryCode\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [phoneMaskAfterCountryCode]=\"\n field?.properties?.phoneMaskAfterCountryCode\n \"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [removeCountryCodeFromValue]=\"\n field?.properties?.removeCountryCodeFromValue\n \"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-phone>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Radio -->\n <ng-container *ngSwitchCase=\"'radio'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto; padding: 0px 0.5rem\"\n >\n <kwikui-input-radio\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [items]=\"field?.options\"\n [label]=\"field?.label\"\n [orientation]=\"field?.properties?.orientation\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-radio>\n </label>\n <ng-template #labelTemplate>\n <p\n class=\"tui-space_bottom-2\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Dropdown -->\n <ng-container *ngSwitchCase=\"'select'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-select\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [options]=\"field.options\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [searchable]=\"field?.properties?.searchable\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-select>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Slider -->\n <ng-container *ngSwitchCase=\"'slider'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-slider\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [quantum]=\"field?.properties?.quantum\"\n [size]=\"field?.properties?.size\"\n [steps]=\"field?.properties?.steps\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-slider>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- API Call -->\n <ng-container *ngSwitchCase=\"'api'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button-api-call\n [apiStatus]=\"field?.api?.status?.value\"\n [apiTimer]=\"field?.api?.timer\"\n [class]=\"field?.class\"\n [disabled]=\"field?.disabled\"\n [id]=\"field.key\"\n [label]=\"field?.api?.status?.labels[field?.api?.status?.value]\"\n [showLoader]=\"field?.disabled === 'loading'\"\n [size]=\"field?.properties?.size\"\n [styles]=\"\n field?.properties?.styles\n ? field?.properties?.styles\n : 'width: fit-content'\n \"\n (onClick)=\"handleOnClickApiCall($event)\"\n (onApiTimerStop)=\"handleOnApiTimerStop($event)\"\n ></kwikui-button-api-call>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Live Location -->\n <ng-container *ngSwitchCase=\"'live-location'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button-live-location\n [class]=\"field?.class\"\n [disabled]=\"field?.disabled\"\n [id]=\"field.key\"\n [label]=\"field?.api?.status?.labels[field?.api?.status?.value]\"\n [liveLocationStatus]=\"field?.api?.status?.value\"\n [shape]=\"field?.properties?.shape\"\n [isShowLatLongCaptureTimestamp]=\"\n field?.properties?.isShowLatLongCaptureTimestamp\n \"\n [showLoader]=\"field?.disabled\"\n [size]=\"field?.properties?.size\"\n styles=\"width: fit-content\"\n (onClick)=\"handleOnClickLiveLocation($event)\"\n (onLocationPermission)=\"handleOnLocationPermission($event)\"\n ></kwikui-button-live-location>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Mobile OTP -->\n <ng-container *ngSwitchCase=\"'otp'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-otp\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [mask]=\"field?.properties?.mask\"\n [mode]=\"field?.properties?.mode\"\n [otpLength]=\"field?.properties?.otpLength\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-otp>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Aadhaar Number -->\n <ng-container *ngSwitchCase=\"'aadhaar-number'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-aadhaar\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [mask]=\"field?.properties?.mask\"\n [placeholder]=\"field?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-aadhaar>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Preview Image -->\n <ng-container *ngSwitchCase=\"'image'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-image\n [altText]=\"field?.properties?.altText\"\n [class]=\"field?.properties?.class\"\n [html]=\"field?.properties?.html\"\n [id]=\"field.key\"\n [imageSrc]=\"formGroup.controls[field.key].value ?? ''\"\n [imageType]=\"field?.properties?.imageType\"\n [loadingType]=\"field?.properties?.loadingType\"\n [styles]=\"field?.properties?.styles\"\n ></kwikui-image>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- File Upload -->\n <ng-container *ngSwitchCase=\"'file'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto\"\n >\n <kwikui-input-files\n [accept]=\"field?.properties?.accept\"\n [class]=\"field?.properties?.class\"\n [disabled]=\"field?.disabled\"\n [files]=\"files[field.key]\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field?.key\"\n [label]=\"field?.properties?.label\"\n [link]=\"field?.properties?.link\"\n [maxFileSize]=\"field?.properties?.maxFileSize\"\n [multiple]=\"field?.properties?.multiple\"\n [setFileTypesToForm]=\"['NORMAL']\"\n [styles]=\"field?.properties?.styles\"\n [validators]=\"field?.validators\"\n [showViewButton]=\"field?.properties?.showViewButton\"\n (getKeyValue)=\"handleGetKeyValueFile($event)\"\n (getRemovedFile)=\"handleRemovedFile($event)\"\n (getViewButtonClick)=\"handleViewButtonClick($event, field)\"\n ></kwikui-input-files>\n </label>\n <ng-template #labelTemplate>\n <p\n style=\"padding: 0px 0.25rem; margin-bottom: 0.25rem\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Camera Capture -->\n <ng-container *ngSwitchCase=\"'capture'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n *ngIf=\"\n field?.label !== '' &&\n field?.label !== undefined &&\n field?.label !== null\n \"\n style=\"min-height: auto\"\n >\n <p\n *ngIf=\"field?.label !== ''\"\n style=\"padding: 0px 0.25rem; margin-bottom: 0.5rem\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </label>\n <kwikui-input-camera\n [buttonText]=\"field?.properties?.buttonText\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [icon]=\"field?.properties?.icon\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [mediaFiles]=\"mediaFiles[field.key]\"\n [properties]=\"field?.properties\"\n [showMediaFiles]=\"field?.properties?.showMediaFiles\"\n [type]=\"'capture'\"\n [validators]=\"field?.validators\"\n (onClick)=\"handleOnClickInputCamera($event, field)\"\n (getRemovedFile)=\"handleOnClickGetRemovedMediaFile($event)\"\n ></kwikui-input-camera>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Camera Record -->\n <ng-container *ngSwitchCase=\"'record'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n *ngIf=\"\n field?.label !== '' &&\n field?.label !== undefined &&\n field?.label !== null\n \"\n style=\"min-height: auto\"\n >\n <p\n *ngIf=\"field?.label !== ''\"\n style=\"padding: 0px 0.25rem; margin-bottom: 0.5rem\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </label>\n <kwikui-input-camera\n [buttonText]=\"field?.properties?.buttonText\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [icon]=\"field?.properties?.icon\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [mediaFiles]=\"mediaFiles[field.key]\"\n [properties]=\"field?.properties\"\n [showMediaFiles]=\"field?.properties?.showMediaFiles\"\n [type]=\"'record'\"\n [validators]=\"field?.validators\"\n (onClick)=\"handleOnClickInputCamera($event, field)\"\n (getRemovedFile)=\"handleOnClickGetRemovedMediaFile($event)\"\n ></kwikui-input-camera>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Star Rating -->\n <ng-container *ngSwitchCase=\"'star-rating'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto; padding: 0px 0.5rem\"\n >\n <kwikui-star-rating\n [color]=\"field?.properties?.color\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [icon]=\"field?.properties?.icon\"\n [iconMarked]=\"field?.properties?.iconMarked\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-star-rating>\n </label>\n <ng-template #labelTemplate>\n <p>\n <b\n >{{ field?.properties?.placeholder }}\n <span *ngIf=\"field.validators?.required\">*</span></b\n >\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n </ng-container>\n </ng-container>\n </form>\n <div\n class=\"kwikid-form-buttons\"\n *ngIf=\"\n !formConfig.properties.footer.viewFormsButton.hidden ||\n !formConfig.properties.footer.saveButton.hidden\n \"\n >\n <kwikui-button\n *ngIf=\"\n !formConfig.properties.footer.viewFormsButton.hidden && isMobileView\n \"\n [appearance]=\"'secondary'\"\n [disabled]=\"viewFormsButton.disabled\"\n [label]=\"formConfig.properties.footer.viewFormsButton.label\"\n [showLoader]=\"viewFormsButton.showLoader\"\n [styles]=\"'width: 100%'\"\n (onClick)=\"handleOnClickViewForms($event)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"!formConfig.properties.footer.saveButton.hidden\"\n [disabled]=\"saveFormButton.disabled\"\n [label]=\"formConfig.properties.footer.saveButton.label\"\n [showLoader]=\"saveFormButton.showLoader\"\n [styles]=\"'width: 100%'\"\n (onClick)=\"handleOnClickSaveForm($event)\"\n ></kwikui-button>\n </div>\n</div>\n<div\n class=\"kwikid-form-container-loading\"\n *ngIf=\"loading\"\n>\n <div\n *ngFor=\"let item of [].constructor(7); let i = index\"\n class=\"large-wrapper tui-skeleton tui-skeleton_rounded\"\n >\n </div>\n</div>\n\n<kwikui-loader></kwikui-loader>\n\n<tui-push\n id=\"field-error-notification\"\n *tuiPush=\"showErrorNotification\"\n heading=\"Missing/Incorrect Fields!\"\n type=\"Error\"\n (close)=\"toggleErrorNotification(false)\"\n>\n <tui-svg\n src=\"tuiIconXCircle\"\n style=\"color: #fff !important\"\n >\n </tui-svg>\n</tui-push>\n\n<tui-push\n id=\"permission-error-notification\"\n *tuiPush=\"showPermissionErrorNotification\"\n heading=\"Please provide required permissions!\"\n type=\"Error\"\n (close)=\"togglePermissionErrorNotification(false)\"\n>\n <tui-svg\n src=\"tuiIconXCircle\"\n style=\"color: #fff !important\"\n >\n </tui-svg>\n</tui-push>\n\n<ng-template\n #preview\n let-preview\n>\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n class=\"preview-container\"\n >\n <tui-preview-title *ngIf=\"previewProperties.title !== ''\">{{\n previewProperties.title\n }}</tui-preview-title>\n\n <ng-container *ngIf=\"!previewProperties.unavailable\">\n <div\n *ngIf=\"previewProperties?.html?.before !== ''\"\n class=\"preview-html preview-html-before\"\n [style]=\"previewProperties?.html?.beforeStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.before | kwikuiSafeHtml\"\n ></div>\n\n <!-- Content within the iframe -->\n <div\n class=\"preview-iframe-content\"\n [style]=\"\n previewProperties?.iframe?.containerStyles ?? '' | styleSanitizer\n \"\n *ngIf=\"previewProperties.iframe.src !== ''\"\n >\n <!-- Your HTML content here -->\n <iframe\n [src]=\"previewProperties.iframe.src | kwikuiSafeUrl\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n allowfullscreen\n [title]=\"previewProperties.iframe.title\"\n class=\"preview-iframe\"\n scrolling=\"auto\"\n ></iframe>\n </div>\n\n <div\n *ngIf=\"previewProperties?.html?.after !== ''\"\n class=\"preview-html preview-html-after\"\n [style]=\"previewProperties?.html?.afterStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.after | kwikuiSafeHtml\"\n ></div>\n </ng-container>\n\n <ng-container *ngIf=\"previewProperties.unavailable\">\n <div class=\"preview-unavailable\">\n <tui-svg\n src=\"tuiIconFileLarge\"\n class=\"t-icon\"\n ></tui-svg>\n <div>Preview unavailable</div>\n </div>\n </ng-container>\n\n <button\n tuiIconButton\n tuiPreviewAction\n icon=\"tuiIconCloseLarge\"\n title=\"Close\"\n type=\"button\"\n (click)=\"preview.complete()\"\n ></button>\n </tui-preview>\n</ng-template>\n\n<ng-template\n #dialog\n let-dialog\n>\n <div class=\"preview-container\">\n <ng-container *ngIf=\"!previewProperties.unavailable\">\n <div\n *ngIf=\"previewProperties?.html?.before !== ''\"\n class=\"preview-html preview-html-before\"\n [style]=\"previewProperties?.html?.beforeStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.before | kwikuiSafeHtml\"\n ></div>\n\n <!-- Content within the iframe -->\n <div\n class=\"preview-iframe-content\"\n [style]=\"\n previewProperties?.iframe?.containerStyles ?? '' | styleSanitizer\n \"\n *ngIf=\"previewProperties.iframe.src !== ''\"\n >\n <!-- Your HTML content here -->\n <iframe\n [src]=\"previewProperties.iframe.src | kwikuiSafeUrl\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n allowfullscreen\n [title]=\"previewProperties.iframe.title\"\n class=\"preview-iframe\"\n scrolling=\"auto\"\n ></iframe>\n </div>\n\n <div\n *ngIf=\"previewProperties?.html?.after !== ''\"\n class=\"preview-html preview-html-after\"\n [style]=\"previewProperties?.html?.afterStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.after | kwikuiSafeHtml\"\n ></div>\n </ng-container>\n\n <ng-container *ngIf=\"previewProperties.unavailable\">\n <div class=\"preview-unavailable\">\n <tui-svg\n src=\"tuiIconFileLarge\"\n class=\"t-icon\"\n ></tui-svg>\n <div>Preview unavailable</div>\n </div>\n </ng-container>\n </div>\n</ng-template>\n\n<div\n id=\"kwikid-camera-container\"\n *ngIf=\"isShowCamera\"\n>\n <div\n id=\"kwikid-camera-wrapper\"\n [class.fullscreen]=\"isShowCameraFullscreen\"\n >\n <kwikid-camera\n [type]=\"cameraType\"\n [data]=\"cameraData\"\n [image]=\"cameraImage\"\n [video]=\"cameraVideo\"\n [config]=\"cameraConfig\"\n (getImage)=\"handleGetCameraMedia($event, 'CAPTURE')\"\n (getVideo)=\"handleGetCameraMedia($event, 'RECORD')\"\n (onClickBack)=\"handleOnClickCameraBack($event)\"\n (onClickClose)=\"handleOnClickCameraClose($event)\"\n (onClickSave)=\"handleOnClickSaveCameraMedia($event, cameraType)\"\n >\n <ng-container\n *ngIf=\"cameraType === 'CAPTURE'\"\n slot=\"capture-header\"\n >\n <div class=\"capture-header-container\">\n <div class=\"capture-header-left\"> </div>\n <div class=\"capture-header-center\">\n <kwikui-button\n *ngIf=\"cameraConfig?.header?.title !== ''\"\n appearance=\"whiteblock\"\n [label]=\"cameraConfig?.header?.title\"\n shape=\"rounded\"\n size=\"s\"\n ></kwikui-button>\n </div>\n <div class=\"capture-header-right\">\n <kwikui-button\n *ngIf=\"cameraConfig?.header?.isExpand\"\n id=\"kwikid-camera-header-enlarge-button\"\n appearance=\"whiteblock\"\n [icon]=\"\n isShowCameraFullscreen ? 'tuiIconMinimize2' : 'tuiIconMaximize2'\n \"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"isShowCameraFullscreen = !isShowCameraFullscreen\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"cameraConfig?.header?.isClose\"\n id=\"kwikid-camera-header-close-button\"\n appearance=\"whiteblock\"\n icon=\"tuiIconCloseLarge\"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"handleOnClickCameraClose($event)\"\n ></kwikui-button>\n </div>\n </div>\n </ng-container>\n <ng-container\n *ngIf=\"cameraType === 'RECORD'\"\n slot=\"record-header\"\n >\n <div class=\"record-header-container\">\n <div class=\"record-header-row row-1\">\n <div class=\"record-header-left\">\n <kwikui-button\n *ngIf=\"\n cameraConfig?.header?.isBack && cameraRecordingState == 'NONE'\n \"\n appearance=\"whiteblock\"\n icon=\"tuiIconArrowLeft\"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"handleOnClickCameraClose($event)\"\n ></kwikui-button>\n </div>\n <div class=\"record-header-center\">\n <kwikui-button\n *ngIf=\"cameraConfig?.header?.title !== ''\"\n appearance=\"whiteblock\"\n [label]=\"cameraConfig?.header?.title\"\n shape=\"rounded\"\n size=\"s\"\n ></kwikui-button>\n </div>\n <div class=\"record-header-right\">\n <kwikui-button\n *ngIf=\"cameraConfig?.header?.isExpand\"\n id=\"kwikid-camera-header-enlarge-button\"\n appearance=\"whiteblock\"\n [icon]=\"\n isShowCameraFullscreen\n ? 'tuiIconMinimize2'\n : 'tuiIconMaximize2'\n \"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"isShowCameraFullscreen = !isShowCameraFullscreen\"\n ></kwikui-button>\n </div>\n </div>\n <div class=\"record-header-row row-2\">\n <div\n id=\"blinking-dot-container\"\n [class.recording]=\"cameraRecordingState == 'RECORDING'\"\n [class.paused]=\"cameraRecordingState == 'PAUSED'\"\n [class.recorded]=\"\n cameraRecordingState == 'NONE' ||\n cameraRecordingState === 'RECORDED'\n \"\n >\n <div\n *ngIf=\"cameraRecordingState == 'RECORDING'\"\n class=\"dot recording blink\"\n >\n </div>\n <div\n *ngIf=\"cameraRecordingState === 'PAUSED'\"\n class=\"dot paused\"\n >\n </div>\n <div\n *ngIf=\"\n cameraRecordingState == 'NONE' ||\n cameraRecordingState === 'RECORDED'\n \"\n class=\"dot recorded\"\n >\n </div>\n <div>\n {{ cameraRecordingTime | formatTimer }}\n <ng-container\n *ngIf=\"cameraConfig?.others?.maxRecordingTimeInSeconds\"\n >\n /\n {{\n cameraConfig?.others?.maxRecordingTimeInSeconds\n | formatTimer\n }}\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </kwikid-camera>\n </div>\n</div>\n", styles: [".kwikid-form-container{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center}.kwikid-form.show{width:100%;height:100%;padding:1rem;overflow-y:auto;display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;scroll-behavior:smooth}.kwikid-form.show>*:not(:last-child){margin-bottom:1rem}.kwikid-form-buttons{width:100%;bottom:0px;padding:1rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.kwikid-form-buttons>*:not(:last-child){margin-right:1rem}.kwikid-form-buttons *{flex-grow:1}#uf-form-fields-header-container{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:flex-start;padding:1rem 1rem 0}#uf-form-fields-header-container>*:not(:last-child){margin-bottom:.5rem}#uf-form-fields-header-container #uf-header-logo{width:-moz-fit-content;width:fit-content;height:50px}#uf-form-fields-header-container #uf-form-fields-header-main{display:flex;flex-direction:row;align-content:center;justify-content:flex-start;align-items:center;width:100%}#uf-form-fields-header-container #uf-form-fields-header-main>*:not(:last-child){margin-right:.25rem}#uf-form-fields-header-container #uf-form-fields-header-main #uf-form-fields-header-right{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:flex-start}#uf-form-fields-header-container #uf-form-fields-header-main #uf-form-fields-header-right>*{margin-bottom:.5rem}#uf-form-fields-header-container hr{width:100%}#uf-form-fields-title{color:#000;font-size:1.75em;font-weight:bold}#uf-form-fields-steps{color:var(--color-on-secondary-container);font-size:1rem}.title{border-left:.25rem solid var(--tui-primary);padding:.75rem;font-size:1.4em;font-weight:bold;background-color:var(--tui-secondary);display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center}.title>*:not(:last-child){margin-right:.5rem}.title:not(:first-child){margin-top:.5rem}.title.hidden{display:none}.large-wrapper{width:100%;height:60px}.large-wrapper:first-child{margin-bottom:auto}.large-wrapper:last-child{margin-top:auto}.kwikid-form-container-loading{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;padding:1rem}.kwikid-form-container-loading>* :not(:last-child){margin-bottom:1rem}#field-error-notification,#permission-error-notification{background-color:var(--tui-error-fill);color:#fff!important}#field-error-notification .t-top,#permission-error-notification .t-top{color:#fff!important}#field-error-notification .t-close,#permission-error-notification .t-close{color:#fff!important}.preview-container{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;align-content:center;height:calc(100vh - 3rem)}@media only screen and (min-width: 768px){.preview-container{height:calc(100vh - 10rem);width:calc(100vw - 10rem)}}.preview-container>*:not(:last-child){margin-bottom:1rem}.preview-container .preview-html{flex-grow:1}.preview-container .preview-iframe-content{height:100%;flex-grow:1}.preview-container .preview-iframe-content .preview-iframe{width:100%;height:100%}.preview-container .preview-unavailable{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;color:#fff;font-size:1.2rem;top:50%;left:50%;width:100%;height:100vh}.preview-container .preview-unavailable>*:not(:last-child){margin-bottom:1rem}#kwikid-camera-container{width:100%;height:100%;position:fixed;top:50%;left:50%;background-color:#0000008f;transform:translate(-50%,-50%);z-index:100}#kwikid-camera-container #kwikid-camera-wrapper{width:min(80%);height:max(85%);box-shadow:#0000008f 0 22px 70px 4px;overflow:hidden;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:1rem;background-color:#000;transition:5s linear ease}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container{display:flex;width:100%;max-width:100%;padding:0}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container .capture-header-left{flex:1;text-align:left}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container .capture-header-center{flex:1;width:100%;min-width:max-content;text-align:center;margin:auto}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container .capture-header-right{flex:1;text-align:right;display:flex;justify-content:flex-end;grid-gap:1rem;gap:1rem}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container{display:flex;width:100%;max-width:100%;padding:0;color:#fff;flex-direction:column;justify-content:flex-start;align-items:stretch}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1{display:flex;flex-direction:row;justify-content:space-between;align-items:center;margin-bottom:1rem}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1 .record-header-left{flex:1;display:flex;justify-content:flex-start;grid-gap:1rem;gap:1rem;text-align:left}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1 .record-header-center{flex:1;width:100%;min-width:max-content;text-align:center;margin:auto}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1 .record-header-right{flex:1;text-align:right;display:flex;justify-content:flex-end;grid-gap:1rem;gap:1rem}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2{display:flex;flex-direction:row;justify-content:center;align-items:center}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;grid-gap:.25rem;gap:.25rem;padding:.35rem .6rem;width:-moz-fit-content;width:fit-content;border-radius:2rem;background-color:#f5f5f5}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container.recording{color:red;font-weight:bold}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container.paused{color:#525252;font-weight:bold}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container.recorded{color:#000;font-weight:bold}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot{display:inline-block;width:.75rem;height:.75rem;border-radius:100%}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.recording{background-color:red;box-shadow:0 0 5px -1px red}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.paused{background-color:#525252;box-shadow:0 0 5px -1px #000}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.recorded{background-color:#000;box-shadow:0 0 5px -1px #000}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.blink{animation:blinker 1s cubic-bezier(.5,0,1,1) infinite alternate}@keyframes blinker{0%{opacity:1}to{opacity:0}}#kwikid-camera-container #kwikid-camera-wrapper.fullscreen{width:100%;height:100%;border-radius:0;transition:5s linear ease}@media only screen and (max-width: 600px){#kwikid-camera-container #kwikid-camera-wrapper{width:100%;height:100%;border-radius:0;transition:5s linear ease}#kwikid-camera-container #kwikid-camera-wrapper #kwikid-camera-header-enlarge-button{display:none}}\n", "::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}\n"], components: [{ type: i3.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type", "pseudoHover"], outputs: ["onClick"] }, { type: i3.KwikUIMessagesComponent, selector: "kwikui-messages", inputs: ["id", "messages"] }, { type: i3.KwikUIInputComponent, selector: "kwikui-input", inputs: ["case", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "type", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputCurrencyComponent, selector: "kwikui-input-currency", inputs: ["currencyType", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators", "value"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputEmailComponent, selector: "kwikui-input-email", inputs: ["case", "disabled", "domains", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputPasswordComponent, selector: "kwikui-input-password", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUITextareaComponent, selector: "kwikui-textarea", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUICheckboxComponent, selector: "kwikui-checkbox", inputs: ["contentAlign", "disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "placeholder", "properties", "size", "validators", "variant"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputNumberComponent, selector: "kwikui-input-number", inputs: ["decimal", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "min", "placeholder", "postfix", "precision", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputDateComponent, selector: "kwikui-input-date", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "maxCalculatedFromToday", "min", "minCalculatedFromToday", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputTimeComponent, selector: "kwikui-input-time", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "items", "invalid", "label", "mode", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputPhoneComponent, selector: "kwikui-input-phone", inputs: ["countryCode", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "phoneMaskAfterCountryCode", "placeholder", "postfix", "prefix", "properties", "removeCountryCodeFromValue", "size", "validators"], outputs: ["getKeyValue"] }, { type: i5.TuiLabelComponent, selector: "label[tuiLabel]", inputs: ["tuiLabel", "context"] }, { type: i3.KwikUIInputRadioComponent, selector: "kwikui-input-radio", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "items", "label", "orientation", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputSelectComponent, selector: "kwikui-input-select", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "options", "placeholder", "properties", "searchable", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputSliderComponent, selector: "kwikui-input-slider", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "min", "placeholder", "postfix", "prefix", "properties", "quantum", "size", "steps", "type", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIButtonApiCallComponent, selector: "kwikui-button-api-call", inputs: ["apiTimer", "apiStatus", "class", "disabled", "id", "label", "shape", "showLoader", "size", "styles"], outputs: ["onClick", "onApiTimerStop"] }, { type: i3.KwikUIButtonLiveLocationComponent, selector: "kwikui-button-live-location", inputs: ["liveLocationStatus", "class", "disabled", "id", "label", "shape", "showLoader", "size", "styles", "isShowLatLongCaptureTimestamp"], outputs: ["onClick", "onLocationPermission"] }, { type: i3.KwikUIInputOtpComponent, selector: "kwikui-input-otp", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "mask", "mode", "otpLength", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputAadhaarComponent, selector: "kwikui-input-aadhaar", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "mask", "placeholder", "properties", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIImageComponent, selector: "kwikui-image", inputs: ["altText", "class", "html", "id", "imageSrc", "imageType", "loadingType", "styles"], outputs: ["onClick"] }, { type: i3.KwikUIInputFilesComponent, selector: "kwikui-input-files", inputs: ["accept", "class", "disabled", "files", "formControl", "formControlName", "icon", "id", "label", "link", "maxFileSize", "multiple", "setFileTypesToForm", "showAddedFiles", "size", "styles", "validators", "variant", "showViewButton"], outputs: ["getKeyValue", "getRemovedFile", "getViewButtonClick"] }, { type: i4.KwikUIInputCameraComponent, selector: "kwikui-input-camera", inputs: ["buttonText", "disabled", "focus", "formControl", "formControlName", "icon", "id", "invalid", "mediaFiles", "properties", "showMediaFiles", "size", "type", "validators"], outputs: ["onClick", "getRemovedFile"] }, { type: i3.KwikUIStarRatingComponent, selector: "kwikui-star-rating", inputs: ["color", "disabled", "focus", "formControl", "formControlName", "icon", "iconMarked", "id", "invalid", "label", "max", "min", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUILoaderComponent, selector: "kwikui-loader" }, { type: i6.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "lines", "timestamp"], outputs: ["close"] }, { type: i5.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i7.TuiPreviewComponent, selector: "tui-preview", inputs: ["zoomable", "rotatable"] }, { type: i7.TuiPreviewTitleComponent, selector: "tui-preview-title" }, { type: i5.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }, { type: i4.KwikIDCameraComponent, selector: "kwikid-camera", inputs: ["type", "config", "data", "image", "video"], outputs: ["getImage", "onClickSave", "getVideo"] }], directives: [{ type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3$2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3$2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i6.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i6.TuiPushDirective, selector: "tui-push" }, { type: i7.TuiPreviewActionDirective, selector: "[tuiPreviewAction]" }], pipes: { "styleSanitizer": StyleSanitizerPipe, "kwikuiSafeHtml": i3.KwikUISafeHtmlPipe, "kwikuiSafeUrl": i3.KwikUISafeUrlPipe, "formatTimer": TimerPipe } });
|
|
6734
|
+
/** @nocollapse */ KwikIDFormViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: { allFormsData: "allFormsData", extraData: "extraData", apiCallResponse: "apiCallResponse", buttonClickResponse: "buttonClickResponse", formConfig: "formConfig", formData: "formData", isMobileView: "isMobileView", popupFormCallback: "popupFormCallback", userConfig: "userConfig", stepConfig: "stepConfig" }, outputs: { getLogs: "getLogs", getUnsavedDataState: "getUnsavedDataState", onActionShowPopupForm: "onActionShowPopupForm", onClickApiCall: "onClickApiCall", onClickViewFile: "onClickViewFile", onClickFormFieldButton: "onClickFormFieldButton", onClickGoBack: "onClickGoBack", onClickSaveForm: "onClickSaveForm", onClickViewForms: "onClickViewForms" }, providers: [KwikIDFormViewService, KwikIDFormViewApiService], viewQueries: [{ propertyName: "formFieldContainerRef", first: true, predicate: ["formFieldContainerRef"], descendants: true }, { propertyName: "dialog", first: true, predicate: ["dialog"], descendants: true }, { propertyName: "preview", first: true, predicate: ["preview"], descendants: true }, { propertyName: "formFieldsRef", predicate: ["formFieldsRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"kwikid-form-container\"\n *ngIf=\"!loading\"\n>\n <div\n id=\"uf-form-fields-header-container\"\n *ngIf=\"\n !formConfig.properties?.header?.title?.hidden ||\n !formConfig.properties?.header?.logo?.hidden ||\n !formConfig.properties?.header?.steps?.hidden ||\n !formConfig.properties?.header?.backButton?.hidden\n \"\n >\n <img\n id=\"uf-header-logo\"\n *ngIf=\"!formConfig.properties?.header?.logo?.hidden && isMobileView\"\n [src]=\"formConfig.properties?.header?.logo?.src\"\n [alt]=\"formConfig.properties?.header?.logo?.alt\"\n [style]=\"\n formConfig.properties?.header?.logo?.styles ?? '' | styleSanitizer\n \"\n />\n <div id=\"uf-form-fields-header-main\">\n <div id=\"uf-form-fields-header-left\">\n <kwikui-button\n *ngIf=\"\n !formConfig.properties?.header.backButton.hidden && isMobileView\n \"\n [disabled]=\"backButton.disabled\"\n [showLoader]=\"backButton.showLoader\"\n appearance=\"mono\"\n icon=\"tuiIconArrowLeft\"\n shape=\"rounded\"\n (onClick)=\"\n handleOnClickGoBack(\n $event,\n formConfig.properties?.header.backButton.mode\n )\n \"\n ></kwikui-button>\n </div>\n <div id=\"uf-form-fields-header-right\">\n <div\n id=\"uf-form-fields-title\"\n *ngIf=\"!formConfig.properties?.header.title.hidden\"\n >{{ formConfig.properties?.header.title.label }}</div\n >\n <div\n id=\"uf-form-fields-steps\"\n *ngIf=\"!formConfig.properties?.header.steps.hidden\"\n >\n Step {{ formConfig.sequenceNo }} of {{ formConfig.formsListLength }}\n </div>\n </div>\n </div>\n <hr\n *ngIf=\"\n !formConfig.properties?.header.title.hidden ||\n !formConfig.properties?.header.steps.hidden ||\n !formConfig.properties?.header.backButton.hidden\n \"\n />\n </div>\n <form\n #formFieldContainerRef\n class=\"kwikid-form show\"\n [style]=\"formConfig.properties?.main?.styles ?? '' | styleSanitizer\"\n [formGroup]=\"formGroup\"\n >\n <ng-container\n *ngFor=\"\n let field of formFields;\n let i = index;\n trackBy: getUniqueIdentifier\n \"\n >\n <ng-container [ngSwitch]=\"field.type\">\n <!-- HTML Content -->\n <ng-container *ngSwitchCase=\"'html'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <div [innerHtml]=\"field.html | kwikuiSafeHtml\"></div>\n </div>\n </ng-container>\n <!-- Form Title -->\n <ng-container *ngSwitchCase=\"'title'\">\n <div\n #formFieldsRef\n class=\"title\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n [class.hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <div>\n {{ field.label }}\n </div>\n <kwikui-button\n *ngIf=\"field?.reset\"\n appearance=\"whiteblock\"\n size=\"s\"\n [label]=\"field?.properties?.resetButtonLabel ?? 'Reset'\"\n (onClick)=\"handleOnClickResetFormFields($event, field)\"\n ></kwikui-button>\n </div>\n </ng-container>\n <!-- Button -->\n <ng-container *ngSwitchCase=\"'button'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button\n [appearance]=\"field?.properties?.appearance ?? 'primary'\"\n [class]=\"field?.properties?.class\"\n [disabled]=\"field?.disabled\"\n [icon]=\"field?.properties?.icon\"\n [iconRight]=\"field?.properties?.iconRight\"\n [id]=\"field?.key\"\n [label]=\"field?.label\"\n [shape]=\"field?.properties?.shape\"\n [showLoader]=\"field?.properties?.loading ?? false\"\n [size]=\"field?.properties?.size\"\n [styles]=\"field?.properties?.styles\"\n [type]=\"'button'\"\n (onClick)=\"handleOnClickFormFieldButton(field)\"\n ></kwikui-button>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Text -->\n <ng-container *ngSwitchCase=\"'text'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input\n [case]=\"field?.properties?.case\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [type]=\"'text'\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Currency -->\n <ng-container *ngSwitchCase=\"'currency'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-currency\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [currencyType]=\"field?.properties?.currencyType\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n [value]=\"formGroup.controls[field.key].value\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-currency>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Email -->\n <ng-container *ngSwitchCase=\"'email'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-email\n [case]=\"field?.properties?.case\"\n [disabled]=\"field?.disabled\"\n [domains]=\"field?.properties?.domains\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-email>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Password -->\n <ng-container *ngSwitchCase=\"'password'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-password\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [hintContent]=\"field?.properties?.hintContent\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-password>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Textarea -->\n <ng-container *ngSwitchCase=\"'textarea'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-textarea\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-textarea>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Checkbox -->\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-checkbox\n [contentAlign]=\"field?.properties?.contentAlign ?? 'left'\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.properties?.placeholder\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size ?? 'l'\"\n [validators]=\"field?.validators\"\n [variant]=\"field?.properties?.variant ?? 'block'\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-checkbox>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Number -->\n <ng-container *ngSwitchCase=\"'number'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-number\n [decimal]=\"field?.properties?.decimal\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix ?? ''\"\n [precision]=\"field?.properties?.precision\"\n [prefix]=\"field?.properties?.prefix ?? ''\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-number>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Date -->\n <ng-container *ngSwitchCase=\"'date'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-date\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [maxCalculatedFromToday]=\"\n field?.properties?.maxCalculatedFromToday\n \"\n [min]=\"field?.properties?.min\"\n [minCalculatedFromToday]=\"\n field?.properties?.minCalculatedFromToday\n \"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-date>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Time -->\n <ng-container *ngSwitchCase=\"'time'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-time\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [items]=\"field?.properties?.items\"\n [label]=\"field?.label\"\n [mode]=\"field?.properties?.mode\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-time>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Phone -->\n <ng-container *ngSwitchCase=\"'phone'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-phone\n [countryCode]=\"field?.properties?.countryCode\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [phoneMaskAfterCountryCode]=\"\n field?.properties?.phoneMaskAfterCountryCode\n \"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [removeCountryCodeFromValue]=\"\n field?.properties?.removeCountryCodeFromValue\n \"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-phone>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Radio -->\n <ng-container *ngSwitchCase=\"'radio'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto; padding: 0px 0.5rem\"\n >\n <kwikui-input-radio\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [items]=\"field?.options\"\n [label]=\"field?.label\"\n [orientation]=\"field?.properties?.orientation\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-radio>\n </label>\n <ng-template #labelTemplate>\n <p\n class=\"tui-space_bottom-2\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Dropdown -->\n <ng-container *ngSwitchCase=\"'select'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-select\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [options]=\"field.options\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [searchable]=\"field?.properties?.searchable\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-select>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Slider -->\n <ng-container *ngSwitchCase=\"'slider'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-slider\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix\"\n [prefix]=\"field?.properties?.prefix\"\n [properties]=\"field?.properties\"\n [quantum]=\"field?.properties?.quantum\"\n [size]=\"field?.properties?.size\"\n [steps]=\"field?.properties?.steps\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-slider>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- API Call -->\n <ng-container *ngSwitchCase=\"'api'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button-api-call\n [apiStatus]=\"field?.api?.status?.value\"\n [apiTimer]=\"field?.api?.timer\"\n [class]=\"field?.class\"\n [disabled]=\"field?.disabled\"\n [id]=\"field.key\"\n [label]=\"field?.api?.status?.labels[field?.api?.status?.value]\"\n [showLoader]=\"field?.disabled === 'loading'\"\n [size]=\"field?.properties?.size\"\n [styles]=\"\n field?.properties?.styles\n ? field?.properties?.styles\n : 'width: fit-content'\n \"\n (onClick)=\"handleOnClickApiCall($event)\"\n (onApiTimerStop)=\"handleOnApiTimerStop($event)\"\n ></kwikui-button-api-call>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Live Location -->\n <ng-container *ngSwitchCase=\"'live-location'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button-live-location\n [class]=\"field?.class\"\n [disabled]=\"field?.disabled\"\n [id]=\"field.key\"\n [label]=\"field?.api?.status?.labels[field?.api?.status?.value]\"\n [liveLocationStatus]=\"field?.api?.status?.value\"\n [shape]=\"field?.properties?.shape\"\n [isShowLatLongCaptureTimestamp]=\"\n field?.properties?.isShowLatLongCaptureTimestamp\n \"\n [showLoader]=\"field?.disabled\"\n [size]=\"field?.properties?.size\"\n styles=\"width: fit-content\"\n (onClick)=\"handleOnClickLiveLocation($event)\"\n (onLocationPermission)=\"handleOnLocationPermission($event)\"\n ></kwikui-button-live-location>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Mobile OTP -->\n <ng-container *ngSwitchCase=\"'otp'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-otp\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [mask]=\"field?.properties?.mask\"\n [mode]=\"field?.properties?.mode\"\n [otpLength]=\"field?.properties?.otpLength\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-otp>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Aadhaar Number -->\n <ng-container *ngSwitchCase=\"'aadhaar-number'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-aadhaar\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [mask]=\"field?.properties?.mask\"\n [placeholder]=\"field?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-aadhaar>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Preview Image -->\n <ng-container *ngSwitchCase=\"'image'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-image\n [altText]=\"field?.properties?.altText\"\n [class]=\"field?.properties?.class\"\n [html]=\"field?.properties?.html\"\n [id]=\"field.key\"\n [imageSrc]=\"formGroup.controls[field.key].value ?? ''\"\n [imageType]=\"field?.properties?.imageType\"\n [loadingType]=\"field?.properties?.loadingType\"\n [styles]=\"field?.properties?.styles\"\n ></kwikui-image>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- File Upload -->\n <ng-container *ngSwitchCase=\"'file'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto\"\n >\n <kwikui-input-files\n [accept]=\"field?.properties?.accept\"\n [class]=\"field?.properties?.class\"\n [disabled]=\"field?.disabled\"\n [files]=\"files[field.key]\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field?.key\"\n [label]=\"field?.properties?.label\"\n [link]=\"field?.properties?.link\"\n [maxFileSize]=\"field?.properties?.maxFileSize\"\n [multiple]=\"field?.properties?.multiple\"\n [setFileTypesToForm]=\"['NORMAL']\"\n [styles]=\"field?.properties?.styles\"\n [validators]=\"field?.validators\"\n [showViewButton]=\"field?.properties?.showViewButton\"\n (getKeyValue)=\"handleGetKeyValueFile($event)\"\n (getRemovedFile)=\"handleRemovedFile($event)\"\n (getViewButtonClick)=\"handleViewButtonClick($event, field)\"\n ></kwikui-input-files>\n </label>\n <ng-template #labelTemplate>\n <p\n style=\"padding: 0px 0.25rem; margin-bottom: 0.25rem\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Camera Capture -->\n <ng-container *ngSwitchCase=\"'capture'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n *ngIf=\"\n field?.label !== '' &&\n field?.label !== undefined &&\n field?.label !== null\n \"\n style=\"min-height: auto\"\n >\n <p\n *ngIf=\"field?.label !== ''\"\n style=\"padding: 0px 0.25rem; margin-bottom: 0.5rem\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </label>\n <kwikui-input-camera\n [buttonText]=\"field?.properties?.buttonText\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [icon]=\"field?.properties?.icon\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [mediaFiles]=\"\n mediaFiles[field.key] | filterImageUrlOrBase64FromObject\n \"\n [properties]=\"field?.properties\"\n [showMediaFiles]=\"field?.properties?.showMediaFiles\"\n [type]=\"'capture'\"\n [validators]=\"field?.validators\"\n (onClick)=\"handleOnClickInputCamera($event, field)\"\n (getRemovedFile)=\"handleOnClickGetRemovedMediaFile($event)\"\n ></kwikui-input-camera>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Camera Record -->\n <ng-container *ngSwitchCase=\"'record'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n *ngIf=\"\n field?.label !== '' &&\n field?.label !== undefined &&\n field?.label !== null\n \"\n style=\"min-height: auto\"\n >\n <p\n *ngIf=\"field?.label !== ''\"\n style=\"padding: 0px 0.25rem; margin-bottom: 0.5rem\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\">*</span>\n </b>\n </p>\n </label>\n <kwikui-input-camera\n [buttonText]=\"field?.properties?.buttonText\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [icon]=\"field?.properties?.icon\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [mediaFiles]=\"\n mediaFiles[field.key] | filterVideoUrlOrBase64FromObject\n \"\n [properties]=\"field?.properties\"\n [showMediaFiles]=\"field?.properties?.showMediaFiles\"\n [type]=\"'record'\"\n [validators]=\"field?.validators\"\n (onClick)=\"handleOnClickInputCamera($event, field)\"\n (getRemovedFile)=\"handleOnClickGetRemovedMediaFile($event)\"\n ></kwikui-input-camera>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Star Rating -->\n <ng-container *ngSwitchCase=\"'star-rating'\">\n <div\n #formFieldsRef\n [hidden]=\"field?.hidden\"\n [style]=\"field?.properties?.containerStyles ?? '' | styleSanitizer\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto; padding: 0px 0.5rem\"\n >\n <kwikui-star-rating\n [color]=\"field?.properties?.color\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [icon]=\"field?.properties?.icon\"\n [iconMarked]=\"field?.properties?.iconMarked\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-star-rating>\n </label>\n <ng-template #labelTemplate>\n <p>\n <b\n >{{ field?.properties?.placeholder }}\n <span *ngIf=\"field.validators?.required\">*</span></b\n >\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n </ng-container>\n </ng-container>\n </form>\n <div\n class=\"kwikid-form-buttons\"\n *ngIf=\"\n !formConfig.properties.footer.viewFormsButton.hidden ||\n !formConfig.properties.footer.saveButton.hidden\n \"\n >\n <kwikui-button\n *ngIf=\"\n !formConfig.properties.footer.viewFormsButton.hidden && isMobileView\n \"\n [appearance]=\"'secondary'\"\n [disabled]=\"viewFormsButton.disabled\"\n [label]=\"formConfig.properties.footer.viewFormsButton.label\"\n [showLoader]=\"viewFormsButton.showLoader\"\n [styles]=\"'width: 100%'\"\n (onClick)=\"handleOnClickViewForms($event)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"!formConfig.properties.footer.saveButton.hidden\"\n [disabled]=\"saveFormButton.disabled\"\n [label]=\"formConfig.properties.footer.saveButton.label\"\n [showLoader]=\"saveFormButton.showLoader\"\n [styles]=\"'width: 100%'\"\n (onClick)=\"handleOnClickSaveForm($event)\"\n ></kwikui-button>\n </div>\n</div>\n<div\n class=\"kwikid-form-container-loading\"\n *ngIf=\"loading\"\n>\n <div\n *ngFor=\"let item of [].constructor(7); let i = index\"\n class=\"large-wrapper tui-skeleton tui-skeleton_rounded\"\n >\n </div>\n</div>\n\n<kwikui-loader></kwikui-loader>\n\n<tui-push\n id=\"field-error-notification\"\n *tuiPush=\"showErrorNotification\"\n heading=\"Missing/Incorrect Fields!\"\n type=\"Error\"\n (close)=\"toggleErrorNotification(false)\"\n>\n <tui-svg\n src=\"tuiIconXCircle\"\n style=\"color: #fff !important\"\n >\n </tui-svg>\n</tui-push>\n\n<tui-push\n id=\"permission-error-notification\"\n *tuiPush=\"showPermissionErrorNotification\"\n heading=\"Please provide required permissions!\"\n type=\"Error\"\n (close)=\"togglePermissionErrorNotification(false)\"\n>\n <tui-svg\n src=\"tuiIconXCircle\"\n style=\"color: #fff !important\"\n >\n </tui-svg>\n</tui-push>\n\n<ng-template\n #preview\n let-preview\n>\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n class=\"preview-container\"\n >\n <tui-preview-title *ngIf=\"previewProperties.title !== ''\">{{\n previewProperties.title\n }}</tui-preview-title>\n\n <ng-container *ngIf=\"!previewProperties.unavailable\">\n <div\n *ngIf=\"previewProperties?.html?.before !== ''\"\n class=\"preview-html preview-html-before\"\n [style]=\"previewProperties?.html?.beforeStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.before | kwikuiSafeHtml\"\n ></div>\n\n <!-- Content within the iframe -->\n <div\n class=\"preview-iframe-content\"\n [style]=\"\n previewProperties?.iframe?.containerStyles ?? '' | styleSanitizer\n \"\n *ngIf=\"previewProperties.iframe.src !== ''\"\n >\n <!-- Your HTML content here -->\n <iframe\n [src]=\"previewProperties.iframe.src | kwikuiSafeUrl\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n allowfullscreen\n [title]=\"previewProperties.iframe.title\"\n class=\"preview-iframe\"\n scrolling=\"auto\"\n ></iframe>\n </div>\n\n <div\n *ngIf=\"previewProperties?.html?.after !== ''\"\n class=\"preview-html preview-html-after\"\n [style]=\"previewProperties?.html?.afterStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.after | kwikuiSafeHtml\"\n ></div>\n </ng-container>\n\n <ng-container *ngIf=\"previewProperties.unavailable\">\n <div class=\"preview-unavailable\">\n <tui-svg\n src=\"tuiIconFileLarge\"\n class=\"t-icon\"\n ></tui-svg>\n <div>Preview unavailable</div>\n </div>\n </ng-container>\n\n <button\n tuiIconButton\n tuiPreviewAction\n icon=\"tuiIconCloseLarge\"\n title=\"Close\"\n type=\"button\"\n (click)=\"preview.complete()\"\n ></button>\n </tui-preview>\n</ng-template>\n\n<ng-template\n #dialog\n let-dialog\n>\n <div class=\"preview-container\">\n <ng-container *ngIf=\"!previewProperties.unavailable\">\n <div\n *ngIf=\"previewProperties?.html?.before !== ''\"\n class=\"preview-html preview-html-before\"\n [style]=\"previewProperties?.html?.beforeStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.before | kwikuiSafeHtml\"\n ></div>\n\n <!-- Content within the iframe -->\n <div\n class=\"preview-iframe-content\"\n [style]=\"\n previewProperties?.iframe?.containerStyles ?? '' | styleSanitizer\n \"\n *ngIf=\"previewProperties.iframe.src !== ''\"\n >\n <!-- Your HTML content here -->\n <iframe\n [src]=\"previewProperties.iframe.src | kwikuiSafeUrl\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n allowfullscreen\n [title]=\"previewProperties.iframe.title\"\n class=\"preview-iframe\"\n scrolling=\"auto\"\n ></iframe>\n </div>\n\n <div\n *ngIf=\"previewProperties?.html?.after !== ''\"\n class=\"preview-html preview-html-after\"\n [style]=\"previewProperties?.html?.afterStyles ?? '' | styleSanitizer\"\n [innerHtml]=\"previewProperties.html.after | kwikuiSafeHtml\"\n ></div>\n </ng-container>\n\n <ng-container *ngIf=\"previewProperties.unavailable\">\n <div class=\"preview-unavailable\">\n <tui-svg\n src=\"tuiIconFileLarge\"\n class=\"t-icon\"\n ></tui-svg>\n <div>Preview unavailable</div>\n </div>\n </ng-container>\n </div>\n</ng-template>\n\n<div\n id=\"kwikid-camera-container\"\n *ngIf=\"isShowCamera\"\n>\n <div\n id=\"kwikid-camera-wrapper\"\n [class.fullscreen]=\"isShowCameraFullscreen\"\n >\n <kwikid-camera\n [type]=\"activeCameraType\"\n [data]=\"activeCameraData\"\n [image]=\"activeCameraImage\"\n [video]=\"activeCameraVideo\"\n [config]=\"activeCameraConfig?.cameraConfig\"\n (getImage)=\"handleGetCameraMedia($event, 'CAPTURE')\"\n (getVideo)=\"handleGetCameraMedia($event, 'RECORD')\"\n (onClickBack)=\"handleOnClickCameraBack($event)\"\n (onClickClose)=\"handleOnClickCameraClose($event)\"\n (onClickSave)=\"handleOnClickSaveCameraMedia($event, activeCameraType)\"\n >\n <ng-container\n *ngIf=\"activeCameraType === 'CAPTURE'\"\n slot=\"capture-header\"\n >\n <div class=\"capture-header-container\">\n <div class=\"capture-header-left\"> </div>\n <div class=\"capture-header-center\">\n <kwikui-button\n *ngIf=\"activeCameraConfig?.cameraConfig?.header?.title !== ''\"\n appearance=\"whiteblock\"\n [label]=\"activeCameraConfig?.cameraConfig?.header?.title\"\n shape=\"rounded\"\n size=\"s\"\n ></kwikui-button>\n </div>\n <div class=\"capture-header-right\">\n <kwikui-button\n *ngIf=\"activeCameraConfig?.cameraConfig?.header?.isExpand\"\n id=\"kwikid-camera-header-enlarge-button\"\n appearance=\"whiteblock\"\n [icon]=\"\n isShowCameraFullscreen ? 'tuiIconMinimize2' : 'tuiIconMaximize2'\n \"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"isShowCameraFullscreen = !isShowCameraFullscreen\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"activeCameraConfig?.cameraConfig?.header?.isClose\"\n id=\"kwikid-camera-header-close-button\"\n appearance=\"whiteblock\"\n icon=\"tuiIconCloseLarge\"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"handleOnClickCameraClose($event)\"\n ></kwikui-button>\n </div>\n </div>\n </ng-container>\n <ng-container\n *ngIf=\"activeCameraType === 'RECORD'\"\n slot=\"record-header\"\n >\n <div class=\"record-header-container\">\n <div class=\"record-header-row row-1\">\n <div class=\"record-header-left\">\n <kwikui-button\n *ngIf=\"\n activeCameraConfig?.cameraConfig?.header?.isBack &&\n activeCameraRecordingState == 'NONE'\n \"\n appearance=\"whiteblock\"\n icon=\"tuiIconArrowLeft\"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"handleOnClickCameraClose($event)\"\n ></kwikui-button>\n </div>\n <div class=\"record-header-center\">\n <kwikui-button\n *ngIf=\"activeCameraConfig?.cameraConfig?.header?.title !== ''\"\n appearance=\"whiteblock\"\n [label]=\"activeCameraConfig?.cameraConfig?.header?.title\"\n shape=\"rounded\"\n size=\"s\"\n ></kwikui-button>\n </div>\n <div class=\"record-header-right\">\n <kwikui-button\n *ngIf=\"activeCameraConfig?.cameraConfig?.header?.isExpand\"\n id=\"kwikid-camera-header-enlarge-button\"\n appearance=\"whiteblock\"\n [icon]=\"\n isShowCameraFullscreen\n ? 'tuiIconMinimize2'\n : 'tuiIconMaximize2'\n \"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"isShowCameraFullscreen = !isShowCameraFullscreen\"\n ></kwikui-button>\n </div>\n </div>\n <div class=\"record-header-row row-2\">\n <div\n id=\"blinking-dot-container\"\n [class.recording]=\"activeCameraRecordingState == 'RECORDING'\"\n [class.paused]=\"activeCameraRecordingState == 'PAUSED'\"\n [class.recorded]=\"\n activeCameraRecordingState == 'NONE' ||\n activeCameraRecordingState === 'RECORDED'\n \"\n >\n <div\n *ngIf=\"activeCameraRecordingState == 'RECORDING'\"\n class=\"dot recording blink\"\n >\n </div>\n <div\n *ngIf=\"activeCameraRecordingState === 'PAUSED'\"\n class=\"dot paused\"\n >\n </div>\n <div\n *ngIf=\"\n activeCameraRecordingState == 'NONE' ||\n activeCameraRecordingState === 'RECORDED'\n \"\n class=\"dot recorded\"\n >\n </div>\n <div>\n {{ activeCameraRecordingTime | formatTimer }}\n <ng-container\n *ngIf=\"\n activeCameraConfig?.cameraConfig?.others\n ?.maxRecordingTimeInSeconds\n \"\n >\n /\n {{\n activeCameraConfig?.cameraConfig?.others\n ?.maxRecordingTimeInSeconds | formatTimer\n }}\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </kwikid-camera>\n </div>\n</div>\n", styles: [".kwikid-form-container{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center}.kwikid-form.show{width:100%;height:100%;padding:1rem;overflow-y:auto;display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;scroll-behavior:smooth}.kwikid-form.show>*:not(:last-child){margin-bottom:1rem}.kwikid-form-buttons{width:100%;bottom:0px;padding:1rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.kwikid-form-buttons>*:not(:last-child){margin-right:1rem}.kwikid-form-buttons *{flex-grow:1}#uf-form-fields-header-container{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:flex-start;padding:1rem 1rem 0}#uf-form-fields-header-container>*:not(:last-child){margin-bottom:.5rem}#uf-form-fields-header-container #uf-header-logo{width:-moz-fit-content;width:fit-content;height:50px}#uf-form-fields-header-container #uf-form-fields-header-main{display:flex;flex-direction:row;align-content:center;justify-content:flex-start;align-items:center;width:100%}#uf-form-fields-header-container #uf-form-fields-header-main>*:not(:last-child){margin-right:.25rem}#uf-form-fields-header-container #uf-form-fields-header-main #uf-form-fields-header-right{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:flex-start}#uf-form-fields-header-container #uf-form-fields-header-main #uf-form-fields-header-right>*{margin-bottom:.5rem}#uf-form-fields-header-container hr{width:100%}#uf-form-fields-title{color:#000;font-size:1.75em;font-weight:bold}#uf-form-fields-steps{color:var(--color-on-secondary-container);font-size:1rem}.title{border-left:.25rem solid var(--tui-primary);padding:.75rem;font-size:1.4em;font-weight:bold;background-color:var(--tui-secondary);display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center}.title>*:not(:last-child){margin-right:.5rem}.title:not(:first-child){margin-top:.5rem}.title.hidden{display:none}.large-wrapper{width:100%;height:60px}.large-wrapper:first-child{margin-bottom:auto}.large-wrapper:last-child{margin-top:auto}.kwikid-form-container-loading{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;padding:1rem}.kwikid-form-container-loading>* :not(:last-child){margin-bottom:1rem}#field-error-notification,#permission-error-notification{background-color:var(--tui-error-fill);color:#fff!important}#field-error-notification .t-top,#permission-error-notification .t-top{color:#fff!important}#field-error-notification .t-close,#permission-error-notification .t-close{color:#fff!important}.preview-container{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;align-content:center;height:calc(100vh - 3rem)}@media only screen and (min-width: 768px){.preview-container{height:calc(100vh - 10rem);width:calc(100vw - 10rem)}}.preview-container>*:not(:last-child){margin-bottom:1rem}.preview-container .preview-html{flex-grow:1}.preview-container .preview-iframe-content{height:100%;flex-grow:1}.preview-container .preview-iframe-content .preview-iframe{width:100%;height:100%}.preview-container .preview-unavailable{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;color:#fff;font-size:1.2rem;top:50%;left:50%;width:100%;height:100vh}.preview-container .preview-unavailable>*:not(:last-child){margin-bottom:1rem}#kwikid-camera-container{width:100%;height:100%;position:fixed;top:50%;left:50%;background-color:#0000008f;transform:translate(-50%,-50%);z-index:100}#kwikid-camera-container #kwikid-camera-wrapper{width:min(80%);height:max(85%);box-shadow:#0000008f 0 22px 70px 4px;overflow:hidden;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:1rem;background-color:#000;transition:5s linear ease}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container{display:flex;width:100%;max-width:100%;padding:0}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container .capture-header-left{flex:1;text-align:left}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container .capture-header-center{flex:1;width:100%;min-width:max-content;text-align:center;margin:auto}#kwikid-camera-container #kwikid-camera-wrapper .capture-header-container .capture-header-right{flex:1;text-align:right;display:flex;justify-content:flex-end;grid-gap:1rem;gap:1rem}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container{display:flex;width:100%;max-width:100%;padding:0;color:#fff;flex-direction:column;justify-content:flex-start;align-items:stretch}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1{display:flex;flex-direction:row;justify-content:space-between;align-items:center;margin-bottom:1rem}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1 .record-header-left{flex:1;display:flex;justify-content:flex-start;grid-gap:1rem;gap:1rem;text-align:left}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1 .record-header-center{flex:1;width:100%;min-width:max-content;text-align:center;margin:auto}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-1 .record-header-right{flex:1;text-align:right;display:flex;justify-content:flex-end;grid-gap:1rem;gap:1rem}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2{display:flex;flex-direction:row;justify-content:center;align-items:center}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;grid-gap:.25rem;gap:.25rem;padding:.35rem .6rem;width:-moz-fit-content;width:fit-content;border-radius:2rem;background-color:#f5f5f5}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container.recording{color:red;font-weight:bold}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container.paused{color:#525252;font-weight:bold}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container.recorded{color:#000;font-weight:bold}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot{display:inline-block;width:.75rem;height:.75rem;border-radius:100%}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.recording{background-color:red;box-shadow:0 0 5px -1px red}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.paused{background-color:#525252;box-shadow:0 0 5px -1px #000}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.recorded{background-color:#000;box-shadow:0 0 5px -1px #000}#kwikid-camera-container #kwikid-camera-wrapper .record-header-container .record-header-row.row-2 #blinking-dot-container .dot.blink{animation:blinker 1s cubic-bezier(.5,0,1,1) infinite alternate}@keyframes blinker{0%{opacity:1}to{opacity:0}}#kwikid-camera-container #kwikid-camera-wrapper.fullscreen{width:100%;height:100%;border-radius:0;transition:5s linear ease}@media only screen and (max-width: 600px){#kwikid-camera-container #kwikid-camera-wrapper{width:100%;height:100%;border-radius:0;transition:5s linear ease}#kwikid-camera-container #kwikid-camera-wrapper #kwikid-camera-header-enlarge-button{display:none}}\n", "::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}\n"], components: [{ type: i3.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type", "pseudoHover"], outputs: ["onClick"] }, { type: i3.KwikUIMessagesComponent, selector: "kwikui-messages", inputs: ["id", "messages"] }, { type: i3.KwikUIInputComponent, selector: "kwikui-input", inputs: ["case", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "type", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputCurrencyComponent, selector: "kwikui-input-currency", inputs: ["currencyType", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators", "value"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputEmailComponent, selector: "kwikui-input-email", inputs: ["case", "disabled", "domains", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputPasswordComponent, selector: "kwikui-input-password", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUITextareaComponent, selector: "kwikui-textarea", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUICheckboxComponent, selector: "kwikui-checkbox", inputs: ["contentAlign", "disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "placeholder", "properties", "size", "validators", "variant"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputNumberComponent, selector: "kwikui-input-number", inputs: ["decimal", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "min", "placeholder", "postfix", "precision", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputDateComponent, selector: "kwikui-input-date", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "maxCalculatedFromToday", "min", "minCalculatedFromToday", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputTimeComponent, selector: "kwikui-input-time", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "items", "invalid", "label", "mode", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputPhoneComponent, selector: "kwikui-input-phone", inputs: ["countryCode", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "phoneMaskAfterCountryCode", "placeholder", "postfix", "prefix", "properties", "removeCountryCodeFromValue", "size", "validators"], outputs: ["getKeyValue"] }, { type: i5.TuiLabelComponent, selector: "label[tuiLabel]", inputs: ["tuiLabel", "context"] }, { type: i3.KwikUIInputRadioComponent, selector: "kwikui-input-radio", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "items", "label", "orientation", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputSelectComponent, selector: "kwikui-input-select", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "options", "placeholder", "properties", "searchable", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputSliderComponent, selector: "kwikui-input-slider", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "min", "placeholder", "postfix", "prefix", "properties", "quantum", "size", "steps", "type", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIButtonApiCallComponent, selector: "kwikui-button-api-call", inputs: ["apiTimer", "apiStatus", "class", "disabled", "id", "label", "shape", "showLoader", "size", "styles"], outputs: ["onClick", "onApiTimerStop"] }, { type: i3.KwikUIButtonLiveLocationComponent, selector: "kwikui-button-live-location", inputs: ["liveLocationStatus", "class", "disabled", "id", "label", "shape", "showLoader", "size", "styles", "isShowLatLongCaptureTimestamp"], outputs: ["onClick", "onLocationPermission"] }, { type: i3.KwikUIInputOtpComponent, selector: "kwikui-input-otp", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "mask", "mode", "otpLength", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIInputAadhaarComponent, selector: "kwikui-input-aadhaar", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "mask", "placeholder", "properties", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUIImageComponent, selector: "kwikui-image", inputs: ["altText", "class", "html", "id", "imageSrc", "imageType", "loadingType", "styles"], outputs: ["onClick"] }, { type: i3.KwikUIInputFilesComponent, selector: "kwikui-input-files", inputs: ["accept", "class", "disabled", "files", "formControl", "formControlName", "icon", "id", "label", "link", "maxFileSize", "multiple", "setFileTypesToForm", "showAddedFiles", "size", "styles", "validators", "variant", "showViewButton"], outputs: ["getKeyValue", "getRemovedFile", "getViewButtonClick"] }, { type: i4.KwikUIInputCameraComponent, selector: "kwikui-input-camera", inputs: ["buttonText", "disabled", "focus", "formControl", "formControlName", "icon", "id", "invalid", "mediaFiles", "properties", "showMediaFiles", "size", "type", "validators"], outputs: ["onClick", "getRemovedFile"] }, { type: i3.KwikUIStarRatingComponent, selector: "kwikui-star-rating", inputs: ["color", "disabled", "focus", "formControl", "formControlName", "icon", "iconMarked", "id", "invalid", "label", "max", "min", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i3.KwikUILoaderComponent, selector: "kwikui-loader" }, { type: i6.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "lines", "timestamp"], outputs: ["close"] }, { type: i5.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i7.TuiPreviewComponent, selector: "tui-preview", inputs: ["zoomable", "rotatable"] }, { type: i7.TuiPreviewTitleComponent, selector: "tui-preview-title" }, { type: i5.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }, { type: i4.KwikIDCameraComponent, selector: "kwikid-camera", inputs: ["type", "config", "data", "image", "video"], outputs: ["getImage", "onClickSave", "getVideo"] }], directives: [{ type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3$2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3$2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i6.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i6.TuiPushDirective, selector: "tui-push" }, { type: i7.TuiPreviewActionDirective, selector: "[tuiPreviewAction]" }], pipes: { "styleSanitizer": StyleSanitizerPipe, "kwikuiSafeHtml": i3.KwikUISafeHtmlPipe, "filterImageUrlOrBase64FromObject": FilterImageUrlOrBase64FromObjectPipe, "filterVideoUrlOrBase64FromObject": FilterVideoUrlOrBase64FromObjectPipe, "kwikuiSafeUrl": i3.KwikUISafeUrlPipe, "formatTimer": TimerPipe } });
|
|
6564
6735
|
__decorate([
|
|
6565
6736
|
logMethod
|
|
6566
6737
|
], KwikIDFormViewComponent.prototype, "resetCamera", null);
|
|
@@ -6651,9 +6822,6 @@ __decorate([
|
|
|
6651
6822
|
__decorate([
|
|
6652
6823
|
logMethod
|
|
6653
6824
|
], KwikIDFormViewComponent.prototype, "handleGetKeyValue", null);
|
|
6654
|
-
__decorate([
|
|
6655
|
-
logMethod
|
|
6656
|
-
], KwikIDFormViewComponent.prototype, "handleOnClickResetFormFields2", null);
|
|
6657
6825
|
__decorate([
|
|
6658
6826
|
logMethod
|
|
6659
6827
|
], KwikIDFormViewComponent.prototype, "handleOnClickResetFormFields", null);
|
|
@@ -6907,8 +7075,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
6907
7075
|
type: Output
|
|
6908
7076
|
}], onClickViewForms: [{
|
|
6909
7077
|
type: Output
|
|
6910
|
-
}], resetCamera: [], ngOnInit: [], ngOnChanges: [], ngOnDestroy: [], triggerLogs: [], initFormConfig: [], setFormFieldsFromFormConfig: [], setFormFieldGroupsFromFormConfig: [], setFormDataFromAllFormsData: [], handleConnectedElementFieldGroupActions: [], handleConnectedElementFieldGroup: [], handleConnectedElementFieldActions: [], handleConnectedElementFields: [], handleConnectedElements: [], handleRemovedFile: [], handleViewButtonClick: [], handleGetKeyValueFile: [], handleOnClickGetRemovedMediaFile: [], handleOnClickInputCamera: [], setCameraMedia: [], handleGetCameraMedia: [], handleOnClickSaveCameraMedia: [], handleOnClickCameraBack: [], handleOnClickCameraClose: [], updateFiles: [], uploadFile: [], handleOnClickFormFieldButton: [], handleOnLocationPermission: [], handleOnClickLiveLocation: [], handleGetKeyValue: [],
|
|
7078
|
+
}], resetCamera: [], ngOnInit: [], ngOnChanges: [], ngOnDestroy: [], triggerLogs: [], initFormConfig: [], setFormFieldsFromFormConfig: [], setFormFieldGroupsFromFormConfig: [], setFormDataFromAllFormsData: [], handleConnectedElementFieldGroupActions: [], handleConnectedElementFieldGroup: [], handleConnectedElementFieldActions: [], handleConnectedElementFields: [], handleConnectedElements: [], handleRemovedFile: [], handleViewButtonClick: [], handleGetKeyValueFile: [], handleOnClickGetRemovedMediaFile: [], handleOnClickInputCamera: [], setCameraMedia: [], handleGetCameraMedia: [], handleOnClickSaveCameraMedia: [], handleOnClickCameraBack: [], handleOnClickCameraClose: [], updateFiles: [], uploadFile: [], handleOnClickFormFieldButton: [], handleOnLocationPermission: [], handleOnClickLiveLocation: [], handleGetKeyValue: [], handleOnClickResetFormFields: [], handleFieldApiCall: [], handleApiCall: [], executeApiCall: [], isValidRequestHeadersAndBody: [], handleOnClickApiCall: [], handleOnClickGoBack: [], handleOnClickViewForms: [], handleOnClickSaveForm: [], handleOnApiTimerStop: [], handleOnScrollToField: [], toggleErrorNotification: [], togglePermissionErrorNotification: [], fieldHide: [], fieldGroupHide: [], fieldShow: [], fieldGroupShow: [], fieldDisable: [], fieldGroupDisable: [], fieldEnable: [], fieldGroupEnable: [], fieldReset: [], fieldGroupReset: [], fieldHideApiLoader: [], fieldShowApiLoader: [], 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: [] } });
|
|
6911
7079
|
|
|
7080
|
+
/* eslint-disable no-unused-vars */
|
|
6912
7081
|
var EFormType;
|
|
6913
7082
|
(function (EFormType) {
|
|
6914
7083
|
EFormType["FORM"] = "FORM";
|
|
@@ -6961,8 +7130,8 @@ class KwikIDFormsListComponent {
|
|
|
6961
7130
|
this.isAllFormsCompleted = true;
|
|
6962
7131
|
this.loading = false;
|
|
6963
7132
|
}
|
|
6964
|
-
setSelectedForm(
|
|
6965
|
-
this.selectedForm =
|
|
7133
|
+
setSelectedForm(selectedForm) {
|
|
7134
|
+
this.selectedForm = selectedForm;
|
|
6966
7135
|
}
|
|
6967
7136
|
ngOnInit() {
|
|
6968
7137
|
var _a, _b;
|
|
@@ -7025,14 +7194,12 @@ class KwikIDFormsListComponent {
|
|
|
7025
7194
|
if (isNull(stepConfig) || isUndefined(stepConfig)) {
|
|
7026
7195
|
stepConfig = setValueToObjectPath({}, "props", stepConfigProperties);
|
|
7027
7196
|
}
|
|
7197
|
+
else if (checkObjectKeyExists(stepConfig, "props")) {
|
|
7198
|
+
stepConfigProperties = mergeObjects(stepConfigProperties, stepConfig.props);
|
|
7199
|
+
stepConfig = setValueToObjectPath(stepConfig, "props", stepConfigProperties);
|
|
7200
|
+
}
|
|
7028
7201
|
else {
|
|
7029
|
-
|
|
7030
|
-
stepConfigProperties = mergeObjects(stepConfigProperties, stepConfig.props);
|
|
7031
|
-
stepConfig = setValueToObjectPath(stepConfig, "props", stepConfigProperties);
|
|
7032
|
-
}
|
|
7033
|
-
else {
|
|
7034
|
-
stepConfig = setValueToObjectPath(stepConfig, "props", stepConfigProperties);
|
|
7035
|
-
}
|
|
7202
|
+
stepConfig = setValueToObjectPath(stepConfig, "props", stepConfigProperties);
|
|
7036
7203
|
}
|
|
7037
7204
|
stepConfig.props.formListProperties.footer.submitFormButton.label =
|
|
7038
7205
|
updateLanguage(stepConfig.props.formListProperties.footer.submitFormButton.label, getLanguage());
|
|
@@ -7041,47 +7208,38 @@ class KwikIDFormsListComponent {
|
|
|
7041
7208
|
filterHiddenForms(formsList) {
|
|
7042
7209
|
return formsList.filter((form) => {
|
|
7043
7210
|
if (checkObjectKeyExists(form, "hidden")) {
|
|
7044
|
-
|
|
7045
|
-
return form;
|
|
7046
|
-
}
|
|
7211
|
+
return !form.hidden;
|
|
7047
7212
|
}
|
|
7213
|
+
return false;
|
|
7048
7214
|
});
|
|
7049
7215
|
}
|
|
7050
7216
|
setFormTitles(formsList) {
|
|
7051
|
-
return formsList
|
|
7217
|
+
return formsList
|
|
7218
|
+
.map((form) => {
|
|
7052
7219
|
if (form.type === EFormType.HTML) {
|
|
7053
|
-
return form;
|
|
7220
|
+
return form; // No modification, just return
|
|
7054
7221
|
}
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
form.props.title = updateLanguage(form.props.title, getLanguage());
|
|
7058
|
-
return form;
|
|
7059
|
-
}
|
|
7222
|
+
if (checkObjectPathExists(form, "props.title")) {
|
|
7223
|
+
form.props.title = updateLanguage(form.props.title, getLanguage());
|
|
7060
7224
|
}
|
|
7061
|
-
|
|
7225
|
+
return form; // Return the form regardless of modification
|
|
7226
|
+
})
|
|
7227
|
+
.filter((form) => form.type === EFormType.HTML ||
|
|
7228
|
+
checkObjectPathExists(form, "props.title"));
|
|
7062
7229
|
}
|
|
7063
7230
|
findFormsListLength(formsList) {
|
|
7064
|
-
|
|
7231
|
+
return formsList.filter((form) => {
|
|
7065
7232
|
if (checkObjectKeyExists(form, "type")) {
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
return form;
|
|
7070
|
-
}
|
|
7071
|
-
}
|
|
7072
|
-
}
|
|
7073
|
-
}
|
|
7074
|
-
else if (checkObjectKeyExists(form, "hidden")) {
|
|
7075
|
-
if (!form.hidden) {
|
|
7076
|
-
return form;
|
|
7077
|
-
}
|
|
7233
|
+
return (form.type !== EFormType.HTML &&
|
|
7234
|
+
checkObjectKeyExists(form, "hidden") &&
|
|
7235
|
+
!form.hidden);
|
|
7078
7236
|
}
|
|
7079
|
-
|
|
7080
|
-
|
|
7237
|
+
return checkObjectKeyExists(form, "hidden") && !form.hidden;
|
|
7238
|
+
}).length;
|
|
7081
7239
|
}
|
|
7082
7240
|
checkIsAllFormsCompleted(formsList) {
|
|
7083
7241
|
let isAllFormsCompleted = true;
|
|
7084
|
-
for (
|
|
7242
|
+
for (const form of formsList) {
|
|
7085
7243
|
if (checkObjectKeyExists(form, "type")) {
|
|
7086
7244
|
if (form.type !== EFormType.HTML) {
|
|
7087
7245
|
if (form.status !== "completed") {
|
|
@@ -7135,6 +7293,9 @@ __decorate([
|
|
|
7135
7293
|
__decorate([
|
|
7136
7294
|
logMethod
|
|
7137
7295
|
], KwikIDFormsListComponent.prototype, "filterHiddenForms", null);
|
|
7296
|
+
__decorate([
|
|
7297
|
+
logMethod
|
|
7298
|
+
], KwikIDFormsListComponent.prototype, "setFormTitles", null);
|
|
7138
7299
|
__decorate([
|
|
7139
7300
|
logMethod
|
|
7140
7301
|
], KwikIDFormsListComponent.prototype, "findFormsListLength", null);
|
|
@@ -7154,7 +7315,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
7154
7315
|
templateUrl: "./forms-list.component.html",
|
|
7155
7316
|
styleUrls: ["./forms-list.component.scss", "../shared.scss"]
|
|
7156
7317
|
}]
|
|
7157
|
-
}],
|
|
7318
|
+
}], propDecorators: { showFormFields: [{
|
|
7158
7319
|
type: Input
|
|
7159
7320
|
}], userConfig: [{
|
|
7160
7321
|
type: Input
|
|
@@ -7178,7 +7339,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
7178
7339
|
type: Output
|
|
7179
7340
|
}], onClickSubmitForms: [{
|
|
7180
7341
|
type: Output
|
|
7181
|
-
}], ngOnChanges: [], triggerLogs: [], formatStepConfig: [], filterHiddenForms: [], findFormsListLength: [], checkIsAllFormsCompleted: [], handleOnClickSetActiveForm: [], handleOnSubmitForms: [] } });
|
|
7342
|
+
}], ngOnChanges: [], triggerLogs: [], formatStepConfig: [], filterHiddenForms: [], setFormTitles: [], findFormsListLength: [], checkIsAllFormsCompleted: [], handleOnClickSetActiveForm: [], handleOnSubmitForms: [] } });
|
|
7182
7343
|
|
|
7183
7344
|
var ERendererActionKey;
|
|
7184
7345
|
(function (ERendererActionKey) {
|
|
@@ -7191,9 +7352,7 @@ var ERendererActionKey;
|
|
|
7191
7352
|
|
|
7192
7353
|
const getFormConfigByKey = (forms, key) => {
|
|
7193
7354
|
const form = forms.find((form) => {
|
|
7194
|
-
|
|
7195
|
-
return form;
|
|
7196
|
-
}
|
|
7355
|
+
return form.key === key;
|
|
7197
7356
|
});
|
|
7198
7357
|
return form;
|
|
7199
7358
|
};
|
|
@@ -7309,7 +7468,7 @@ class KwikIDFormsRendererComponent {
|
|
|
7309
7468
|
}
|
|
7310
7469
|
ngOnChanges(changes) {
|
|
7311
7470
|
const verifyChange = (prop) => {
|
|
7312
|
-
return changes
|
|
7471
|
+
return checkObjectKeyExists(changes, prop) && !changes[prop].firstChange;
|
|
7313
7472
|
};
|
|
7314
7473
|
if (verifyChange("userConfig")) {
|
|
7315
7474
|
this.userConfig = changes.userConfig.currentValue;
|
|
@@ -7391,19 +7550,19 @@ class KwikIDFormsRendererComponent {
|
|
|
7391
7550
|
if (checkObjectKeyExists(form, "formContent")) {
|
|
7392
7551
|
if (checkObjectKeyExists(form.formContent, "url")) {
|
|
7393
7552
|
form = setValueToObjectPath(form, "props.url", form.formContent.url);
|
|
7394
|
-
delete form
|
|
7553
|
+
delete form.formContent.url;
|
|
7395
7554
|
}
|
|
7396
7555
|
if (checkObjectKeyExists(form.formContent, "path")) {
|
|
7397
7556
|
form = setValueToObjectPath(form, "props.path", form.formContent.path);
|
|
7398
|
-
delete form
|
|
7557
|
+
delete form.formContent.path;
|
|
7399
7558
|
}
|
|
7400
7559
|
}
|
|
7401
7560
|
if (isEmptyValue(form.formContent)) {
|
|
7402
|
-
delete form
|
|
7561
|
+
delete form.formContent;
|
|
7403
7562
|
}
|
|
7404
7563
|
if (checkObjectKeyExists(form, "title")) {
|
|
7405
7564
|
form = setValueToObjectPath(form, "props.title", form.title);
|
|
7406
|
-
delete form
|
|
7565
|
+
delete form.title;
|
|
7407
7566
|
}
|
|
7408
7567
|
if (!checkObjectKeyExists(form, "hidden")) {
|
|
7409
7568
|
form.hidden = false;
|
|
@@ -7429,18 +7588,16 @@ class KwikIDFormsRendererComponent {
|
|
|
7429
7588
|
htmlContent: form.htmlContent
|
|
7430
7589
|
};
|
|
7431
7590
|
}
|
|
7432
|
-
delete form
|
|
7591
|
+
delete form.htmlContent;
|
|
7433
7592
|
}
|
|
7434
|
-
else {
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
};
|
|
7439
|
-
}
|
|
7593
|
+
else if (!checkObjectKeyExists(form, "props")) {
|
|
7594
|
+
form.props = {
|
|
7595
|
+
htmlContent: ""
|
|
7596
|
+
};
|
|
7440
7597
|
}
|
|
7441
7598
|
if (checkObjectKeyExists(form, "title")) {
|
|
7442
7599
|
form = setValueToObjectPath(form, "props.title", form.title);
|
|
7443
|
-
delete form
|
|
7600
|
+
delete form.title;
|
|
7444
7601
|
}
|
|
7445
7602
|
if (!checkObjectKeyExists(form, "hidden")) {
|
|
7446
7603
|
form.hidden = false;
|
|
@@ -7471,21 +7628,22 @@ class KwikIDFormsRendererComponent {
|
|
|
7471
7628
|
*/
|
|
7472
7629
|
assignSequenceNoToForm(formsList) {
|
|
7473
7630
|
let sequenceNo = 1;
|
|
7474
|
-
for (
|
|
7631
|
+
for (const form of formsList) {
|
|
7475
7632
|
if (checkObjectKeyExists(form, "hidden")) {
|
|
7476
7633
|
if (!form.hidden && form.type !== EFormType.HTML) {
|
|
7477
|
-
form.sequenceNo = sequenceNo
|
|
7634
|
+
form.sequenceNo = sequenceNo;
|
|
7635
|
+
sequenceNo += 1;
|
|
7478
7636
|
}
|
|
7479
7637
|
else {
|
|
7480
|
-
delete form
|
|
7638
|
+
delete form.sequenceNo;
|
|
7481
7639
|
}
|
|
7482
7640
|
}
|
|
7483
7641
|
}
|
|
7484
7642
|
return formsList;
|
|
7485
7643
|
}
|
|
7486
7644
|
findCompletedFormsList(allFormsData) {
|
|
7487
|
-
|
|
7488
|
-
Object.keys(allFormsData).
|
|
7645
|
+
const formsListCompleted = [];
|
|
7646
|
+
Object.keys(allFormsData).forEach((formKey) => {
|
|
7489
7647
|
formsListCompleted.push(formKey);
|
|
7490
7648
|
});
|
|
7491
7649
|
return formsListCompleted;
|
|
@@ -7544,7 +7702,7 @@ class KwikIDFormsRendererComponent {
|
|
|
7544
7702
|
}
|
|
7545
7703
|
filterAllFormsData(allFormsData, formsList) {
|
|
7546
7704
|
let currentUserFormAllFormsData = {};
|
|
7547
|
-
for (
|
|
7705
|
+
for (const form of formsList) {
|
|
7548
7706
|
if (checkObjectKeyExists(form, "hidden") &&
|
|
7549
7707
|
!form.hidden &&
|
|
7550
7708
|
form.type !== EFormType.HTML) {
|
|
@@ -7570,31 +7728,28 @@ class KwikIDFormsRendererComponent {
|
|
|
7570
7728
|
return allFormsCompleted;
|
|
7571
7729
|
}
|
|
7572
7730
|
findActiveFormConfig(formsList) {
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
7731
|
+
return formsList.find((form) => {
|
|
7732
|
+
return (checkObjectKeyExists(form, "hidden") &&
|
|
7733
|
+
!form.hidden &&
|
|
7734
|
+
form.type !== EFormType.HTML &&
|
|
7735
|
+
form.status === "editable" &&
|
|
7736
|
+
!form.disabled);
|
|
7579
7737
|
});
|
|
7580
|
-
return activeFormConfig;
|
|
7581
7738
|
}
|
|
7582
7739
|
updateFormsList() {
|
|
7583
7740
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7584
7741
|
this.formsList = this.convertFormListConfig(this.formsList);
|
|
7585
|
-
for (
|
|
7742
|
+
for (const form of this.formsList) {
|
|
7586
7743
|
if (checkObjectKeyExists(form, "default") &&
|
|
7587
7744
|
isNotEmptyValue(form.default)) {
|
|
7588
|
-
const triggers = form.default
|
|
7589
|
-
const rules = form.default.rules;
|
|
7590
|
-
const actions = form.default.actions;
|
|
7745
|
+
const { triggers, rules, actions } = form.default;
|
|
7591
7746
|
const rulesMapping = new Rule(rules, {
|
|
7592
7747
|
USER_CONFIG: this.userConfig,
|
|
7593
7748
|
FORMS_LIST: this.formsList,
|
|
7594
7749
|
ALL_FORMS_DATA: this.allFormsData,
|
|
7595
7750
|
EXTRA_DATA: this.extraData
|
|
7596
7751
|
}).mapping();
|
|
7597
|
-
for (
|
|
7752
|
+
for (const action of actions) {
|
|
7598
7753
|
const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
|
|
7599
7754
|
if (conditionEvaluation) {
|
|
7600
7755
|
const actions = new Action(action, rulesMapping, {
|
|
@@ -7606,10 +7761,8 @@ class KwikIDFormsRendererComponent {
|
|
|
7606
7761
|
}
|
|
7607
7762
|
}
|
|
7608
7763
|
}
|
|
7609
|
-
else {
|
|
7610
|
-
|
|
7611
|
-
form.hidden = false;
|
|
7612
|
-
}
|
|
7764
|
+
else if (!checkObjectKeyExists(form, "hidden")) {
|
|
7765
|
+
form.hidden = false;
|
|
7613
7766
|
}
|
|
7614
7767
|
}
|
|
7615
7768
|
this.formsList = this.assignSequenceNoToForm(this.formsList);
|
|
@@ -7676,7 +7829,7 @@ class KwikIDFormsRendererComponent {
|
|
|
7676
7829
|
case ERendererActionKey.FORM_SHOW:
|
|
7677
7830
|
this.formShow(action.props.formKey);
|
|
7678
7831
|
break;
|
|
7679
|
-
case EActionKey.SET_VALUE:
|
|
7832
|
+
case EActionKey.SET_VALUE: {
|
|
7680
7833
|
const sources = new Source({
|
|
7681
7834
|
USER_CONFIG: this.userConfig,
|
|
7682
7835
|
ALL_FORMS_DATA: this.formsData,
|
|
@@ -7688,29 +7841,22 @@ class KwikIDFormsRendererComponent {
|
|
|
7688
7841
|
this.formsData = sources.object.ALL_FORMS_DATA;
|
|
7689
7842
|
this.extraData = sources.object.EXTRA_DATA;
|
|
7690
7843
|
break;
|
|
7844
|
+
}
|
|
7691
7845
|
default:
|
|
7692
7846
|
break;
|
|
7693
7847
|
}
|
|
7694
7848
|
});
|
|
7695
7849
|
}
|
|
7696
7850
|
findFormsListLength(formsList) {
|
|
7697
|
-
const
|
|
7851
|
+
const updatedFormsList = formsList.filter((form) => {
|
|
7698
7852
|
if (checkObjectKeyExists(form, "type")) {
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
return form;
|
|
7703
|
-
}
|
|
7704
|
-
}
|
|
7705
|
-
}
|
|
7706
|
-
}
|
|
7707
|
-
else if (checkObjectKeyExists(form, "hidden")) {
|
|
7708
|
-
if (!form.hidden) {
|
|
7709
|
-
return form;
|
|
7710
|
-
}
|
|
7853
|
+
return (form.type !== EFormType.HTML &&
|
|
7854
|
+
checkObjectKeyExists(form, "hidden") &&
|
|
7855
|
+
!form.hidden);
|
|
7711
7856
|
}
|
|
7857
|
+
return checkObjectKeyExists(form, "hidden") && !form.hidden;
|
|
7712
7858
|
});
|
|
7713
|
-
return
|
|
7859
|
+
return updatedFormsList.length;
|
|
7714
7860
|
}
|
|
7715
7861
|
/**
|
|
7716
7862
|
* Library Event Listeners
|
|
@@ -7726,12 +7872,10 @@ class KwikIDFormsRendererComponent {
|
|
|
7726
7872
|
this.toggleLoader(true);
|
|
7727
7873
|
this.isUnsavedData = false;
|
|
7728
7874
|
let activeFormConfig = this.formsList.find((form) => {
|
|
7729
|
-
|
|
7730
|
-
return form;
|
|
7731
|
-
}
|
|
7875
|
+
return form.key === selectedForm;
|
|
7732
7876
|
});
|
|
7733
7877
|
activeFormConfig = new Converter().updateFormConfigProperties(activeFormConfig);
|
|
7734
|
-
let formConfig
|
|
7878
|
+
let formConfig;
|
|
7735
7879
|
if (checkObjectKeyExists(activeFormConfig, "props")) {
|
|
7736
7880
|
if (checkObjectKeyExists(activeFormConfig.props, "url")) {
|
|
7737
7881
|
const formConfigFromUrl = yield this.fetchFormConfig(activeFormConfig.props.url);
|
|
@@ -7744,34 +7888,8 @@ class KwikIDFormsRendererComponent {
|
|
|
7744
7888
|
const formConfigFromPath = yield this.fetchFormConfig(url);
|
|
7745
7889
|
formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromPath);
|
|
7746
7890
|
}
|
|
7747
|
-
else
|
|
7748
|
-
|
|
7749
|
-
activeFormConfig.type === EFormType.FORM) {
|
|
7750
|
-
if (checkObjectKeyExists(activeFormConfig, "fields")) {
|
|
7751
|
-
formConfig = activeFormConfig;
|
|
7752
|
-
}
|
|
7753
|
-
else {
|
|
7754
|
-
console.error("No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!");
|
|
7755
|
-
}
|
|
7756
|
-
}
|
|
7757
|
-
else {
|
|
7758
|
-
console.error(`No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!`);
|
|
7759
|
-
}
|
|
7760
|
-
}
|
|
7761
|
-
}
|
|
7762
|
-
else {
|
|
7763
|
-
if (checkObjectKeyExists(activeFormConfig.formContent, "url")) {
|
|
7764
|
-
const formConfigFromUrl = yield this.fetchFormConfig(activeFormConfig.formContent.url);
|
|
7765
|
-
formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromUrl);
|
|
7766
|
-
}
|
|
7767
|
-
else if (checkObjectKeyExists(activeFormConfig.formContent, "path") &&
|
|
7768
|
-
checkObjectKeyExists(this.userConfig, "backend") &&
|
|
7769
|
-
checkObjectKeyExists(this.userConfig.backend, "CONFIG_BASE_URL")) {
|
|
7770
|
-
const url = `${(_d = (_c = this.userConfig) === null || _c === void 0 ? void 0 : _c.backend) === null || _d === void 0 ? void 0 : _d.CONFIG_BASE_URL}${activeFormConfig.props.path}`;
|
|
7771
|
-
const formConfigFromPath = yield this.fetchFormConfig(url);
|
|
7772
|
-
formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromPath);
|
|
7773
|
-
}
|
|
7774
|
-
else {
|
|
7891
|
+
else if (checkObjectKeyExists(activeFormConfig, "type") &&
|
|
7892
|
+
activeFormConfig.type === EFormType.FORM) {
|
|
7775
7893
|
if (checkObjectKeyExists(activeFormConfig, "fields")) {
|
|
7776
7894
|
formConfig = activeFormConfig;
|
|
7777
7895
|
}
|
|
@@ -7779,6 +7897,26 @@ class KwikIDFormsRendererComponent {
|
|
|
7779
7897
|
console.error("No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!");
|
|
7780
7898
|
}
|
|
7781
7899
|
}
|
|
7900
|
+
else {
|
|
7901
|
+
console.error(`No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!`);
|
|
7902
|
+
}
|
|
7903
|
+
}
|
|
7904
|
+
else if (checkObjectKeyExists(activeFormConfig.formContent, "url")) {
|
|
7905
|
+
const formConfigFromUrl = yield this.fetchFormConfig(activeFormConfig.formContent.url);
|
|
7906
|
+
formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromUrl);
|
|
7907
|
+
}
|
|
7908
|
+
else if (checkObjectKeyExists(activeFormConfig.formContent, "path") &&
|
|
7909
|
+
checkObjectKeyExists(this.userConfig, "backend") &&
|
|
7910
|
+
checkObjectKeyExists(this.userConfig.backend, "CONFIG_BASE_URL")) {
|
|
7911
|
+
const url = `${(_d = (_c = this.userConfig) === null || _c === void 0 ? void 0 : _c.backend) === null || _d === void 0 ? void 0 : _d.CONFIG_BASE_URL}${activeFormConfig.props.path}`;
|
|
7912
|
+
const formConfigFromPath = yield this.fetchFormConfig(url);
|
|
7913
|
+
formConfig = Object.assign(Object.assign({}, activeFormConfig), formConfigFromPath);
|
|
7914
|
+
}
|
|
7915
|
+
else if (checkObjectKeyExists(activeFormConfig, "fields")) {
|
|
7916
|
+
formConfig = activeFormConfig;
|
|
7917
|
+
}
|
|
7918
|
+
else {
|
|
7919
|
+
console.error("No Direct URL, No Path with Base URL, No fields key found in Active Form's Config!");
|
|
7782
7920
|
}
|
|
7783
7921
|
formConfig = new Converter().updateFormConfigFromUserConfig(formConfig, this.userConfig);
|
|
7784
7922
|
formConfig = new Converter().updateFormConfigMiscellaneous(formConfig, {
|
|
@@ -7847,8 +7985,8 @@ class KwikIDFormsRendererComponent {
|
|
|
7847
7985
|
.subscribe({
|
|
7848
7986
|
next: (data) => {
|
|
7849
7987
|
this.popupFormCallback = {
|
|
7850
|
-
popupFormData: data
|
|
7851
|
-
popupFormConfig: data
|
|
7988
|
+
popupFormData: data.data,
|
|
7989
|
+
popupFormConfig: data.formConfig,
|
|
7852
7990
|
activeFormConfig: this.activeFormConfig
|
|
7853
7991
|
};
|
|
7854
7992
|
this.activePopupFormData = {};
|
|
@@ -7877,8 +8015,8 @@ class KwikIDFormsRendererComponent {
|
|
|
7877
8015
|
.subscribe({
|
|
7878
8016
|
next: (data) => {
|
|
7879
8017
|
this.popupFormCallback = {
|
|
7880
|
-
popupFormData: data
|
|
7881
|
-
popupFormConfig: data
|
|
8018
|
+
popupFormData: data.data,
|
|
8019
|
+
popupFormConfig: data.formConfig,
|
|
7882
8020
|
activeFormConfig: this.activeFormConfig
|
|
7883
8021
|
};
|
|
7884
8022
|
this.activePopupFormData = {};
|
|
@@ -7917,9 +8055,9 @@ class KwikIDFormsRendererComponent {
|
|
|
7917
8055
|
this.toggleLoader(true);
|
|
7918
8056
|
this.getFormData.emit({
|
|
7919
8057
|
[this.activeFormConfig.key]: {
|
|
7920
|
-
formConfig: e
|
|
7921
|
-
data: e
|
|
7922
|
-
extendedData: e
|
|
8058
|
+
formConfig: e.formConfig,
|
|
8059
|
+
data: e.data,
|
|
8060
|
+
extendedData: e.extendedData
|
|
7923
8061
|
}
|
|
7924
8062
|
});
|
|
7925
8063
|
break;
|
|
@@ -7961,34 +8099,26 @@ class KwikIDFormsRendererComponent {
|
|
|
7961
8099
|
this.showFormSections = true;
|
|
7962
8100
|
this.showForm = false;
|
|
7963
8101
|
this.showFormFields = false;
|
|
7964
|
-
|
|
8102
|
+
}
|
|
8103
|
+
else if (this.checkIfFormsStatusCompleted(this.formsList, this.formsListCompleted)) {
|
|
8104
|
+
this.showFormSections = true;
|
|
8105
|
+
this.showForm = false;
|
|
8106
|
+
this.showFormFields = false;
|
|
7965
8107
|
}
|
|
7966
8108
|
else {
|
|
7967
|
-
|
|
7968
|
-
this.
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
else {
|
|
7974
|
-
const previousFormConfigDirect = this.formsList.find((form) => {
|
|
7975
|
-
if (form.sequenceNo === this.activeFormConfig.sequenceNo - 1 &&
|
|
7976
|
-
form.status !== EFormsListStatus.LOCKED) {
|
|
7977
|
-
return form;
|
|
7978
|
-
}
|
|
7979
|
-
});
|
|
7980
|
-
if (previousFormConfigDirect) {
|
|
7981
|
-
this.handleOnClickSetActiveForm(previousFormConfigDirect.key, undefined);
|
|
7982
|
-
}
|
|
8109
|
+
const previousFormConfigDirect = this.formsList.find((form) => {
|
|
8110
|
+
return (form.sequenceNo === this.activeFormConfig.sequenceNo - 1 &&
|
|
8111
|
+
form.status !== EFormsListStatus.LOCKED);
|
|
8112
|
+
});
|
|
8113
|
+
if (previousFormConfigDirect) {
|
|
8114
|
+
this.handleOnClickSetActiveForm(previousFormConfigDirect.key, undefined);
|
|
7983
8115
|
}
|
|
7984
8116
|
}
|
|
7985
8117
|
break;
|
|
7986
|
-
case EFormViewGoBackMode.TABBED:
|
|
8118
|
+
case EFormViewGoBackMode.TABBED: {
|
|
7987
8119
|
const previousFormConfig = this.formsList.find((form) => {
|
|
7988
|
-
|
|
7989
|
-
form.status === EFormsListStatus.EDITABLE)
|
|
7990
|
-
return form;
|
|
7991
|
-
}
|
|
8120
|
+
return (form.sequenceNo < this.activeFormConfig.sequenceNo &&
|
|
8121
|
+
form.status === EFormsListStatus.EDITABLE);
|
|
7992
8122
|
});
|
|
7993
8123
|
if (previousFormConfig) {
|
|
7994
8124
|
this.handleOnClickSetActiveForm(previousFormConfig.key, undefined);
|
|
@@ -7999,6 +8129,7 @@ class KwikIDFormsRendererComponent {
|
|
|
7999
8129
|
this.showFormFields = false;
|
|
8000
8130
|
}
|
|
8001
8131
|
break;
|
|
8132
|
+
}
|
|
8002
8133
|
default:
|
|
8003
8134
|
break;
|
|
8004
8135
|
}
|
|
@@ -8012,7 +8143,7 @@ class KwikIDFormsRendererComponent {
|
|
|
8012
8143
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8013
8144
|
const formsList = JSON.parse(JSON.stringify(this.formsList));
|
|
8014
8145
|
let firstFormWithError = "";
|
|
8015
|
-
for (
|
|
8146
|
+
for (const form of formsList) {
|
|
8016
8147
|
if (!form.hidden &&
|
|
8017
8148
|
form.type !== EFormType.HTML &&
|
|
8018
8149
|
form.required &&
|
|
@@ -8328,7 +8459,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
8328
8459
|
class KwikIDFormViewModule {
|
|
8329
8460
|
}
|
|
8330
8461
|
/** @nocollapse */ KwikIDFormViewModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormViewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
8331
|
-
/** @nocollapse */ KwikIDFormViewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormViewModule, declarations: [KwikIDFormViewComponent,
|
|
8462
|
+
/** @nocollapse */ KwikIDFormViewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormViewModule, declarations: [KwikIDFormViewComponent,
|
|
8463
|
+
StyleSanitizerPipe,
|
|
8464
|
+
TimerPipe,
|
|
8465
|
+
FilterImageUrlOrBase64FromObjectPipe,
|
|
8466
|
+
FilterVideoUrlOrBase64FromObjectPipe], imports: [CommonModule,
|
|
8332
8467
|
FormsModule,
|
|
8333
8468
|
ReactiveFormsModule,
|
|
8334
8469
|
TuiLabelModule,
|
|
@@ -8363,7 +8498,13 @@ class KwikIDFormViewModule {
|
|
|
8363
8498
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormViewModule, decorators: [{
|
|
8364
8499
|
type: NgModule,
|
|
8365
8500
|
args: [{
|
|
8366
|
-
declarations: [
|
|
8501
|
+
declarations: [
|
|
8502
|
+
KwikIDFormViewComponent,
|
|
8503
|
+
StyleSanitizerPipe,
|
|
8504
|
+
TimerPipe,
|
|
8505
|
+
FilterImageUrlOrBase64FromObjectPipe,
|
|
8506
|
+
FilterVideoUrlOrBase64FromObjectPipe
|
|
8507
|
+
],
|
|
8367
8508
|
imports: [
|
|
8368
8509
|
CommonModule,
|
|
8369
8510
|
FormsModule,
|