kwikid-forms 0.6.12 → 0.6.14
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 +1165 -679
- package/bundles/kwikid-forms.umd.js.map +1 -1
- package/esm2015/lib/renderer/config-converter/config-converter.js +52 -48
- package/esm2015/lib/renderer/form-view/definitions/form-view.actions.definition.js +7 -1
- package/esm2015/lib/renderer/form-view/definitions/form-view.apis.definition.js +1 -1
- package/esm2015/lib/renderer/form-view/definitions/form-view.fields.definition.js +1 -1
- package/esm2015/lib/renderer/form-view/definitions/from-view.logs.definition.js +5 -0
- package/esm2015/lib/renderer/form-view/form-view.component.js +170 -10
- package/esm2015/lib/renderer/form-view/form-view.service.js +12 -2
- package/esm2015/lib/renderer/form-view/helpers/form-view.apis.helper.js +81 -7
- package/esm2015/lib/renderer/form-view/helpers/form-view.defaults.helper.js +31 -1
- package/esm2015/lib/renderer/renderer.component.js +12 -3
- package/fesm2015/kwikid-forms.js +359 -62
- package/fesm2015/kwikid-forms.js.map +1 -1
- package/lib/renderer/form-view/definitions/form-view.actions.definition.d.ts +7 -1
- package/lib/renderer/form-view/definitions/form-view.apis.definition.d.ts +3 -3
- package/lib/renderer/form-view/definitions/form-view.fields.definition.d.ts +6 -0
- package/lib/renderer/form-view/definitions/from-view.logs.definition.d.ts +3 -0
- package/lib/renderer/form-view/form-view.component.d.ts +9 -2
- package/lib/renderer/form-view/helpers/form-view.defaults.helper.d.ts +1 -0
- package/lib/renderer/renderer.component.d.ts +3 -1
- package/package.json +1 -1
|
@@ -1203,7 +1203,8 @@
|
|
|
1203
1203
|
logo: {
|
|
1204
1204
|
src: "",
|
|
1205
1205
|
alt: "Logo",
|
|
1206
|
-
hidden: false
|
|
1206
|
+
hidden: false,
|
|
1207
|
+
styles: ""
|
|
1207
1208
|
},
|
|
1208
1209
|
backButton: {
|
|
1209
1210
|
mode: "TABBED",
|
|
@@ -1212,10 +1213,12 @@
|
|
|
1212
1213
|
},
|
|
1213
1214
|
title: {
|
|
1214
1215
|
hidden: false,
|
|
1215
|
-
label: (_b = (_a = formConfig === null || formConfig === void 0 ? void 0 : formConfig.title) !== null && _a !== void 0 ? _a : formConfig === null || formConfig === void 0 ? void 0 : formConfig.props.title) !== null && _b !== void 0 ? _b : "Form"
|
|
1216
|
+
label: (_b = (_a = formConfig === null || formConfig === void 0 ? void 0 : formConfig.title) !== null && _a !== void 0 ? _a : formConfig === null || formConfig === void 0 ? void 0 : formConfig.props.title) !== null && _b !== void 0 ? _b : "Form",
|
|
1217
|
+
styles: ""
|
|
1216
1218
|
},
|
|
1217
1219
|
steps: {
|
|
1218
|
-
hidden: false
|
|
1220
|
+
hidden: false,
|
|
1221
|
+
styles: ""
|
|
1219
1222
|
}
|
|
1220
1223
|
},
|
|
1221
1224
|
main: {
|
|
@@ -1639,49 +1642,6 @@
|
|
|
1639
1642
|
return field;
|
|
1640
1643
|
};
|
|
1641
1644
|
var updateFieldDefaultValue = function (field) {
|
|
1642
|
-
var defaultValue = {
|
|
1643
|
-
value: {
|
|
1644
|
-
is_found: false,
|
|
1645
|
-
value: "",
|
|
1646
|
-
sources: [
|
|
1647
|
-
{
|
|
1648
|
-
key: "OBJECT",
|
|
1649
|
-
props: {
|
|
1650
|
-
object: {
|
|
1651
|
-
key: "FORM_DATA",
|
|
1652
|
-
path: "$." + field.key
|
|
1653
|
-
}
|
|
1654
|
-
},
|
|
1655
|
-
value: "",
|
|
1656
|
-
validation: {
|
|
1657
|
-
is_valid: false,
|
|
1658
|
-
triggers: ["ON_INIT"],
|
|
1659
|
-
rules: [],
|
|
1660
|
-
actions: [
|
|
1661
|
-
{
|
|
1662
|
-
id: "1",
|
|
1663
|
-
key: "SET_FIELD_DEFAULT_VALUE",
|
|
1664
|
-
condition: "1",
|
|
1665
|
-
props: {
|
|
1666
|
-
value: {
|
|
1667
|
-
source: {
|
|
1668
|
-
key: "OBJECT",
|
|
1669
|
-
props: {
|
|
1670
|
-
object: {
|
|
1671
|
-
key: "FORM_DATA",
|
|
1672
|
-
path: "$." + field.key
|
|
1673
|
-
}
|
|
1674
|
-
}
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
|
-
}
|
|
1678
|
-
}
|
|
1679
|
-
]
|
|
1680
|
-
}
|
|
1681
|
-
}
|
|
1682
|
-
]
|
|
1683
|
-
}
|
|
1684
|
-
};
|
|
1685
1645
|
if (field.isFormElement) {
|
|
1686
1646
|
if (kwikidToolkit.checkObjectKeyExists(field, "defaultValue")) {
|
|
1687
1647
|
return field;
|
|
@@ -1690,7 +1650,48 @@
|
|
|
1690
1650
|
return field;
|
|
1691
1651
|
}
|
|
1692
1652
|
else if (!kwikidToolkit.checkObjectPathExists(field, "default.value.sources")) {
|
|
1693
|
-
|
|
1653
|
+
var defaultValue = {
|
|
1654
|
+
is_found: false,
|
|
1655
|
+
value: "",
|
|
1656
|
+
sources: [
|
|
1657
|
+
{
|
|
1658
|
+
key: "OBJECT",
|
|
1659
|
+
props: {
|
|
1660
|
+
object: {
|
|
1661
|
+
key: "FORM_DATA",
|
|
1662
|
+
path: "$." + field.key
|
|
1663
|
+
}
|
|
1664
|
+
},
|
|
1665
|
+
value: "",
|
|
1666
|
+
validation: {
|
|
1667
|
+
is_valid: false,
|
|
1668
|
+
triggers: ["ON_INIT"],
|
|
1669
|
+
rules: [],
|
|
1670
|
+
actions: [
|
|
1671
|
+
{
|
|
1672
|
+
id: "1",
|
|
1673
|
+
key: "SET_FIELD_DEFAULT_VALUE",
|
|
1674
|
+
condition: "1",
|
|
1675
|
+
props: {
|
|
1676
|
+
value: {
|
|
1677
|
+
source: {
|
|
1678
|
+
key: "OBJECT",
|
|
1679
|
+
props: {
|
|
1680
|
+
object: {
|
|
1681
|
+
key: "FORM_DATA",
|
|
1682
|
+
path: "$." + field.key
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
]
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
]
|
|
1693
|
+
};
|
|
1694
|
+
field = kwikidToolkit.setValueToObjectPath(field, "default.value", defaultValue);
|
|
1694
1695
|
return field;
|
|
1695
1696
|
}
|
|
1696
1697
|
delete field["defaultVal"];
|
|
@@ -1752,7 +1753,10 @@
|
|
|
1752
1753
|
field = formatOnFieldType(field);
|
|
1753
1754
|
field = updateFieldDisability(field);
|
|
1754
1755
|
fieldGroups = updateFormFieldGroups(fieldGroups, field);
|
|
1756
|
+
console.log("sadssadasdsdda");
|
|
1757
|
+
console.log(kwikidToolkit.getObjectDeepCopy(field));
|
|
1755
1758
|
field = updateFieldDefaultValue(field);
|
|
1759
|
+
console.log(kwikidToolkit.getObjectDeepCopy(field));
|
|
1756
1760
|
field = updateFieldValidators(field);
|
|
1757
1761
|
field = updateFieldResetButton(field);
|
|
1758
1762
|
field = updateFieldMessages(field);
|
|
@@ -2769,6 +2773,12 @@
|
|
|
2769
2773
|
(function (EActionKey) {
|
|
2770
2774
|
EActionKey["SET_VALUE"] = "SET_VALUE";
|
|
2771
2775
|
EActionKey["SET_FIELD_DEFAULT_VALUE"] = "SET_FIELD_DEFAULT_VALUE";
|
|
2776
|
+
EActionKey["SET_API_STATUS"] = "SET_API_STATUS";
|
|
2777
|
+
EActionKey["SET_API_HEADER_VALUE"] = "SET_API_HEADER_VALUE";
|
|
2778
|
+
EActionKey["SET_API_HEADER_VALIDITY"] = "SET_API_HEADER_VALIDITY";
|
|
2779
|
+
EActionKey["SET_API_BODY_VALUE"] = "SET_API_BODY_VALUE";
|
|
2780
|
+
EActionKey["SET_API_BODY_VALIDITY"] = "SET_API_BODY_VALIDITY";
|
|
2781
|
+
EActionKey["SET_FIELD_VALIDITY"] = "SET_FIELD_VALIDITY";
|
|
2772
2782
|
EActionKey["FIELD_MESSAGE_SHOW"] = "FIELD_MESSAGE_SHOW";
|
|
2773
2783
|
EActionKey["FIELD_MESSAGES_HIDE"] = "FIELD_MESSAGES_HIDE";
|
|
2774
2784
|
EActionKey["FIELD_ERROR_SHOW"] = "FIELD_ERROR_SHOW";
|
|
@@ -2942,16 +2952,16 @@
|
|
|
2942
2952
|
});
|
|
2943
2953
|
});
|
|
2944
2954
|
};
|
|
2945
|
-
Defaults.prototype.
|
|
2955
|
+
Defaults.prototype.getFormFieldApiValue = function () {
|
|
2946
2956
|
return __awaiter(this, void 0, void 0, function () {
|
|
2947
|
-
var
|
|
2957
|
+
var apiConfig, rules, actions, rulesMapping, actions_3, actions_3_1, action, conditionEvaluation, actions_4, e_3_1;
|
|
2948
2958
|
var e_3, _a;
|
|
2949
2959
|
return __generator(this, function (_b) {
|
|
2950
2960
|
switch (_b.label) {
|
|
2951
2961
|
case 0:
|
|
2952
|
-
|
|
2953
|
-
rules =
|
|
2954
|
-
actions =
|
|
2962
|
+
apiConfig = this._field.default.api;
|
|
2963
|
+
rules = apiConfig.rules;
|
|
2964
|
+
actions = apiConfig.actions;
|
|
2955
2965
|
rulesMapping = new kwikidToolkit.Rule(rules, {
|
|
2956
2966
|
FIELD_CONFIG: this._field,
|
|
2957
2967
|
FORM_FIELDS: this._formFields,
|
|
@@ -2999,11 +3009,71 @@
|
|
|
2999
3009
|
});
|
|
3000
3010
|
});
|
|
3001
3011
|
};
|
|
3012
|
+
Defaults.prototype.getFormFieldOptions = function () {
|
|
3013
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3014
|
+
var optionsConfig, rules, actions, rulesMapping, actions_5, actions_5_1, action, conditionEvaluation, actions_6, e_4_1;
|
|
3015
|
+
var e_4, _a;
|
|
3016
|
+
return __generator(this, function (_b) {
|
|
3017
|
+
switch (_b.label) {
|
|
3018
|
+
case 0:
|
|
3019
|
+
optionsConfig = this._field.default.options;
|
|
3020
|
+
rules = optionsConfig.rules;
|
|
3021
|
+
actions = optionsConfig.actions;
|
|
3022
|
+
rulesMapping = new kwikidToolkit.Rule(rules, {
|
|
3023
|
+
FIELD_CONFIG: this._field,
|
|
3024
|
+
FORM_FIELDS: this._formFields,
|
|
3025
|
+
FORM_DATA: this._formData,
|
|
3026
|
+
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
3027
|
+
ALL_FORMS_DATA: this._allFormsData
|
|
3028
|
+
}).mapping();
|
|
3029
|
+
_b.label = 1;
|
|
3030
|
+
case 1:
|
|
3031
|
+
_b.trys.push([1, 6, 7, 8]);
|
|
3032
|
+
actions_5 = __values(actions), actions_5_1 = actions_5.next();
|
|
3033
|
+
_b.label = 2;
|
|
3034
|
+
case 2:
|
|
3035
|
+
if (!!actions_5_1.done) return [3 /*break*/, 5];
|
|
3036
|
+
action = actions_5_1.value;
|
|
3037
|
+
conditionEvaluation = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
3038
|
+
if (!conditionEvaluation) return [3 /*break*/, 4];
|
|
3039
|
+
actions_6 = new kwikidToolkit.Action(action, rulesMapping, {
|
|
3040
|
+
FIELD_CONFIG: this._field,
|
|
3041
|
+
FORM_FIELDS: this._formFields,
|
|
3042
|
+
FORM_DATA: this._formData,
|
|
3043
|
+
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
3044
|
+
ALL_FORMS_DATA: this._allFormsData
|
|
3045
|
+
}, this._takeAction);
|
|
3046
|
+
return [4 /*yield*/, actions_6.execute()];
|
|
3047
|
+
case 3:
|
|
3048
|
+
_b.sent();
|
|
3049
|
+
_b.label = 4;
|
|
3050
|
+
case 4:
|
|
3051
|
+
actions_5_1 = actions_5.next();
|
|
3052
|
+
return [3 /*break*/, 2];
|
|
3053
|
+
case 5: return [3 /*break*/, 8];
|
|
3054
|
+
case 6:
|
|
3055
|
+
e_4_1 = _b.sent();
|
|
3056
|
+
e_4 = { error: e_4_1 };
|
|
3057
|
+
return [3 /*break*/, 8];
|
|
3058
|
+
case 7:
|
|
3059
|
+
try {
|
|
3060
|
+
if (actions_5_1 && !actions_5_1.done && (_a = actions_5.return)) _a.call(actions_5);
|
|
3061
|
+
}
|
|
3062
|
+
finally { if (e_4) throw e_4.error; }
|
|
3063
|
+
return [7 /*endfinally*/];
|
|
3064
|
+
case 8: return [2 /*return*/];
|
|
3065
|
+
}
|
|
3066
|
+
});
|
|
3067
|
+
});
|
|
3068
|
+
};
|
|
3002
3069
|
return Defaults;
|
|
3003
3070
|
}());
|
|
3004
3071
|
__decorate([
|
|
3005
3072
|
kwikidToolkit.logMethod
|
|
3006
3073
|
], Defaults.prototype, "getFormFieldValue", null);
|
|
3074
|
+
__decorate([
|
|
3075
|
+
kwikidToolkit.logMethod
|
|
3076
|
+
], Defaults.prototype, "getFormFieldApiValue", null);
|
|
3007
3077
|
__decorate([
|
|
3008
3078
|
kwikidToolkit.logMethod
|
|
3009
3079
|
], Defaults.prototype, "getFormFieldOptions", null);
|
|
@@ -3139,13 +3209,13 @@
|
|
|
3139
3209
|
formGroup = new i3.FormGroup({});
|
|
3140
3210
|
_b.label = 1;
|
|
3141
3211
|
case 1:
|
|
3142
|
-
_b.trys.push([1,
|
|
3212
|
+
_b.trys.push([1, 11, 12, 13]);
|
|
3143
3213
|
fields_1 = __values(fields), fields_1_1 = fields_1.next();
|
|
3144
3214
|
_b.label = 2;
|
|
3145
3215
|
case 2:
|
|
3146
|
-
if (!!fields_1_1.done) return [3 /*break*/,
|
|
3216
|
+
if (!!fields_1_1.done) return [3 /*break*/, 10];
|
|
3147
3217
|
field = fields_1_1.value;
|
|
3148
|
-
if (!field.isFormElement) return [3 /*break*/,
|
|
3218
|
+
if (!field.isFormElement) return [3 /*break*/, 9];
|
|
3149
3219
|
defaults = new Defaults(field, fields, allFormsData, formData, previousFormData, takeAction);
|
|
3150
3220
|
value = "";
|
|
3151
3221
|
if (!kwikidToolkit.checkObjectKeyExists(field, "default")) return [3 /*break*/, 4];
|
|
@@ -3155,33 +3225,45 @@
|
|
|
3155
3225
|
value = _b.sent();
|
|
3156
3226
|
_b.label = 4;
|
|
3157
3227
|
case 4:
|
|
3228
|
+
console.log("sdasgdjsgsadaghas");
|
|
3229
|
+
console.log("sdasgdjsgsadaghas1");
|
|
3158
3230
|
if (!kwikidToolkit.checkObjectKeyExists(field, "default")) return [3 /*break*/, 6];
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
return [
|
|
3231
|
+
console.log("sdasgdjsgsadaghas2");
|
|
3232
|
+
console.log(kwikidToolkit.getObjectDeepCopy(field));
|
|
3233
|
+
if (!kwikidToolkit.checkObjectKeyExists(field.default, "api")) return [3 /*break*/, 6];
|
|
3234
|
+
console.log("sdasgdjsgsadaghas3");
|
|
3235
|
+
return [4 /*yield*/, defaults.getFormFieldApiValue()];
|
|
3162
3236
|
case 5:
|
|
3163
3237
|
_b.sent();
|
|
3164
3238
|
_b.label = 6;
|
|
3165
3239
|
case 6:
|
|
3240
|
+
if (!kwikidToolkit.checkObjectKeyExists(field, "default")) return [3 /*break*/, 8];
|
|
3241
|
+
if (!kwikidToolkit.checkObjectKeyExists(field.default, "options")) return [3 /*break*/, 8];
|
|
3242
|
+
if (!field.default.options.triggers.includes("ON_INIT")) return [3 /*break*/, 8];
|
|
3243
|
+
return [4 /*yield*/, defaults.getFormFieldOptions()];
|
|
3244
|
+
case 7:
|
|
3245
|
+
_b.sent();
|
|
3246
|
+
_b.label = 8;
|
|
3247
|
+
case 8:
|
|
3166
3248
|
value = convertFormFieldValueToKwikUIFormat(field, value);
|
|
3167
3249
|
validators = new FormValidation().getFormFieldValidators(field);
|
|
3168
3250
|
formGroup.addControl(field.key, new i3.FormControl({ value: value, disabled: field.disabled }, { validators: validators }));
|
|
3169
|
-
_b.label =
|
|
3170
|
-
case
|
|
3251
|
+
_b.label = 9;
|
|
3252
|
+
case 9:
|
|
3171
3253
|
fields_1_1 = fields_1.next();
|
|
3172
3254
|
return [3 /*break*/, 2];
|
|
3173
|
-
case
|
|
3174
|
-
case
|
|
3255
|
+
case 10: return [3 /*break*/, 13];
|
|
3256
|
+
case 11:
|
|
3175
3257
|
e_1_1 = _b.sent();
|
|
3176
3258
|
e_1 = { error: e_1_1 };
|
|
3177
|
-
return [3 /*break*/,
|
|
3178
|
-
case
|
|
3259
|
+
return [3 /*break*/, 13];
|
|
3260
|
+
case 12:
|
|
3179
3261
|
try {
|
|
3180
3262
|
if (fields_1_1 && !fields_1_1.done && (_a = fields_1.return)) _a.call(fields_1);
|
|
3181
3263
|
}
|
|
3182
3264
|
finally { if (e_1) throw e_1.error; }
|
|
3183
3265
|
return [7 /*endfinally*/];
|
|
3184
|
-
case
|
|
3266
|
+
case 13: return [2 /*return*/, formGroup];
|
|
3185
3267
|
}
|
|
3186
3268
|
});
|
|
3187
3269
|
});
|
|
@@ -3212,54 +3294,54 @@
|
|
|
3212
3294
|
Apis.prototype.setUrl = function () {
|
|
3213
3295
|
return __awaiter(this, void 0, void 0, function () {
|
|
3214
3296
|
var source, url;
|
|
3215
|
-
return __generator(this, function (
|
|
3216
|
-
switch (
|
|
3297
|
+
return __generator(this, function (_l) {
|
|
3298
|
+
switch (_l.label) {
|
|
3217
3299
|
case 0:
|
|
3218
3300
|
if (!(this._request.url.hasOwnProperty("type") &&
|
|
3219
3301
|
this._request.url.type === EApiRequestUrlType.CALCULATED)) return [3 /*break*/, 2];
|
|
3220
3302
|
source = new kwikidToolkit.Source(this._object);
|
|
3221
3303
|
return [4 /*yield*/, source.getValueFromSource(this._request.url.props.value.source)];
|
|
3222
3304
|
case 1:
|
|
3223
|
-
url =
|
|
3305
|
+
url = _l.sent();
|
|
3224
3306
|
this._request.url = kwikidToolkit.setValueToObjectPath(this._request.url, "value", url);
|
|
3225
3307
|
return [3 /*break*/, 3];
|
|
3226
3308
|
case 2:
|
|
3227
3309
|
if (typeof this._request.url === "string") {
|
|
3228
3310
|
this._request.url = kwikidToolkit.setValueToObjectPath({}, "value", this._request.url);
|
|
3229
3311
|
}
|
|
3230
|
-
|
|
3312
|
+
_l.label = 3;
|
|
3231
3313
|
case 3: return [2 /*return*/, this._object.API_CONFIG];
|
|
3232
3314
|
}
|
|
3233
3315
|
});
|
|
3234
3316
|
});
|
|
3235
3317
|
};
|
|
3236
3318
|
Apis.prototype.setRequestBody = function () {
|
|
3237
|
-
var _a, _b, _c, _d;
|
|
3319
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3238
3320
|
return __awaiter(this, void 0, void 0, function () {
|
|
3239
|
-
var params, paramIndex, params_1, params_1_1, param, sources, sourceIndex, sources_1, sources_1_1, source, sources_2, value, validation, triggers, rules, actions, rulesMapping, actions_1, actions_1_1, action, conditionEvaluation,
|
|
3240
|
-
var e_3,
|
|
3241
|
-
return __generator(this, function (
|
|
3242
|
-
switch (
|
|
3321
|
+
var params, paramIndex, params_1, params_1_1, param, sources, sourceIndex, sources_1, sources_1_1, source, sources_2, value, validation, triggers, rules, actions, rulesMapping, actions_1, actions_1_1, action, conditionEvaluation, actions_3, e_1_1, e_2_1, e_3_1, triggers, rules, actions, rulesMapping, actions_2, actions_2_1, action, conditionEvaluation, actions_4, e_4_1;
|
|
3322
|
+
var e_3, _l, e_2, _m, e_1, _o, e_4, _p;
|
|
3323
|
+
return __generator(this, function (_q) {
|
|
3324
|
+
switch (_q.label) {
|
|
3243
3325
|
case 0:
|
|
3244
|
-
if (!kwikidToolkit.checkObjectKeyExists(this._request, "body")) return [3 /*break*/,
|
|
3326
|
+
if (!kwikidToolkit.checkObjectKeyExists(this._request, "body")) return [3 /*break*/, 34];
|
|
3245
3327
|
if (!kwikidToolkit.checkObjectKeyExists(this._request.body, "params")) return [3 /*break*/, 23];
|
|
3246
3328
|
params = this._request.body.params;
|
|
3247
3329
|
paramIndex = 0;
|
|
3248
|
-
|
|
3330
|
+
_q.label = 1;
|
|
3249
3331
|
case 1:
|
|
3250
|
-
|
|
3332
|
+
_q.trys.push([1, 20, 21, 22]);
|
|
3251
3333
|
params_1 = __values(params), params_1_1 = params_1.next();
|
|
3252
|
-
|
|
3334
|
+
_q.label = 2;
|
|
3253
3335
|
case 2:
|
|
3254
3336
|
if (!!params_1_1.done) return [3 /*break*/, 19];
|
|
3255
3337
|
param = params_1_1.value;
|
|
3256
3338
|
sources = param.sources;
|
|
3257
3339
|
sourceIndex = 0;
|
|
3258
|
-
|
|
3340
|
+
_q.label = 3;
|
|
3259
3341
|
case 3:
|
|
3260
|
-
|
|
3342
|
+
_q.trys.push([3, 15, 16, 17]);
|
|
3261
3343
|
sources_1 = (e_2 = void 0, __values(sources)), sources_1_1 = sources_1.next();
|
|
3262
|
-
|
|
3344
|
+
_q.label = 4;
|
|
3263
3345
|
case 4:
|
|
3264
3346
|
if (!!sources_1_1.done) return [3 /*break*/, 14];
|
|
3265
3347
|
source = sources_1_1.value;
|
|
@@ -3272,87 +3354,124 @@
|
|
|
3272
3354
|
rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
|
|
3273
3355
|
actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
|
|
3274
3356
|
rulesMapping = new kwikidToolkit.Rule(rules, this._object).mapping();
|
|
3275
|
-
|
|
3357
|
+
_q.label = 5;
|
|
3276
3358
|
case 5:
|
|
3277
|
-
|
|
3359
|
+
_q.trys.push([5, 10, 11, 12]);
|
|
3278
3360
|
actions_1 = (e_1 = void 0, __values(actions)), actions_1_1 = actions_1.next();
|
|
3279
|
-
|
|
3361
|
+
_q.label = 6;
|
|
3280
3362
|
case 6:
|
|
3281
3363
|
if (!!actions_1_1.done) return [3 /*break*/, 9];
|
|
3282
3364
|
action = actions_1_1.value;
|
|
3283
3365
|
conditionEvaluation = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
3284
3366
|
if (!conditionEvaluation) return [3 /*break*/, 8];
|
|
3285
|
-
|
|
3286
|
-
return [4 /*yield*/,
|
|
3367
|
+
actions_3 = new kwikidToolkit.Action(action, rulesMapping, this._object, this._takeAction);
|
|
3368
|
+
return [4 /*yield*/, actions_3.execute()];
|
|
3287
3369
|
case 7:
|
|
3288
|
-
|
|
3289
|
-
|
|
3370
|
+
_q.sent();
|
|
3371
|
+
_q.label = 8;
|
|
3290
3372
|
case 8:
|
|
3291
3373
|
actions_1_1 = actions_1.next();
|
|
3292
3374
|
return [3 /*break*/, 6];
|
|
3293
3375
|
case 9: return [3 /*break*/, 12];
|
|
3294
3376
|
case 10:
|
|
3295
|
-
e_1_1 =
|
|
3377
|
+
e_1_1 = _q.sent();
|
|
3296
3378
|
e_1 = { error: e_1_1 };
|
|
3297
3379
|
return [3 /*break*/, 12];
|
|
3298
3380
|
case 11:
|
|
3299
3381
|
try {
|
|
3300
|
-
if (actions_1_1 && !actions_1_1.done && (
|
|
3382
|
+
if (actions_1_1 && !actions_1_1.done && (_o = actions_1.return)) _o.call(actions_1);
|
|
3301
3383
|
}
|
|
3302
3384
|
finally { if (e_1) throw e_1.error; }
|
|
3303
3385
|
return [7 /*endfinally*/];
|
|
3304
3386
|
case 12:
|
|
3305
3387
|
sourceIndex++;
|
|
3306
|
-
|
|
3388
|
+
_q.label = 13;
|
|
3307
3389
|
case 13:
|
|
3308
3390
|
sources_1_1 = sources_1.next();
|
|
3309
3391
|
return [3 /*break*/, 4];
|
|
3310
3392
|
case 14: return [3 /*break*/, 17];
|
|
3311
3393
|
case 15:
|
|
3312
|
-
e_2_1 =
|
|
3394
|
+
e_2_1 = _q.sent();
|
|
3313
3395
|
e_2 = { error: e_2_1 };
|
|
3314
3396
|
return [3 /*break*/, 17];
|
|
3315
3397
|
case 16:
|
|
3316
3398
|
try {
|
|
3317
|
-
if (sources_1_1 && !sources_1_1.done && (
|
|
3399
|
+
if (sources_1_1 && !sources_1_1.done && (_m = sources_1.return)) _m.call(sources_1);
|
|
3318
3400
|
}
|
|
3319
3401
|
finally { if (e_2) throw e_2.error; }
|
|
3320
3402
|
return [7 /*endfinally*/];
|
|
3321
3403
|
case 17:
|
|
3322
3404
|
paramIndex++;
|
|
3323
|
-
|
|
3405
|
+
_q.label = 18;
|
|
3324
3406
|
case 18:
|
|
3325
3407
|
params_1_1 = params_1.next();
|
|
3326
3408
|
return [3 /*break*/, 2];
|
|
3327
3409
|
case 19: return [3 /*break*/, 22];
|
|
3328
3410
|
case 20:
|
|
3329
|
-
e_3_1 =
|
|
3411
|
+
e_3_1 = _q.sent();
|
|
3330
3412
|
e_3 = { error: e_3_1 };
|
|
3331
3413
|
return [3 /*break*/, 22];
|
|
3332
3414
|
case 21:
|
|
3333
3415
|
try {
|
|
3334
|
-
if (params_1_1 && !params_1_1.done && (
|
|
3416
|
+
if (params_1_1 && !params_1_1.done && (_l = params_1.return)) _l.call(params_1);
|
|
3335
3417
|
}
|
|
3336
3418
|
finally { if (e_3) throw e_3.error; }
|
|
3337
3419
|
return [7 /*endfinally*/];
|
|
3338
3420
|
case 22: return [2 /*return*/, this._object.API_CONFIG];
|
|
3339
|
-
case 23:
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3421
|
+
case 23:
|
|
3422
|
+
if (!(kwikidToolkit.checkObjectKeyExists(this._request.body, "rules") &&
|
|
3423
|
+
kwikidToolkit.checkObjectKeyExists(this._request.body, "actions"))) return [3 /*break*/, 32];
|
|
3424
|
+
triggers = (_f = (_e = this._request.body) === null || _e === void 0 ? void 0 : _e.triggers) !== null && _f !== void 0 ? _f : [];
|
|
3425
|
+
rules = (_h = (_g = this._request.body) === null || _g === void 0 ? void 0 : _g.rules) !== null && _h !== void 0 ? _h : [];
|
|
3426
|
+
actions = (_k = (_j = this._request.body) === null || _j === void 0 ? void 0 : _j.actions) !== null && _k !== void 0 ? _k : [];
|
|
3427
|
+
rulesMapping = new kwikidToolkit.Rule(rules, this._object).mapping();
|
|
3428
|
+
_q.label = 24;
|
|
3429
|
+
case 24:
|
|
3430
|
+
_q.trys.push([24, 29, 30, 31]);
|
|
3431
|
+
actions_2 = __values(actions), actions_2_1 = actions_2.next();
|
|
3432
|
+
_q.label = 25;
|
|
3433
|
+
case 25:
|
|
3434
|
+
if (!!actions_2_1.done) return [3 /*break*/, 28];
|
|
3435
|
+
action = actions_2_1.value;
|
|
3436
|
+
conditionEvaluation = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
3437
|
+
if (!conditionEvaluation) return [3 /*break*/, 27];
|
|
3438
|
+
actions_4 = new kwikidToolkit.Action(action, rulesMapping, this._object, this._takeAction);
|
|
3439
|
+
return [4 /*yield*/, actions_4.execute()];
|
|
3440
|
+
case 26:
|
|
3441
|
+
_q.sent();
|
|
3442
|
+
_q.label = 27;
|
|
3443
|
+
case 27:
|
|
3444
|
+
actions_2_1 = actions_2.next();
|
|
3445
|
+
return [3 /*break*/, 25];
|
|
3446
|
+
case 28: return [3 /*break*/, 31];
|
|
3447
|
+
case 29:
|
|
3448
|
+
e_4_1 = _q.sent();
|
|
3449
|
+
e_4 = { error: e_4_1 };
|
|
3450
|
+
return [3 /*break*/, 31];
|
|
3451
|
+
case 30:
|
|
3452
|
+
try {
|
|
3453
|
+
if (actions_2_1 && !actions_2_1.done && (_p = actions_2.return)) _p.call(actions_2);
|
|
3454
|
+
}
|
|
3455
|
+
finally { if (e_4) throw e_4.error; }
|
|
3456
|
+
return [7 /*endfinally*/];
|
|
3457
|
+
case 31: return [2 /*return*/, this._object.API_CONFIG];
|
|
3458
|
+
case 32: return [2 /*return*/, this._object.API_CONFIG];
|
|
3459
|
+
case 33: return [3 /*break*/, 35];
|
|
3460
|
+
case 34: return [2 /*return*/, this._object.API_CONFIG];
|
|
3461
|
+
case 35: return [2 /*return*/];
|
|
3343
3462
|
}
|
|
3344
3463
|
});
|
|
3345
3464
|
});
|
|
3346
3465
|
};
|
|
3347
3466
|
Apis.prototype.validateRequestBody = function () {
|
|
3348
|
-
var _a, _b, _c, _d;
|
|
3467
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3349
3468
|
return __awaiter(this, void 0, void 0, function () {
|
|
3350
|
-
var body, validation, triggers, rules, actions, rulesMapping,
|
|
3351
|
-
var
|
|
3352
|
-
return __generator(this, function (
|
|
3353
|
-
switch (
|
|
3469
|
+
var body, validation, triggers, rules, actions, rulesMapping, actions_5, actions_5_1, action, conditionSuccess, actions_7, e_5_1, triggers, rules, actions, rulesMapping, actions_6, actions_6_1, action, conditionSuccess, actions_8, e_6_1;
|
|
3470
|
+
var e_5, _l, e_6, _m;
|
|
3471
|
+
return __generator(this, function (_o) {
|
|
3472
|
+
switch (_o.label) {
|
|
3354
3473
|
case 0:
|
|
3355
|
-
if (!kwikidToolkit.checkObjectKeyExists(this._request, "body")) return [3 /*break*/,
|
|
3474
|
+
if (!kwikidToolkit.checkObjectKeyExists(this._request, "body")) return [3 /*break*/, 20];
|
|
3356
3475
|
if (!kwikidToolkit.checkObjectKeyExists(this._request.body, "validation")) return [3 /*break*/, 9];
|
|
3357
3476
|
body = this._request.body;
|
|
3358
3477
|
validation = body.validation;
|
|
@@ -3360,75 +3479,112 @@
|
|
|
3360
3479
|
rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
|
|
3361
3480
|
actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
|
|
3362
3481
|
rulesMapping = new kwikidToolkit.Rule(rules, this._object).mapping();
|
|
3363
|
-
|
|
3482
|
+
_o.label = 1;
|
|
3364
3483
|
case 1:
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3484
|
+
_o.trys.push([1, 6, 7, 8]);
|
|
3485
|
+
actions_5 = __values(actions), actions_5_1 = actions_5.next();
|
|
3486
|
+
_o.label = 2;
|
|
3368
3487
|
case 2:
|
|
3369
|
-
if (!!
|
|
3370
|
-
action =
|
|
3488
|
+
if (!!actions_5_1.done) return [3 /*break*/, 5];
|
|
3489
|
+
action = actions_5_1.value;
|
|
3371
3490
|
conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
3372
3491
|
if (!conditionSuccess) return [3 /*break*/, 4];
|
|
3373
|
-
|
|
3374
|
-
return [4 /*yield*/,
|
|
3492
|
+
actions_7 = new kwikidToolkit.Action(action, rulesMapping, this._object, this._takeAction);
|
|
3493
|
+
return [4 /*yield*/, actions_7.execute()];
|
|
3375
3494
|
case 3:
|
|
3376
|
-
|
|
3377
|
-
|
|
3495
|
+
_o.sent();
|
|
3496
|
+
_o.label = 4;
|
|
3378
3497
|
case 4:
|
|
3379
|
-
|
|
3498
|
+
actions_5_1 = actions_5.next();
|
|
3380
3499
|
return [3 /*break*/, 2];
|
|
3381
3500
|
case 5: return [3 /*break*/, 8];
|
|
3382
3501
|
case 6:
|
|
3383
|
-
|
|
3384
|
-
|
|
3502
|
+
e_5_1 = _o.sent();
|
|
3503
|
+
e_5 = { error: e_5_1 };
|
|
3385
3504
|
return [3 /*break*/, 8];
|
|
3386
3505
|
case 7:
|
|
3387
3506
|
try {
|
|
3388
|
-
if (
|
|
3507
|
+
if (actions_5_1 && !actions_5_1.done && (_l = actions_5.return)) _l.call(actions_5);
|
|
3389
3508
|
}
|
|
3390
|
-
finally { if (
|
|
3509
|
+
finally { if (e_5) throw e_5.error; }
|
|
3391
3510
|
return [7 /*endfinally*/];
|
|
3392
3511
|
case 8: return [2 /*return*/, this._object.API_CONFIG];
|
|
3393
3512
|
case 9:
|
|
3513
|
+
if (!(kwikidToolkit.checkObjectPathExists(this._request.body, "rules") &&
|
|
3514
|
+
kwikidToolkit.checkObjectPathExists(this._request.body, "actions"))) return [3 /*break*/, 18];
|
|
3515
|
+
triggers = (_f = (_e = this._request.body) === null || _e === void 0 ? void 0 : _e.triggers) !== null && _f !== void 0 ? _f : [];
|
|
3516
|
+
rules = (_h = (_g = this._request.body) === null || _g === void 0 ? void 0 : _g.rules) !== null && _h !== void 0 ? _h : [];
|
|
3517
|
+
actions = (_k = (_j = this._request.body) === null || _j === void 0 ? void 0 : _j.actions) !== null && _k !== void 0 ? _k : [];
|
|
3518
|
+
rulesMapping = new kwikidToolkit.Rule(rules, this._object).mapping();
|
|
3519
|
+
_o.label = 10;
|
|
3520
|
+
case 10:
|
|
3521
|
+
_o.trys.push([10, 15, 16, 17]);
|
|
3522
|
+
actions_6 = __values(actions), actions_6_1 = actions_6.next();
|
|
3523
|
+
_o.label = 11;
|
|
3524
|
+
case 11:
|
|
3525
|
+
if (!!actions_6_1.done) return [3 /*break*/, 14];
|
|
3526
|
+
action = actions_6_1.value;
|
|
3527
|
+
conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
3528
|
+
if (!conditionSuccess) return [3 /*break*/, 13];
|
|
3529
|
+
actions_8 = new kwikidToolkit.Action(action, rulesMapping, this._object, this._takeAction);
|
|
3530
|
+
return [4 /*yield*/, actions_8.execute()];
|
|
3531
|
+
case 12:
|
|
3532
|
+
_o.sent();
|
|
3533
|
+
_o.label = 13;
|
|
3534
|
+
case 13:
|
|
3535
|
+
actions_6_1 = actions_6.next();
|
|
3536
|
+
return [3 /*break*/, 11];
|
|
3537
|
+
case 14: return [3 /*break*/, 17];
|
|
3538
|
+
case 15:
|
|
3539
|
+
e_6_1 = _o.sent();
|
|
3540
|
+
e_6 = { error: e_6_1 };
|
|
3541
|
+
return [3 /*break*/, 17];
|
|
3542
|
+
case 16:
|
|
3543
|
+
try {
|
|
3544
|
+
if (actions_6_1 && !actions_6_1.done && (_m = actions_6.return)) _m.call(actions_6);
|
|
3545
|
+
}
|
|
3546
|
+
finally { if (e_6) throw e_6.error; }
|
|
3547
|
+
return [7 /*endfinally*/];
|
|
3548
|
+
case 17: return [2 /*return*/, this._object.API_CONFIG];
|
|
3549
|
+
case 18:
|
|
3394
3550
|
this._object = kwikidToolkit.setValueToObjectPath(this._object, "API_CONFIG.request.validation.body.is_valid", true);
|
|
3395
3551
|
return [2 /*return*/, this._object.API_CONFIG];
|
|
3396
|
-
case
|
|
3397
|
-
case
|
|
3552
|
+
case 19: return [3 /*break*/, 21];
|
|
3553
|
+
case 20:
|
|
3398
3554
|
this._object = kwikidToolkit.setValueToObjectPath(this._object, "API_CONFIG.request.validation.body.is_valid", true);
|
|
3399
3555
|
return [2 /*return*/, this._object.API_CONFIG];
|
|
3400
|
-
case
|
|
3556
|
+
case 21: return [2 /*return*/];
|
|
3401
3557
|
}
|
|
3402
3558
|
});
|
|
3403
3559
|
});
|
|
3404
3560
|
};
|
|
3405
3561
|
Apis.prototype.setRequestHeaders = function () {
|
|
3406
|
-
var _a, _b, _c, _d;
|
|
3562
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3407
3563
|
return __awaiter(this, void 0, void 0, function () {
|
|
3408
|
-
var params, paramIndex, params_2, params_2_1, param, sources, sourceIndex, sources_3, sources_3_1, source, sources_4, value, validation, triggers, rules, actions, rulesMapping,
|
|
3409
|
-
var
|
|
3410
|
-
return __generator(this, function (
|
|
3411
|
-
switch (
|
|
3564
|
+
var params, paramIndex, params_2, params_2_1, param, sources, sourceIndex, sources_3, sources_3_1, source, sources_4, value, validation, triggers, rules, actions, rulesMapping, actions_9, actions_9_1, action, conditionEvaluation, actions_11, e_7_1, e_8_1, e_9_1, triggers, rules, actions, rulesMapping, actions_10, actions_10_1, action, conditionEvaluation, actions_12, e_10_1;
|
|
3565
|
+
var e_9, _l, e_8, _m, e_7, _o, e_10, _p;
|
|
3566
|
+
return __generator(this, function (_q) {
|
|
3567
|
+
switch (_q.label) {
|
|
3412
3568
|
case 0:
|
|
3413
|
-
if (!kwikidToolkit.checkObjectKeyExists(this._request, "headers")) return [3 /*break*/,
|
|
3569
|
+
if (!kwikidToolkit.checkObjectKeyExists(this._request, "headers")) return [3 /*break*/, 34];
|
|
3414
3570
|
if (!kwikidToolkit.checkObjectKeyExists(this._request.headers, "params")) return [3 /*break*/, 23];
|
|
3415
3571
|
params = this._request.headers.params;
|
|
3416
3572
|
paramIndex = 0;
|
|
3417
|
-
|
|
3573
|
+
_q.label = 1;
|
|
3418
3574
|
case 1:
|
|
3419
|
-
|
|
3575
|
+
_q.trys.push([1, 20, 21, 22]);
|
|
3420
3576
|
params_2 = __values(params), params_2_1 = params_2.next();
|
|
3421
|
-
|
|
3577
|
+
_q.label = 2;
|
|
3422
3578
|
case 2:
|
|
3423
3579
|
if (!!params_2_1.done) return [3 /*break*/, 19];
|
|
3424
3580
|
param = params_2_1.value;
|
|
3425
3581
|
sources = param.sources;
|
|
3426
3582
|
sourceIndex = 0;
|
|
3427
|
-
|
|
3583
|
+
_q.label = 3;
|
|
3428
3584
|
case 3:
|
|
3429
|
-
|
|
3430
|
-
sources_3 = (
|
|
3431
|
-
|
|
3585
|
+
_q.trys.push([3, 15, 16, 17]);
|
|
3586
|
+
sources_3 = (e_8 = void 0, __values(sources)), sources_3_1 = sources_3.next();
|
|
3587
|
+
_q.label = 4;
|
|
3432
3588
|
case 4:
|
|
3433
3589
|
if (!!sources_3_1.done) return [3 /*break*/, 14];
|
|
3434
3590
|
source = sources_3_1.value;
|
|
@@ -3441,180 +3597,291 @@
|
|
|
3441
3597
|
rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
|
|
3442
3598
|
actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
|
|
3443
3599
|
rulesMapping = new kwikidToolkit.Rule(rules, this._object).mapping();
|
|
3444
|
-
|
|
3600
|
+
_q.label = 5;
|
|
3445
3601
|
case 5:
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3602
|
+
_q.trys.push([5, 10, 11, 12]);
|
|
3603
|
+
actions_9 = (e_7 = void 0, __values(actions)), actions_9_1 = actions_9.next();
|
|
3604
|
+
_q.label = 6;
|
|
3449
3605
|
case 6:
|
|
3450
|
-
if (!!
|
|
3451
|
-
action =
|
|
3606
|
+
if (!!actions_9_1.done) return [3 /*break*/, 9];
|
|
3607
|
+
action = actions_9_1.value;
|
|
3452
3608
|
conditionEvaluation = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
3453
3609
|
if (!conditionEvaluation) return [3 /*break*/, 8];
|
|
3454
|
-
|
|
3455
|
-
return [4 /*yield*/,
|
|
3610
|
+
actions_11 = new kwikidToolkit.Action(action, rulesMapping, this._object, this._takeAction);
|
|
3611
|
+
return [4 /*yield*/, actions_11.execute()];
|
|
3456
3612
|
case 7:
|
|
3457
|
-
|
|
3458
|
-
|
|
3613
|
+
_q.sent();
|
|
3614
|
+
_q.label = 8;
|
|
3459
3615
|
case 8:
|
|
3460
|
-
|
|
3616
|
+
actions_9_1 = actions_9.next();
|
|
3461
3617
|
return [3 /*break*/, 6];
|
|
3462
3618
|
case 9: return [3 /*break*/, 12];
|
|
3463
3619
|
case 10:
|
|
3464
|
-
|
|
3465
|
-
|
|
3620
|
+
e_7_1 = _q.sent();
|
|
3621
|
+
e_7 = { error: e_7_1 };
|
|
3466
3622
|
return [3 /*break*/, 12];
|
|
3467
3623
|
case 11:
|
|
3468
3624
|
try {
|
|
3469
|
-
if (
|
|
3625
|
+
if (actions_9_1 && !actions_9_1.done && (_o = actions_9.return)) _o.call(actions_9);
|
|
3470
3626
|
}
|
|
3471
|
-
finally { if (
|
|
3627
|
+
finally { if (e_7) throw e_7.error; }
|
|
3472
3628
|
return [7 /*endfinally*/];
|
|
3473
3629
|
case 12:
|
|
3474
3630
|
sourceIndex++;
|
|
3475
|
-
|
|
3631
|
+
_q.label = 13;
|
|
3476
3632
|
case 13:
|
|
3477
3633
|
sources_3_1 = sources_3.next();
|
|
3478
3634
|
return [3 /*break*/, 4];
|
|
3479
3635
|
case 14: return [3 /*break*/, 17];
|
|
3480
3636
|
case 15:
|
|
3481
|
-
|
|
3482
|
-
|
|
3637
|
+
e_8_1 = _q.sent();
|
|
3638
|
+
e_8 = { error: e_8_1 };
|
|
3483
3639
|
return [3 /*break*/, 17];
|
|
3484
3640
|
case 16:
|
|
3485
3641
|
try {
|
|
3486
|
-
if (sources_3_1 && !sources_3_1.done && (
|
|
3642
|
+
if (sources_3_1 && !sources_3_1.done && (_m = sources_3.return)) _m.call(sources_3);
|
|
3487
3643
|
}
|
|
3488
|
-
finally { if (
|
|
3644
|
+
finally { if (e_8) throw e_8.error; }
|
|
3489
3645
|
return [7 /*endfinally*/];
|
|
3490
3646
|
case 17:
|
|
3491
3647
|
paramIndex++;
|
|
3492
|
-
|
|
3648
|
+
_q.label = 18;
|
|
3493
3649
|
case 18:
|
|
3494
3650
|
params_2_1 = params_2.next();
|
|
3495
3651
|
return [3 /*break*/, 2];
|
|
3496
3652
|
case 19: return [3 /*break*/, 22];
|
|
3497
3653
|
case 20:
|
|
3498
|
-
|
|
3499
|
-
|
|
3654
|
+
e_9_1 = _q.sent();
|
|
3655
|
+
e_9 = { error: e_9_1 };
|
|
3500
3656
|
return [3 /*break*/, 22];
|
|
3501
3657
|
case 21:
|
|
3502
3658
|
try {
|
|
3503
|
-
if (params_2_1 && !params_2_1.done && (
|
|
3659
|
+
if (params_2_1 && !params_2_1.done && (_l = params_2.return)) _l.call(params_2);
|
|
3504
3660
|
}
|
|
3505
|
-
finally { if (
|
|
3661
|
+
finally { if (e_9) throw e_9.error; }
|
|
3506
3662
|
return [7 /*endfinally*/];
|
|
3507
3663
|
case 22: return [2 /*return*/, this._object.API_CONFIG];
|
|
3508
|
-
case 23:
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3664
|
+
case 23:
|
|
3665
|
+
if (!(kwikidToolkit.checkObjectKeyExists(this._request.headers, "rules") &&
|
|
3666
|
+
kwikidToolkit.checkObjectKeyExists(this._request.headers, "actions"))) return [3 /*break*/, 32];
|
|
3667
|
+
triggers = (_f = (_e = this._request.headers) === null || _e === void 0 ? void 0 : _e.triggers) !== null && _f !== void 0 ? _f : [];
|
|
3668
|
+
rules = (_h = (_g = this._request.headers) === null || _g === void 0 ? void 0 : _g.rules) !== null && _h !== void 0 ? _h : [];
|
|
3669
|
+
actions = (_k = (_j = this._request.headers) === null || _j === void 0 ? void 0 : _j.actions) !== null && _k !== void 0 ? _k : [];
|
|
3670
|
+
rulesMapping = new kwikidToolkit.Rule(rules, this._object).mapping();
|
|
3671
|
+
_q.label = 24;
|
|
3672
|
+
case 24:
|
|
3673
|
+
_q.trys.push([24, 29, 30, 31]);
|
|
3674
|
+
actions_10 = __values(actions), actions_10_1 = actions_10.next();
|
|
3675
|
+
_q.label = 25;
|
|
3676
|
+
case 25:
|
|
3677
|
+
if (!!actions_10_1.done) return [3 /*break*/, 28];
|
|
3678
|
+
action = actions_10_1.value;
|
|
3679
|
+
conditionEvaluation = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
3680
|
+
if (!conditionEvaluation) return [3 /*break*/, 27];
|
|
3681
|
+
actions_12 = new kwikidToolkit.Action(action, rulesMapping, this._object, this._takeAction);
|
|
3682
|
+
return [4 /*yield*/, actions_12.execute()];
|
|
3683
|
+
case 26:
|
|
3684
|
+
_q.sent();
|
|
3685
|
+
_q.label = 27;
|
|
3686
|
+
case 27:
|
|
3687
|
+
actions_10_1 = actions_10.next();
|
|
3688
|
+
return [3 /*break*/, 25];
|
|
3689
|
+
case 28: return [3 /*break*/, 31];
|
|
3690
|
+
case 29:
|
|
3691
|
+
e_10_1 = _q.sent();
|
|
3692
|
+
e_10 = { error: e_10_1 };
|
|
3693
|
+
return [3 /*break*/, 31];
|
|
3694
|
+
case 30:
|
|
3695
|
+
try {
|
|
3696
|
+
if (actions_10_1 && !actions_10_1.done && (_p = actions_10.return)) _p.call(actions_10);
|
|
3697
|
+
}
|
|
3698
|
+
finally { if (e_10) throw e_10.error; }
|
|
3699
|
+
return [7 /*endfinally*/];
|
|
3700
|
+
case 31: return [2 /*return*/, this._object.API_CONFIG];
|
|
3701
|
+
case 32: return [2 /*return*/, this._object.API_CONFIG];
|
|
3702
|
+
case 33: return [3 /*break*/, 35];
|
|
3703
|
+
case 34: return [2 /*return*/, this._object.API_CONFIG];
|
|
3704
|
+
case 35: return [2 /*return*/];
|
|
3512
3705
|
}
|
|
3513
3706
|
});
|
|
3514
3707
|
});
|
|
3515
3708
|
};
|
|
3516
3709
|
Apis.prototype.validateRequestHeaders = function () {
|
|
3517
|
-
var _a, _b, _c, _d;
|
|
3710
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3518
3711
|
return __awaiter(this, void 0, void 0, function () {
|
|
3519
|
-
var headers, validation, triggers, rules, actions, rulesMapping,
|
|
3520
|
-
var
|
|
3521
|
-
return __generator(this, function (
|
|
3522
|
-
switch (
|
|
3712
|
+
var headers, validation, triggers, rules, actions, rulesMapping, actions_13, actions_13_1, action, conditionSuccess, actions_15, e_11_1, triggers, rules, actions, rulesMapping, actions_14, actions_14_1, action, conditionSuccess, actions_16, e_12_1;
|
|
3713
|
+
var e_11, _l, e_12, _m;
|
|
3714
|
+
return __generator(this, function (_o) {
|
|
3715
|
+
switch (_o.label) {
|
|
3523
3716
|
case 0:
|
|
3524
3717
|
headers = this._request.headers;
|
|
3525
|
-
if (!kwikidToolkit.checkObjectKeyExists(this._request, "headers")) return [3 /*break*/,
|
|
3718
|
+
if (!kwikidToolkit.checkObjectKeyExists(this._request, "headers")) return [3 /*break*/, 20];
|
|
3526
3719
|
if (!kwikidToolkit.checkObjectKeyExists(this._request.headers, "validation")) return [3 /*break*/, 9];
|
|
3527
3720
|
validation = headers.validation;
|
|
3528
3721
|
triggers = (_a = validation === null || validation === void 0 ? void 0 : validation.triggers) !== null && _a !== void 0 ? _a : [];
|
|
3529
3722
|
rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
|
|
3530
3723
|
actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
|
|
3531
3724
|
rulesMapping = new kwikidToolkit.Rule(rules, this._object).mapping();
|
|
3532
|
-
|
|
3725
|
+
_o.label = 1;
|
|
3533
3726
|
case 1:
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3727
|
+
_o.trys.push([1, 6, 7, 8]);
|
|
3728
|
+
actions_13 = __values(actions), actions_13_1 = actions_13.next();
|
|
3729
|
+
_o.label = 2;
|
|
3537
3730
|
case 2:
|
|
3538
|
-
if (!!
|
|
3539
|
-
action =
|
|
3731
|
+
if (!!actions_13_1.done) return [3 /*break*/, 5];
|
|
3732
|
+
action = actions_13_1.value;
|
|
3540
3733
|
conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
3541
3734
|
if (!conditionSuccess) return [3 /*break*/, 4];
|
|
3542
|
-
|
|
3543
|
-
return [4 /*yield*/,
|
|
3735
|
+
actions_15 = new kwikidToolkit.Action(action, rulesMapping, this._object, this._takeAction);
|
|
3736
|
+
return [4 /*yield*/, actions_15.execute()];
|
|
3544
3737
|
case 3:
|
|
3545
|
-
|
|
3546
|
-
|
|
3738
|
+
_o.sent();
|
|
3739
|
+
_o.label = 4;
|
|
3547
3740
|
case 4:
|
|
3548
|
-
|
|
3741
|
+
actions_13_1 = actions_13.next();
|
|
3549
3742
|
return [3 /*break*/, 2];
|
|
3550
3743
|
case 5: return [3 /*break*/, 8];
|
|
3551
3744
|
case 6:
|
|
3552
|
-
|
|
3553
|
-
|
|
3745
|
+
e_11_1 = _o.sent();
|
|
3746
|
+
e_11 = { error: e_11_1 };
|
|
3554
3747
|
return [3 /*break*/, 8];
|
|
3555
3748
|
case 7:
|
|
3556
3749
|
try {
|
|
3557
|
-
if (
|
|
3750
|
+
if (actions_13_1 && !actions_13_1.done && (_l = actions_13.return)) _l.call(actions_13);
|
|
3558
3751
|
}
|
|
3559
|
-
finally { if (
|
|
3752
|
+
finally { if (e_11) throw e_11.error; }
|
|
3560
3753
|
return [7 /*endfinally*/];
|
|
3561
3754
|
case 8: return [2 /*return*/, this._object.API_CONFIG];
|
|
3562
3755
|
case 9:
|
|
3756
|
+
if (!(kwikidToolkit.checkObjectPathExists(this._request.headers, "rules") &&
|
|
3757
|
+
kwikidToolkit.checkObjectPathExists(this._request.headers, "actions"))) return [3 /*break*/, 18];
|
|
3758
|
+
triggers = (_e = headers === null || headers === void 0 ? void 0 : headers.triggers) !== null && _e !== void 0 ? _e : [];
|
|
3759
|
+
rules = (_f = headers === null || headers === void 0 ? void 0 : headers.rules) !== null && _f !== void 0 ? _f : [];
|
|
3760
|
+
actions = (_h = (_g = headers) === null || _g === void 0 ? void 0 : _g.actions) !== null && _h !== void 0 ? _h : [];
|
|
3761
|
+
rulesMapping = new kwikidToolkit.Rule(rules, this._object).mapping();
|
|
3762
|
+
_o.label = 10;
|
|
3763
|
+
case 10:
|
|
3764
|
+
_o.trys.push([10, 15, 16, 17]);
|
|
3765
|
+
actions_14 = __values(actions), actions_14_1 = actions_14.next();
|
|
3766
|
+
_o.label = 11;
|
|
3767
|
+
case 11:
|
|
3768
|
+
if (!!actions_14_1.done) return [3 /*break*/, 14];
|
|
3769
|
+
action = actions_14_1.value;
|
|
3770
|
+
conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
3771
|
+
if (!conditionSuccess) return [3 /*break*/, 13];
|
|
3772
|
+
actions_16 = new kwikidToolkit.Action(action, rulesMapping, this._object, this._takeAction);
|
|
3773
|
+
return [4 /*yield*/, actions_16.execute()];
|
|
3774
|
+
case 12:
|
|
3775
|
+
_o.sent();
|
|
3776
|
+
_o.label = 13;
|
|
3777
|
+
case 13:
|
|
3778
|
+
actions_14_1 = actions_14.next();
|
|
3779
|
+
return [3 /*break*/, 11];
|
|
3780
|
+
case 14: return [3 /*break*/, 17];
|
|
3781
|
+
case 15:
|
|
3782
|
+
e_12_1 = _o.sent();
|
|
3783
|
+
e_12 = { error: e_12_1 };
|
|
3784
|
+
return [3 /*break*/, 17];
|
|
3785
|
+
case 16:
|
|
3786
|
+
try {
|
|
3787
|
+
if (actions_14_1 && !actions_14_1.done && (_m = actions_14.return)) _m.call(actions_14);
|
|
3788
|
+
}
|
|
3789
|
+
finally { if (e_12) throw e_12.error; }
|
|
3790
|
+
return [7 /*endfinally*/];
|
|
3791
|
+
case 17: return [2 /*return*/, this._object.API_CONFIG];
|
|
3792
|
+
case 18:
|
|
3563
3793
|
this._object = kwikidToolkit.setValueToObjectPath(this._object, "API_CONFIG.request.validation.headers.is_valid", true);
|
|
3564
3794
|
return [2 /*return*/, this._object.API_CONFIG];
|
|
3565
|
-
case
|
|
3566
|
-
case
|
|
3795
|
+
case 19: return [3 /*break*/, 21];
|
|
3796
|
+
case 20:
|
|
3567
3797
|
this._object = kwikidToolkit.setValueToObjectPath(this._object, "API_CONFIG.request.validation.headers.is_valid", true);
|
|
3568
3798
|
return [2 /*return*/, this._object.API_CONFIG];
|
|
3569
|
-
case
|
|
3799
|
+
case 21: return [2 /*return*/];
|
|
3570
3800
|
}
|
|
3571
3801
|
});
|
|
3572
3802
|
});
|
|
3573
3803
|
};
|
|
3574
3804
|
Apis.prototype.validateResponse = function () {
|
|
3575
|
-
var _a, _b, _c, _d;
|
|
3805
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3576
3806
|
return __awaiter(this, void 0, void 0, function () {
|
|
3577
|
-
var validation, triggers, rules, actions, rulesMapping,
|
|
3578
|
-
var
|
|
3579
|
-
return __generator(this, function (
|
|
3580
|
-
switch (
|
|
3807
|
+
var validation, triggers, rules, actions, rulesMapping, actions_17, actions_17_1, action, conditionSuccess, actions_19, e_13_1, triggers, rules, actions, rulesMapping, actions_18, actions_18_1, action, conditionSuccess, actions_20, e_14_1;
|
|
3808
|
+
var e_13, _l, e_14, _m;
|
|
3809
|
+
return __generator(this, function (_o) {
|
|
3810
|
+
switch (_o.label) {
|
|
3581
3811
|
case 0:
|
|
3582
|
-
if (!kwikidToolkit.checkObjectKeyExists(this._response, "validation")) return [3 /*break*/,
|
|
3812
|
+
if (!kwikidToolkit.checkObjectKeyExists(this._response, "validation")) return [3 /*break*/, 9];
|
|
3583
3813
|
validation = this._response.validation;
|
|
3584
3814
|
triggers = (_a = validation === null || validation === void 0 ? void 0 : validation.triggers) !== null && _a !== void 0 ? _a : [];
|
|
3585
3815
|
rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
|
|
3586
3816
|
actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
|
|
3587
3817
|
rulesMapping = new kwikidToolkit.Rule(rules, this._object).mapping();
|
|
3588
|
-
|
|
3818
|
+
_o.label = 1;
|
|
3589
3819
|
case 1:
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3820
|
+
_o.trys.push([1, 6, 7, 8]);
|
|
3821
|
+
actions_17 = __values(actions), actions_17_1 = actions_17.next();
|
|
3822
|
+
_o.label = 2;
|
|
3593
3823
|
case 2:
|
|
3594
|
-
if (!!
|
|
3595
|
-
action =
|
|
3824
|
+
if (!!actions_17_1.done) return [3 /*break*/, 5];
|
|
3825
|
+
action = actions_17_1.value;
|
|
3596
3826
|
conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
3597
3827
|
if (!conditionSuccess) return [3 /*break*/, 4];
|
|
3598
|
-
|
|
3599
|
-
return [4 /*yield*/,
|
|
3828
|
+
actions_19 = new kwikidToolkit.Action(action, rulesMapping, this._object, this._takeAction);
|
|
3829
|
+
return [4 /*yield*/, actions_19.execute()];
|
|
3600
3830
|
case 3:
|
|
3601
|
-
|
|
3602
|
-
|
|
3831
|
+
_o.sent();
|
|
3832
|
+
_o.label = 4;
|
|
3603
3833
|
case 4:
|
|
3604
|
-
|
|
3834
|
+
actions_17_1 = actions_17.next();
|
|
3605
3835
|
return [3 /*break*/, 2];
|
|
3606
3836
|
case 5: return [3 /*break*/, 8];
|
|
3607
3837
|
case 6:
|
|
3608
|
-
|
|
3609
|
-
|
|
3838
|
+
e_13_1 = _o.sent();
|
|
3839
|
+
e_13 = { error: e_13_1 };
|
|
3610
3840
|
return [3 /*break*/, 8];
|
|
3611
3841
|
case 7:
|
|
3612
3842
|
try {
|
|
3613
|
-
if (
|
|
3843
|
+
if (actions_17_1 && !actions_17_1.done && (_l = actions_17.return)) _l.call(actions_17);
|
|
3614
3844
|
}
|
|
3615
|
-
finally { if (
|
|
3845
|
+
finally { if (e_13) throw e_13.error; }
|
|
3616
3846
|
return [7 /*endfinally*/];
|
|
3617
|
-
case 8: return [
|
|
3847
|
+
case 8: return [3 /*break*/, 17];
|
|
3848
|
+
case 9:
|
|
3849
|
+
if (!(kwikidToolkit.checkObjectKeyExists(this._response, "rules") &&
|
|
3850
|
+
kwikidToolkit.checkObjectKeyExists(this._response, "actions"))) return [3 /*break*/, 17];
|
|
3851
|
+
triggers = (_f = (_e = this._response) === null || _e === void 0 ? void 0 : _e.triggers) !== null && _f !== void 0 ? _f : [];
|
|
3852
|
+
rules = (_h = (_g = this._response) === null || _g === void 0 ? void 0 : _g.rules) !== null && _h !== void 0 ? _h : [];
|
|
3853
|
+
actions = (_k = (_j = this._response) === null || _j === void 0 ? void 0 : _j.actions) !== null && _k !== void 0 ? _k : [];
|
|
3854
|
+
rulesMapping = new kwikidToolkit.Rule(rules, this._object).mapping();
|
|
3855
|
+
_o.label = 10;
|
|
3856
|
+
case 10:
|
|
3857
|
+
_o.trys.push([10, 15, 16, 17]);
|
|
3858
|
+
actions_18 = __values(actions), actions_18_1 = actions_18.next();
|
|
3859
|
+
_o.label = 11;
|
|
3860
|
+
case 11:
|
|
3861
|
+
if (!!actions_18_1.done) return [3 /*break*/, 14];
|
|
3862
|
+
action = actions_18_1.value;
|
|
3863
|
+
conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
3864
|
+
if (!conditionSuccess) return [3 /*break*/, 13];
|
|
3865
|
+
actions_20 = new kwikidToolkit.Action(action, rulesMapping, this._object, this._takeAction);
|
|
3866
|
+
return [4 /*yield*/, actions_20.execute()];
|
|
3867
|
+
case 12:
|
|
3868
|
+
_o.sent();
|
|
3869
|
+
_o.label = 13;
|
|
3870
|
+
case 13:
|
|
3871
|
+
actions_18_1 = actions_18.next();
|
|
3872
|
+
return [3 /*break*/, 11];
|
|
3873
|
+
case 14: return [3 /*break*/, 17];
|
|
3874
|
+
case 15:
|
|
3875
|
+
e_14_1 = _o.sent();
|
|
3876
|
+
e_14 = { error: e_14_1 };
|
|
3877
|
+
return [3 /*break*/, 17];
|
|
3878
|
+
case 16:
|
|
3879
|
+
try {
|
|
3880
|
+
if (actions_18_1 && !actions_18_1.done && (_m = actions_18.return)) _m.call(actions_18);
|
|
3881
|
+
}
|
|
3882
|
+
finally { if (e_14) throw e_14.error; }
|
|
3883
|
+
return [7 /*endfinally*/];
|
|
3884
|
+
case 17: return [2 /*return*/, this._object.API_CONFIG];
|
|
3618
3885
|
}
|
|
3619
3886
|
});
|
|
3620
3887
|
});
|
|
@@ -3622,43 +3889,43 @@
|
|
|
3622
3889
|
Apis.prototype.callNextApi = function (validation) {
|
|
3623
3890
|
var _a, _b, _c, _d;
|
|
3624
3891
|
return __awaiter(this, void 0, void 0, function () {
|
|
3625
|
-
var triggers, rules, actions, rulesMapping,
|
|
3626
|
-
var
|
|
3627
|
-
return __generator(this, function (
|
|
3628
|
-
switch (
|
|
3892
|
+
var triggers, rules, actions, rulesMapping, actions_21, actions_21_1, action, conditionSuccess, actions_22, e_15_1;
|
|
3893
|
+
var e_15, _l;
|
|
3894
|
+
return __generator(this, function (_m) {
|
|
3895
|
+
switch (_m.label) {
|
|
3629
3896
|
case 0:
|
|
3630
3897
|
triggers = (_a = validation === null || validation === void 0 ? void 0 : validation.triggers) !== null && _a !== void 0 ? _a : [];
|
|
3631
3898
|
rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
|
|
3632
3899
|
actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
|
|
3633
3900
|
rulesMapping = new kwikidToolkit.Rule(rules, this._object).mapping();
|
|
3634
|
-
|
|
3901
|
+
_m.label = 1;
|
|
3635
3902
|
case 1:
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3903
|
+
_m.trys.push([1, 6, 7, 8]);
|
|
3904
|
+
actions_21 = __values(actions), actions_21_1 = actions_21.next();
|
|
3905
|
+
_m.label = 2;
|
|
3639
3906
|
case 2:
|
|
3640
|
-
if (!!
|
|
3641
|
-
action =
|
|
3907
|
+
if (!!actions_21_1.done) return [3 /*break*/, 5];
|
|
3908
|
+
action = actions_21_1.value;
|
|
3642
3909
|
conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
3643
3910
|
if (!conditionSuccess) return [3 /*break*/, 4];
|
|
3644
|
-
|
|
3645
|
-
return [4 /*yield*/,
|
|
3911
|
+
actions_22 = new kwikidToolkit.Action(action, rulesMapping, this._object, this._takeAction);
|
|
3912
|
+
return [4 /*yield*/, actions_22.execute()];
|
|
3646
3913
|
case 3:
|
|
3647
|
-
|
|
3648
|
-
|
|
3914
|
+
_m.sent();
|
|
3915
|
+
_m.label = 4;
|
|
3649
3916
|
case 4:
|
|
3650
|
-
|
|
3917
|
+
actions_21_1 = actions_21.next();
|
|
3651
3918
|
return [3 /*break*/, 2];
|
|
3652
3919
|
case 5: return [3 /*break*/, 8];
|
|
3653
3920
|
case 6:
|
|
3654
|
-
|
|
3655
|
-
|
|
3921
|
+
e_15_1 = _m.sent();
|
|
3922
|
+
e_15 = { error: e_15_1 };
|
|
3656
3923
|
return [3 /*break*/, 8];
|
|
3657
3924
|
case 7:
|
|
3658
3925
|
try {
|
|
3659
|
-
if (
|
|
3926
|
+
if (actions_21_1 && !actions_21_1.done && (_l = actions_21.return)) _l.call(actions_21);
|
|
3660
3927
|
}
|
|
3661
|
-
finally { if (
|
|
3928
|
+
finally { if (e_15) throw e_15.error; }
|
|
3662
3929
|
return [7 /*endfinally*/];
|
|
3663
3930
|
case 8: return [2 /*return*/];
|
|
3664
3931
|
}
|
|
@@ -3746,6 +4013,11 @@
|
|
|
3746
4013
|
kwikidToolkit.logMethod
|
|
3747
4014
|
], Tasks.prototype, "execute", null);
|
|
3748
4015
|
|
|
4016
|
+
var ETypeLogs;
|
|
4017
|
+
(function (ETypeLogs) {
|
|
4018
|
+
ETypeLogs["API"] = "API";
|
|
4019
|
+
})(ETypeLogs || (ETypeLogs = {}));
|
|
4020
|
+
|
|
3749
4021
|
var StyleSanitizerPipe = /** @class */ (function () {
|
|
3750
4022
|
function StyleSanitizerPipe(sanitizer) {
|
|
3751
4023
|
this.sanitizer = sanitizer;
|
|
@@ -3780,6 +4052,7 @@
|
|
|
3780
4052
|
this.getUnsavedDataState = new i0.EventEmitter();
|
|
3781
4053
|
this.onClickSaveForm = new i0.EventEmitter();
|
|
3782
4054
|
this.onClickApiCall = new i0.EventEmitter();
|
|
4055
|
+
this.getLogs = new i0.EventEmitter();
|
|
3783
4056
|
this.onActionShowPopupForm = new i0.EventEmitter();
|
|
3784
4057
|
this.onClickFormFieldButton = new i0.EventEmitter();
|
|
3785
4058
|
this.fieldGroups = {};
|
|
@@ -3837,11 +4110,11 @@
|
|
|
3837
4110
|
var _this = this;
|
|
3838
4111
|
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3839
4112
|
var res;
|
|
3840
|
-
return __generator(this, function (
|
|
3841
|
-
switch (
|
|
4113
|
+
return __generator(this, function (_k) {
|
|
4114
|
+
switch (_k.label) {
|
|
3842
4115
|
case 0: return [4 /*yield*/, this.initFormConfig(this.formConfig)];
|
|
3843
4116
|
case 1:
|
|
3844
|
-
res =
|
|
4117
|
+
res = _k.sent();
|
|
3845
4118
|
if (res) {
|
|
3846
4119
|
this.loading = false;
|
|
3847
4120
|
}
|
|
@@ -3852,7 +4125,7 @@
|
|
|
3852
4125
|
};
|
|
3853
4126
|
KwikIDFormViewComponent.prototype.ngAfterViewInit = function () { };
|
|
3854
4127
|
KwikIDFormViewComponent.prototype.ngOnChanges = function (changes) {
|
|
3855
|
-
var
|
|
4128
|
+
var _k;
|
|
3856
4129
|
var _this = this;
|
|
3857
4130
|
var _a, _b, _c, _d;
|
|
3858
4131
|
var verifyChange = function (key) {
|
|
@@ -3874,9 +4147,9 @@
|
|
|
3874
4147
|
? changes.popupFormCallback.currentValue.popupFormData["data"]
|
|
3875
4148
|
: changes.popupFormCallback.currentValue.popupFormData;
|
|
3876
4149
|
var popupFormConfig = changes.popupFormCallback.currentValue.popupFormConfig;
|
|
3877
|
-
this.popupFormData = kwikidToolkit.mergeObjects(this.popupFormData, (
|
|
3878
|
-
|
|
3879
|
-
|
|
4150
|
+
this.popupFormData = kwikidToolkit.mergeObjects(this.popupFormData, (_k = {},
|
|
4151
|
+
_k[popupFormConfig.key] = popupFormData,
|
|
4152
|
+
_k));
|
|
3880
4153
|
this.formData = kwikidToolkit.mergeObjects(this.formData, this.popupFormData);
|
|
3881
4154
|
if (kwikidToolkit.checkObjectKeyExists(changes.popupFormCallback.currentValue, "stopTaskExecution")) {
|
|
3882
4155
|
this.stopTaskExecution =
|
|
@@ -3961,11 +4234,11 @@
|
|
|
3961
4234
|
ALL_FORMS_DATA: this.allFormsData
|
|
3962
4235
|
}, this.takeAction.bind(this));
|
|
3963
4236
|
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3964
|
-
return __generator(this, function (
|
|
3965
|
-
switch (
|
|
4237
|
+
return __generator(this, function (_k) {
|
|
4238
|
+
switch (_k.label) {
|
|
3966
4239
|
case 0: return [4 /*yield*/, validations_1.validate(field_1.validation)];
|
|
3967
4240
|
case 1:
|
|
3968
|
-
|
|
4241
|
+
_k.sent();
|
|
3969
4242
|
return [2 /*return*/];
|
|
3970
4243
|
}
|
|
3971
4244
|
});
|
|
@@ -3980,11 +4253,11 @@
|
|
|
3980
4253
|
if (verifyChange("formConfig")) {
|
|
3981
4254
|
this.formConfig = changes.formConfig.currentValue;
|
|
3982
4255
|
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3983
|
-
return __generator(this, function (
|
|
3984
|
-
switch (
|
|
4256
|
+
return __generator(this, function (_k) {
|
|
4257
|
+
switch (_k.label) {
|
|
3985
4258
|
case 0: return [4 /*yield*/, this.initFormConfig(this.formConfig)];
|
|
3986
4259
|
case 1:
|
|
3987
|
-
|
|
4260
|
+
_k.sent();
|
|
3988
4261
|
return [2 /*return*/];
|
|
3989
4262
|
}
|
|
3990
4263
|
});
|
|
@@ -3993,11 +4266,11 @@
|
|
|
3993
4266
|
};
|
|
3994
4267
|
KwikIDFormViewComponent.prototype.initFormConfig = function (formConfig) {
|
|
3995
4268
|
return __awaiter(this, void 0, void 0, function () {
|
|
3996
|
-
var
|
|
3997
|
-
var e_1,
|
|
4269
|
+
var _k, _l, preTask, task, e_1_1, _m, _loop_1, this_1, _o, _p, field, _q, _r, field, validations, e_2_1;
|
|
4270
|
+
var e_1, _s, e_3, _t, e_2, _u;
|
|
3998
4271
|
var _this = this;
|
|
3999
|
-
return __generator(this, function (
|
|
4000
|
-
switch (
|
|
4272
|
+
return __generator(this, function (_v) {
|
|
4273
|
+
switch (_v.label) {
|
|
4001
4274
|
case 0:
|
|
4002
4275
|
formConfig = new Converter().convertFormConfig(formConfig);
|
|
4003
4276
|
formConfig = new Converter().updateFormConfigProperties(formConfig);
|
|
@@ -4006,14 +4279,14 @@
|
|
|
4006
4279
|
this.setFormDataFromAllFormsData();
|
|
4007
4280
|
if (!(kwikidToolkit.checkObjectKeyExists(this.formConfig, "tasks") &&
|
|
4008
4281
|
kwikidToolkit.checkObjectKeyExists(this.formConfig.tasks, "pre"))) return [3 /*break*/, 10];
|
|
4009
|
-
|
|
4282
|
+
_v.label = 1;
|
|
4010
4283
|
case 1:
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4284
|
+
_v.trys.push([1, 7, 8, 9]);
|
|
4285
|
+
_k = __values(this.formConfig.tasks.pre), _l = _k.next();
|
|
4286
|
+
_v.label = 2;
|
|
4014
4287
|
case 2:
|
|
4015
|
-
if (!!
|
|
4016
|
-
preTask =
|
|
4288
|
+
if (!!_l.done) return [3 /*break*/, 6];
|
|
4289
|
+
preTask = _l.value;
|
|
4017
4290
|
task = new Tasks(preTask, {
|
|
4018
4291
|
FORM_CONFIG: this.formConfig,
|
|
4019
4292
|
FORM_FIELDS: this.formFields,
|
|
@@ -4031,7 +4304,7 @@
|
|
|
4031
4304
|
}
|
|
4032
4305
|
return [4 /*yield*/, task.execute()];
|
|
4033
4306
|
case 3:
|
|
4034
|
-
|
|
4307
|
+
_v.sent();
|
|
4035
4308
|
// Wait for ngOnChanges to be called before continuing to the next task
|
|
4036
4309
|
return [4 /*yield*/, new Promise(function (resolve) {
|
|
4037
4310
|
var intervalId = setInterval(function () {
|
|
@@ -4043,36 +4316,36 @@
|
|
|
4043
4316
|
})];
|
|
4044
4317
|
case 4:
|
|
4045
4318
|
// Wait for ngOnChanges to be called before continuing to the next task
|
|
4046
|
-
|
|
4319
|
+
_v.sent();
|
|
4047
4320
|
if (this.stopTaskExecution) {
|
|
4048
4321
|
return [3 /*break*/, 6];
|
|
4049
4322
|
}
|
|
4050
|
-
|
|
4323
|
+
_v.label = 5;
|
|
4051
4324
|
case 5:
|
|
4052
|
-
|
|
4325
|
+
_l = _k.next();
|
|
4053
4326
|
return [3 /*break*/, 2];
|
|
4054
4327
|
case 6: return [3 /*break*/, 9];
|
|
4055
4328
|
case 7:
|
|
4056
|
-
e_1_1 =
|
|
4329
|
+
e_1_1 = _v.sent();
|
|
4057
4330
|
e_1 = { error: e_1_1 };
|
|
4058
4331
|
return [3 /*break*/, 9];
|
|
4059
4332
|
case 8:
|
|
4060
4333
|
try {
|
|
4061
|
-
if (
|
|
4334
|
+
if (_l && !_l.done && (_s = _k.return)) _s.call(_k);
|
|
4062
4335
|
}
|
|
4063
4336
|
finally { if (e_1) throw e_1.error; }
|
|
4064
4337
|
return [7 /*endfinally*/];
|
|
4065
4338
|
case 9:
|
|
4066
4339
|
this.formData = kwikidToolkit.mergeObjects(this.formData, this.popupFormData);
|
|
4067
|
-
|
|
4340
|
+
_v.label = 10;
|
|
4068
4341
|
case 10:
|
|
4069
4342
|
if (this.stopTaskExecution) {
|
|
4070
4343
|
return [2 /*return*/, false];
|
|
4071
4344
|
}
|
|
4072
|
-
|
|
4345
|
+
_m = this;
|
|
4073
4346
|
return [4 /*yield*/, this.formViewService.createFormGroup(this.formFields, this.formData, this.previousFormData, this.allFormsData, this.takeAction.bind(this))];
|
|
4074
4347
|
case 11:
|
|
4075
|
-
|
|
4348
|
+
_m.formGroup = _v.sent();
|
|
4076
4349
|
/**
|
|
4077
4350
|
* For some reason if their a field of type 'IMAGE' then
|
|
4078
4351
|
* formData is adding a 'undefined' key with last image's value from the array.
|
|
@@ -4082,10 +4355,10 @@
|
|
|
4082
4355
|
delete this.formData["undefined"];
|
|
4083
4356
|
}
|
|
4084
4357
|
_loop_1 = function (field) {
|
|
4085
|
-
var
|
|
4358
|
+
var _w, _x;
|
|
4086
4359
|
if (field.isFormElement) {
|
|
4087
|
-
this_1.previousFormData = Object.assign(Object.assign({}, this_1.previousFormData), (
|
|
4088
|
-
this_1.formData = Object.assign(Object.assign({}, this_1.formData), (
|
|
4360
|
+
this_1.previousFormData = Object.assign(Object.assign({}, this_1.previousFormData), (_w = {}, _w[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _w));
|
|
4361
|
+
this_1.formData = Object.assign(Object.assign({}, this_1.formData), (_x = {}, _x[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _x));
|
|
4089
4362
|
if (field.type === EFieldType.FILE) {
|
|
4090
4363
|
this_1.files[field.key] = this_1.formGroup.controls[field.key].value;
|
|
4091
4364
|
}
|
|
@@ -4096,11 +4369,11 @@
|
|
|
4096
4369
|
}
|
|
4097
4370
|
this_1.formGroup.controls[field.key].valueChanges
|
|
4098
4371
|
.pipe(operators.pairwise())
|
|
4099
|
-
.subscribe(function (
|
|
4100
|
-
var
|
|
4101
|
-
var
|
|
4102
|
-
_this.previousFormData = Object.assign(Object.assign({}, _this.previousFormData), (
|
|
4103
|
-
_this.formData = Object.assign(Object.assign({}, _this.formData), (
|
|
4372
|
+
.subscribe(function (_k) {
|
|
4373
|
+
var _l, _m;
|
|
4374
|
+
var _o = __read(_k, 2), previousValue = _o[0], currentValue = _o[1];
|
|
4375
|
+
_this.previousFormData = Object.assign(Object.assign({}, _this.previousFormData), (_l = {}, _l[field.key] = convertFormFieldValueToStandardFormat(field, previousValue), _l));
|
|
4376
|
+
_this.formData = Object.assign(Object.assign({}, _this.formData), (_m = {}, _m[field.key] = convertFormFieldValueToStandardFormat(field, currentValue), _m));
|
|
4104
4377
|
if (field.type === EFieldType.FILE) {
|
|
4105
4378
|
_this.files[field.key] = currentValue;
|
|
4106
4379
|
}
|
|
@@ -4114,26 +4387,26 @@
|
|
|
4114
4387
|
};
|
|
4115
4388
|
this_1 = this;
|
|
4116
4389
|
try {
|
|
4117
|
-
for (
|
|
4118
|
-
field =
|
|
4390
|
+
for (_o = __values(this.formFields), _p = _o.next(); !_p.done; _p = _o.next()) {
|
|
4391
|
+
field = _p.value;
|
|
4119
4392
|
_loop_1(field);
|
|
4120
4393
|
}
|
|
4121
4394
|
}
|
|
4122
4395
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
4123
4396
|
finally {
|
|
4124
4397
|
try {
|
|
4125
|
-
if (
|
|
4398
|
+
if (_p && !_p.done && (_t = _o.return)) _t.call(_o);
|
|
4126
4399
|
}
|
|
4127
4400
|
finally { if (e_3) throw e_3.error; }
|
|
4128
4401
|
}
|
|
4129
|
-
|
|
4402
|
+
_v.label = 12;
|
|
4130
4403
|
case 12:
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4404
|
+
_v.trys.push([12, 18, 19, 20]);
|
|
4405
|
+
_q = __values(this.formFields), _r = _q.next();
|
|
4406
|
+
_v.label = 13;
|
|
4134
4407
|
case 13:
|
|
4135
|
-
if (!!
|
|
4136
|
-
field =
|
|
4408
|
+
if (!!_r.done) return [3 /*break*/, 17];
|
|
4409
|
+
field = _r.value;
|
|
4137
4410
|
if (!field.isFormElement) return [3 /*break*/, 16];
|
|
4138
4411
|
if (!kwikidToolkit.checkObjectKeyExists(field, "validation")) return [3 /*break*/, 15];
|
|
4139
4412
|
if (!field.validation.triggers.includes("ON_INIT")) return [3 /*break*/, 15];
|
|
@@ -4147,8 +4420,8 @@
|
|
|
4147
4420
|
}, this.takeAction.bind(this));
|
|
4148
4421
|
return [4 /*yield*/, validations.validate(field.validation)];
|
|
4149
4422
|
case 14:
|
|
4150
|
-
|
|
4151
|
-
|
|
4423
|
+
_v.sent();
|
|
4424
|
+
_v.label = 15;
|
|
4152
4425
|
case 15:
|
|
4153
4426
|
if (kwikidToolkit.checkObjectKeyExists(field, "connectedElements")) {
|
|
4154
4427
|
this.handleConnectedElements({
|
|
@@ -4156,18 +4429,18 @@
|
|
|
4156
4429
|
value: this.formGroup.controls[field.key].value
|
|
4157
4430
|
}, "ON_INIT");
|
|
4158
4431
|
}
|
|
4159
|
-
|
|
4432
|
+
_v.label = 16;
|
|
4160
4433
|
case 16:
|
|
4161
|
-
|
|
4434
|
+
_r = _q.next();
|
|
4162
4435
|
return [3 /*break*/, 13];
|
|
4163
4436
|
case 17: return [3 /*break*/, 20];
|
|
4164
4437
|
case 18:
|
|
4165
|
-
e_2_1 =
|
|
4438
|
+
e_2_1 = _v.sent();
|
|
4166
4439
|
e_2 = { error: e_2_1 };
|
|
4167
4440
|
return [3 /*break*/, 20];
|
|
4168
4441
|
case 19:
|
|
4169
4442
|
try {
|
|
4170
|
-
if (
|
|
4443
|
+
if (_r && !_r.done && (_u = _q.return)) _u.call(_q);
|
|
4171
4444
|
}
|
|
4172
4445
|
finally { if (e_2) throw e_2.error; }
|
|
4173
4446
|
return [7 /*endfinally*/];
|
|
@@ -4205,10 +4478,10 @@
|
|
|
4205
4478
|
};
|
|
4206
4479
|
KwikIDFormViewComponent.prototype.handleConnectedElementFieldGroupActions = function (childFieldGroupConfig, parentField) {
|
|
4207
4480
|
return __awaiter(this, void 0, void 0, function () {
|
|
4208
|
-
var rulesMapping,
|
|
4209
|
-
var e_4,
|
|
4210
|
-
return __generator(this, function (
|
|
4211
|
-
switch (
|
|
4481
|
+
var rulesMapping, _k, _l, action, conditionSuccess, actions, e_4_1;
|
|
4482
|
+
var e_4, _m;
|
|
4483
|
+
return __generator(this, function (_o) {
|
|
4484
|
+
switch (_o.label) {
|
|
4212
4485
|
case 0:
|
|
4213
4486
|
if (!kwikidToolkit.checkObjectKeyExists(childFieldGroupConfig, "rules")) return [3 /*break*/, 8];
|
|
4214
4487
|
rulesMapping = new kwikidToolkit.Rule(childFieldGroupConfig.rules, {
|
|
@@ -4218,14 +4491,14 @@
|
|
|
4218
4491
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4219
4492
|
ALL_FORMS_DATA: this.allFormsData
|
|
4220
4493
|
}).mapping();
|
|
4221
|
-
|
|
4494
|
+
_o.label = 1;
|
|
4222
4495
|
case 1:
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4496
|
+
_o.trys.push([1, 6, 7, 8]);
|
|
4497
|
+
_k = __values(childFieldGroupConfig.actions), _l = _k.next();
|
|
4498
|
+
_o.label = 2;
|
|
4226
4499
|
case 2:
|
|
4227
|
-
if (!!
|
|
4228
|
-
action =
|
|
4500
|
+
if (!!_l.done) return [3 /*break*/, 5];
|
|
4501
|
+
action = _l.value;
|
|
4229
4502
|
conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
4230
4503
|
if (!conditionSuccess) return [3 /*break*/, 4];
|
|
4231
4504
|
actions = new kwikidToolkit.Action(action, rulesMapping, {
|
|
@@ -4238,19 +4511,19 @@
|
|
|
4238
4511
|
}, this.takeActionOnFieldGroup.bind(this));
|
|
4239
4512
|
return [4 /*yield*/, actions.execute()];
|
|
4240
4513
|
case 3:
|
|
4241
|
-
|
|
4242
|
-
|
|
4514
|
+
_o.sent();
|
|
4515
|
+
_o.label = 4;
|
|
4243
4516
|
case 4:
|
|
4244
|
-
|
|
4517
|
+
_l = _k.next();
|
|
4245
4518
|
return [3 /*break*/, 2];
|
|
4246
4519
|
case 5: return [3 /*break*/, 8];
|
|
4247
4520
|
case 6:
|
|
4248
|
-
e_4_1 =
|
|
4521
|
+
e_4_1 = _o.sent();
|
|
4249
4522
|
e_4 = { error: e_4_1 };
|
|
4250
4523
|
return [3 /*break*/, 8];
|
|
4251
4524
|
case 7:
|
|
4252
4525
|
try {
|
|
4253
|
-
if (
|
|
4526
|
+
if (_l && !_l.done && (_m = _k.return)) _m.call(_k);
|
|
4254
4527
|
}
|
|
4255
4528
|
finally { if (e_4) throw e_4.error; }
|
|
4256
4529
|
return [7 /*endfinally*/];
|
|
@@ -4261,15 +4534,15 @@
|
|
|
4261
4534
|
};
|
|
4262
4535
|
KwikIDFormViewComponent.prototype.handleConnectedElementFieldGroup = function (currentField, connectedFieldGroupConfig, eventType) {
|
|
4263
4536
|
return __awaiter(this, void 0, void 0, function () {
|
|
4264
|
-
return __generator(this, function (
|
|
4265
|
-
switch (
|
|
4537
|
+
return __generator(this, function (_k) {
|
|
4538
|
+
switch (_k.label) {
|
|
4266
4539
|
case 0:
|
|
4267
4540
|
if (!kwikidToolkit.checkObjectKeyExists(connectedFieldGroupConfig, "triggers")) return [3 /*break*/, 2];
|
|
4268
4541
|
if (!connectedFieldGroupConfig.triggers.includes(eventType)) return [3 /*break*/, 2];
|
|
4269
4542
|
return [4 /*yield*/, this.handleConnectedElementFieldGroupActions(connectedFieldGroupConfig, currentField)];
|
|
4270
4543
|
case 1:
|
|
4271
|
-
|
|
4272
|
-
|
|
4544
|
+
_k.sent();
|
|
4545
|
+
_k.label = 2;
|
|
4273
4546
|
case 2: return [2 /*return*/];
|
|
4274
4547
|
}
|
|
4275
4548
|
});
|
|
@@ -4277,10 +4550,10 @@
|
|
|
4277
4550
|
};
|
|
4278
4551
|
KwikIDFormViewComponent.prototype.handleConnectedElementFieldActions = function (connectedFieldConfig, connectedField) {
|
|
4279
4552
|
return __awaiter(this, void 0, void 0, function () {
|
|
4280
|
-
var rulesMapping,
|
|
4281
|
-
var e_5,
|
|
4282
|
-
return __generator(this, function (
|
|
4283
|
-
switch (
|
|
4553
|
+
var rulesMapping, _k, _l, action, conditionSuccess, actions, e_5_1;
|
|
4554
|
+
var e_5, _m;
|
|
4555
|
+
return __generator(this, function (_o) {
|
|
4556
|
+
switch (_o.label) {
|
|
4284
4557
|
case 0:
|
|
4285
4558
|
if (!kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "rules")) return [3 /*break*/, 8];
|
|
4286
4559
|
rulesMapping = new kwikidToolkit.Rule(connectedFieldConfig.rules, {
|
|
@@ -4290,14 +4563,14 @@
|
|
|
4290
4563
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
4291
4564
|
ALL_FORMS_DATA: this.allFormsData
|
|
4292
4565
|
}).mapping();
|
|
4293
|
-
|
|
4566
|
+
_o.label = 1;
|
|
4294
4567
|
case 1:
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4568
|
+
_o.trys.push([1, 6, 7, 8]);
|
|
4569
|
+
_k = __values(connectedFieldConfig.actions), _l = _k.next();
|
|
4570
|
+
_o.label = 2;
|
|
4298
4571
|
case 2:
|
|
4299
|
-
if (!!
|
|
4300
|
-
action =
|
|
4572
|
+
if (!!_l.done) return [3 /*break*/, 5];
|
|
4573
|
+
action = _l.value;
|
|
4301
4574
|
conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
4302
4575
|
if (!conditionSuccess) return [3 /*break*/, 4];
|
|
4303
4576
|
actions = new kwikidToolkit.Action(action, rulesMapping, {
|
|
@@ -4310,19 +4583,19 @@
|
|
|
4310
4583
|
}, this.takeAction.bind(this));
|
|
4311
4584
|
return [4 /*yield*/, actions.execute()];
|
|
4312
4585
|
case 3:
|
|
4313
|
-
|
|
4314
|
-
|
|
4586
|
+
_o.sent();
|
|
4587
|
+
_o.label = 4;
|
|
4315
4588
|
case 4:
|
|
4316
|
-
|
|
4589
|
+
_l = _k.next();
|
|
4317
4590
|
return [3 /*break*/, 2];
|
|
4318
4591
|
case 5: return [3 /*break*/, 8];
|
|
4319
4592
|
case 6:
|
|
4320
|
-
e_5_1 =
|
|
4593
|
+
e_5_1 = _o.sent();
|
|
4321
4594
|
e_5 = { error: e_5_1 };
|
|
4322
4595
|
return [3 /*break*/, 8];
|
|
4323
4596
|
case 7:
|
|
4324
4597
|
try {
|
|
4325
|
-
if (
|
|
4598
|
+
if (_l && !_l.done && (_m = _k.return)) _m.call(_k);
|
|
4326
4599
|
}
|
|
4327
4600
|
finally { if (e_5) throw e_5.error; }
|
|
4328
4601
|
return [7 /*endfinally*/];
|
|
@@ -4334,16 +4607,16 @@
|
|
|
4334
4607
|
KwikIDFormViewComponent.prototype.handleConnectedElementFields = function (currentField, connectedFieldConfig, eventType, nested) {
|
|
4335
4608
|
return __awaiter(this, void 0, void 0, function () {
|
|
4336
4609
|
var connectedField;
|
|
4337
|
-
return __generator(this, function (
|
|
4338
|
-
switch (
|
|
4610
|
+
return __generator(this, function (_k) {
|
|
4611
|
+
switch (_k.label) {
|
|
4339
4612
|
case 0:
|
|
4340
4613
|
connectedField = getFormFieldByKey(this.formFields, connectedFieldConfig["key"]);
|
|
4341
4614
|
if (!kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "triggers")) return [3 /*break*/, 2];
|
|
4342
4615
|
if (!connectedFieldConfig.triggers.includes(eventType)) return [3 /*break*/, 2];
|
|
4343
4616
|
return [4 /*yield*/, this.handleConnectedElementFieldActions(connectedFieldConfig, connectedField)];
|
|
4344
4617
|
case 1:
|
|
4345
|
-
connectedField =
|
|
4346
|
-
|
|
4618
|
+
connectedField = _k.sent();
|
|
4619
|
+
_k.label = 2;
|
|
4347
4620
|
case 2:
|
|
4348
4621
|
if (kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "handleNestedFields")) {
|
|
4349
4622
|
if (connectedFieldConfig.handleNestedFields) {
|
|
@@ -4358,67 +4631,67 @@
|
|
|
4358
4631
|
KwikIDFormViewComponent.prototype.handleConnectedElements = function (e, eventType) {
|
|
4359
4632
|
return __awaiter(this, void 0, void 0, function () {
|
|
4360
4633
|
var currentField, connectedFieldGroups, connectedFieldGroups_1, connectedFieldGroups_1_1, connectedFieldGroupConfig, e_6_1, connectedFields, connectedFields_1, connectedFields_1_1, connectedFieldConfig, e_7_1;
|
|
4361
|
-
var e_6,
|
|
4362
|
-
return __generator(this, function (
|
|
4363
|
-
switch (
|
|
4634
|
+
var e_6, _k, e_7, _l;
|
|
4635
|
+
return __generator(this, function (_m) {
|
|
4636
|
+
switch (_m.label) {
|
|
4364
4637
|
case 0:
|
|
4365
4638
|
currentField = getFormFieldByKey(this.formFields, e.key);
|
|
4366
4639
|
if (!(currentField !== undefined)) return [3 /*break*/, 17];
|
|
4367
4640
|
if (!kwikidToolkit.checkObjectKeyExists(currentField, "connectedElements")) return [3 /*break*/, 16];
|
|
4368
4641
|
if (!kwikidToolkit.checkObjectKeyExists(currentField.connectedElements, "connectedFieldGroups")) return [3 /*break*/, 8];
|
|
4369
4642
|
connectedFieldGroups = currentField.connectedElements.connectedFieldGroups;
|
|
4370
|
-
|
|
4643
|
+
_m.label = 1;
|
|
4371
4644
|
case 1:
|
|
4372
|
-
|
|
4645
|
+
_m.trys.push([1, 6, 7, 8]);
|
|
4373
4646
|
connectedFieldGroups_1 = __values(connectedFieldGroups), connectedFieldGroups_1_1 = connectedFieldGroups_1.next();
|
|
4374
|
-
|
|
4647
|
+
_m.label = 2;
|
|
4375
4648
|
case 2:
|
|
4376
4649
|
if (!!connectedFieldGroups_1_1.done) return [3 /*break*/, 5];
|
|
4377
4650
|
connectedFieldGroupConfig = connectedFieldGroups_1_1.value;
|
|
4378
4651
|
return [4 /*yield*/, this.handleConnectedElementFieldGroup(currentField, connectedFieldGroupConfig, eventType)];
|
|
4379
4652
|
case 3:
|
|
4380
|
-
|
|
4381
|
-
|
|
4653
|
+
_m.sent();
|
|
4654
|
+
_m.label = 4;
|
|
4382
4655
|
case 4:
|
|
4383
4656
|
connectedFieldGroups_1_1 = connectedFieldGroups_1.next();
|
|
4384
4657
|
return [3 /*break*/, 2];
|
|
4385
4658
|
case 5: return [3 /*break*/, 8];
|
|
4386
4659
|
case 6:
|
|
4387
|
-
e_6_1 =
|
|
4660
|
+
e_6_1 = _m.sent();
|
|
4388
4661
|
e_6 = { error: e_6_1 };
|
|
4389
4662
|
return [3 /*break*/, 8];
|
|
4390
4663
|
case 7:
|
|
4391
4664
|
try {
|
|
4392
|
-
if (connectedFieldGroups_1_1 && !connectedFieldGroups_1_1.done && (
|
|
4665
|
+
if (connectedFieldGroups_1_1 && !connectedFieldGroups_1_1.done && (_k = connectedFieldGroups_1.return)) _k.call(connectedFieldGroups_1);
|
|
4393
4666
|
}
|
|
4394
4667
|
finally { if (e_6) throw e_6.error; }
|
|
4395
4668
|
return [7 /*endfinally*/];
|
|
4396
4669
|
case 8:
|
|
4397
4670
|
if (!kwikidToolkit.checkObjectKeyExists(currentField.connectedElements, "connectedFields")) return [3 /*break*/, 16];
|
|
4398
4671
|
connectedFields = currentField.connectedElements.connectedFields;
|
|
4399
|
-
|
|
4672
|
+
_m.label = 9;
|
|
4400
4673
|
case 9:
|
|
4401
|
-
|
|
4674
|
+
_m.trys.push([9, 14, 15, 16]);
|
|
4402
4675
|
connectedFields_1 = __values(connectedFields), connectedFields_1_1 = connectedFields_1.next();
|
|
4403
|
-
|
|
4676
|
+
_m.label = 10;
|
|
4404
4677
|
case 10:
|
|
4405
4678
|
if (!!connectedFields_1_1.done) return [3 /*break*/, 13];
|
|
4406
4679
|
connectedFieldConfig = connectedFields_1_1.value;
|
|
4407
4680
|
return [4 /*yield*/, this.handleConnectedElementFields(currentField, connectedFieldConfig, eventType, eventType)];
|
|
4408
4681
|
case 11:
|
|
4409
|
-
currentField =
|
|
4410
|
-
|
|
4682
|
+
currentField = _m.sent();
|
|
4683
|
+
_m.label = 12;
|
|
4411
4684
|
case 12:
|
|
4412
4685
|
connectedFields_1_1 = connectedFields_1.next();
|
|
4413
4686
|
return [3 /*break*/, 10];
|
|
4414
4687
|
case 13: return [3 /*break*/, 16];
|
|
4415
4688
|
case 14:
|
|
4416
|
-
e_7_1 =
|
|
4689
|
+
e_7_1 = _m.sent();
|
|
4417
4690
|
e_7 = { error: e_7_1 };
|
|
4418
4691
|
return [3 /*break*/, 16];
|
|
4419
4692
|
case 15:
|
|
4420
4693
|
try {
|
|
4421
|
-
if (connectedFields_1_1 && !connectedFields_1_1.done && (
|
|
4694
|
+
if (connectedFields_1_1 && !connectedFields_1_1.done && (_l = connectedFields_1.return)) _l.call(connectedFields_1);
|
|
4422
4695
|
}
|
|
4423
4696
|
finally { if (e_7) throw e_7.error; }
|
|
4424
4697
|
return [7 /*endfinally*/];
|
|
@@ -4430,23 +4703,23 @@
|
|
|
4430
4703
|
});
|
|
4431
4704
|
};
|
|
4432
4705
|
KwikIDFormViewComponent.prototype.handleRemovedFile = function (e) {
|
|
4433
|
-
var
|
|
4706
|
+
var _k;
|
|
4434
4707
|
this.showApiLoader();
|
|
4435
4708
|
if (this.formGroup["controls"][e.key].enabled) {
|
|
4436
4709
|
this.files[e.key] = e.files;
|
|
4437
4710
|
this.formData[e.key] = filterDuplicatesFiles(this.files[e.key]);
|
|
4438
|
-
this.formGroup.patchValue((
|
|
4439
|
-
|
|
4440
|
-
|
|
4711
|
+
this.formGroup.patchValue((_k = {},
|
|
4712
|
+
_k[e.key] = this.formData[e.key],
|
|
4713
|
+
_k), { emitEvent: false });
|
|
4441
4714
|
}
|
|
4442
4715
|
this.hideApiLoader();
|
|
4443
4716
|
};
|
|
4444
4717
|
KwikIDFormViewComponent.prototype.handleGetKeyValueFile = function (e) {
|
|
4445
4718
|
return __awaiter(this, void 0, void 0, function () {
|
|
4446
4719
|
var field, values, values_1, values_1_1, value, e_8_1, _loop_2, this_2, values_2, values_2_1, value, e_9_1;
|
|
4447
|
-
var e_8,
|
|
4448
|
-
return __generator(this, function (
|
|
4449
|
-
switch (
|
|
4720
|
+
var e_8, _k, e_9, _l;
|
|
4721
|
+
return __generator(this, function (_m) {
|
|
4722
|
+
switch (_m.label) {
|
|
4450
4723
|
case 0:
|
|
4451
4724
|
this.showApiLoader();
|
|
4452
4725
|
field = getFormFieldByKey(this.formFields, e.key);
|
|
@@ -4454,41 +4727,41 @@
|
|
|
4454
4727
|
if (!(kwikidToolkit.checkObjectKeyExists(field, "properties") &&
|
|
4455
4728
|
kwikidToolkit.checkObjectKeyExists(field.properties, "uploadFileToServer") &&
|
|
4456
4729
|
field.properties.uploadFileToServer)) return [3 /*break*/, 9];
|
|
4457
|
-
|
|
4730
|
+
_m.label = 1;
|
|
4458
4731
|
case 1:
|
|
4459
|
-
|
|
4732
|
+
_m.trys.push([1, 6, 7, 8]);
|
|
4460
4733
|
values_1 = __values(values), values_1_1 = values_1.next();
|
|
4461
|
-
|
|
4734
|
+
_m.label = 2;
|
|
4462
4735
|
case 2:
|
|
4463
4736
|
if (!!values_1_1.done) return [3 /*break*/, 5];
|
|
4464
4737
|
value = values_1_1.value;
|
|
4465
4738
|
return [4 /*yield*/, this.uploadFile(field, value)];
|
|
4466
4739
|
case 3:
|
|
4467
|
-
|
|
4468
|
-
|
|
4740
|
+
_m.sent();
|
|
4741
|
+
_m.label = 4;
|
|
4469
4742
|
case 4:
|
|
4470
4743
|
values_1_1 = values_1.next();
|
|
4471
4744
|
return [3 /*break*/, 2];
|
|
4472
4745
|
case 5: return [3 /*break*/, 8];
|
|
4473
4746
|
case 6:
|
|
4474
|
-
e_8_1 =
|
|
4747
|
+
e_8_1 = _m.sent();
|
|
4475
4748
|
e_8 = { error: e_8_1 };
|
|
4476
4749
|
return [3 /*break*/, 8];
|
|
4477
4750
|
case 7:
|
|
4478
4751
|
try {
|
|
4479
|
-
if (values_1_1 && !values_1_1.done && (
|
|
4752
|
+
if (values_1_1 && !values_1_1.done && (_k = values_1.return)) _k.call(values_1);
|
|
4480
4753
|
}
|
|
4481
4754
|
finally { if (e_8) throw e_8.error; }
|
|
4482
4755
|
return [7 /*endfinally*/];
|
|
4483
4756
|
case 8: return [3 /*break*/, 18];
|
|
4484
4757
|
case 9:
|
|
4485
4758
|
_loop_2 = function (value) {
|
|
4486
|
-
var updatedFile,
|
|
4487
|
-
return __generator(this, function (
|
|
4488
|
-
switch (
|
|
4759
|
+
var updatedFile, _o;
|
|
4760
|
+
return __generator(this, function (_p) {
|
|
4761
|
+
switch (_p.label) {
|
|
4489
4762
|
case 0:
|
|
4490
4763
|
this_2.updateFiles(value, "LOADING", e.key);
|
|
4491
|
-
|
|
4764
|
+
_o = kwikidToolkit.getObjectDeepCopy;
|
|
4492
4765
|
return [4 /*yield*/, new Promise(function (resolve) {
|
|
4493
4766
|
setTimeout(function () {
|
|
4494
4767
|
resolve({
|
|
@@ -4502,42 +4775,42 @@
|
|
|
4502
4775
|
}, 300); // 1000 ms = 1 sec
|
|
4503
4776
|
})];
|
|
4504
4777
|
case 1:
|
|
4505
|
-
updatedFile =
|
|
4778
|
+
updatedFile = _o.apply(void 0, [_p.sent()]);
|
|
4506
4779
|
this_2.updateFiles(updatedFile, "NORMAL", e.key);
|
|
4507
4780
|
return [2 /*return*/];
|
|
4508
4781
|
}
|
|
4509
4782
|
});
|
|
4510
4783
|
};
|
|
4511
4784
|
this_2 = this;
|
|
4512
|
-
|
|
4785
|
+
_m.label = 10;
|
|
4513
4786
|
case 10:
|
|
4514
|
-
|
|
4787
|
+
_m.trys.push([10, 15, 16, 17]);
|
|
4515
4788
|
values_2 = __values(values), values_2_1 = values_2.next();
|
|
4516
|
-
|
|
4789
|
+
_m.label = 11;
|
|
4517
4790
|
case 11:
|
|
4518
4791
|
if (!!values_2_1.done) return [3 /*break*/, 14];
|
|
4519
4792
|
value = values_2_1.value;
|
|
4520
4793
|
return [5 /*yield**/, _loop_2(value)];
|
|
4521
4794
|
case 12:
|
|
4522
|
-
|
|
4523
|
-
|
|
4795
|
+
_m.sent();
|
|
4796
|
+
_m.label = 13;
|
|
4524
4797
|
case 13:
|
|
4525
4798
|
values_2_1 = values_2.next();
|
|
4526
4799
|
return [3 /*break*/, 11];
|
|
4527
4800
|
case 14: return [3 /*break*/, 17];
|
|
4528
4801
|
case 15:
|
|
4529
|
-
e_9_1 =
|
|
4802
|
+
e_9_1 = _m.sent();
|
|
4530
4803
|
e_9 = { error: e_9_1 };
|
|
4531
4804
|
return [3 /*break*/, 17];
|
|
4532
4805
|
case 16:
|
|
4533
4806
|
try {
|
|
4534
|
-
if (values_2_1 && !values_2_1.done && (
|
|
4807
|
+
if (values_2_1 && !values_2_1.done && (_l = values_2.return)) _l.call(values_2);
|
|
4535
4808
|
}
|
|
4536
4809
|
finally { if (e_9) throw e_9.error; }
|
|
4537
4810
|
return [7 /*endfinally*/];
|
|
4538
4811
|
case 17:
|
|
4539
4812
|
this.hideApiLoader();
|
|
4540
|
-
|
|
4813
|
+
_m.label = 18;
|
|
4541
4814
|
case 18: return [2 /*return*/];
|
|
4542
4815
|
}
|
|
4543
4816
|
});
|
|
@@ -4545,16 +4818,16 @@
|
|
|
4545
4818
|
};
|
|
4546
4819
|
/** Methods for Camera related fields like 'CAPTURE' */
|
|
4547
4820
|
KwikIDFormViewComponent.prototype.handleOnClickGetRemovedMediaFile = function (e) {
|
|
4548
|
-
var
|
|
4821
|
+
var _k;
|
|
4549
4822
|
this.showApiLoader();
|
|
4550
4823
|
if (this.formGroup["controls"][e.key].enabled) {
|
|
4551
4824
|
this.cameraCaptureFieldKey = "";
|
|
4552
4825
|
this.cameraCaptureImage = "";
|
|
4553
4826
|
this.mediaFiles[e.key] = e.mediaFiles;
|
|
4554
4827
|
this.formData[e.key] = filterDuplicatesMediaFiles(this.mediaFiles[e.key]);
|
|
4555
|
-
this.formGroup.patchValue((
|
|
4556
|
-
|
|
4557
|
-
|
|
4828
|
+
this.formGroup.patchValue((_k = {},
|
|
4829
|
+
_k[e.key] = this.formData[e.key],
|
|
4830
|
+
_k), { emitEvent: false });
|
|
4558
4831
|
}
|
|
4559
4832
|
this.hideApiLoader();
|
|
4560
4833
|
};
|
|
@@ -4573,8 +4846,8 @@
|
|
|
4573
4846
|
KwikIDFormViewComponent.prototype.setImage = function (image) {
|
|
4574
4847
|
return __awaiter(this, void 0, void 0, function () {
|
|
4575
4848
|
var field;
|
|
4576
|
-
return __generator(this, function (
|
|
4577
|
-
switch (
|
|
4849
|
+
return __generator(this, function (_k) {
|
|
4850
|
+
switch (_k.label) {
|
|
4578
4851
|
case 0:
|
|
4579
4852
|
field = getFormFieldByKey(this.formFields, this.cameraCaptureFieldKey);
|
|
4580
4853
|
if (!(kwikidToolkit.checkObjectKeyExists(field, "properties") &&
|
|
@@ -4582,7 +4855,7 @@
|
|
|
4582
4855
|
field.properties.uploadFileToServer)) return [3 /*break*/, 2];
|
|
4583
4856
|
return [4 /*yield*/, this.uploadFile(field, image)];
|
|
4584
4857
|
case 1:
|
|
4585
|
-
|
|
4858
|
+
_k.sent();
|
|
4586
4859
|
return [3 /*break*/, 3];
|
|
4587
4860
|
case 2:
|
|
4588
4861
|
this.cameraCaptureImage = "";
|
|
@@ -4595,7 +4868,7 @@
|
|
|
4595
4868
|
this.formGroup.controls[field.key].updateValueAndValidity({
|
|
4596
4869
|
emitEvent: false
|
|
4597
4870
|
});
|
|
4598
|
-
|
|
4871
|
+
_k.label = 3;
|
|
4599
4872
|
case 3: return [2 /*return*/];
|
|
4600
4873
|
}
|
|
4601
4874
|
});
|
|
@@ -4650,7 +4923,7 @@
|
|
|
4650
4923
|
* This method is used to update the files array with the new file and it's state and response from the api of uploading the file.
|
|
4651
4924
|
*/
|
|
4652
4925
|
KwikIDFormViewComponent.prototype.updateFiles = function (file, state, key) {
|
|
4653
|
-
var
|
|
4926
|
+
var _k;
|
|
4654
4927
|
var _a;
|
|
4655
4928
|
var fileWithState = kwikidToolkit.mergeObjects(file, { state: state });
|
|
4656
4929
|
var field = getFormFieldByKey(this.formFields, key);
|
|
@@ -4677,16 +4950,16 @@
|
|
|
4677
4950
|
emitEvent: false,
|
|
4678
4951
|
onlySelf: false
|
|
4679
4952
|
});
|
|
4680
|
-
this.formGroup.patchValue((
|
|
4681
|
-
|
|
4682
|
-
|
|
4953
|
+
this.formGroup.patchValue((_k = {},
|
|
4954
|
+
_k[key] = normalFiles,
|
|
4955
|
+
_k), { emitEvent: false });
|
|
4683
4956
|
};
|
|
4684
4957
|
/**
|
|
4685
4958
|
* 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.
|
|
4686
4959
|
*/
|
|
4687
4960
|
KwikIDFormViewComponent.prototype.uploadFile = function (field, file) {
|
|
4688
4961
|
return __awaiter(this, void 0, void 0, function () {
|
|
4689
|
-
return __generator(this, function (
|
|
4962
|
+
return __generator(this, function (_k) {
|
|
4690
4963
|
switch (field.type) {
|
|
4691
4964
|
case EFieldType.FILE:
|
|
4692
4965
|
this.updateFiles(file, "LOADING", field.key);
|
|
@@ -4732,11 +5005,11 @@
|
|
|
4732
5005
|
});
|
|
4733
5006
|
};
|
|
4734
5007
|
KwikIDFormViewComponent.prototype.handleOnClickFormFieldButton = function (field) {
|
|
4735
|
-
var e_10,
|
|
5008
|
+
var e_10, _k;
|
|
4736
5009
|
var formData = this.formGroup.getRawValue();
|
|
4737
5010
|
try {
|
|
4738
|
-
for (var
|
|
4739
|
-
var field_2 =
|
|
5011
|
+
for (var _l = __values(this.formFields), _m = _l.next(); !_m.done; _m = _l.next()) {
|
|
5012
|
+
var field_2 = _m.value;
|
|
4740
5013
|
if (field_2.isFormElement) {
|
|
4741
5014
|
if (field_2.hidden) {
|
|
4742
5015
|
delete formData[field_2.key];
|
|
@@ -4750,22 +5023,22 @@
|
|
|
4750
5023
|
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
4751
5024
|
finally {
|
|
4752
5025
|
try {
|
|
4753
|
-
if (
|
|
5026
|
+
if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
|
|
4754
5027
|
}
|
|
4755
5028
|
finally { if (e_10) throw e_10.error; }
|
|
4756
5029
|
}
|
|
4757
5030
|
var extendedFormData = this.formFields.reduce(function (result, field, index) {
|
|
4758
|
-
var
|
|
5031
|
+
var _k;
|
|
4759
5032
|
if (field.isFormElement && !field.hidden) {
|
|
4760
|
-
var fieldData = (
|
|
4761
|
-
|
|
5033
|
+
var fieldData = (_k = {},
|
|
5034
|
+
_k[field.key] = {
|
|
4762
5035
|
key: field.key,
|
|
4763
5036
|
label: field.label,
|
|
4764
5037
|
value: kwikidToolkit.isEmptyValue(formData[field.key]) ? "" : formData[field.key],
|
|
4765
5038
|
type: field.type,
|
|
4766
5039
|
index: index
|
|
4767
5040
|
},
|
|
4768
|
-
|
|
5041
|
+
_k);
|
|
4769
5042
|
result[field.key] = fieldData[field.key];
|
|
4770
5043
|
}
|
|
4771
5044
|
return result;
|
|
@@ -4778,11 +5051,11 @@
|
|
|
4778
5051
|
};
|
|
4779
5052
|
// DOM Event Handlers
|
|
4780
5053
|
KwikIDFormViewComponent.prototype.handleGetKeyValue = function (e) {
|
|
4781
|
-
var
|
|
5054
|
+
var _k;
|
|
4782
5055
|
var _this = this;
|
|
4783
|
-
this.formGroup.patchValue((
|
|
4784
|
-
|
|
4785
|
-
|
|
5056
|
+
this.formGroup.patchValue((_k = {},
|
|
5057
|
+
_k[e.key] = e.value,
|
|
5058
|
+
_k), { emitEvent: false });
|
|
4786
5059
|
var field = getFormFieldByKey(this.formFields, e.key);
|
|
4787
5060
|
this.formData[e.key] = convertFormFieldValueToStandardFormat(field, e.value);
|
|
4788
5061
|
this.getUnsavedDataState.emit(true);
|
|
@@ -4798,11 +5071,11 @@
|
|
|
4798
5071
|
ALL_FORMS_DATA: this.allFormsData
|
|
4799
5072
|
}, this.takeAction.bind(this));
|
|
4800
5073
|
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
4801
|
-
return __generator(this, function (
|
|
4802
|
-
switch (
|
|
5074
|
+
return __generator(this, function (_k) {
|
|
5075
|
+
switch (_k.label) {
|
|
4803
5076
|
case 0: return [4 /*yield*/, validations_2.validate(field.validation)];
|
|
4804
5077
|
case 1:
|
|
4805
|
-
|
|
5078
|
+
_k.sent();
|
|
4806
5079
|
return [2 /*return*/];
|
|
4807
5080
|
}
|
|
4808
5081
|
});
|
|
@@ -4821,27 +5094,27 @@
|
|
|
4821
5094
|
return __awaiter(this, void 0, void 0, function () {
|
|
4822
5095
|
var resetFormFields, BYPASS_RESET_CONFIRM, CONFIRM_RESET;
|
|
4823
5096
|
var _this = this;
|
|
4824
|
-
return __generator(this, function (
|
|
5097
|
+
return __generator(this, function (_k) {
|
|
4825
5098
|
resetFormFields = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
4826
|
-
var
|
|
4827
|
-
var e_12,
|
|
4828
|
-
return __generator(this, function (
|
|
4829
|
-
switch (
|
|
5099
|
+
var _k, _l, f, _m, _o, action, resetField, actions, e_11_1, e_12_1;
|
|
5100
|
+
var e_12, _p, e_11, _q;
|
|
5101
|
+
return __generator(this, function (_r) {
|
|
5102
|
+
switch (_r.label) {
|
|
4830
5103
|
case 0:
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
5104
|
+
_r.trys.push([0, 11, 12, 13]);
|
|
5105
|
+
_k = __values(field.reset.fields), _l = _k.next();
|
|
5106
|
+
_r.label = 1;
|
|
4834
5107
|
case 1:
|
|
4835
|
-
if (!!
|
|
4836
|
-
f =
|
|
4837
|
-
|
|
5108
|
+
if (!!_l.done) return [3 /*break*/, 10];
|
|
5109
|
+
f = _l.value;
|
|
5110
|
+
_r.label = 2;
|
|
4838
5111
|
case 2:
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
5112
|
+
_r.trys.push([2, 7, 8, 9]);
|
|
5113
|
+
_m = (e_11 = void 0, __values(f.actions)), _o = _m.next();
|
|
5114
|
+
_r.label = 3;
|
|
4842
5115
|
case 3:
|
|
4843
|
-
if (!!
|
|
4844
|
-
action =
|
|
5116
|
+
if (!!_o.done) return [3 /*break*/, 6];
|
|
5117
|
+
action = _o.value;
|
|
4845
5118
|
resetField = getFormFieldByKey(this.formFields, action.props.fieldKey);
|
|
4846
5119
|
actions = new kwikidToolkit.Action(action, {}, {
|
|
4847
5120
|
FIELD_CONFIG: resetField,
|
|
@@ -4853,33 +5126,33 @@
|
|
|
4853
5126
|
}, this.takeAction.bind(this));
|
|
4854
5127
|
return [4 /*yield*/, actions.execute()];
|
|
4855
5128
|
case 4:
|
|
4856
|
-
|
|
4857
|
-
|
|
5129
|
+
_r.sent();
|
|
5130
|
+
_r.label = 5;
|
|
4858
5131
|
case 5:
|
|
4859
|
-
|
|
5132
|
+
_o = _m.next();
|
|
4860
5133
|
return [3 /*break*/, 3];
|
|
4861
5134
|
case 6: return [3 /*break*/, 9];
|
|
4862
5135
|
case 7:
|
|
4863
|
-
e_11_1 =
|
|
5136
|
+
e_11_1 = _r.sent();
|
|
4864
5137
|
e_11 = { error: e_11_1 };
|
|
4865
5138
|
return [3 /*break*/, 9];
|
|
4866
5139
|
case 8:
|
|
4867
5140
|
try {
|
|
4868
|
-
if (
|
|
5141
|
+
if (_o && !_o.done && (_q = _m.return)) _q.call(_m);
|
|
4869
5142
|
}
|
|
4870
5143
|
finally { if (e_11) throw e_11.error; }
|
|
4871
5144
|
return [7 /*endfinally*/];
|
|
4872
5145
|
case 9:
|
|
4873
|
-
|
|
5146
|
+
_l = _k.next();
|
|
4874
5147
|
return [3 /*break*/, 1];
|
|
4875
5148
|
case 10: return [3 /*break*/, 13];
|
|
4876
5149
|
case 11:
|
|
4877
|
-
e_12_1 =
|
|
5150
|
+
e_12_1 = _r.sent();
|
|
4878
5151
|
e_12 = { error: e_12_1 };
|
|
4879
5152
|
return [3 /*break*/, 13];
|
|
4880
5153
|
case 12:
|
|
4881
5154
|
try {
|
|
4882
|
-
if (
|
|
5155
|
+
if (_l && !_l.done && (_p = _k.return)) _p.call(_k);
|
|
4883
5156
|
}
|
|
4884
5157
|
finally { if (e_12) throw e_12.error; }
|
|
4885
5158
|
return [7 /*endfinally*/];
|
|
@@ -4904,9 +5177,9 @@
|
|
|
4904
5177
|
KwikIDFormViewComponent.prototype.handleFieldApiCall = function (field, api) {
|
|
4905
5178
|
return __awaiter(this, void 0, void 0, function () {
|
|
4906
5179
|
var apis;
|
|
4907
|
-
var
|
|
4908
|
-
return __generator(this, function (
|
|
4909
|
-
switch (
|
|
5180
|
+
var _k, _l;
|
|
5181
|
+
return __generator(this, function (_m) {
|
|
5182
|
+
switch (_m.label) {
|
|
4910
5183
|
case 0: return [4 /*yield*/, this.executeApiCall(api, {
|
|
4911
5184
|
FIELD_CONFIG: field,
|
|
4912
5185
|
API_CONFIG: api,
|
|
@@ -4917,13 +5190,13 @@
|
|
|
4917
5190
|
ALL_FORMS_DATA: this.allFormsData
|
|
4918
5191
|
})];
|
|
4919
5192
|
case 1:
|
|
4920
|
-
api =
|
|
5193
|
+
api = _m.sent();
|
|
4921
5194
|
if (!this.isValidRequestHeadersAndBody(api)) return [3 /*break*/, 3];
|
|
4922
5195
|
if (kwikidToolkit.checkObjectKeyExists(field.api, "request")) {
|
|
4923
|
-
this.formData = Object.assign(Object.assign({}, this.formData), (
|
|
4924
|
-
this.formGroup.patchValue((
|
|
4925
|
-
|
|
4926
|
-
|
|
5196
|
+
this.formData = Object.assign(Object.assign({}, this.formData), (_k = {}, _k[field.key] = api.response.value, _k));
|
|
5197
|
+
this.formGroup.patchValue((_l = {},
|
|
5198
|
+
_l[field.key] = api.response.value,
|
|
5199
|
+
_l), { emitEvent: false });
|
|
4927
5200
|
}
|
|
4928
5201
|
apis = new Apis({
|
|
4929
5202
|
FIELD_CONFIG: field,
|
|
@@ -4937,14 +5210,14 @@
|
|
|
4937
5210
|
}, this.takeAction.bind(this));
|
|
4938
5211
|
return [4 /*yield*/, apis.validateResponse()];
|
|
4939
5212
|
case 2:
|
|
4940
|
-
api =
|
|
5213
|
+
api = _m.sent();
|
|
4941
5214
|
return [3 /*break*/, 4];
|
|
4942
5215
|
case 3:
|
|
4943
5216
|
setTimeout(function () {
|
|
4944
5217
|
field["api"]["status"]["value"] = EApiStatusType.FAILED;
|
|
4945
5218
|
field["showLoader"] = false;
|
|
4946
5219
|
}, 500);
|
|
4947
|
-
|
|
5220
|
+
_m.label = 4;
|
|
4948
5221
|
case 4: return [2 /*return*/, { field: field, api: api }];
|
|
4949
5222
|
}
|
|
4950
5223
|
});
|
|
@@ -4953,8 +5226,8 @@
|
|
|
4953
5226
|
KwikIDFormViewComponent.prototype.handleApiCall = function (api) {
|
|
4954
5227
|
return __awaiter(this, void 0, void 0, function () {
|
|
4955
5228
|
var apis;
|
|
4956
|
-
return __generator(this, function (
|
|
4957
|
-
switch (
|
|
5229
|
+
return __generator(this, function (_k) {
|
|
5230
|
+
switch (_k.label) {
|
|
4958
5231
|
case 0: return [4 /*yield*/, this.executeApiCall(api, {
|
|
4959
5232
|
FORM_CONFIG: this.formConfig,
|
|
4960
5233
|
API_CONFIG: api,
|
|
@@ -4965,7 +5238,7 @@
|
|
|
4965
5238
|
ALL_FORMS_DATA: this.allFormsData
|
|
4966
5239
|
})];
|
|
4967
5240
|
case 1:
|
|
4968
|
-
api =
|
|
5241
|
+
api = _k.sent();
|
|
4969
5242
|
apis = new Apis({
|
|
4970
5243
|
FORM_CONFIG: this.formConfig,
|
|
4971
5244
|
API_CONFIG: api,
|
|
@@ -4978,36 +5251,36 @@
|
|
|
4978
5251
|
if (!this.isValidRequestHeadersAndBody(api)) return [3 /*break*/, 3];
|
|
4979
5252
|
return [4 /*yield*/, apis.validateResponse()];
|
|
4980
5253
|
case 2:
|
|
4981
|
-
api =
|
|
4982
|
-
|
|
5254
|
+
api = _k.sent();
|
|
5255
|
+
_k.label = 3;
|
|
4983
5256
|
case 3: return [2 /*return*/, { api: api }];
|
|
4984
5257
|
}
|
|
4985
5258
|
});
|
|
4986
5259
|
});
|
|
4987
5260
|
};
|
|
4988
5261
|
KwikIDFormViewComponent.prototype.executeApiCall = function (api, object) {
|
|
4989
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
5262
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
4990
5263
|
return __awaiter(this, void 0, void 0, function () {
|
|
4991
5264
|
var apis, apiCallResponse, apiCallResponseStatusCode, url, method, headers, body, response, err_1, response, err_2;
|
|
4992
|
-
return __generator(this, function (
|
|
4993
|
-
switch (
|
|
5265
|
+
return __generator(this, function (_k) {
|
|
5266
|
+
switch (_k.label) {
|
|
4994
5267
|
case 0:
|
|
4995
5268
|
apis = new Apis(object, this.takeAction.bind(this));
|
|
4996
5269
|
return [4 /*yield*/, apis.setUrl()];
|
|
4997
5270
|
case 1:
|
|
4998
|
-
api =
|
|
5271
|
+
api = _k.sent();
|
|
4999
5272
|
return [4 /*yield*/, apis.setRequestHeaders()];
|
|
5000
5273
|
case 2:
|
|
5001
|
-
api =
|
|
5274
|
+
api = _k.sent();
|
|
5002
5275
|
return [4 /*yield*/, apis.validateRequestHeaders()];
|
|
5003
5276
|
case 3:
|
|
5004
|
-
api =
|
|
5277
|
+
api = _k.sent();
|
|
5005
5278
|
return [4 /*yield*/, apis.setRequestBody()];
|
|
5006
5279
|
case 4:
|
|
5007
|
-
api =
|
|
5280
|
+
api = _k.sent();
|
|
5008
5281
|
return [4 /*yield*/, apis.validateRequestBody()];
|
|
5009
5282
|
case 5:
|
|
5010
|
-
api =
|
|
5283
|
+
api = _k.sent();
|
|
5011
5284
|
apiCallResponse = {};
|
|
5012
5285
|
if (!this.isValidRequestHeadersAndBody(api)) return [3 /*break*/, 18];
|
|
5013
5286
|
if (!(api.request.url.hasOwnProperty("type") &&
|
|
@@ -5018,63 +5291,80 @@
|
|
|
5018
5291
|
}, 1000); // 1000 ms = 1 sec
|
|
5019
5292
|
})];
|
|
5020
5293
|
case 6:
|
|
5021
|
-
apiCallResponse =
|
|
5294
|
+
apiCallResponse = _k.sent();
|
|
5295
|
+
apiCallResponseStatusCode = (_b = (_a = api.request.url.props) === null || _a === void 0 ? void 0 : _a.statusCode) !== null && _b !== void 0 ? _b : 200; // Default Status Code for Mocked APIs
|
|
5022
5296
|
return [3 /*break*/, 17];
|
|
5023
5297
|
case 7:
|
|
5024
5298
|
url = api.request.url.value;
|
|
5025
|
-
method = (
|
|
5026
|
-
headers = Object.assign({ "Content-Type": "application/json" }, (((
|
|
5027
|
-
body = (
|
|
5299
|
+
method = (_d = (_c = api.request) === null || _c === void 0 ? void 0 : _c.method) !== null && _d !== void 0 ? _d : "POST";
|
|
5300
|
+
headers = Object.assign({ "Content-Type": "application/json" }, (((_f = (_e = api.request) === null || _e === void 0 ? void 0 : _e.headers) === null || _f === void 0 ? void 0 : _f.value) || {}));
|
|
5301
|
+
body = (_j = (_h = (_g = api.request) === null || _g === void 0 ? void 0 : _g.body) === null || _h === void 0 ? void 0 : _h.value) !== null && _j !== void 0 ? _j : null;
|
|
5028
5302
|
if (!(method === "GET")) return [3 /*break*/, 13];
|
|
5029
|
-
|
|
5303
|
+
_k.label = 8;
|
|
5030
5304
|
case 8:
|
|
5031
|
-
|
|
5305
|
+
_k.trys.push([8, 11, , 12]);
|
|
5032
5306
|
return [4 /*yield*/, fetch(url, {
|
|
5033
5307
|
method: method,
|
|
5034
5308
|
headers: Object.assign({}, headers)
|
|
5035
5309
|
})];
|
|
5036
5310
|
case 9:
|
|
5037
|
-
response =
|
|
5311
|
+
response = _k.sent();
|
|
5038
5312
|
return [4 /*yield*/, response.json()];
|
|
5039
5313
|
case 10:
|
|
5040
|
-
apiCallResponse =
|
|
5314
|
+
apiCallResponse = _k.sent();
|
|
5041
5315
|
apiCallResponseStatusCode = response.status;
|
|
5042
5316
|
return [3 /*break*/, 12];
|
|
5043
5317
|
case 11:
|
|
5044
|
-
err_1 =
|
|
5318
|
+
err_1 = _k.sent();
|
|
5045
5319
|
apiCallResponse = {};
|
|
5046
5320
|
return [3 /*break*/, 12];
|
|
5047
5321
|
case 12: return [3 /*break*/, 17];
|
|
5048
5322
|
case 13:
|
|
5049
|
-
|
|
5323
|
+
_k.trys.push([13, 16, , 17]);
|
|
5050
5324
|
return [4 /*yield*/, fetch(url, {
|
|
5051
5325
|
method: method,
|
|
5052
5326
|
headers: Object.assign({}, headers),
|
|
5053
5327
|
body: JSON.stringify(body)
|
|
5054
5328
|
})];
|
|
5055
5329
|
case 14:
|
|
5056
|
-
response =
|
|
5330
|
+
response = _k.sent();
|
|
5057
5331
|
return [4 /*yield*/, response.json()];
|
|
5058
5332
|
case 15:
|
|
5059
|
-
apiCallResponse =
|
|
5333
|
+
apiCallResponse = _k.sent();
|
|
5060
5334
|
apiCallResponseStatusCode = response.status;
|
|
5061
5335
|
return [3 /*break*/, 17];
|
|
5062
5336
|
case 16:
|
|
5063
|
-
err_2 =
|
|
5337
|
+
err_2 = _k.sent();
|
|
5064
5338
|
apiCallResponse = {};
|
|
5065
5339
|
return [3 /*break*/, 17];
|
|
5066
5340
|
case 17:
|
|
5067
5341
|
api.response = kwikidToolkit.setValueToObjectPath(api.response, "value", apiCallResponse);
|
|
5068
5342
|
api.response = kwikidToolkit.setValueToObjectPath(api.response, "status", apiCallResponseStatusCode);
|
|
5069
|
-
|
|
5343
|
+
this.getLogs.emit({
|
|
5344
|
+
type: ETypeLogs.API,
|
|
5345
|
+
timestamp: new Date().getTime(),
|
|
5346
|
+
data: {
|
|
5347
|
+
request: api.request,
|
|
5348
|
+
response: api.response
|
|
5349
|
+
}
|
|
5350
|
+
});
|
|
5351
|
+
_k.label = 18;
|
|
5070
5352
|
case 18: return [2 /*return*/, api];
|
|
5071
5353
|
}
|
|
5072
5354
|
});
|
|
5073
5355
|
});
|
|
5074
5356
|
};
|
|
5075
5357
|
KwikIDFormViewComponent.prototype.isValidRequestHeadersAndBody = function (api) {
|
|
5076
|
-
|
|
5077
|
-
|
|
5358
|
+
var _a, _b;
|
|
5359
|
+
var bodyValidation = ((_a = api.request.body) === null || _a === void 0 ? void 0 : _a.validation) ||
|
|
5360
|
+
api.request.body;
|
|
5361
|
+
var headersValidation = ((_b = api.request.headers) === null || _b === void 0 ? void 0 : _b.validation) ||
|
|
5362
|
+
api.request.headers;
|
|
5363
|
+
if (!bodyValidation && !headersValidation) {
|
|
5364
|
+
return false;
|
|
5365
|
+
}
|
|
5366
|
+
return (((bodyValidation === null || bodyValidation === void 0 ? void 0 : bodyValidation.is_valid) || false) &&
|
|
5367
|
+
((headersValidation === null || headersValidation === void 0 ? void 0 : headersValidation.is_valid) || false));
|
|
5078
5368
|
};
|
|
5079
5369
|
KwikIDFormViewComponent.prototype.showApiLoader = function () {
|
|
5080
5370
|
this.loaderService.show({
|
|
@@ -5096,8 +5386,8 @@
|
|
|
5096
5386
|
KwikIDFormViewComponent.prototype.handleOnClickApiCall = function (e) {
|
|
5097
5387
|
return __awaiter(this, void 0, void 0, function () {
|
|
5098
5388
|
var field, apis;
|
|
5099
|
-
return __generator(this, function (
|
|
5100
|
-
switch (
|
|
5389
|
+
return __generator(this, function (_k) {
|
|
5390
|
+
switch (_k.label) {
|
|
5101
5391
|
case 0:
|
|
5102
5392
|
field = getFormFieldByKey(this.formFields, e.key);
|
|
5103
5393
|
if (!(field.type === EFieldType.API)) return [3 /*break*/, 5];
|
|
@@ -5108,7 +5398,7 @@
|
|
|
5108
5398
|
if (!kwikidToolkit.checkObjectKeyExists(field.api, "request")) return [3 /*break*/, 2];
|
|
5109
5399
|
return [4 /*yield*/, this.handleFieldApiCall(field, field.api)];
|
|
5110
5400
|
case 1:
|
|
5111
|
-
|
|
5401
|
+
_k.sent();
|
|
5112
5402
|
return [3 /*break*/, 4];
|
|
5113
5403
|
case 2:
|
|
5114
5404
|
apis = new Apis({
|
|
@@ -5122,11 +5412,11 @@
|
|
|
5122
5412
|
}, this.takeAction.bind(this));
|
|
5123
5413
|
return [4 /*yield*/, apis.callNextApi(field.api.entrypoint)];
|
|
5124
5414
|
case 3:
|
|
5125
|
-
|
|
5126
|
-
|
|
5415
|
+
_k.sent();
|
|
5416
|
+
_k.label = 4;
|
|
5127
5417
|
case 4:
|
|
5128
5418
|
this.hideApiLoader();
|
|
5129
|
-
|
|
5419
|
+
_k.label = 5;
|
|
5130
5420
|
case 5: return [2 /*return*/];
|
|
5131
5421
|
}
|
|
5132
5422
|
});
|
|
@@ -5171,11 +5461,11 @@
|
|
|
5171
5461
|
};
|
|
5172
5462
|
KwikIDFormViewComponent.prototype.handleOnClickSaveForm = function (e) {
|
|
5173
5463
|
return __awaiter(this, void 0, void 0, function () {
|
|
5174
|
-
var controls, firstFieldWithError, controls_1, controls_1_1, control,
|
|
5175
|
-
var e_15,
|
|
5464
|
+
var controls, firstFieldWithError, controls_1, controls_1_1, control, _k, _l, field, validations, e_13_1, formData, _m, _o, field, extendedFormData, _p, _q, postTask, task, e_14_1;
|
|
5465
|
+
var e_15, _r, e_13, _s, e_16, _t, e_14, _u;
|
|
5176
5466
|
var _this = this;
|
|
5177
|
-
return __generator(this, function (
|
|
5178
|
-
switch (
|
|
5467
|
+
return __generator(this, function (_v) {
|
|
5468
|
+
switch (_v.label) {
|
|
5179
5469
|
case 0:
|
|
5180
5470
|
controls = new FormValidation().getFormFieldsInvalidControls(this.formGroup);
|
|
5181
5471
|
firstFieldWithError = "";
|
|
@@ -5191,7 +5481,7 @@
|
|
|
5191
5481
|
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
5192
5482
|
finally {
|
|
5193
5483
|
try {
|
|
5194
|
-
if (controls_1_1 && !controls_1_1.done && (
|
|
5484
|
+
if (controls_1_1 && !controls_1_1.done && (_r = controls_1.return)) _r.call(controls_1);
|
|
5195
5485
|
}
|
|
5196
5486
|
finally { if (e_15) throw e_15.error; }
|
|
5197
5487
|
}
|
|
@@ -5202,14 +5492,14 @@
|
|
|
5202
5492
|
}, 3000);
|
|
5203
5493
|
return [2 /*return*/];
|
|
5204
5494
|
}
|
|
5205
|
-
|
|
5495
|
+
_v.label = 1;
|
|
5206
5496
|
case 1:
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5497
|
+
_v.trys.push([1, 6, 7, 8]);
|
|
5498
|
+
_k = __values(this.formFields), _l = _k.next();
|
|
5499
|
+
_v.label = 2;
|
|
5210
5500
|
case 2:
|
|
5211
|
-
if (!!
|
|
5212
|
-
field =
|
|
5501
|
+
if (!!_l.done) return [3 /*break*/, 5];
|
|
5502
|
+
field = _l.value;
|
|
5213
5503
|
if (!(field.isFormElement &&
|
|
5214
5504
|
!field.hidden &&
|
|
5215
5505
|
kwikidToolkit.checkObjectKeyExists(field, "validation") &&
|
|
@@ -5224,7 +5514,7 @@
|
|
|
5224
5514
|
}, this.takeAction.bind(this));
|
|
5225
5515
|
return [4 /*yield*/, validations.validate(field.validation)];
|
|
5226
5516
|
case 3:
|
|
5227
|
-
|
|
5517
|
+
_v.sent();
|
|
5228
5518
|
if (!field.validation.is_valid) {
|
|
5229
5519
|
this.toggleErrorNotification(true);
|
|
5230
5520
|
setTimeout(function () {
|
|
@@ -5232,26 +5522,26 @@
|
|
|
5232
5522
|
}, 3000);
|
|
5233
5523
|
return [2 /*return*/];
|
|
5234
5524
|
}
|
|
5235
|
-
|
|
5525
|
+
_v.label = 4;
|
|
5236
5526
|
case 4:
|
|
5237
|
-
|
|
5527
|
+
_l = _k.next();
|
|
5238
5528
|
return [3 /*break*/, 2];
|
|
5239
5529
|
case 5: return [3 /*break*/, 8];
|
|
5240
5530
|
case 6:
|
|
5241
|
-
e_13_1 =
|
|
5531
|
+
e_13_1 = _v.sent();
|
|
5242
5532
|
e_13 = { error: e_13_1 };
|
|
5243
5533
|
return [3 /*break*/, 8];
|
|
5244
5534
|
case 7:
|
|
5245
5535
|
try {
|
|
5246
|
-
if (
|
|
5536
|
+
if (_l && !_l.done && (_s = _k.return)) _s.call(_k);
|
|
5247
5537
|
}
|
|
5248
5538
|
finally { if (e_13) throw e_13.error; }
|
|
5249
5539
|
return [7 /*endfinally*/];
|
|
5250
5540
|
case 8:
|
|
5251
5541
|
formData = this.formGroup.getRawValue();
|
|
5252
5542
|
try {
|
|
5253
|
-
for (
|
|
5254
|
-
field =
|
|
5543
|
+
for (_m = __values(this.formFields), _o = _m.next(); !_o.done; _o = _m.next()) {
|
|
5544
|
+
field = _o.value;
|
|
5255
5545
|
if (field.isFormElement) {
|
|
5256
5546
|
if (field.hidden) {
|
|
5257
5547
|
delete formData[field.key];
|
|
@@ -5265,22 +5555,22 @@
|
|
|
5265
5555
|
catch (e_16_1) { e_16 = { error: e_16_1 }; }
|
|
5266
5556
|
finally {
|
|
5267
5557
|
try {
|
|
5268
|
-
if (
|
|
5558
|
+
if (_o && !_o.done && (_t = _m.return)) _t.call(_m);
|
|
5269
5559
|
}
|
|
5270
5560
|
finally { if (e_16) throw e_16.error; }
|
|
5271
5561
|
}
|
|
5272
5562
|
extendedFormData = this.formFields.reduce(function (result, field, index) {
|
|
5273
|
-
var
|
|
5563
|
+
var _k;
|
|
5274
5564
|
if (field.isFormElement && !field.hidden) {
|
|
5275
|
-
var fieldData = (
|
|
5276
|
-
|
|
5565
|
+
var fieldData = (_k = {},
|
|
5566
|
+
_k[field.key] = {
|
|
5277
5567
|
key: field.key,
|
|
5278
5568
|
label: field.label,
|
|
5279
5569
|
value: kwikidToolkit.isEmptyValue(formData[field.key]) ? "" : formData[field.key],
|
|
5280
5570
|
type: field.type,
|
|
5281
5571
|
index: index
|
|
5282
5572
|
},
|
|
5283
|
-
|
|
5573
|
+
_k);
|
|
5284
5574
|
result[field.key] = fieldData[field.key];
|
|
5285
5575
|
}
|
|
5286
5576
|
return result;
|
|
@@ -5292,14 +5582,14 @@
|
|
|
5292
5582
|
});
|
|
5293
5583
|
if (!(kwikidToolkit.checkObjectKeyExists(this.formConfig, "tasks") &&
|
|
5294
5584
|
kwikidToolkit.checkObjectKeyExists(this.formConfig.tasks, "post"))) return [3 /*break*/, 18];
|
|
5295
|
-
|
|
5585
|
+
_v.label = 9;
|
|
5296
5586
|
case 9:
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5587
|
+
_v.trys.push([9, 15, 16, 17]);
|
|
5588
|
+
_p = __values(this.formConfig.tasks.post), _q = _p.next();
|
|
5589
|
+
_v.label = 10;
|
|
5300
5590
|
case 10:
|
|
5301
|
-
if (!!
|
|
5302
|
-
postTask =
|
|
5591
|
+
if (!!_q.done) return [3 /*break*/, 14];
|
|
5592
|
+
postTask = _q.value;
|
|
5303
5593
|
task = new Tasks(postTask, {
|
|
5304
5594
|
FORM_CONFIG: this.formConfig,
|
|
5305
5595
|
FORM_FIELDS: this.formFields,
|
|
@@ -5317,7 +5607,7 @@
|
|
|
5317
5607
|
}
|
|
5318
5608
|
return [4 /*yield*/, task.execute()];
|
|
5319
5609
|
case 11:
|
|
5320
|
-
|
|
5610
|
+
_v.sent();
|
|
5321
5611
|
// Wait for ngOnChanges to be called before continuing to the next task
|
|
5322
5612
|
return [4 /*yield*/, new Promise(function (resolve) {
|
|
5323
5613
|
var intervalId = setInterval(function () {
|
|
@@ -5329,22 +5619,22 @@
|
|
|
5329
5619
|
})];
|
|
5330
5620
|
case 12:
|
|
5331
5621
|
// Wait for ngOnChanges to be called before continuing to the next task
|
|
5332
|
-
|
|
5622
|
+
_v.sent();
|
|
5333
5623
|
if (this.stopTaskExecution) {
|
|
5334
5624
|
return [3 /*break*/, 14];
|
|
5335
5625
|
}
|
|
5336
|
-
|
|
5626
|
+
_v.label = 13;
|
|
5337
5627
|
case 13:
|
|
5338
|
-
|
|
5628
|
+
_q = _p.next();
|
|
5339
5629
|
return [3 /*break*/, 10];
|
|
5340
5630
|
case 14: return [3 /*break*/, 17];
|
|
5341
5631
|
case 15:
|
|
5342
|
-
e_14_1 =
|
|
5632
|
+
e_14_1 = _v.sent();
|
|
5343
5633
|
e_14 = { error: e_14_1 };
|
|
5344
5634
|
return [3 /*break*/, 17];
|
|
5345
5635
|
case 16:
|
|
5346
5636
|
try {
|
|
5347
|
-
if (
|
|
5637
|
+
if (_q && !_q.done && (_u = _p.return)) _u.call(_p);
|
|
5348
5638
|
}
|
|
5349
5639
|
finally { if (e_14) throw e_14.error; }
|
|
5350
5640
|
return [7 /*endfinally*/];
|
|
@@ -5366,7 +5656,7 @@
|
|
|
5366
5656
|
data: kwikidToolkit.mergeObjects(formData, this.popupFormData, this.taskData),
|
|
5367
5657
|
extendedData: extendedFormData
|
|
5368
5658
|
});
|
|
5369
|
-
|
|
5659
|
+
_v.label = 19;
|
|
5370
5660
|
case 19: return [2 /*return*/];
|
|
5371
5661
|
}
|
|
5372
5662
|
});
|
|
@@ -5385,17 +5675,17 @@
|
|
|
5385
5675
|
this.formGroup.updateValueAndValidity();
|
|
5386
5676
|
};
|
|
5387
5677
|
KwikIDFormViewComponent.prototype.fieldGroupHide = function (fieldGroup) {
|
|
5388
|
-
var e_17,
|
|
5678
|
+
var e_17, _k;
|
|
5389
5679
|
try {
|
|
5390
|
-
for (var
|
|
5391
|
-
var fieldKey =
|
|
5680
|
+
for (var _l = __values(this.fieldGroups[fieldGroup]), _m = _l.next(); !_m.done; _m = _l.next()) {
|
|
5681
|
+
var fieldKey = _m.value;
|
|
5392
5682
|
this.fieldHide(fieldKey);
|
|
5393
5683
|
}
|
|
5394
5684
|
}
|
|
5395
5685
|
catch (e_17_1) { e_17 = { error: e_17_1 }; }
|
|
5396
5686
|
finally {
|
|
5397
5687
|
try {
|
|
5398
|
-
if (
|
|
5688
|
+
if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
|
|
5399
5689
|
}
|
|
5400
5690
|
finally { if (e_17) throw e_17.error; }
|
|
5401
5691
|
}
|
|
@@ -5409,17 +5699,17 @@
|
|
|
5409
5699
|
this.formGroup.updateValueAndValidity();
|
|
5410
5700
|
};
|
|
5411
5701
|
KwikIDFormViewComponent.prototype.fieldGroupShow = function (fieldGroup) {
|
|
5412
|
-
var e_18,
|
|
5702
|
+
var e_18, _k;
|
|
5413
5703
|
try {
|
|
5414
|
-
for (var
|
|
5415
|
-
var fieldKey =
|
|
5704
|
+
for (var _l = __values(this.fieldGroups[fieldGroup]), _m = _l.next(); !_m.done; _m = _l.next()) {
|
|
5705
|
+
var fieldKey = _m.value;
|
|
5416
5706
|
this.fieldShow(fieldKey);
|
|
5417
5707
|
}
|
|
5418
5708
|
}
|
|
5419
5709
|
catch (e_18_1) { e_18 = { error: e_18_1 }; }
|
|
5420
5710
|
finally {
|
|
5421
5711
|
try {
|
|
5422
|
-
if (
|
|
5712
|
+
if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
|
|
5423
5713
|
}
|
|
5424
5714
|
finally { if (e_18) throw e_18.error; }
|
|
5425
5715
|
}
|
|
@@ -5443,17 +5733,17 @@
|
|
|
5443
5733
|
}
|
|
5444
5734
|
};
|
|
5445
5735
|
KwikIDFormViewComponent.prototype.fieldGroupDisable = function (fieldGroup) {
|
|
5446
|
-
var e_19,
|
|
5736
|
+
var e_19, _k;
|
|
5447
5737
|
try {
|
|
5448
|
-
for (var
|
|
5449
|
-
var fieldKey =
|
|
5738
|
+
for (var _l = __values(this.fieldGroups[fieldGroup]), _m = _l.next(); !_m.done; _m = _l.next()) {
|
|
5739
|
+
var fieldKey = _m.value;
|
|
5450
5740
|
this.fieldDisable(fieldKey);
|
|
5451
5741
|
}
|
|
5452
5742
|
}
|
|
5453
5743
|
catch (e_19_1) { e_19 = { error: e_19_1 }; }
|
|
5454
5744
|
finally {
|
|
5455
5745
|
try {
|
|
5456
|
-
if (
|
|
5746
|
+
if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
|
|
5457
5747
|
}
|
|
5458
5748
|
finally { if (e_19) throw e_19.error; }
|
|
5459
5749
|
}
|
|
@@ -5477,23 +5767,23 @@
|
|
|
5477
5767
|
}
|
|
5478
5768
|
};
|
|
5479
5769
|
KwikIDFormViewComponent.prototype.fieldGroupEnable = function (fieldGroup) {
|
|
5480
|
-
var e_20,
|
|
5770
|
+
var e_20, _k;
|
|
5481
5771
|
try {
|
|
5482
|
-
for (var
|
|
5483
|
-
var fieldKey =
|
|
5772
|
+
for (var _l = __values(this.fieldGroups[fieldGroup]), _m = _l.next(); !_m.done; _m = _l.next()) {
|
|
5773
|
+
var fieldKey = _m.value;
|
|
5484
5774
|
this.fieldEnable(fieldKey);
|
|
5485
5775
|
}
|
|
5486
5776
|
}
|
|
5487
5777
|
catch (e_20_1) { e_20 = { error: e_20_1 }; }
|
|
5488
5778
|
finally {
|
|
5489
5779
|
try {
|
|
5490
|
-
if (
|
|
5780
|
+
if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
|
|
5491
5781
|
}
|
|
5492
5782
|
finally { if (e_20) throw e_20.error; }
|
|
5493
5783
|
}
|
|
5494
5784
|
};
|
|
5495
5785
|
KwikIDFormViewComponent.prototype.fieldReset = function (fieldKey) {
|
|
5496
|
-
var
|
|
5786
|
+
var _k;
|
|
5497
5787
|
// Find the field and its index in the formFields array
|
|
5498
5788
|
var field = getFormFieldByKey(this.formFields, fieldKey);
|
|
5499
5789
|
var fieldIndex = getFormFieldIndexByKey(this.formFields, fieldKey);
|
|
@@ -5504,9 +5794,9 @@
|
|
|
5504
5794
|
emitEvent: false,
|
|
5505
5795
|
onlySelf: true
|
|
5506
5796
|
});
|
|
5507
|
-
this.formGroup.patchValue((
|
|
5508
|
-
|
|
5509
|
-
|
|
5797
|
+
this.formGroup.patchValue((_k = {},
|
|
5798
|
+
_k[field.key] = resetValue,
|
|
5799
|
+
_k), { emitEvent: false });
|
|
5510
5800
|
this.formGroup.controls[field.key].updateValueAndValidity({
|
|
5511
5801
|
emitEvent: true
|
|
5512
5802
|
});
|
|
@@ -5574,13 +5864,13 @@
|
|
|
5574
5864
|
KwikIDFormViewComponent.prototype.setValue = function (action, object) {
|
|
5575
5865
|
return __awaiter(this, void 0, void 0, function () {
|
|
5576
5866
|
var source, sourceValue;
|
|
5577
|
-
return __generator(this, function (
|
|
5578
|
-
switch (
|
|
5867
|
+
return __generator(this, function (_k) {
|
|
5868
|
+
switch (_k.label) {
|
|
5579
5869
|
case 0:
|
|
5580
5870
|
source = new kwikidToolkit.Source(object);
|
|
5581
5871
|
return [4 /*yield*/, source.getValueFromSource(action.props.value.source)];
|
|
5582
5872
|
case 1:
|
|
5583
|
-
sourceValue =
|
|
5873
|
+
sourceValue = _k.sent();
|
|
5584
5874
|
source.setValueToSource(action.props.value.destination, sourceValue);
|
|
5585
5875
|
object.FIELD_CONFIG = source.object.FIELD_CONFIG;
|
|
5586
5876
|
this.formData = source.object.FORM_DATA;
|
|
@@ -5595,13 +5885,13 @@
|
|
|
5595
5885
|
KwikIDFormViewComponent.prototype.setFieldDefaultValue = function (action, object) {
|
|
5596
5886
|
return __awaiter(this, void 0, void 0, function () {
|
|
5597
5887
|
var source, sourceValue;
|
|
5598
|
-
return __generator(this, function (
|
|
5599
|
-
switch (
|
|
5888
|
+
return __generator(this, function (_k) {
|
|
5889
|
+
switch (_k.label) {
|
|
5600
5890
|
case 0:
|
|
5601
5891
|
source = new kwikidToolkit.Source(object);
|
|
5602
5892
|
return [4 /*yield*/, source.getValueFromSource(action.props.value.source)];
|
|
5603
5893
|
case 1:
|
|
5604
|
-
sourceValue =
|
|
5894
|
+
sourceValue = _k.sent();
|
|
5605
5895
|
source.setValueToSource({
|
|
5606
5896
|
key: kwikidToolkit.ESourceKey.OBJECT,
|
|
5607
5897
|
props: {
|
|
@@ -5630,21 +5920,158 @@
|
|
|
5630
5920
|
});
|
|
5631
5921
|
});
|
|
5632
5922
|
};
|
|
5923
|
+
KwikIDFormViewComponent.prototype.setApiStatus = function (action, object) {
|
|
5924
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5925
|
+
var source, sourceValue;
|
|
5926
|
+
return __generator(this, function (_k) {
|
|
5927
|
+
source = new kwikidToolkit.Source(object);
|
|
5928
|
+
sourceValue = action.props.status;
|
|
5929
|
+
source.setValueToSource({
|
|
5930
|
+
key: kwikidToolkit.ESourceKey.OBJECT,
|
|
5931
|
+
props: {
|
|
5932
|
+
object: {
|
|
5933
|
+
key: "FIELD_CONFIG",
|
|
5934
|
+
path: "api.status.value"
|
|
5935
|
+
}
|
|
5936
|
+
}
|
|
5937
|
+
}, sourceValue);
|
|
5938
|
+
object.FIELD_CONFIG = source.object.FIELD_CONFIG;
|
|
5939
|
+
console.log("PRINT0", kwikidToolkit.getObjectDeepCopy(source), sourceValue);
|
|
5940
|
+
return [2 /*return*/];
|
|
5941
|
+
});
|
|
5942
|
+
});
|
|
5943
|
+
};
|
|
5944
|
+
KwikIDFormViewComponent.prototype.setApiHeaderValue = function (action, object) {
|
|
5945
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5946
|
+
var source, sourceValue;
|
|
5947
|
+
return __generator(this, function (_k) {
|
|
5948
|
+
switch (_k.label) {
|
|
5949
|
+
case 0:
|
|
5950
|
+
source = new kwikidToolkit.Source(object);
|
|
5951
|
+
return [4 /*yield*/, source.getValueFromSource(action.props.source)];
|
|
5952
|
+
case 1:
|
|
5953
|
+
sourceValue = _k.sent();
|
|
5954
|
+
source.setValueToSource({
|
|
5955
|
+
key: kwikidToolkit.ESourceKey.OBJECT,
|
|
5956
|
+
props: {
|
|
5957
|
+
object: {
|
|
5958
|
+
key: "API_CONFIG",
|
|
5959
|
+
path: "request.headers.value." + action.props.key
|
|
5960
|
+
}
|
|
5961
|
+
}
|
|
5962
|
+
}, sourceValue);
|
|
5963
|
+
object.API_CONFIG = source.object.API_CONFIG;
|
|
5964
|
+
console.log("PRINT1", kwikidToolkit.getObjectDeepCopy(source), sourceValue);
|
|
5965
|
+
return [2 /*return*/];
|
|
5966
|
+
}
|
|
5967
|
+
});
|
|
5968
|
+
});
|
|
5969
|
+
};
|
|
5970
|
+
KwikIDFormViewComponent.prototype.setApiHeaderValidity = function (action, object) {
|
|
5971
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5972
|
+
var source, sourceValue;
|
|
5973
|
+
return __generator(this, function (_k) {
|
|
5974
|
+
source = new kwikidToolkit.Source(object);
|
|
5975
|
+
sourceValue = action.props.valid;
|
|
5976
|
+
source.setValueToSource({
|
|
5977
|
+
key: kwikidToolkit.ESourceKey.OBJECT,
|
|
5978
|
+
props: {
|
|
5979
|
+
object: {
|
|
5980
|
+
key: "API_CONFIG",
|
|
5981
|
+
path: "request.headers.is_valid"
|
|
5982
|
+
}
|
|
5983
|
+
}
|
|
5984
|
+
}, sourceValue);
|
|
5985
|
+
object.API_CONFIG = source.object.API_CONFIG;
|
|
5986
|
+
console.log("PRINT2", kwikidToolkit.getObjectDeepCopy(source), sourceValue);
|
|
5987
|
+
return [2 /*return*/];
|
|
5988
|
+
});
|
|
5989
|
+
});
|
|
5990
|
+
};
|
|
5991
|
+
KwikIDFormViewComponent.prototype.setApiBodyValue = function (action, object) {
|
|
5992
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5993
|
+
var source, sourceValue;
|
|
5994
|
+
return __generator(this, function (_k) {
|
|
5995
|
+
switch (_k.label) {
|
|
5996
|
+
case 0:
|
|
5997
|
+
source = new kwikidToolkit.Source(object);
|
|
5998
|
+
return [4 /*yield*/, source.getValueFromSource(action.props.source)];
|
|
5999
|
+
case 1:
|
|
6000
|
+
sourceValue = _k.sent();
|
|
6001
|
+
source.setValueToSource({
|
|
6002
|
+
key: kwikidToolkit.ESourceKey.OBJECT,
|
|
6003
|
+
props: {
|
|
6004
|
+
object: {
|
|
6005
|
+
key: "API_CONFIG",
|
|
6006
|
+
path: "request.body.value." + action.props.key
|
|
6007
|
+
}
|
|
6008
|
+
}
|
|
6009
|
+
}, sourceValue);
|
|
6010
|
+
object.API_CONFIG = source.object.API_CONFIG;
|
|
6011
|
+
console.log("PRINT3", kwikidToolkit.getObjectDeepCopy(source), sourceValue);
|
|
6012
|
+
return [2 /*return*/];
|
|
6013
|
+
}
|
|
6014
|
+
});
|
|
6015
|
+
});
|
|
6016
|
+
};
|
|
6017
|
+
KwikIDFormViewComponent.prototype.setApiBodyValidity = function (action, object) {
|
|
6018
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
6019
|
+
var source, sourceValue;
|
|
6020
|
+
return __generator(this, function (_k) {
|
|
6021
|
+
source = new kwikidToolkit.Source(object);
|
|
6022
|
+
sourceValue = action.props.valid;
|
|
6023
|
+
source.setValueToSource({
|
|
6024
|
+
key: kwikidToolkit.ESourceKey.OBJECT,
|
|
6025
|
+
props: {
|
|
6026
|
+
object: {
|
|
6027
|
+
key: "API_CONFIG",
|
|
6028
|
+
path: "request.body.is_valid"
|
|
6029
|
+
}
|
|
6030
|
+
}
|
|
6031
|
+
}, sourceValue);
|
|
6032
|
+
object.API_CONFIG = source.object.API_CONFIG;
|
|
6033
|
+
console.log("PRINT4", kwikidToolkit.getObjectDeepCopy(source), sourceValue);
|
|
6034
|
+
return [2 /*return*/];
|
|
6035
|
+
});
|
|
6036
|
+
});
|
|
6037
|
+
};
|
|
6038
|
+
KwikIDFormViewComponent.prototype.setFieldValidity = function (action, object) {
|
|
6039
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
6040
|
+
var source, sourceValue;
|
|
6041
|
+
return __generator(this, function (_k) {
|
|
6042
|
+
source = new kwikidToolkit.Source(object);
|
|
6043
|
+
console.log(kwikidToolkit.getObjectDeepCopy(object));
|
|
6044
|
+
sourceValue = action.props.valid;
|
|
6045
|
+
source.setValueToSource({
|
|
6046
|
+
key: kwikidToolkit.ESourceKey.OBJECT,
|
|
6047
|
+
props: {
|
|
6048
|
+
object: {
|
|
6049
|
+
key: "FIELD_CONFIG",
|
|
6050
|
+
path: "validation.is_valid"
|
|
6051
|
+
}
|
|
6052
|
+
}
|
|
6053
|
+
}, sourceValue);
|
|
6054
|
+
object.API_CONFIG = source.object.API_CONFIG;
|
|
6055
|
+
console.log("PRINT5", kwikidToolkit.getObjectDeepCopy(source), sourceValue);
|
|
6056
|
+
return [2 /*return*/];
|
|
6057
|
+
});
|
|
6058
|
+
});
|
|
6059
|
+
};
|
|
5633
6060
|
KwikIDFormViewComponent.prototype.setDropdownOptions = function (action, object) {
|
|
5634
6061
|
return __awaiter(this, void 0, void 0, function () {
|
|
5635
6062
|
var source, sourceValue, appendToPath, appendToPathStr, optionsPath;
|
|
5636
|
-
return __generator(this, function (
|
|
5637
|
-
switch (
|
|
6063
|
+
return __generator(this, function (_k) {
|
|
6064
|
+
switch (_k.label) {
|
|
5638
6065
|
case 0:
|
|
5639
6066
|
source = new kwikidToolkit.Source(object);
|
|
5640
6067
|
return [4 /*yield*/, source.getValueFromSource(action.props.value.source)];
|
|
5641
6068
|
case 1:
|
|
5642
|
-
sourceValue =
|
|
6069
|
+
sourceValue = _k.sent();
|
|
5643
6070
|
if (!kwikidToolkit.checkObjectKeyExists(action.props, "options")) return [3 /*break*/, 4];
|
|
5644
6071
|
if (!kwikidToolkit.checkObjectKeyExists(action.props.options, "appendToPath")) return [3 /*break*/, 3];
|
|
5645
6072
|
return [4 /*yield*/, source.getValueFromSource(action.props.options.appendToPath.source)];
|
|
5646
6073
|
case 2:
|
|
5647
|
-
appendToPath =
|
|
6074
|
+
appendToPath = _k.sent();
|
|
5648
6075
|
if (kwikidToolkit.isNotEmptyValue(appendToPath)) {
|
|
5649
6076
|
appendToPathStr = kwikidToolkit.replaceString(appendToPath.match("" + action.props.options.appendToPath.filterSourceValue)[0], "[^a-zA-Z0-9_]", "_");
|
|
5650
6077
|
optionsPath = "" + action.props.options.path + appendToPathStr;
|
|
@@ -5653,7 +6080,7 @@
|
|
|
5653
6080
|
return [3 /*break*/, 4];
|
|
5654
6081
|
case 3:
|
|
5655
6082
|
sourceValue = kwikidToolkit.getObjectValueFromPath(sourceValue, action.props.options.path);
|
|
5656
|
-
|
|
6083
|
+
_k.label = 4;
|
|
5657
6084
|
case 4:
|
|
5658
6085
|
source.setValueToSource(action.props.value.destination, sourceValue);
|
|
5659
6086
|
object.FIELD_CONFIG = source.object.FIELD_CONFIG;
|
|
@@ -5668,19 +6095,19 @@
|
|
|
5668
6095
|
KwikIDFormViewComponent.prototype.apiCall = function (action, object) {
|
|
5669
6096
|
return __awaiter(this, void 0, void 0, function () {
|
|
5670
6097
|
var apiConfig, response;
|
|
5671
|
-
var
|
|
5672
|
-
return __generator(this, function (
|
|
5673
|
-
switch (
|
|
6098
|
+
var _k;
|
|
6099
|
+
return __generator(this, function (_l) {
|
|
6100
|
+
switch (_l.label) {
|
|
5674
6101
|
case 0:
|
|
5675
6102
|
apiConfig = this.formConfig.apis[action.props.formApiKey];
|
|
5676
6103
|
return [4 /*yield*/, this.handleApiCall(apiConfig)];
|
|
5677
6104
|
case 1:
|
|
5678
|
-
response =
|
|
6105
|
+
response = _l.sent();
|
|
5679
6106
|
apiConfig = response.api;
|
|
5680
6107
|
this.formConfig = kwikidToolkit.setValueToObjectPath(this.formConfig, "apis." + action.props.formApiKey, apiConfig);
|
|
5681
|
-
this.formData = kwikidToolkit.mergeObjects(this.formData, (
|
|
5682
|
-
|
|
5683
|
-
|
|
6108
|
+
this.formData = kwikidToolkit.mergeObjects(this.formData, (_k = {},
|
|
6109
|
+
_k[action.props.formApiKey] = apiConfig.response.value,
|
|
6110
|
+
_k));
|
|
5684
6111
|
return [2 /*return*/, apiConfig];
|
|
5685
6112
|
}
|
|
5686
6113
|
});
|
|
@@ -5689,13 +6116,13 @@
|
|
|
5689
6116
|
KwikIDFormViewComponent.prototype.fieldApiCall = function (action, object) {
|
|
5690
6117
|
return __awaiter(this, void 0, void 0, function () {
|
|
5691
6118
|
var apiConfig;
|
|
5692
|
-
return __generator(this, function (
|
|
5693
|
-
switch (
|
|
6119
|
+
return __generator(this, function (_k) {
|
|
6120
|
+
switch (_k.label) {
|
|
5694
6121
|
case 0:
|
|
5695
6122
|
this.showApiLoader();
|
|
5696
6123
|
return [4 /*yield*/, this.apiCall(action, object)];
|
|
5697
6124
|
case 1:
|
|
5698
|
-
apiConfig =
|
|
6125
|
+
apiConfig = _k.sent();
|
|
5699
6126
|
this.hideApiLoader();
|
|
5700
6127
|
return [2 /*return*/];
|
|
5701
6128
|
}
|
|
@@ -5705,8 +6132,8 @@
|
|
|
5705
6132
|
KwikIDFormViewComponent.prototype.fieldMultipleApiCalls = function (action, object) {
|
|
5706
6133
|
return __awaiter(this, void 0, void 0, function () {
|
|
5707
6134
|
var entrypointApiKey, field, endpoints, nextApiIndex, apiConfig, response;
|
|
5708
|
-
return __generator(this, function (
|
|
5709
|
-
switch (
|
|
6135
|
+
return __generator(this, function (_k) {
|
|
6136
|
+
switch (_k.label) {
|
|
5710
6137
|
case 0:
|
|
5711
6138
|
entrypointApiKey = action.props.apiKey;
|
|
5712
6139
|
field = getFormFieldByKey(this.formFields, action.props.fieldKey);
|
|
@@ -5715,7 +6142,7 @@
|
|
|
5715
6142
|
apiConfig = endpoints[nextApiIndex];
|
|
5716
6143
|
return [4 /*yield*/, this.handleFieldApiCall(field, apiConfig)];
|
|
5717
6144
|
case 1:
|
|
5718
|
-
response =
|
|
6145
|
+
response = _k.sent();
|
|
5719
6146
|
field = response.field;
|
|
5720
6147
|
field.api.endpoints[nextApiIndex] = response.api;
|
|
5721
6148
|
return [2 /*return*/];
|
|
@@ -5726,15 +6153,15 @@
|
|
|
5726
6153
|
KwikIDFormViewComponent.prototype.fieldMultipleApiCallsEnd = function (action, object) {
|
|
5727
6154
|
return __awaiter(this, void 0, void 0, function () {
|
|
5728
6155
|
var field, multipleApiCallResponses;
|
|
5729
|
-
var
|
|
5730
|
-
return __generator(this, function (
|
|
6156
|
+
var _k;
|
|
6157
|
+
return __generator(this, function (_l) {
|
|
5731
6158
|
field = getFormFieldByKey(this.formFields, action.props.fieldKey);
|
|
5732
6159
|
multipleApiCallResponses = {};
|
|
5733
6160
|
field.api.endpoints.map(function (api) {
|
|
5734
6161
|
if (kwikidToolkit.checkObjectKeyExists(api.response, "value"))
|
|
5735
6162
|
multipleApiCallResponses = kwikidToolkit.setValueToObjectPath(multipleApiCallResponses, "" + api.apiKey, api.response.value);
|
|
5736
6163
|
});
|
|
5737
|
-
this.formData = Object.assign(Object.assign({}, this.formData), (
|
|
6164
|
+
this.formData = Object.assign(Object.assign({}, this.formData), (_k = {}, _k[field.key] = multipleApiCallResponses, _k));
|
|
5738
6165
|
this.patchFormGroup(this.formData);
|
|
5739
6166
|
return [2 /*return*/];
|
|
5740
6167
|
});
|
|
@@ -5743,17 +6170,17 @@
|
|
|
5743
6170
|
KwikIDFormViewComponent.prototype.taskApiCall = function (action, object) {
|
|
5744
6171
|
return __awaiter(this, void 0, void 0, function () {
|
|
5745
6172
|
var apiConfig;
|
|
5746
|
-
var
|
|
5747
|
-
return __generator(this, function (
|
|
5748
|
-
switch (
|
|
6173
|
+
var _k;
|
|
6174
|
+
return __generator(this, function (_l) {
|
|
6175
|
+
switch (_l.label) {
|
|
5749
6176
|
case 0:
|
|
5750
6177
|
this.showApiLoader();
|
|
5751
6178
|
return [4 /*yield*/, this.apiCall(action, object)];
|
|
5752
6179
|
case 1:
|
|
5753
|
-
apiConfig =
|
|
5754
|
-
this.taskData = kwikidToolkit.mergeObjects(this.taskData, (
|
|
5755
|
-
|
|
5756
|
-
|
|
6180
|
+
apiConfig = _l.sent();
|
|
6181
|
+
this.taskData = kwikidToolkit.mergeObjects(this.taskData, (_k = {},
|
|
6182
|
+
_k[action.props.formApiKey] = apiConfig.response.value,
|
|
6183
|
+
_k));
|
|
5757
6184
|
this.waitingForChanges = false;
|
|
5758
6185
|
this.hideApiLoader();
|
|
5759
6186
|
return [2 /*return*/];
|
|
@@ -5764,8 +6191,8 @@
|
|
|
5764
6191
|
KwikIDFormViewComponent.prototype.taskMultipleApiCalls = function (action, object) {
|
|
5765
6192
|
return __awaiter(this, void 0, void 0, function () {
|
|
5766
6193
|
var multipleApiConfig, entrypointApiKey_1, endpoints, nextApiIndex, apiConfig, response, apis;
|
|
5767
|
-
return __generator(this, function (
|
|
5768
|
-
switch (
|
|
6194
|
+
return __generator(this, function (_k) {
|
|
6195
|
+
switch (_k.label) {
|
|
5769
6196
|
case 0:
|
|
5770
6197
|
this.showApiLoader();
|
|
5771
6198
|
multipleApiConfig = this.formConfig.apis[action.props.formApiKey];
|
|
@@ -5776,7 +6203,7 @@
|
|
|
5776
6203
|
apiConfig = endpoints[nextApiIndex];
|
|
5777
6204
|
return [4 /*yield*/, this.handleApiCall(apiConfig)];
|
|
5778
6205
|
case 1:
|
|
5779
|
-
response =
|
|
6206
|
+
response = _k.sent();
|
|
5780
6207
|
multipleApiConfig.endpoints[nextApiIndex] = response.api;
|
|
5781
6208
|
this.formConfig = kwikidToolkit.setValueToObjectPath(this.formConfig, "apis." + action.props.formApiKey, multipleApiConfig);
|
|
5782
6209
|
this.hideApiLoader();
|
|
@@ -5793,8 +6220,8 @@
|
|
|
5793
6220
|
}, this.takeAction.bind(this));
|
|
5794
6221
|
return [4 /*yield*/, apis.callNextApi(multipleApiConfig.entrypoint)];
|
|
5795
6222
|
case 3:
|
|
5796
|
-
|
|
5797
|
-
|
|
6223
|
+
_k.sent();
|
|
6224
|
+
_k.label = 4;
|
|
5798
6225
|
case 4: return [2 /*return*/];
|
|
5799
6226
|
}
|
|
5800
6227
|
});
|
|
@@ -5803,15 +6230,15 @@
|
|
|
5803
6230
|
KwikIDFormViewComponent.prototype.taskMultipleApiCallsEnd = function (action, object) {
|
|
5804
6231
|
return __awaiter(this, void 0, void 0, function () {
|
|
5805
6232
|
var multipleApiConfig, multipleApiCallResponses;
|
|
5806
|
-
var
|
|
5807
|
-
return __generator(this, function (
|
|
6233
|
+
var _k;
|
|
6234
|
+
return __generator(this, function (_l) {
|
|
5808
6235
|
multipleApiConfig = this.formConfig.apis[action.props.formApiKey];
|
|
5809
6236
|
multipleApiCallResponses = {};
|
|
5810
6237
|
multipleApiConfig.endpoints.map(function (api) {
|
|
5811
6238
|
if (kwikidToolkit.checkObjectKeyExists(api.response, "value"))
|
|
5812
6239
|
multipleApiCallResponses = kwikidToolkit.setValueToObjectPath(multipleApiCallResponses, "" + api.apiKey, api.response.value);
|
|
5813
6240
|
});
|
|
5814
|
-
this.taskData = Object.assign(Object.assign({}, this.taskData), (
|
|
6241
|
+
this.taskData = Object.assign(Object.assign({}, this.taskData), (_k = {}, _k[action.props.formApiKey] = multipleApiCallResponses, _k));
|
|
5815
6242
|
this.waitingForChanges = false;
|
|
5816
6243
|
this.hideApiLoader();
|
|
5817
6244
|
return [2 /*return*/];
|
|
@@ -5993,7 +6420,7 @@
|
|
|
5993
6420
|
};
|
|
5994
6421
|
KwikIDFormViewComponent.prototype.takeActionOnFieldGroup = function (action, object) {
|
|
5995
6422
|
return __awaiter(this, void 0, void 0, function () {
|
|
5996
|
-
return __generator(this, function (
|
|
6423
|
+
return __generator(this, function (_k) {
|
|
5997
6424
|
switch (action.key) {
|
|
5998
6425
|
case EActionKey.FIELD_GROUP_HIDE:
|
|
5999
6426
|
this.fieldGroupHide(action.props.groupKey);
|
|
@@ -6017,12 +6444,12 @@
|
|
|
6017
6444
|
KwikIDFormViewComponent.prototype.takeAction = function (action, object) {
|
|
6018
6445
|
var _a, _b, _c, _d, _e, _f;
|
|
6019
6446
|
return __awaiter(this, void 0, void 0, function () {
|
|
6020
|
-
var
|
|
6021
|
-
return __generator(this, function (
|
|
6022
|
-
switch (
|
|
6447
|
+
var _k, fieldErrorShow_Source, fieldErrorShowSourceValue, fieldErrorHide_Source, fieldErrorHideSourceValue, redirectToUrl_Source, redirectToUrlSourceValue, previewErrorShow_Source, previewErrorShowSourceValue;
|
|
6448
|
+
return __generator(this, function (_l) {
|
|
6449
|
+
switch (_l.label) {
|
|
6023
6450
|
case 0:
|
|
6024
|
-
|
|
6025
|
-
switch (
|
|
6451
|
+
_k = action.key;
|
|
6452
|
+
switch (_k) {
|
|
6026
6453
|
case EActionKey.FIELD_HIDE: return [3 /*break*/, 1];
|
|
6027
6454
|
case EActionKey.FIELD_SHOW: return [3 /*break*/, 2];
|
|
6028
6455
|
case EActionKey.FIELD_DISABLE: return [3 /*break*/, 3];
|
|
@@ -6034,50 +6461,56 @@
|
|
|
6034
6461
|
case EActionKey.FIELD_MESSAGES_HIDE: return [3 /*break*/, 13];
|
|
6035
6462
|
case EActionKey.SET_VALUE: return [3 /*break*/, 14];
|
|
6036
6463
|
case EActionKey.SET_FIELD_DEFAULT_VALUE: return [3 /*break*/, 16];
|
|
6037
|
-
case EActionKey.
|
|
6038
|
-
case EActionKey.
|
|
6039
|
-
case EActionKey.
|
|
6040
|
-
case EActionKey.
|
|
6041
|
-
case EActionKey.
|
|
6042
|
-
case EActionKey.
|
|
6043
|
-
case EActionKey.
|
|
6044
|
-
case EActionKey.
|
|
6045
|
-
case EActionKey.
|
|
6046
|
-
case EActionKey.
|
|
6047
|
-
case EActionKey.
|
|
6048
|
-
case EActionKey.
|
|
6049
|
-
case EActionKey.
|
|
6050
|
-
case EActionKey.
|
|
6051
|
-
case EActionKey.
|
|
6052
|
-
case EActionKey.
|
|
6053
|
-
case EActionKey.
|
|
6054
|
-
case EActionKey.
|
|
6055
|
-
case EActionKey.
|
|
6056
|
-
case EActionKey.
|
|
6057
|
-
case EActionKey.
|
|
6464
|
+
case EActionKey.SET_API_STATUS: return [3 /*break*/, 18];
|
|
6465
|
+
case EActionKey.SET_API_HEADER_VALUE: return [3 /*break*/, 20];
|
|
6466
|
+
case EActionKey.SET_API_HEADER_VALIDITY: return [3 /*break*/, 22];
|
|
6467
|
+
case EActionKey.SET_API_BODY_VALUE: return [3 /*break*/, 24];
|
|
6468
|
+
case EActionKey.SET_API_BODY_VALIDITY: return [3 /*break*/, 26];
|
|
6469
|
+
case EActionKey.SET_DROPDOWN_OPTIONS: return [3 /*break*/, 28];
|
|
6470
|
+
case EActionKey.SET_FIELD_VALIDITY: return [3 /*break*/, 30];
|
|
6471
|
+
case EActionKey.HANDLE_CONNECTED_ELEMENTS: return [3 /*break*/, 32];
|
|
6472
|
+
case EActionKey.API_CALL: return [3 /*break*/, 33];
|
|
6473
|
+
case EActionKey.API_CALL_MULTIPLE: return [3 /*break*/, 35];
|
|
6474
|
+
case EActionKey.API_CALL_MULTIPLE_END: return [3 /*break*/, 37];
|
|
6475
|
+
case EActionKey.TASK_API_CALL: return [3 /*break*/, 39];
|
|
6476
|
+
case EActionKey.TASK_API_CALL_MULTIPLE: return [3 /*break*/, 41];
|
|
6477
|
+
case EActionKey.TASK_API_CALL_MULTIPLE_END: return [3 /*break*/, 43];
|
|
6478
|
+
case EActionKey.REDIRECT_TO_URL: return [3 /*break*/, 45];
|
|
6479
|
+
case EActionKey.PREVIEW_DIALOG_SHOW: return [3 /*break*/, 48];
|
|
6480
|
+
case EActionKey.PREVIEW_ERROR_SHOW: return [3 /*break*/, 49];
|
|
6481
|
+
case EActionKey.POPUP_FORM_SHOW: return [3 /*break*/, 52];
|
|
6482
|
+
case EActionKey.STOP_WAITING: return [3 /*break*/, 53];
|
|
6483
|
+
case EActionKey.NOTIFICATION_ERROR_SHOW: return [3 /*break*/, 54];
|
|
6484
|
+
case EActionKey.NOTIFICATION_ERROR_HIDE: return [3 /*break*/, 55];
|
|
6485
|
+
case EActionKey.RESUME_TASK_EXECUTION: return [3 /*break*/, 56];
|
|
6486
|
+
case EActionKey.STOP_TASK_EXECUTION: return [3 /*break*/, 57];
|
|
6487
|
+
case EActionKey.DIALOG_SHOW: return [3 /*break*/, 58];
|
|
6488
|
+
case EActionKey.DIALOG_HIDE: return [3 /*break*/, 59];
|
|
6489
|
+
case EActionKey.SAVE_FORM: return [3 /*break*/, 60];
|
|
6490
|
+
case EActionKey.ALERT_SHOW: return [3 /*break*/, 61];
|
|
6058
6491
|
}
|
|
6059
|
-
return [3 /*break*/,
|
|
6492
|
+
return [3 /*break*/, 62];
|
|
6060
6493
|
case 1:
|
|
6061
6494
|
this.fieldHide(action.props.fieldKey);
|
|
6062
|
-
return [3 /*break*/,
|
|
6495
|
+
return [3 /*break*/, 63];
|
|
6063
6496
|
case 2:
|
|
6064
6497
|
this.fieldShow(action.props.fieldKey);
|
|
6065
|
-
return [3 /*break*/,
|
|
6498
|
+
return [3 /*break*/, 63];
|
|
6066
6499
|
case 3:
|
|
6067
6500
|
this.fieldDisable(action.props.fieldKey);
|
|
6068
|
-
return [3 /*break*/,
|
|
6501
|
+
return [3 /*break*/, 63];
|
|
6069
6502
|
case 4:
|
|
6070
6503
|
this.fieldEnable(action.props.fieldKey);
|
|
6071
|
-
return [3 /*break*/,
|
|
6504
|
+
return [3 /*break*/, 63];
|
|
6072
6505
|
case 5:
|
|
6073
6506
|
this.fieldReset(action.props.fieldKey);
|
|
6074
|
-
return [3 /*break*/,
|
|
6507
|
+
return [3 /*break*/, 63];
|
|
6075
6508
|
case 6:
|
|
6076
6509
|
if (!kwikidToolkit.checkObjectKeyExists(action.props.message, "source")) return [3 /*break*/, 8];
|
|
6077
6510
|
fieldErrorShow_Source = new kwikidToolkit.Source(object);
|
|
6078
6511
|
return [4 /*yield*/, fieldErrorShow_Source.getValueFromSource(action.props.message.source)];
|
|
6079
6512
|
case 7:
|
|
6080
|
-
fieldErrorShowSourceValue =
|
|
6513
|
+
fieldErrorShowSourceValue = _l.sent();
|
|
6081
6514
|
if (typeof fieldErrorShowSourceValue == "string" ||
|
|
6082
6515
|
typeof fieldErrorShowSourceValue == "number") {
|
|
6083
6516
|
fieldErrorShowSourceValue = String(fieldErrorShowSourceValue);
|
|
@@ -6086,16 +6519,16 @@
|
|
|
6086
6519
|
fieldErrorShowSourceValue = "";
|
|
6087
6520
|
}
|
|
6088
6521
|
action = kwikidToolkit.setValueToObjectPath(action, "props.message.message", fieldErrorShowSourceValue);
|
|
6089
|
-
|
|
6522
|
+
_l.label = 8;
|
|
6090
6523
|
case 8:
|
|
6091
6524
|
this.fieldErrorShow(action.props.fieldKey, action.props.message);
|
|
6092
|
-
return [3 /*break*/,
|
|
6525
|
+
return [3 /*break*/, 63];
|
|
6093
6526
|
case 9:
|
|
6094
6527
|
if (!kwikidToolkit.checkObjectKeyExists(action.props.message, "source")) return [3 /*break*/, 11];
|
|
6095
6528
|
fieldErrorHide_Source = new kwikidToolkit.Source(object);
|
|
6096
6529
|
return [4 /*yield*/, fieldErrorHide_Source.getValueFromSource(action.props.message.source)];
|
|
6097
6530
|
case 10:
|
|
6098
|
-
fieldErrorHideSourceValue =
|
|
6531
|
+
fieldErrorHideSourceValue = _l.sent();
|
|
6099
6532
|
if (typeof fieldErrorHideSourceValue == "string" ||
|
|
6100
6533
|
typeof fieldErrorHideSourceValue == "number") {
|
|
6101
6534
|
fieldErrorHideSourceValue = String(fieldErrorHideSourceValue);
|
|
@@ -6104,78 +6537,102 @@
|
|
|
6104
6537
|
fieldErrorHideSourceValue = "";
|
|
6105
6538
|
}
|
|
6106
6539
|
action = kwikidToolkit.setValueToObjectPath(action, "props.message.message", fieldErrorHideSourceValue);
|
|
6107
|
-
|
|
6540
|
+
_l.label = 11;
|
|
6108
6541
|
case 11:
|
|
6109
6542
|
this.fieldErrorHide(action.props.fieldKey, action.props.message);
|
|
6110
|
-
return [3 /*break*/,
|
|
6543
|
+
return [3 /*break*/, 63];
|
|
6111
6544
|
case 12:
|
|
6112
6545
|
this.fieldMessageShow(action.props.fieldKey, action.props.message);
|
|
6113
|
-
return [3 /*break*/,
|
|
6546
|
+
return [3 /*break*/, 63];
|
|
6114
6547
|
case 13:
|
|
6115
6548
|
this.fieldMessageHide(action.props.fieldKey, action.props.message);
|
|
6116
|
-
return [3 /*break*/,
|
|
6549
|
+
return [3 /*break*/, 63];
|
|
6117
6550
|
case 14: return [4 /*yield*/, this.setValue(action, object)];
|
|
6118
6551
|
case 15:
|
|
6119
|
-
|
|
6120
|
-
return [3 /*break*/,
|
|
6552
|
+
_l.sent();
|
|
6553
|
+
return [3 /*break*/, 63];
|
|
6121
6554
|
case 16: return [4 /*yield*/, this.setFieldDefaultValue(action, object)];
|
|
6122
6555
|
case 17:
|
|
6123
|
-
|
|
6124
|
-
return [3 /*break*/,
|
|
6125
|
-
case 18: return [4 /*yield*/, this.
|
|
6556
|
+
_l.sent();
|
|
6557
|
+
return [3 /*break*/, 63];
|
|
6558
|
+
case 18: return [4 /*yield*/, this.setApiStatus(action, object)];
|
|
6126
6559
|
case 19:
|
|
6127
|
-
|
|
6128
|
-
return [3 /*break*/,
|
|
6129
|
-
case 20:
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
case 22:
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
case 24:
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
case 26:
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
case 28:
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
case 30:
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6560
|
+
_l.sent();
|
|
6561
|
+
return [3 /*break*/, 63];
|
|
6562
|
+
case 20: return [4 /*yield*/, this.setApiHeaderValue(action, object)];
|
|
6563
|
+
case 21:
|
|
6564
|
+
_l.sent();
|
|
6565
|
+
return [3 /*break*/, 63];
|
|
6566
|
+
case 22: return [4 /*yield*/, this.setApiHeaderValidity(action, object)];
|
|
6567
|
+
case 23:
|
|
6568
|
+
_l.sent();
|
|
6569
|
+
return [3 /*break*/, 63];
|
|
6570
|
+
case 24: return [4 /*yield*/, this.setApiBodyValue(action, object)];
|
|
6571
|
+
case 25:
|
|
6572
|
+
_l.sent();
|
|
6573
|
+
return [3 /*break*/, 63];
|
|
6574
|
+
case 26: return [4 /*yield*/, this.setApiBodyValidity(action, object)];
|
|
6575
|
+
case 27:
|
|
6576
|
+
_l.sent();
|
|
6577
|
+
return [3 /*break*/, 63];
|
|
6578
|
+
case 28: return [4 /*yield*/, this.setDropdownOptions(action, object)];
|
|
6579
|
+
case 29:
|
|
6580
|
+
_l.sent();
|
|
6581
|
+
return [3 /*break*/, 63];
|
|
6582
|
+
case 30: return [4 /*yield*/, this.setFieldValidity(action, object)];
|
|
6583
|
+
case 31:
|
|
6584
|
+
_l.sent();
|
|
6585
|
+
return [3 /*break*/, 63];
|
|
6153
6586
|
case 32:
|
|
6154
|
-
|
|
6155
|
-
return [3 /*break*/,
|
|
6156
|
-
case 33:
|
|
6157
|
-
|
|
6587
|
+
this.handleConnectedElements({ key: action.props.fieldKey }, "ON_ACTION");
|
|
6588
|
+
return [3 /*break*/, 63];
|
|
6589
|
+
case 33: return [4 /*yield*/, this.fieldApiCall(action, object)];
|
|
6590
|
+
case 34:
|
|
6591
|
+
_l.sent();
|
|
6592
|
+
return [3 /*break*/, 63];
|
|
6593
|
+
case 35: return [4 /*yield*/, this.fieldMultipleApiCalls(action, object)];
|
|
6594
|
+
case 36:
|
|
6595
|
+
_l.sent();
|
|
6596
|
+
return [3 /*break*/, 63];
|
|
6597
|
+
case 37: return [4 /*yield*/, this.fieldMultipleApiCallsEnd(action, object)];
|
|
6598
|
+
case 38:
|
|
6599
|
+
_l.sent();
|
|
6600
|
+
return [3 /*break*/, 63];
|
|
6601
|
+
case 39: return [4 /*yield*/, this.taskApiCall(action, object)];
|
|
6602
|
+
case 40:
|
|
6603
|
+
_l.sent();
|
|
6604
|
+
return [3 /*break*/, 63];
|
|
6605
|
+
case 41: return [4 /*yield*/, this.taskMultipleApiCalls(action, object)];
|
|
6606
|
+
case 42:
|
|
6607
|
+
_l.sent();
|
|
6608
|
+
return [3 /*break*/, 63];
|
|
6609
|
+
case 43: return [4 /*yield*/, this.taskMultipleApiCallsEnd(action, object)];
|
|
6610
|
+
case 44:
|
|
6611
|
+
_l.sent();
|
|
6612
|
+
return [3 /*break*/, 63];
|
|
6613
|
+
case 45:
|
|
6614
|
+
if (!kwikidToolkit.checkObjectKeyExists(action.props.url, "source")) return [3 /*break*/, 47];
|
|
6158
6615
|
redirectToUrl_Source = new kwikidToolkit.Source(object);
|
|
6159
6616
|
return [4 /*yield*/, redirectToUrl_Source.getValueFromSource(action.props.url.source)];
|
|
6160
|
-
case
|
|
6161
|
-
redirectToUrlSourceValue =
|
|
6617
|
+
case 46:
|
|
6618
|
+
redirectToUrlSourceValue = _l.sent();
|
|
6162
6619
|
if (kwikidToolkit.isEmptyString(redirectToUrlSourceValue)) {
|
|
6163
6620
|
redirectToUrlSourceValue = "";
|
|
6164
6621
|
}
|
|
6165
6622
|
action = kwikidToolkit.setValueToObjectPath(action, "props.url.url", redirectToUrlSourceValue);
|
|
6166
|
-
|
|
6167
|
-
case
|
|
6623
|
+
_l.label = 47;
|
|
6624
|
+
case 47:
|
|
6168
6625
|
this.redirectToUrl(action);
|
|
6169
|
-
|
|
6170
|
-
case
|
|
6626
|
+
_l.label = 48;
|
|
6627
|
+
case 48:
|
|
6171
6628
|
this.showPreview(action.props);
|
|
6172
|
-
return [3 /*break*/,
|
|
6173
|
-
case
|
|
6174
|
-
if (!kwikidToolkit.checkObjectKeyExists(action.props.message, "source")) return [3 /*break*/,
|
|
6629
|
+
return [3 /*break*/, 63];
|
|
6630
|
+
case 49:
|
|
6631
|
+
if (!kwikidToolkit.checkObjectKeyExists(action.props.message, "source")) return [3 /*break*/, 51];
|
|
6175
6632
|
previewErrorShow_Source = new kwikidToolkit.Source(object);
|
|
6176
6633
|
return [4 /*yield*/, previewErrorShow_Source.getValueFromSource(action.props.message.source)];
|
|
6177
|
-
case
|
|
6178
|
-
previewErrorShowSourceValue =
|
|
6634
|
+
case 50:
|
|
6635
|
+
previewErrorShowSourceValue = _l.sent();
|
|
6179
6636
|
if (typeof previewErrorShowSourceValue == "string" ||
|
|
6180
6637
|
typeof previewErrorShowSourceValue == "number") {
|
|
6181
6638
|
previewErrorShowSourceValue = String(previewErrorShowSourceValue);
|
|
@@ -6184,47 +6641,47 @@
|
|
|
6184
6641
|
previewErrorShowSourceValue = "";
|
|
6185
6642
|
}
|
|
6186
6643
|
action = kwikidToolkit.setValueToObjectPath(action, "props.message.message", previewErrorShowSourceValue);
|
|
6187
|
-
|
|
6188
|
-
case
|
|
6644
|
+
_l.label = 51;
|
|
6645
|
+
case 51:
|
|
6189
6646
|
this.showErrorPreview(action.props);
|
|
6190
|
-
return [3 /*break*/,
|
|
6191
|
-
case
|
|
6647
|
+
return [3 /*break*/, 63];
|
|
6648
|
+
case 52:
|
|
6192
6649
|
this.showPopupForm(action.props.popupFormKey, (_b = (_a = action.props) === null || _a === void 0 ? void 0 : _a.popupType) !== null && _b !== void 0 ? _b : "DIALOG");
|
|
6193
|
-
return [3 /*break*/,
|
|
6194
|
-
case
|
|
6650
|
+
return [3 /*break*/, 63];
|
|
6651
|
+
case 53:
|
|
6195
6652
|
this.waitingForChanges = false;
|
|
6196
|
-
return [3 /*break*/,
|
|
6197
|
-
case
|
|
6653
|
+
return [3 /*break*/, 63];
|
|
6654
|
+
case 54:
|
|
6198
6655
|
this.toggleErrorNotification(true);
|
|
6199
|
-
return [3 /*break*/,
|
|
6200
|
-
case
|
|
6656
|
+
return [3 /*break*/, 63];
|
|
6657
|
+
case 55:
|
|
6201
6658
|
this.toggleErrorNotification(false);
|
|
6202
|
-
return [3 /*break*/,
|
|
6203
|
-
case
|
|
6659
|
+
return [3 /*break*/, 63];
|
|
6660
|
+
case 56:
|
|
6204
6661
|
this.stopTaskExecution = false;
|
|
6205
|
-
return [3 /*break*/,
|
|
6206
|
-
case
|
|
6662
|
+
return [3 /*break*/, 63];
|
|
6663
|
+
case 57:
|
|
6207
6664
|
this.stopTaskExecution = true;
|
|
6208
|
-
return [3 /*break*/,
|
|
6209
|
-
case
|
|
6665
|
+
return [3 /*break*/, 63];
|
|
6666
|
+
case 58:
|
|
6210
6667
|
this.dialogShow({
|
|
6211
6668
|
html: (_c = action.props) === null || _c === void 0 ? void 0 : _c.html,
|
|
6212
6669
|
label: (_d = action.props) === null || _d === void 0 ? void 0 : _d.label,
|
|
6213
6670
|
size: (_e = action.props) === null || _e === void 0 ? void 0 : _e.size,
|
|
6214
6671
|
button: (_f = action.props) === null || _f === void 0 ? void 0 : _f.button
|
|
6215
6672
|
});
|
|
6216
|
-
return [3 /*break*/,
|
|
6217
|
-
case
|
|
6673
|
+
return [3 /*break*/, 63];
|
|
6674
|
+
case 59:
|
|
6218
6675
|
this.dialogHide();
|
|
6219
|
-
return [3 /*break*/,
|
|
6220
|
-
case
|
|
6676
|
+
return [3 /*break*/, 63];
|
|
6677
|
+
case 60:
|
|
6221
6678
|
this.handleOnClickSaveForm(undefined);
|
|
6222
|
-
return [3 /*break*/,
|
|
6223
|
-
case
|
|
6679
|
+
return [3 /*break*/, 63];
|
|
6680
|
+
case 61:
|
|
6224
6681
|
this.alertShow(action.props.type, action.props.message);
|
|
6225
|
-
return [3 /*break*/,
|
|
6226
|
-
case
|
|
6227
|
-
case
|
|
6682
|
+
return [3 /*break*/, 63];
|
|
6683
|
+
case 62: return [3 /*break*/, 63];
|
|
6684
|
+
case 63: return [2 /*return*/];
|
|
6228
6685
|
}
|
|
6229
6686
|
});
|
|
6230
6687
|
});
|
|
@@ -6232,7 +6689,7 @@
|
|
|
6232
6689
|
return KwikIDFormViewComponent;
|
|
6233
6690
|
}());
|
|
6234
6691
|
/** @nocollapse */ KwikIDFormViewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormViewComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: KwikIDFormViewService }, { token: i5.TuiPushService }, { token: i3$1.TuiAlertService }, { token: i6.TuiPreviewDialogService }, { token: i3$1.TuiDialogService }, { token: i2__namespace.KwikUILoaderService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6235
|
-
/** @nocollapse */ KwikIDFormViewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: { formConfig: "formConfig", formData: "formData", isMobileView: "isMobileView", allFormsData: "allFormsData", userConfig: "userConfig", apiCallResponse: "apiCallResponse", buttonClickResponse: "buttonClickResponse", popupFormCallback: "popupFormCallback" }, outputs: { onClickGoBack: "onClickGoBack", onClickViewForms: "onClickViewForms", getUnsavedDataState: "getUnsavedDataState", onClickSaveForm: "onClickSaveForm", onClickApiCall: "onClickApiCall", onActionShowPopupForm: "onActionShowPopupForm", onClickFormFieldButton: "onClickFormFieldButton" }, providers: [KwikIDFormViewService], viewQueries: [{ propertyName: "preview", first: true, predicate: ["preview"], descendants: true }, { propertyName: "dialog", first: true, predicate: ["dialog"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, 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?.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 />\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 >Step {{ formConfig.sequenceNo }} of\n {{ formConfig.formsListLength }}</div\n >\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 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 [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 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=\"Reset\"\n (onClick)=\"handleOnClickResetFormFields($event, field)\"\n ></kwikui-button>\n </div>\n </ng-container>\n <!-- Button -->\n <ng-container *ngSwitchCase=\"'button'\">\n <div\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 [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 <!-- Email -->\n <ng-container *ngSwitchCase=\"'email'\">\n <div\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 [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 [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 [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 [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 [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 Phone -->\n <ng-container *ngSwitchCase=\"'phone'\">\n <div\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 [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 [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 [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 [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 [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 styles=\"width: fit-content\"\n (onClick)=\"handleOnClickApiCall($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 <!-- Mobile OTP -->\n <ng-container *ngSwitchCase=\"'otp'\">\n <div\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 [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 [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]=\"field?.default?.value?.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 [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 (getKeyValue)=\"handleGetKeyValueFile($event)\"\n (getRemovedFile)=\"handleRemovedFile($event)\"\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 [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 <!-- Star Rating -->\n <ng-container *ngSwitchCase=\"'star-rating'\">\n <div\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<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\"\n [innerHtml]=\"previewProperties.html.before | kwikuiSafeHtml\"\n ></div>\n\n <!-- Content within the iframe -->\n <div\n class=\"preview-iframe-content\"\n [style]=\"previewProperties?.iframe?.containerStyles\"\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\"\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\"\n [innerHtml]=\"previewProperties.html.before | kwikuiSafeHtml\"\n ></div>\n\n <!-- Content within the iframe -->\n <div\n class=\"preview-iframe-content\"\n [style]=\"previewProperties?.iframe?.containerStyles\"\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\"\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=\"isShowCameraCapture\"\n>\n <div\n id=\"kwikid-camera-wrapper\"\n [class.fullscreen]=\"isShowCameraFullscreen\"\n >\n <kwikid-camera\n [type]=\"'CAPTURE'\"\n [image]=\"cameraCaptureImage\"\n [config]=\"cameraCaptureConfig\"\n (getImage)=\"handleGetImage($event)\"\n (onClickSave)=\"handleOnClickSaveCameraCapture($event)\"\n >\n <ng-container slot=\"header\">\n <div style=\"display: flex; width: 100%; max-width: 100%; padding: 0rem\">\n <div style=\"flex: 1; text-align: left\"> </div>\n <kwikui-button\n *ngIf=\"cameraCaptureConfig?.header?.title !== ''\"\n appearance=\"whiteblock\"\n [label]=\"cameraCaptureConfig?.header?.title\"\n shape=\"rounded\"\n style=\"\n flex: 1;\n width: 100%;\n min-width: max-content;\n text-align: center;\n margin: auto;\n \"\n size=\"s\"\n ></kwikui-button>\n <div\n style=\"\n flex: 1;\n text-align: right;\n display: flex;\n justify-content: flex-end;\n gap: 1rem;\n \"\n >\n <kwikui-button\n *ngIf=\"cameraCaptureConfig?.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=\"cameraCaptureConfig?.header?.isClose\"\n id=\"kwikid-camera-header-close-button\"\n appearance=\"whiteblock\"\n icon=\"tuiIconCloseLarge\"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"handleOnClickCloseCamera($event)\"\n ></kwikui-button>\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}.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{background-color:var(--tui-error-fill);color:#fff!important}#field-error-notification .t-top{color:#fff!important}#field-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)}.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.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: i2__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }, { type: i2__namespace.KwikUIMessagesComponent, selector: "kwikui-messages", inputs: ["id", "messages"] }, { type: i2__namespace.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: i2__namespace.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: i2__namespace.KwikUIInputPasswordComponent, selector: "kwikui-input-password", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUITextareaComponent, selector: "kwikui-textarea", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUICheckboxComponent, selector: "kwikui-checkbox", inputs: ["contentAlign", "disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "placeholder", "properties", "size", "validators", "variant"], outputs: ["getKeyValue"] }, { type: i2__namespace.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: i2__namespace.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: i2__namespace.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: i3__namespace.TuiLabelComponent, selector: "label[tuiLabel]", inputs: ["tuiLabel", "context"] }, { type: i2__namespace.KwikUIInputRadioComponent, selector: "kwikui-input-radio", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "items", "label", "orientation", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIInputSelectComponent, selector: "kwikui-input-select", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "options", "placeholder", "properties", "searchable", "size", "validators"], outputs: ["getKeyValue"] }, { type: i2__namespace.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: i2__namespace.KwikUIButtonApiCallComponent, selector: "kwikui-button-api-call", inputs: ["apiStatus", "class", "disabled", "id", "label", "shape", "showLoader", "size", "styles"], outputs: ["onClick"] }, { type: i2__namespace.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: i2__namespace.KwikUIInputAadhaarComponent, selector: "kwikui-input-aadhaar", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "mask", "placeholder", "properties", "validators"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIImageComponent, selector: "kwikui-image", inputs: ["altText", "class", "html", "id", "imageSrc", "imageType", "loadingType", "styles"], outputs: ["onClick"] }, { type: i2__namespace.KwikUIInputFilesComponent, selector: "kwikui-input-files", inputs: ["accept", "class", "disabled", "files", "formControl", "formControlName", "icon", "id", "label", "link", "maxFileSize", "multiple", "setFileTypesToForm", "showAddedFiles", "size", "styles", "validators"], outputs: ["getKeyValue", "getRemovedFile"] }, { type: i4__namespace.KwikUIInputCameraComponent, selector: "kwikui-input-camera", inputs: ["buttonText", "disabled", "focus", "formControl", "formControlName", "icon", "id", "invalid", "mediaFiles", "properties", "showMediaFiles", "size", "type", "validators"], outputs: ["onClick", "getRemovedFile"] }, { type: i2__namespace.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: i2__namespace.KwikUILoaderComponent, selector: "kwikui-loader" }, { type: i5__namespace.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "timestamp"], outputs: ["close"] }, { type: i3__namespace.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i6__namespace.TuiPreviewComponent, selector: "tui-preview", inputs: ["zoomable", "rotatable"] }, { type: i6__namespace.TuiPreviewTitleComponent, selector: "tui-preview-title" }, { type: i3__namespace.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }, { type: i4__namespace.KwikIDCameraComponent, selector: "kwikid-camera", inputs: ["type", "config", "data", "image"], outputs: ["getImage", "onClickSave"] }], directives: [{ type: i3__namespace$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i3__namespace$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3__namespace$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3__namespace$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace$2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace$2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3__namespace$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3__namespace$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i5__namespace.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i5__namespace.TuiPushDirective, selector: "tui-push" }, { type: i6__namespace.TuiPreviewActionDirective, selector: "[tuiPreviewAction]" }], pipes: { "styleSanitizer": StyleSanitizerPipe, "kwikuiSafeHtml": i2__namespace.KwikUISafeHtmlPipe, "kwikuiSafeUrl": i2__namespace.KwikUISafeUrlPipe } });
|
|
6692
|
+
/** @nocollapse */ KwikIDFormViewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: { formConfig: "formConfig", formData: "formData", isMobileView: "isMobileView", allFormsData: "allFormsData", userConfig: "userConfig", apiCallResponse: "apiCallResponse", buttonClickResponse: "buttonClickResponse", popupFormCallback: "popupFormCallback" }, outputs: { onClickGoBack: "onClickGoBack", onClickViewForms: "onClickViewForms", getUnsavedDataState: "getUnsavedDataState", onClickSaveForm: "onClickSaveForm", onClickApiCall: "onClickApiCall", getLogs: "getLogs", onActionShowPopupForm: "onActionShowPopupForm", onClickFormFieldButton: "onClickFormFieldButton" }, providers: [KwikIDFormViewService], viewQueries: [{ propertyName: "preview", first: true, predicate: ["preview"], descendants: true }, { propertyName: "dialog", first: true, predicate: ["dialog"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, 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 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 [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 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=\"Reset\"\n (onClick)=\"handleOnClickResetFormFields($event, field)\"\n ></kwikui-button>\n </div>\n </ng-container>\n <!-- Button -->\n <ng-container *ngSwitchCase=\"'button'\">\n <div\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 [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 <!-- Email -->\n <ng-container *ngSwitchCase=\"'email'\">\n <div\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 [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 [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 [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 [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 [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 Phone -->\n <ng-container *ngSwitchCase=\"'phone'\">\n <div\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 [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 [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 [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 [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 [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 styles=\"width: fit-content\"\n (onClick)=\"handleOnClickApiCall($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 <!-- Mobile OTP -->\n <ng-container *ngSwitchCase=\"'otp'\">\n <div\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 [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 [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]=\"field?.default?.value?.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 [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 (getKeyValue)=\"handleGetKeyValueFile($event)\"\n (getRemovedFile)=\"handleRemovedFile($event)\"\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 [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 <!-- Star Rating -->\n <ng-container *ngSwitchCase=\"'star-rating'\">\n <div\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<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=\"isShowCameraCapture\"\n>\n <div\n id=\"kwikid-camera-wrapper\"\n [class.fullscreen]=\"isShowCameraFullscreen\"\n >\n <kwikid-camera\n [type]=\"'CAPTURE'\"\n [image]=\"cameraCaptureImage\"\n [config]=\"cameraCaptureConfig\"\n (getImage)=\"handleGetImage($event)\"\n (onClickSave)=\"handleOnClickSaveCameraCapture($event)\"\n >\n <ng-container slot=\"header\">\n <div style=\"display: flex; width: 100%; max-width: 100%; padding: 0rem\">\n <div style=\"flex: 1; text-align: left\"> </div>\n <kwikui-button\n *ngIf=\"cameraCaptureConfig?.header?.title !== ''\"\n appearance=\"whiteblock\"\n [label]=\"cameraCaptureConfig?.header?.title\"\n shape=\"rounded\"\n style=\"\n flex: 1;\n width: 100%;\n min-width: max-content;\n text-align: center;\n margin: auto;\n \"\n size=\"s\"\n ></kwikui-button>\n <div\n style=\"\n flex: 1;\n text-align: right;\n display: flex;\n justify-content: flex-end;\n gap: 1rem;\n \"\n >\n <kwikui-button\n *ngIf=\"cameraCaptureConfig?.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=\"cameraCaptureConfig?.header?.isClose\"\n id=\"kwikid-camera-header-close-button\"\n appearance=\"whiteblock\"\n icon=\"tuiIconCloseLarge\"\n shape=\"rounded\"\n size=\"s\"\n (click)=\"handleOnClickCloseCamera($event)\"\n ></kwikui-button>\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}.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{background-color:var(--tui-error-fill);color:#fff!important}#field-error-notification .t-top{color:#fff!important}#field-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)}.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.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: i2__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }, { type: i2__namespace.KwikUIMessagesComponent, selector: "kwikui-messages", inputs: ["id", "messages"] }, { type: i2__namespace.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: i2__namespace.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: i2__namespace.KwikUIInputPasswordComponent, selector: "kwikui-input-password", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUITextareaComponent, selector: "kwikui-textarea", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUICheckboxComponent, selector: "kwikui-checkbox", inputs: ["contentAlign", "disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "placeholder", "properties", "size", "validators", "variant"], outputs: ["getKeyValue"] }, { type: i2__namespace.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: i2__namespace.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: i2__namespace.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: i3__namespace.TuiLabelComponent, selector: "label[tuiLabel]", inputs: ["tuiLabel", "context"] }, { type: i2__namespace.KwikUIInputRadioComponent, selector: "kwikui-input-radio", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "items", "label", "orientation", "placeholder", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIInputSelectComponent, selector: "kwikui-input-select", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "options", "placeholder", "properties", "searchable", "size", "validators"], outputs: ["getKeyValue"] }, { type: i2__namespace.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: i2__namespace.KwikUIButtonApiCallComponent, selector: "kwikui-button-api-call", inputs: ["apiStatus", "class", "disabled", "id", "label", "shape", "showLoader", "size", "styles"], outputs: ["onClick"] }, { type: i2__namespace.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: i2__namespace.KwikUIInputAadhaarComponent, selector: "kwikui-input-aadhaar", inputs: ["disabled", "focus", "formControl", "formControlName", "id", "invalid", "label", "mask", "placeholder", "properties", "validators"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIImageComponent, selector: "kwikui-image", inputs: ["altText", "class", "html", "id", "imageSrc", "imageType", "loadingType", "styles"], outputs: ["onClick"] }, { type: i2__namespace.KwikUIInputFilesComponent, selector: "kwikui-input-files", inputs: ["accept", "class", "disabled", "files", "formControl", "formControlName", "icon", "id", "label", "link", "maxFileSize", "multiple", "setFileTypesToForm", "showAddedFiles", "size", "styles", "validators"], outputs: ["getKeyValue", "getRemovedFile"] }, { type: i4__namespace.KwikUIInputCameraComponent, selector: "kwikui-input-camera", inputs: ["buttonText", "disabled", "focus", "formControl", "formControlName", "icon", "id", "invalid", "mediaFiles", "properties", "showMediaFiles", "size", "type", "validators"], outputs: ["onClick", "getRemovedFile"] }, { type: i2__namespace.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: i2__namespace.KwikUILoaderComponent, selector: "kwikui-loader" }, { type: i5__namespace.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "timestamp"], outputs: ["close"] }, { type: i3__namespace.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i6__namespace.TuiPreviewComponent, selector: "tui-preview", inputs: ["zoomable", "rotatable"] }, { type: i6__namespace.TuiPreviewTitleComponent, selector: "tui-preview-title" }, { type: i3__namespace.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }, { type: i4__namespace.KwikIDCameraComponent, selector: "kwikid-camera", inputs: ["type", "config", "data", "image"], outputs: ["getImage", "onClickSave"] }], directives: [{ type: i3__namespace$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i3__namespace$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3__namespace$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3__namespace$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace$2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace$2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3__namespace$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3__namespace$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i5__namespace.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i5__namespace.TuiPushDirective, selector: "tui-push" }, { type: i6__namespace.TuiPreviewActionDirective, selector: "[tuiPreviewAction]" }], pipes: { "styleSanitizer": StyleSanitizerPipe, "kwikuiSafeHtml": i2__namespace.KwikUISafeHtmlPipe, "kwikuiSafeUrl": i2__namespace.KwikUISafeUrlPipe } });
|
|
6236
6693
|
__decorate([
|
|
6237
6694
|
kwikidToolkit.logMethod
|
|
6238
6695
|
], KwikIDFormViewComponent.prototype, "ngOnInit", null);
|
|
@@ -6380,6 +6837,24 @@
|
|
|
6380
6837
|
__decorate([
|
|
6381
6838
|
kwikidToolkit.logMethod
|
|
6382
6839
|
], KwikIDFormViewComponent.prototype, "setFieldDefaultValue", null);
|
|
6840
|
+
__decorate([
|
|
6841
|
+
kwikidToolkit.logMethod
|
|
6842
|
+
], KwikIDFormViewComponent.prototype, "setApiStatus", null);
|
|
6843
|
+
__decorate([
|
|
6844
|
+
kwikidToolkit.logMethod
|
|
6845
|
+
], KwikIDFormViewComponent.prototype, "setApiHeaderValue", null);
|
|
6846
|
+
__decorate([
|
|
6847
|
+
kwikidToolkit.logMethod
|
|
6848
|
+
], KwikIDFormViewComponent.prototype, "setApiHeaderValidity", null);
|
|
6849
|
+
__decorate([
|
|
6850
|
+
kwikidToolkit.logMethod
|
|
6851
|
+
], KwikIDFormViewComponent.prototype, "setApiBodyValue", null);
|
|
6852
|
+
__decorate([
|
|
6853
|
+
kwikidToolkit.logMethod
|
|
6854
|
+
], KwikIDFormViewComponent.prototype, "setApiBodyValidity", null);
|
|
6855
|
+
__decorate([
|
|
6856
|
+
kwikidToolkit.logMethod
|
|
6857
|
+
], KwikIDFormViewComponent.prototype, "setFieldValidity", null);
|
|
6383
6858
|
__decorate([
|
|
6384
6859
|
kwikidToolkit.logMethod
|
|
6385
6860
|
], KwikIDFormViewComponent.prototype, "setDropdownOptions", null);
|
|
@@ -6503,11 +6978,13 @@
|
|
|
6503
6978
|
type: i0.Output
|
|
6504
6979
|
}], onClickApiCall: [{
|
|
6505
6980
|
type: i0.Output
|
|
6981
|
+
}], getLogs: [{
|
|
6982
|
+
type: i0.Output
|
|
6506
6983
|
}], onActionShowPopupForm: [{
|
|
6507
6984
|
type: i0.Output
|
|
6508
6985
|
}], onClickFormFieldButton: [{
|
|
6509
6986
|
type: i0.Output
|
|
6510
|
-
}], ngOnInit: [], ngAfterViewInit: [], ngOnChanges: [], initFormConfig: [], setFormFieldsFromFormConfig: [], setFormFieldGroupsFromFormConfig: [], setFormDataFromAllFormsData: [], handleConnectedElementFieldGroupActions: [], handleConnectedElementFieldGroup: [], handleConnectedElementFieldActions: [], handleConnectedElementFields: [], handleConnectedElements: [], handleRemovedFile: [], handleGetKeyValueFile: [], handleOnClickGetRemovedMediaFile: [], handleOnClickInputCamera: [], setImage: [], handleOnClickSaveCameraCapture: [], handleGetImage: [], handleOnClickCloseCamera: [], updateFiles: [], uploadFile: [], handleOnClickFormFieldButton: [], handleGetKeyValue: [], handleOnClickResetFormFields: [], handleFieldApiCall: [], handleApiCall: [], executeApiCall: [], isValidRequestHeadersAndBody: [], handleOnClickApiCall: [], handleOnClickGoBack: [], handleOnClickViewForms: [], handleOnClickSaveForm: [], toggleErrorNotification: [], fieldHide: [], fieldGroupHide: [], fieldShow: [], fieldGroupShow: [], fieldDisable: [], fieldGroupDisable: [], fieldEnable: [], fieldGroupEnable: [], fieldReset: [], fieldErrorShow: [], fieldErrorHide: [], fieldMessageShow: [], fieldMessageHide: [], setValue: [], setFieldDefaultValue: [], setDropdownOptions: [], apiCall: [], fieldApiCall: [], fieldMultipleApiCalls: [], fieldMultipleApiCallsEnd: [], taskApiCall: [], taskMultipleApiCalls: [], taskMultipleApiCallsEnd: [], dialogShow: [], dialogHide: [], redirectToUrl: [], patchFieldControlValue: [], setFieldControlValue: [], patchFormGroup: [], isFieldValid: [], isFieldEnabled: [], getFormGroupRawValues: [], showPreview: [], showErrorPreview: [], showPopupForm: [], alertShow: [], takeActionOnFieldGroup: [], takeAction: [] } });
|
|
6987
|
+
}], ngOnInit: [], ngAfterViewInit: [], ngOnChanges: [], initFormConfig: [], setFormFieldsFromFormConfig: [], setFormFieldGroupsFromFormConfig: [], setFormDataFromAllFormsData: [], handleConnectedElementFieldGroupActions: [], handleConnectedElementFieldGroup: [], handleConnectedElementFieldActions: [], handleConnectedElementFields: [], handleConnectedElements: [], handleRemovedFile: [], handleGetKeyValueFile: [], handleOnClickGetRemovedMediaFile: [], handleOnClickInputCamera: [], setImage: [], handleOnClickSaveCameraCapture: [], handleGetImage: [], handleOnClickCloseCamera: [], updateFiles: [], uploadFile: [], handleOnClickFormFieldButton: [], handleGetKeyValue: [], handleOnClickResetFormFields: [], handleFieldApiCall: [], handleApiCall: [], executeApiCall: [], isValidRequestHeadersAndBody: [], handleOnClickApiCall: [], handleOnClickGoBack: [], handleOnClickViewForms: [], handleOnClickSaveForm: [], toggleErrorNotification: [], fieldHide: [], fieldGroupHide: [], fieldShow: [], fieldGroupShow: [], fieldDisable: [], fieldGroupDisable: [], fieldEnable: [], fieldGroupEnable: [], fieldReset: [], fieldErrorShow: [], fieldErrorHide: [], fieldMessageShow: [], fieldMessageHide: [], setValue: [], setFieldDefaultValue: [], setApiStatus: [], setApiHeaderValue: [], setApiHeaderValidity: [], setApiBodyValue: [], setApiBodyValidity: [], setFieldValidity: [], setDropdownOptions: [], apiCall: [], fieldApiCall: [], fieldMultipleApiCalls: [], fieldMultipleApiCallsEnd: [], taskApiCall: [], taskMultipleApiCalls: [], taskMultipleApiCallsEnd: [], dialogShow: [], dialogHide: [], redirectToUrl: [], patchFieldControlValue: [], setFieldControlValue: [], patchFormGroup: [], isFieldValid: [], isFieldEnabled: [], getFormGroupRawValues: [], showPreview: [], showErrorPreview: [], showPopupForm: [], alertShow: [], takeActionOnFieldGroup: [], takeAction: [] } });
|
|
6511
6988
|
|
|
6512
6989
|
var EFormType;
|
|
6513
6990
|
(function (EFormType) {
|
|
@@ -6765,6 +7242,7 @@
|
|
|
6765
7242
|
this.onClickSubmit = new i0.EventEmitter();
|
|
6766
7243
|
this.getFormData = new i0.EventEmitter();
|
|
6767
7244
|
this.onClickApiCall = new i0.EventEmitter();
|
|
7245
|
+
this.getLogs = new i0.EventEmitter();
|
|
6768
7246
|
this.onClickFormFieldButton = new i0.EventEmitter();
|
|
6769
7247
|
this.loading = false;
|
|
6770
7248
|
this.showErrorNotification = false;
|
|
@@ -7688,6 +8166,9 @@
|
|
|
7688
8166
|
});
|
|
7689
8167
|
});
|
|
7690
8168
|
};
|
|
8169
|
+
KwikIDFormsRendererComponent.prototype.handleGetLogs = function (event) {
|
|
8170
|
+
this.getLogs.emit(event);
|
|
8171
|
+
};
|
|
7691
8172
|
/**
|
|
7692
8173
|
* Miscellaneous Methods
|
|
7693
8174
|
*/
|
|
@@ -7715,7 +8196,7 @@
|
|
|
7715
8196
|
return KwikIDFormsRendererComponent;
|
|
7716
8197
|
}());
|
|
7717
8198
|
/** @nocollapse */ KwikIDFormsRendererComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormsRendererComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: i6.TuiPreviewDialogService }, { token: i2__namespace.KwikUILoaderService }, { token: i3$1.TuiDialogService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
7718
|
-
/** @nocollapse */ KwikIDFormsRendererComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormsRendererComponent, selector: "kwikid-forms-renderer", inputs: { stepConfig: "stepConfig", userConfig: "userConfig", formsData: "formsData", activeFormData: "activeFormData", apiCallResponse: "apiCallResponse", buttonClickResponse: "buttonClickResponse" }, outputs: { onClickSubmit: "onClickSubmit", getFormData: "getFormData", onClickApiCall: "onClickApiCall", onClickFormFieldButton: "onClickFormFieldButton" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, viewQueries: [{ propertyName: "preview", first: true, predicate: ["preview"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div ngClass=\"kwikid-renderer\">\n <div\n ngClass=\"kwikid-layout-container\"\n *ngIf=\"!loading\"\n >\n <div\n ngClass=\"kwikid-sections-container\"\n *ngIf=\"showFormSections\"\n class=\"active\"\n [class.active]=\"showFormSections\"\n [class.mobile]=\"isMobileView\"\n >\n <kwikid-forms-list\n [showFormFields]=\"this.showFormFields\"\n [activeFormConfig]=\"this.activeFormConfig\"\n [userConfig]=\"this.userConfig\"\n [formsList]=\"this.formsList\"\n [stepConfig]=\"this.stepConfig\"\n [isUnsavedData]=\"this.isUnsavedData\"\n [formsListCompleted]=\"this.formsListCompleted\"\n [isMobileView]=\"this.isMobileView\"\n (onClickSetActiveForm)=\"this.handleOnClickSetActiveForm($event)\"\n (onClickSubmitForms)=\"this.handleOnClickSubmitForms($event)\"\n ></kwikid-forms-list>\n </div>\n <div\n ngClass=\"kwikid-forms-container\"\n *ngIf=\"\n this.showForm &&\n this.showFormFields &&\n this.activeFormConfig !== undefined\n \"\n [class.active]=\"showFormFields\"\n [class.mobile]=\"isMobileView\"\n [@panelInOut]\n >\n <kwikid-form-view\n *ngIf=\"this.activeFormConfig.type === 'FORM'\"\n [formConfig]=\"this.activeFormConfig\"\n [allFormsData]=\"this.allFormsData\"\n [isMobileView]=\"this.isMobileView\"\n [userConfig]=\"this.userConfig\"\n [popupFormCallback]=\"this.popupFormCallback\"\n [apiCallResponse]=\"this.apiCallResponse\"\n [buttonClickResponse]=\"this.buttonClickResponse\"\n (onClickFormFieldButton)=\"handleOnClickFormFieldButton($event)\"\n (getUnsavedDataState)=\"handleGetUnsavedState($event)\"\n (onClickApiCall)=\"handleOnClickApiCall($event)\"\n (onActionShowPopupForm)=\"\n this.handleOnActionShowPopupForm($event, content)\n \"\n (onClickGoBack)=\"this.handleOnClickGoBack($event)\"\n (onClickViewForms)=\"this.handleOnClickViewForms($event)\"\n (onClickSaveForm)=\"\n this.handleOnClickSaveForm($event, 'FORM', undefined)\n \"\n ></kwikid-form-view>\n </div>\n </div>\n</div>\n\n<kwikui-loader></kwikui-loader>\n\n<tui-push\n id=\"error-notification\"\n *tuiPush=\"showErrorNotification\"\n heading=\"Please complete the required Forms!\"\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<ng-template\n #preview\n let-preview\n>\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n class=\"preview-container\"\n *ngIf=\"popupFormConfig\"\n >\n <tui-preview-title *ngIf=\"previewProperties.title !== ''\">{{\n previewProperties.title\n }}</tui-preview-title>\n\n <div class=\"kwikid-form-view-popup-container\">\n <kwikid-form-view\n [formData]=\"activePopupFormData\"\n [formConfig]=\"popupFormConfig\"\n [allFormsData]=\"allFormsData\"\n [userConfig]=\"this.userConfig\"\n [isMobileView]=\"this.isMobileView\"\n [apiCallResponse]=\"this.apiCallResponse\"\n [buttonClickResponse]=\"this.buttonClickResponse\"\n (onClickFormFieldButton)=\"handleOnClickFormFieldButton($event)\"\n (getSavedState)=\"handleGetUnsavedState($event)\"\n (onClickApiCall)=\"handleOnClickApiCall($event)\"\n (onClickSaveForm)=\"\n this.handleOnClickSaveForm($event, 'POPUP_FORM', undefined)\n \"\n ></kwikid-form-view>\n </div>\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<ng-template\n #content\n let-context\n>\n <div class=\"kwikid-form-view-popup-container\">\n <kwikid-form-view\n [formData]=\"activePopupFormData\"\n [formConfig]=\"popupFormConfig\"\n [allFormsData]=\"allFormsData\"\n [userConfig]=\"this.userConfig\"\n [isMobileView]=\"this.isMobileView\"\n [apiCallResponse]=\"this.apiCallResponse\"\n [buttonClickResponse]=\"this.buttonClickResponse\"\n (onClickFormFieldButton)=\"handleOnClickFormFieldButton($event)\"\n (getSavedState)=\"handleGetUnsavedState($event)\"\n (onClickApiCall)=\"handleOnClickApiCall($event)\"\n (onClickSaveForm)=\"\n this.handleOnClickSaveForm($event, 'POPUP_FORM', context)\n \"\n ></kwikid-form-view>\n </div>\n</ng-template>\n", styles: [":host{position:relative;height:100%}.kwikid-root{width:100%;height:100%}.kwikid-renderer{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;width:100%;height:100%}.kwikid-layout-container{display:flex;flex-direction:row;padding:0 1rem;height:100%;justify-content:center;align-items:stretch;background:var(--tui-secondary-active);position:relative}.kwikid-sections-container{display:block;width:100%;max-width:400px;height:calc(100% - 2rem);padding:.25rem .5rem 0;border-radius:1rem;background-color:var(--tui-base-01);margin:auto 1rem auto 0;box-shadow:0 0 12px -8px var(--tui-secondary)}.kwikid-sections-container.mobile{position:absolute;top:0;left:0;z-index:5;opacity:1;visibility:visible;transition:all 1s;height:100%;border-radius:0;max-width:unset}.kwikid-forms-container{display:block;width:100%;max-width:min(50%,600px);margin:auto 0;height:calc(100% - 2rem);padding:.25rem .5rem 0;border-radius:1rem;background-color:var(--tui-base-01);box-shadow:0 0 12px -8px var(--tui-primary)}.kwikid-forms-container.mobile{position:absolute;top:0;left:0;z-index:5;opacity:1;visibility:visible;transition:all 1s;height:100%;border-radius:0;max-width:unset}@media screen and (max-width: 600px){.kwikid-layout-container{padding:0;background:transparent}.kwikid-sections-container{position:absolute;max-width:100%;bottom:-10000px;left:-10000px;opacity:0;padding:0;visibility:hidden}.kwikid-sections-container.active{visibility:visible}.kwikid-sections-container.mobile{height:100%;opacity:1;visibility:visible;transition:all 2s;border-radius:0;box-shadow:none;top:0px;margin:0;position:absolute}.kwikid-forms-container{display:none;max-width:100%;height:100%;padding:0;border-radius:0;box-shadow:none}.kwikid-forms-container.mobile{height:100%;opacity:1;visibility:visible;transition:all 2s;border-radius:0;box-shadow:none;top:0px;margin:0;position:absolute}.kwikid-forms-container.active{display:block}}#error-notification{background-color:var(--tui-error-fill);color:#fff!important}#error-notification .t-top{color:#fff!important}#error-notification .t-close{color:#fff!important}.preview-container{display:flex!important;flex-grow:1!important;flex-direction:column!important;align-content:center!important;justify-content:space-between!important;align-items:stretch!important}.preview-container .preview-iframe{width:100vw;height:100vh}.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-form-view-popup-container{border-radius:1rem;background:var(--tui-base-01)}\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: KwikIDFormsListComponent, selector: "kwikid-forms-list", inputs: ["showFormFields", "userConfig", "stepConfig", "activeFormConfig", "formsList", "formsListCompleted", "isMobileView", "isUnsavedData"], outputs: ["onClickSetActiveForm", "onClickHideFormsList", "onClickSubmitForms"] }, { type: KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: ["formConfig", "formData", "isMobileView", "allFormsData", "userConfig", "apiCallResponse", "buttonClickResponse", "popupFormCallback"], outputs: ["onClickGoBack", "onClickViewForms", "getUnsavedDataState", "onClickSaveForm", "onClickApiCall", "onActionShowPopupForm", "onClickFormFieldButton"] }, { type: i2__namespace.KwikUILoaderComponent, selector: "kwikui-loader" }, { type: i5__namespace.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "timestamp"], outputs: ["close"] }, { type: i3__namespace.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i6__namespace.TuiPreviewComponent, selector: "tui-preview", inputs: ["zoomable", "rotatable"] }, { type: i6__namespace.TuiPreviewTitleComponent, selector: "tui-preview-title" }, { type: i3__namespace.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }], directives: [{ type: i3__namespace$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3__namespace$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i5__namespace.TuiPushDirective, selector: "tui-push" }, { type: i6__namespace.TuiPreviewActionDirective, selector: "[tuiPreviewAction]" }], animations: [
|
|
8199
|
+
/** @nocollapse */ KwikIDFormsRendererComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormsRendererComponent, selector: "kwikid-forms-renderer", inputs: { stepConfig: "stepConfig", userConfig: "userConfig", formsData: "formsData", activeFormData: "activeFormData", apiCallResponse: "apiCallResponse", buttonClickResponse: "buttonClickResponse" }, outputs: { onClickSubmit: "onClickSubmit", getFormData: "getFormData", onClickApiCall: "onClickApiCall", getLogs: "getLogs", onClickFormFieldButton: "onClickFormFieldButton" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, viewQueries: [{ propertyName: "preview", first: true, predicate: ["preview"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div ngClass=\"kwikid-renderer\">\n <div\n ngClass=\"kwikid-layout-container\"\n *ngIf=\"!loading\"\n >\n <div\n ngClass=\"kwikid-sections-container\"\n *ngIf=\"showFormSections\"\n class=\"active\"\n [class.active]=\"showFormSections\"\n [class.mobile]=\"isMobileView\"\n >\n <kwikid-forms-list\n [showFormFields]=\"this.showFormFields\"\n [activeFormConfig]=\"this.activeFormConfig\"\n [userConfig]=\"this.userConfig\"\n [formsList]=\"this.formsList\"\n [stepConfig]=\"this.stepConfig\"\n [isUnsavedData]=\"this.isUnsavedData\"\n [formsListCompleted]=\"this.formsListCompleted\"\n [isMobileView]=\"this.isMobileView\"\n (onClickSetActiveForm)=\"this.handleOnClickSetActiveForm($event)\"\n (onClickSubmitForms)=\"this.handleOnClickSubmitForms($event)\"\n ></kwikid-forms-list>\n </div>\n <div\n ngClass=\"kwikid-forms-container\"\n *ngIf=\"\n this.showForm &&\n this.showFormFields &&\n this.activeFormConfig !== undefined\n \"\n [class.active]=\"showFormFields\"\n [class.mobile]=\"isMobileView\"\n [@panelInOut]\n >\n <kwikid-form-view\n *ngIf=\"this.activeFormConfig.type === 'FORM'\"\n [formConfig]=\"this.activeFormConfig\"\n [allFormsData]=\"this.allFormsData\"\n [isMobileView]=\"this.isMobileView\"\n [userConfig]=\"this.userConfig\"\n [popupFormCallback]=\"this.popupFormCallback\"\n [apiCallResponse]=\"this.apiCallResponse\"\n [buttonClickResponse]=\"this.buttonClickResponse\"\n (onClickFormFieldButton)=\"handleOnClickFormFieldButton($event)\"\n (getUnsavedDataState)=\"handleGetUnsavedState($event)\"\n (onClickApiCall)=\"handleOnClickApiCall($event)\"\n (onActionShowPopupForm)=\"\n this.handleOnActionShowPopupForm($event, content)\n \"\n (onClickGoBack)=\"this.handleOnClickGoBack($event)\"\n (onClickViewForms)=\"this.handleOnClickViewForms($event)\"\n (getLogs)=\"handleGetLogs($event)\"\n (onClickSaveForm)=\"\n this.handleOnClickSaveForm($event, 'FORM', undefined)\n \"\n ></kwikid-form-view>\n </div>\n </div>\n</div>\n\n<kwikui-loader></kwikui-loader>\n\n<tui-push\n id=\"error-notification\"\n *tuiPush=\"showErrorNotification\"\n heading=\"Please complete the required Forms!\"\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<ng-template\n #preview\n let-preview\n>\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n class=\"preview-container\"\n *ngIf=\"popupFormConfig\"\n >\n <tui-preview-title *ngIf=\"previewProperties.title !== ''\">{{\n previewProperties.title\n }}</tui-preview-title>\n\n <div class=\"kwikid-form-view-popup-container\">\n <kwikid-form-view\n [formData]=\"activePopupFormData\"\n [formConfig]=\"popupFormConfig\"\n [allFormsData]=\"allFormsData\"\n [userConfig]=\"this.userConfig\"\n [isMobileView]=\"this.isMobileView\"\n [apiCallResponse]=\"this.apiCallResponse\"\n [buttonClickResponse]=\"this.buttonClickResponse\"\n (onClickFormFieldButton)=\"handleOnClickFormFieldButton($event)\"\n (getSavedState)=\"handleGetUnsavedState($event)\"\n (onClickApiCall)=\"handleOnClickApiCall($event)\"\n (getLogs)=\"handleGetLogs($event)\"\n (onClickSaveForm)=\"\n this.handleOnClickSaveForm($event, 'POPUP_FORM', undefined)\n \"\n ></kwikid-form-view>\n </div>\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<ng-template\n #content\n let-context\n>\n <div class=\"kwikid-form-view-popup-container\">\n <kwikid-form-view\n [formData]=\"activePopupFormData\"\n [formConfig]=\"popupFormConfig\"\n [allFormsData]=\"allFormsData\"\n [userConfig]=\"this.userConfig\"\n [isMobileView]=\"this.isMobileView\"\n [apiCallResponse]=\"this.apiCallResponse\"\n [buttonClickResponse]=\"this.buttonClickResponse\"\n (onClickFormFieldButton)=\"handleOnClickFormFieldButton($event)\"\n (getSavedState)=\"handleGetUnsavedState($event)\"\n (onClickApiCall)=\"handleOnClickApiCall($event)\"\n (getLogs)=\"handleGetLogs($event)\"\n (onClickSaveForm)=\"\n this.handleOnClickSaveForm($event, 'POPUP_FORM', context)\n \"\n ></kwikid-form-view>\n </div>\n</ng-template>\n", styles: [":host{position:relative;height:100%}.kwikid-root{width:100%;height:100%}.kwikid-renderer{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;width:100%;height:100%}.kwikid-layout-container{display:flex;flex-direction:row;padding:0 1rem;height:100%;justify-content:center;align-items:stretch;background:var(--tui-secondary-active);position:relative}.kwikid-sections-container{display:block;width:100%;max-width:400px;height:calc(100% - 2rem);padding:.25rem .5rem 0;border-radius:1rem;background-color:var(--tui-base-01);margin:auto 1rem auto 0;box-shadow:0 0 12px -8px var(--tui-secondary)}.kwikid-sections-container.mobile{position:absolute;top:0;left:0;z-index:5;opacity:1;visibility:visible;transition:all 1s;height:100%;border-radius:0;max-width:unset}.kwikid-forms-container{display:block;width:100%;max-width:min(50%,600px);margin:auto 0;height:calc(100% - 2rem);padding:.25rem .5rem 0;border-radius:1rem;background-color:var(--tui-base-01);box-shadow:0 0 12px -8px var(--tui-primary)}.kwikid-forms-container.mobile{position:absolute;top:0;left:0;z-index:5;opacity:1;visibility:visible;transition:all 1s;height:100%;border-radius:0;max-width:unset}@media screen and (max-width: 600px){.kwikid-layout-container{padding:0;background:transparent}.kwikid-sections-container{position:absolute;max-width:100%;bottom:-10000px;left:-10000px;opacity:0;padding:0;visibility:hidden}.kwikid-sections-container.active{visibility:visible}.kwikid-sections-container.mobile{height:100%;opacity:1;visibility:visible;transition:all 2s;border-radius:0;box-shadow:none;top:0px;margin:0;position:absolute}.kwikid-forms-container{display:none;max-width:100%;height:100%;padding:0;border-radius:0;box-shadow:none}.kwikid-forms-container.mobile{height:100%;opacity:1;visibility:visible;transition:all 2s;border-radius:0;box-shadow:none;top:0px;margin:0;position:absolute}.kwikid-forms-container.active{display:block}}#error-notification{background-color:var(--tui-error-fill);color:#fff!important}#error-notification .t-top{color:#fff!important}#error-notification .t-close{color:#fff!important}.preview-container{display:flex!important;flex-grow:1!important;flex-direction:column!important;align-content:center!important;justify-content:space-between!important;align-items:stretch!important}.preview-container .preview-iframe{width:100vw;height:100vh}.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-form-view-popup-container{border-radius:1rem;background:var(--tui-base-01)}\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: KwikIDFormsListComponent, selector: "kwikid-forms-list", inputs: ["showFormFields", "userConfig", "stepConfig", "activeFormConfig", "formsList", "formsListCompleted", "isMobileView", "isUnsavedData"], outputs: ["onClickSetActiveForm", "onClickHideFormsList", "onClickSubmitForms"] }, { type: KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: ["formConfig", "formData", "isMobileView", "allFormsData", "userConfig", "apiCallResponse", "buttonClickResponse", "popupFormCallback"], outputs: ["onClickGoBack", "onClickViewForms", "getUnsavedDataState", "onClickSaveForm", "onClickApiCall", "getLogs", "onActionShowPopupForm", "onClickFormFieldButton"] }, { type: i2__namespace.KwikUILoaderComponent, selector: "kwikui-loader" }, { type: i5__namespace.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "timestamp"], outputs: ["close"] }, { type: i3__namespace.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i6__namespace.TuiPreviewComponent, selector: "tui-preview", inputs: ["zoomable", "rotatable"] }, { type: i6__namespace.TuiPreviewTitleComponent, selector: "tui-preview-title" }, { type: i3__namespace.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }], directives: [{ type: i3__namespace$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3__namespace$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i5__namespace.TuiPushDirective, selector: "tui-push" }, { type: i6__namespace.TuiPreviewActionDirective, selector: "[tuiPreviewAction]" }], animations: [
|
|
7719
8200
|
animations.trigger("panelInOut", [
|
|
7720
8201
|
animations.transition(":enter", [
|
|
7721
8202
|
animations.style({ transform: "translateY(100%)" }),
|
|
@@ -7792,6 +8273,9 @@
|
|
|
7792
8273
|
__decorate([
|
|
7793
8274
|
kwikidToolkit.logMethod
|
|
7794
8275
|
], KwikIDFormsRendererComponent.prototype, "handleOnClickSubmitForms", null);
|
|
8276
|
+
__decorate([
|
|
8277
|
+
kwikidToolkit.logMethod
|
|
8278
|
+
], KwikIDFormsRendererComponent.prototype, "handleGetLogs", null);
|
|
7795
8279
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormsRendererComponent, decorators: [{
|
|
7796
8280
|
type: i0.Component,
|
|
7797
8281
|
args: [{
|
|
@@ -7842,9 +8326,11 @@
|
|
|
7842
8326
|
type: i0.Output
|
|
7843
8327
|
}], onClickApiCall: [{
|
|
7844
8328
|
type: i0.Output
|
|
8329
|
+
}], getLogs: [{
|
|
8330
|
+
type: i0.Output
|
|
7845
8331
|
}], onClickFormFieldButton: [{
|
|
7846
8332
|
type: i0.Output
|
|
7847
|
-
}], toggleLoader: [], fetchFormConfig: [], convertFormListConfig: [], assignSequenceNoToForm: [], findCompletedFormsList: [], markFormInFormsListAsCompleted: [], markFormInFormsListAsDisabled: [], filterAllFormsData: [], checkIfFormsStatusCompleted: [], findActiveFormConfig: [], updateFormsList: [], showPreview: [], formHide: [], formShow: [], findFormsListLength: [], handleOnClickSetActiveForm: [], handleGetUnsavedState: [], handleOnClickFormFieldButton: [], handleOnActionShowPopupForm: [], handleOnClickSaveForm: [], handleOnClickGoBack: [], handleOnClickSubmitForms: [] } });
|
|
8333
|
+
}], toggleLoader: [], fetchFormConfig: [], convertFormListConfig: [], assignSequenceNoToForm: [], findCompletedFormsList: [], markFormInFormsListAsCompleted: [], markFormInFormsListAsDisabled: [], filterAllFormsData: [], checkIfFormsStatusCompleted: [], findActiveFormConfig: [], updateFormsList: [], showPreview: [], formHide: [], formShow: [], findFormsListLength: [], handleOnClickSetActiveForm: [], handleGetUnsavedState: [], handleOnClickFormFieldButton: [], handleOnActionShowPopupForm: [], handleOnClickSaveForm: [], handleOnClickGoBack: [], handleOnClickSubmitForms: [], handleGetLogs: [] } });
|
|
7848
8334
|
|
|
7849
8335
|
var JsonFormatPipe = /** @class */ (function () {
|
|
7850
8336
|
function JsonFormatPipe() {
|