kwikid-forms 0.0.4 → 0.0.6
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 +546 -159
- package/bundles/kwikid-forms.umd.js.map +1 -1
- package/esm2015/lib/renderer/form-view/definitions/fields/form-view.fields.type.definitions.js +1 -1
- package/esm2015/lib/renderer/form-view/definitions/sources/form-view.sources.enum.definitions.js +2 -1
- package/esm2015/lib/renderer/form-view/definitions/sources/form-view.sources.type.definitions.js +1 -1
- package/esm2015/lib/renderer/form-view/form-view.component.js +29 -11
- package/esm2015/lib/renderer/form-view/form-view.module.js +9 -2
- package/esm2015/lib/renderer/form-view/form-view.service.js +3 -2
- package/esm2015/lib/renderer/form-view/helpers/form-view.fields.helper.js +16 -29
- package/esm2015/lib/renderer/helpers/renderer.actions.helper.js +20 -0
- package/esm2015/lib/renderer/helpers/renderer.condition.helper.js +41 -0
- package/esm2015/lib/renderer/helpers/renderer.rules.helper.js +63 -0
- package/esm2015/lib/renderer/helpers/renderer.sources.helper.js +91 -0
- package/esm2015/lib/renderer/helpers/renderer.validations.helper.js +33 -0
- package/esm2015/lib/renderer/renderer.component.js +50 -4
- package/esm2015/lib/renderer/renderer.config-converter.helper.js +15 -10
- package/esm2015/lib/renderer/renderer.module.js +15 -4
- package/fesm2015/kwikid-forms.js +398 -98
- package/fesm2015/kwikid-forms.js.map +1 -1
- package/lib/renderer/form-view/definitions/fields/form-view.fields.type.definitions.d.ts +1 -1
- package/lib/renderer/form-view/definitions/sources/form-view.sources.enum.definitions.d.ts +1 -0
- package/lib/renderer/form-view/definitions/sources/form-view.sources.type.definitions.d.ts +1 -1
- package/lib/renderer/form-view/form-view.component.d.ts +7 -2
- package/lib/renderer/form-view/form-view.module.d.ts +3 -2
- package/lib/renderer/helpers/renderer.actions.helper.d.ts +8 -0
- package/lib/renderer/helpers/renderer.condition.helper.d.ts +8 -0
- package/lib/renderer/helpers/renderer.rules.helper.d.ts +8 -0
- package/lib/renderer/helpers/renderer.sources.helper.d.ts +13 -0
- package/lib/renderer/helpers/renderer.validations.helper.d.ts +8 -0
- package/lib/renderer/renderer.component.d.ts +4 -0
- package/lib/renderer/renderer.module.d.ts +3 -1
- package/package.json +1 -1
package/fesm2015/kwikid-forms.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { copyArrayItem, moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { VERSION, Component, EventEmitter, Input, Output, Injectable, HostListener, NgModule } from '@angular/core';
|
|
4
|
-
import * as
|
|
3
|
+
import { VERSION, Component, EventEmitter, Inject, Input, Output, Injectable, HostListener, NgModule } from '@angular/core';
|
|
4
|
+
import * as i6 from '@angular/forms';
|
|
5
5
|
import { FormGroup, FormControl, Validators, FormArray, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
6
6
|
import * as i2 from 'kwikui';
|
|
7
7
|
import { KwikUIButtonComponent, KwikUIProgressSegmentedComponent, KwikUIInputComponent, KwikUIModule } from 'kwikui';
|
|
8
8
|
import _, { cloneDeep } from 'lodash';
|
|
9
9
|
import { __decorate, __awaiter } from 'tslib';
|
|
10
|
+
import * as i3 from '@taiga-ui/core';
|
|
11
|
+
import { TuiAlertService, TuiLabelModule, TuiSvgModule, TuiLoaderModule } from '@taiga-ui/core';
|
|
12
|
+
import * as i4 from '@taiga-ui/kit';
|
|
13
|
+
import { TuiPushService, TuiPushModule } from '@taiga-ui/kit';
|
|
10
14
|
import { pairwise } from 'rxjs/operators';
|
|
11
15
|
import jp from 'jsonpath';
|
|
12
16
|
import { TuiDay } from '@taiga-ui/cdk';
|
|
13
|
-
import * as
|
|
14
|
-
import { TuiLabelModule, TuiSvgModule } from '@taiga-ui/core';
|
|
15
|
-
import * as i4 from '@angular/common';
|
|
17
|
+
import * as i5 from '@angular/common';
|
|
16
18
|
import { CommonModule } from '@angular/common';
|
|
17
19
|
import { trigger, transition, style, animate } from '@angular/animations';
|
|
18
20
|
import { HttpClientModule } from '@angular/common/http';
|
|
@@ -563,7 +565,7 @@ const setEmptyValue = (field) => {
|
|
|
563
565
|
return value;
|
|
564
566
|
};
|
|
565
567
|
|
|
566
|
-
class Condition {
|
|
568
|
+
class Condition$1 {
|
|
567
569
|
constructor(condition, rulesMapping) {
|
|
568
570
|
this._condition = condition;
|
|
569
571
|
this._rulesMapping = rulesMapping;
|
|
@@ -604,9 +606,9 @@ class Condition {
|
|
|
604
606
|
}
|
|
605
607
|
__decorate([
|
|
606
608
|
log
|
|
607
|
-
], Condition.prototype, "evaluate", null);
|
|
609
|
+
], Condition$1.prototype, "evaluate", null);
|
|
608
610
|
|
|
609
|
-
class Actions {
|
|
611
|
+
class Actions$1 {
|
|
610
612
|
constructor(action, field, ruleMapping, allFormsData, formData, previousFormData, takeAction) {
|
|
611
613
|
this._action = action;
|
|
612
614
|
this._field = field;
|
|
@@ -618,7 +620,7 @@ class Actions {
|
|
|
618
620
|
}
|
|
619
621
|
execute() {
|
|
620
622
|
return __awaiter(this, void 0, void 0, function* () {
|
|
621
|
-
const condition = new Condition(this._action.condition, this._ruleMapping);
|
|
623
|
+
const condition = new Condition$1(this._action.condition, this._ruleMapping);
|
|
622
624
|
const actionSuccess = condition.evaluate();
|
|
623
625
|
if (actionSuccess) {
|
|
624
626
|
return this._takeAction(this._action, this._field, this._allFormsData, this._formData, this._previousFormData);
|
|
@@ -628,7 +630,7 @@ class Actions {
|
|
|
628
630
|
}
|
|
629
631
|
__decorate([
|
|
630
632
|
log
|
|
631
|
-
], Actions.prototype, "execute", null);
|
|
633
|
+
], Actions$1.prototype, "execute", null);
|
|
632
634
|
|
|
633
635
|
var ERuleKey;
|
|
634
636
|
(function (ERuleKey) {
|
|
@@ -645,6 +647,7 @@ var ESourceKey;
|
|
|
645
647
|
ESourceKey["ALL_FORMS_DATA"] = "ALL_FORMS_DATA";
|
|
646
648
|
ESourceKey["BROWSER_STORAGE"] = "BROWSER_STORAGE";
|
|
647
649
|
ESourceKey["PREDEFINED"] = "PREDEFINED";
|
|
650
|
+
ESourceKey["USER_CONFIG"] = "USER_CONFIG";
|
|
648
651
|
ESourceKey["CUSTOM"] = "CUSTOM";
|
|
649
652
|
})(ESourceKey || (ESourceKey = {}));
|
|
650
653
|
var EBrowserStorageType;
|
|
@@ -653,7 +656,7 @@ var EBrowserStorageType;
|
|
|
653
656
|
EBrowserStorageType["SESSION_STORAGE"] = "SESSION_STORAGE";
|
|
654
657
|
})(EBrowserStorageType || (EBrowserStorageType = {}));
|
|
655
658
|
|
|
656
|
-
class Sources {
|
|
659
|
+
class Sources$1 {
|
|
657
660
|
constructor(field, formData, previousFormData, allFormsData) {
|
|
658
661
|
this._field = field;
|
|
659
662
|
this._formData = formData;
|
|
@@ -805,12 +808,12 @@ class Sources {
|
|
|
805
808
|
}
|
|
806
809
|
__decorate([
|
|
807
810
|
log
|
|
808
|
-
], Sources.prototype, "getValueFromSource", null);
|
|
811
|
+
], Sources$1.prototype, "getValueFromSource", null);
|
|
809
812
|
__decorate([
|
|
810
813
|
log
|
|
811
|
-
], Sources.prototype, "setValueToSource", null);
|
|
814
|
+
], Sources$1.prototype, "setValueToSource", null);
|
|
812
815
|
|
|
813
|
-
class Rules {
|
|
816
|
+
class Rules$1 {
|
|
814
817
|
constructor(rules, field, formData, previousFormData, allFormsData) {
|
|
815
818
|
this._field = field;
|
|
816
819
|
this._formData = formData;
|
|
@@ -824,7 +827,7 @@ class Rules {
|
|
|
824
827
|
if (this._field.type === "radio") {
|
|
825
828
|
this._formData[this._field.key] = this._formData[this._field.key].label;
|
|
826
829
|
}
|
|
827
|
-
const source = new Sources(this._field, this._formData, this._previousFormData, this._allFormsData);
|
|
830
|
+
const source = new Sources$1(this._field, this._formData, this._previousFormData, this._allFormsData);
|
|
828
831
|
switch (ruleType) {
|
|
829
832
|
case ERuleKey.OBJECT_PATH_EXISTS:
|
|
830
833
|
const ruleObjectPathExists = rule;
|
|
@@ -884,10 +887,10 @@ class Rules {
|
|
|
884
887
|
}
|
|
885
888
|
__decorate([
|
|
886
889
|
log
|
|
887
|
-
], Rules.prototype, "evaluate", null);
|
|
890
|
+
], Rules$1.prototype, "evaluate", null);
|
|
888
891
|
__decorate([
|
|
889
892
|
log
|
|
890
|
-
], Rules.prototype, "mapping", null);
|
|
893
|
+
], Rules$1.prototype, "mapping", null);
|
|
891
894
|
|
|
892
895
|
class Defaults {
|
|
893
896
|
constructor(field, allFormsData, formData, previousFormData, takeAction) {
|
|
@@ -903,7 +906,7 @@ class Defaults {
|
|
|
903
906
|
const sources = this._field.default.value.sources;
|
|
904
907
|
let sourceIndex = 0;
|
|
905
908
|
for (let source of sources) {
|
|
906
|
-
const sources = new Sources(this._field, this._formData, this._previousFormData, this._allFormsData);
|
|
909
|
+
const sources = new Sources$1(this._field, this._formData, this._previousFormData, this._allFormsData);
|
|
907
910
|
const value = sources.getValueFromSource(source);
|
|
908
911
|
// Set the Value of current source.
|
|
909
912
|
this._field = setValueToObject(this._field, `default.value.sources.[${sourceIndex}].value`, value);
|
|
@@ -911,11 +914,11 @@ class Defaults {
|
|
|
911
914
|
const triggers = validation.triggers;
|
|
912
915
|
const rules = validation.rules;
|
|
913
916
|
const actions = validation.actions;
|
|
914
|
-
const rulesMapping = new Rules(rules, this._field, this._formData, this._previousFormData, this._allFormsData).mapping();
|
|
917
|
+
const rulesMapping = new Rules$1(rules, this._field, this._formData, this._previousFormData, this._allFormsData).mapping();
|
|
915
918
|
for (let action of actions) {
|
|
916
|
-
const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
|
|
919
|
+
const conditionEvaluation = new Condition$1(action.condition, rulesMapping).evaluate();
|
|
917
920
|
if (conditionEvaluation) {
|
|
918
|
-
const actions = new Actions(action, this._field, rulesMapping, this._allFormsData, this._formData, this._previousFormData, this._takeAction);
|
|
921
|
+
const actions = new Actions$1(action, this._field, rulesMapping, this._allFormsData, this._formData, this._previousFormData, this._takeAction);
|
|
919
922
|
yield actions.execute();
|
|
920
923
|
}
|
|
921
924
|
}
|
|
@@ -1103,39 +1106,26 @@ const convertValueFromKwikUIFormatToBasicFormat = (type, value) => {
|
|
|
1103
1106
|
};
|
|
1104
1107
|
const convertValueFromBasicFormatToKwikUIFormat = (field, value) => {
|
|
1105
1108
|
let convertedValue = value;
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
break;
|
|
1115
|
-
case EFieldType.DATE:
|
|
1116
|
-
if (isNull(value)) {
|
|
1117
|
-
convertedValue = "";
|
|
1118
|
-
}
|
|
1119
|
-
else {
|
|
1109
|
+
if (isNotEmpty(value)) {
|
|
1110
|
+
switch (field.type) {
|
|
1111
|
+
case EFieldType.RADIO:
|
|
1112
|
+
if (hasKey$1(value, "label")) {
|
|
1113
|
+
convertedValue = value.label;
|
|
1114
|
+
}
|
|
1115
|
+
break;
|
|
1116
|
+
case EFieldType.DATE:
|
|
1120
1117
|
convertedValue = formatDateToStandardFormat(value);
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
case EFieldType.TITLE:
|
|
1128
|
-
break;
|
|
1129
|
-
default:
|
|
1130
|
-
if (isEmpty(value)) {
|
|
1131
|
-
convertedValue = "";
|
|
1132
|
-
}
|
|
1133
|
-
break;
|
|
1118
|
+
break;
|
|
1119
|
+
case EFieldType.TITLE:
|
|
1120
|
+
break;
|
|
1121
|
+
default:
|
|
1122
|
+
break;
|
|
1123
|
+
}
|
|
1134
1124
|
}
|
|
1135
1125
|
return convertedValue;
|
|
1136
1126
|
};
|
|
1137
1127
|
|
|
1138
|
-
class Validations {
|
|
1128
|
+
class Validations$1 {
|
|
1139
1129
|
constructor(field, formData, previousFormData, allFormsData, takeAction) {
|
|
1140
1130
|
this._field = field;
|
|
1141
1131
|
this._formData = formData;
|
|
@@ -1256,11 +1246,11 @@ class Validations {
|
|
|
1256
1246
|
const triggers = validations.triggers;
|
|
1257
1247
|
const rules = validations.rules;
|
|
1258
1248
|
const actions = validations.actions;
|
|
1259
|
-
const rulesMapping = new Rules(rules, this._field, this._formData, this._previousFormData, this._allFormsData).mapping();
|
|
1249
|
+
const rulesMapping = new Rules$1(rules, this._field, this._formData, this._previousFormData, this._allFormsData).mapping();
|
|
1260
1250
|
for (let action of actions) {
|
|
1261
|
-
const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
|
|
1251
|
+
const conditionEvaluation = new Condition$1(action.condition, rulesMapping).evaluate();
|
|
1262
1252
|
if (conditionEvaluation) {
|
|
1263
|
-
const actions = new Actions(action, this._field, rulesMapping, this._allFormsData, this._formData, this._previousFormData, this._takeAction);
|
|
1253
|
+
const actions = new Actions$1(action, this._field, rulesMapping, this._allFormsData, this._formData, this._previousFormData, this._takeAction);
|
|
1264
1254
|
yield actions.execute();
|
|
1265
1255
|
}
|
|
1266
1256
|
}
|
|
@@ -1269,16 +1259,16 @@ class Validations {
|
|
|
1269
1259
|
}
|
|
1270
1260
|
__decorate([
|
|
1271
1261
|
log
|
|
1272
|
-
], Validations.prototype, "getFieldValidators", null);
|
|
1262
|
+
], Validations$1.prototype, "getFieldValidators", null);
|
|
1273
1263
|
__decorate([
|
|
1274
1264
|
log
|
|
1275
|
-
], Validations.prototype, "getFormValidationErrors", null);
|
|
1265
|
+
], Validations$1.prototype, "getFormValidationErrors", null);
|
|
1276
1266
|
__decorate([
|
|
1277
1267
|
log
|
|
1278
|
-
], Validations.prototype, "findInvalidControlsRecursive", null);
|
|
1268
|
+
], Validations$1.prototype, "findInvalidControlsRecursive", null);
|
|
1279
1269
|
__decorate([
|
|
1280
1270
|
log
|
|
1281
|
-
], Validations.prototype, "validateField", null);
|
|
1271
|
+
], Validations$1.prototype, "validateField", null);
|
|
1282
1272
|
|
|
1283
1273
|
class KwikIDFormViewService {
|
|
1284
1274
|
constructor() { }
|
|
@@ -1289,8 +1279,9 @@ class KwikIDFormViewService {
|
|
|
1289
1279
|
for (let field of fields) {
|
|
1290
1280
|
if (field.type !== "title") {
|
|
1291
1281
|
const defaults = new Defaults(field, allFormsData, formData, previousFormData, takeAction);
|
|
1292
|
-
|
|
1293
|
-
|
|
1282
|
+
let value = yield defaults.getDefaultValue();
|
|
1283
|
+
value = convertValueFromBasicFormatToKwikUIFormat(field.type, value);
|
|
1284
|
+
const validators = new Validations$1(field, formData, previousFormData, allFormsData, takeAction).getFieldValidators(field);
|
|
1294
1285
|
formGroup.addControl(field.key, new FormControl({ value: value, disabled: field.disabled }, { validators: validators }));
|
|
1295
1286
|
}
|
|
1296
1287
|
}
|
|
@@ -1323,7 +1314,7 @@ class Apis {
|
|
|
1323
1314
|
let sources = param.sources;
|
|
1324
1315
|
let sourceIndex = 0;
|
|
1325
1316
|
for (let source of sources) {
|
|
1326
|
-
const sources = new Sources(this._field, this._formData, this._previousFormData, this._allFormsData);
|
|
1317
|
+
const sources = new Sources$1(this._field, this._formData, this._previousFormData, this._allFormsData);
|
|
1327
1318
|
const value = sources.getValueFromSource(source);
|
|
1328
1319
|
// Set the Value of current source.
|
|
1329
1320
|
this._field = setValueToObject(this._field, `api.request.body.params[${paramIndex}].sources[${sourceIndex}].value`, value);
|
|
@@ -1331,11 +1322,11 @@ class Apis {
|
|
|
1331
1322
|
const triggers = (_a = validation === null || validation === void 0 ? void 0 : validation.triggers) !== null && _a !== void 0 ? _a : [];
|
|
1332
1323
|
const rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
|
|
1333
1324
|
const actions = (_c = validation === null || validation === void 0 ? void 0 : validation.actions) !== null && _c !== void 0 ? _c : [];
|
|
1334
|
-
const rulesMapping = new Rules(rules, this._field, this._formData, this._previousFormData, this._allFormsData).mapping();
|
|
1325
|
+
const rulesMapping = new Rules$1(rules, this._field, this._formData, this._previousFormData, this._allFormsData).mapping();
|
|
1335
1326
|
for (let action of actions) {
|
|
1336
|
-
const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
|
|
1327
|
+
const conditionEvaluation = new Condition$1(action.condition, rulesMapping).evaluate();
|
|
1337
1328
|
if (conditionEvaluation) {
|
|
1338
|
-
const actions = new Actions(action, this._field, rulesMapping, this._allFormsData, this._formData, this._previousFormData, this._takeAction);
|
|
1329
|
+
const actions = new Actions$1(action, this._field, rulesMapping, this._allFormsData, this._formData, this._previousFormData, this._takeAction);
|
|
1339
1330
|
yield actions.execute();
|
|
1340
1331
|
}
|
|
1341
1332
|
}
|
|
@@ -1353,11 +1344,11 @@ class Apis {
|
|
|
1353
1344
|
const triggers = validation.triggers;
|
|
1354
1345
|
const rules = validation.rules;
|
|
1355
1346
|
const actions = validation.actions;
|
|
1356
|
-
const rulesMapping = new Rules(rules, this._field, this._formData, this._previousFormData, this._allFormsData).mapping();
|
|
1347
|
+
const rulesMapping = new Rules$1(rules, this._field, this._formData, this._previousFormData, this._allFormsData).mapping();
|
|
1357
1348
|
for (let action of actions) {
|
|
1358
|
-
const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
|
|
1349
|
+
const conditionSuccess = new Condition$1(action.condition, rulesMapping).evaluate();
|
|
1359
1350
|
if (conditionSuccess) {
|
|
1360
|
-
const actions = new Actions(action, this._field, rulesMapping, this._allFormsData, this._formData, this._previousFormData, this._takeAction);
|
|
1351
|
+
const actions = new Actions$1(action, this._field, rulesMapping, this._allFormsData, this._formData, this._previousFormData, this._takeAction);
|
|
1361
1352
|
yield actions.execute();
|
|
1362
1353
|
}
|
|
1363
1354
|
}
|
|
@@ -1370,11 +1361,11 @@ class Apis {
|
|
|
1370
1361
|
const triggers = validation.triggers;
|
|
1371
1362
|
const rules = validation.rules;
|
|
1372
1363
|
const actions = validation.actions;
|
|
1373
|
-
const rulesMapping = new Rules(rules, this._field, this._formData, this._previousFormData, this._allFormsData).mapping();
|
|
1364
|
+
const rulesMapping = new Rules$1(rules, this._field, this._formData, this._previousFormData, this._allFormsData).mapping();
|
|
1374
1365
|
for (let action of actions) {
|
|
1375
|
-
const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
|
|
1366
|
+
const conditionSuccess = new Condition$1(action.condition, rulesMapping).evaluate();
|
|
1376
1367
|
if (conditionSuccess) {
|
|
1377
|
-
const actions = new Actions(action, this._field, rulesMapping, this._allFormsData, this._formData, this._previousFormData, this._takeAction);
|
|
1368
|
+
const actions = new Actions$1(action, this._field, rulesMapping, this._allFormsData, this._formData, this._previousFormData, this._takeAction);
|
|
1378
1369
|
yield actions.execute();
|
|
1379
1370
|
}
|
|
1380
1371
|
}
|
|
@@ -1401,9 +1392,10 @@ __decorate([
|
|
|
1401
1392
|
], Apis.prototype, "validateApiCallResponse", null);
|
|
1402
1393
|
|
|
1403
1394
|
class KwikIDFormViewComponent {
|
|
1404
|
-
constructor(formViewService) {
|
|
1395
|
+
constructor(push, alert, formViewService) {
|
|
1396
|
+
this.push = push;
|
|
1397
|
+
this.alert = alert;
|
|
1405
1398
|
this.formViewService = formViewService;
|
|
1406
|
-
this.componentThis = this;
|
|
1407
1399
|
this.apiCallResponse = {};
|
|
1408
1400
|
this.isMobileView = false;
|
|
1409
1401
|
this.onClickViewForms = new EventEmitter();
|
|
@@ -1422,6 +1414,7 @@ class KwikIDFormViewComponent {
|
|
|
1422
1414
|
showLoader: false
|
|
1423
1415
|
};
|
|
1424
1416
|
this.formGroup = new FormGroup({});
|
|
1417
|
+
this.showErrorNotification = false;
|
|
1425
1418
|
}
|
|
1426
1419
|
ngOnInit() {
|
|
1427
1420
|
(() => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1513,11 +1506,11 @@ class KwikIDFormViewComponent {
|
|
|
1513
1506
|
handleConnectedElementFieldActions(connectedFieldConfig, connectedField) {
|
|
1514
1507
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1515
1508
|
if (hasKey$1(connectedFieldConfig, "rules")) {
|
|
1516
|
-
const rulesMapping = new Rules(connectedFieldConfig.rules, connectedField, this.formData, this.previousFormData, this.allFormsData).mapping();
|
|
1509
|
+
const rulesMapping = new Rules$1(connectedFieldConfig.rules, connectedField, this.formData, this.previousFormData, this.allFormsData).mapping();
|
|
1517
1510
|
for (let action of connectedFieldConfig.actions) {
|
|
1518
|
-
const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
|
|
1511
|
+
const conditionSuccess = new Condition$1(action.condition, rulesMapping).evaluate();
|
|
1519
1512
|
if (conditionSuccess) {
|
|
1520
|
-
const actions = new Actions(action, connectedField, rulesMapping, this.allFormsData, this.formData, this.previousFormData, this.takeAction.bind(this));
|
|
1513
|
+
const actions = new Actions$1(action, connectedField, rulesMapping, this.allFormsData, this.formData, this.previousFormData, this.takeAction.bind(this));
|
|
1521
1514
|
yield actions.execute();
|
|
1522
1515
|
}
|
|
1523
1516
|
}
|
|
@@ -1597,7 +1590,7 @@ class KwikIDFormViewComponent {
|
|
|
1597
1590
|
let field = findFieldFromKey(this.formFields, e.key);
|
|
1598
1591
|
if (field.type !== "title" &&
|
|
1599
1592
|
field.validation.triggers.includes("ON_CHANGE")) {
|
|
1600
|
-
const validations = new Validations(field, this.formData, this.previousFormData, this.allFormsData, this.takeAction.bind(this));
|
|
1593
|
+
const validations = new Validations$1(field, this.formData, this.previousFormData, this.allFormsData, this.takeAction.bind(this));
|
|
1601
1594
|
(() => __awaiter(this, void 0, void 0, function* () {
|
|
1602
1595
|
yield validations.validateField();
|
|
1603
1596
|
}))();
|
|
@@ -1612,7 +1605,7 @@ class KwikIDFormViewComponent {
|
|
|
1612
1605
|
for (let f of field.reset.fields) {
|
|
1613
1606
|
for (let a of f.actions) {
|
|
1614
1607
|
const resetField = findFieldFromKey(this.formFields, a.props.fieldKey);
|
|
1615
|
-
const actions = new Actions(a, resetField, {}, this.allFormsData, this.formData, this.previousFormData, this.takeAction.bind(this));
|
|
1608
|
+
const actions = new Actions$1(a, resetField, {}, this.allFormsData, this.formData, this.previousFormData, this.takeAction.bind(this));
|
|
1616
1609
|
yield actions.execute();
|
|
1617
1610
|
}
|
|
1618
1611
|
}
|
|
@@ -1679,14 +1672,14 @@ class KwikIDFormViewComponent {
|
|
|
1679
1672
|
for (let field of this.formFields) {
|
|
1680
1673
|
if (field.type !== EFieldType.TITLE &&
|
|
1681
1674
|
field.validation.triggers.includes("ON_SAVE")) {
|
|
1682
|
-
const validations = new Validations(field, formData, this.previousFormData, this.allFormsData, this.takeAction.bind(this));
|
|
1675
|
+
const validations = new Validations$1(field, formData, this.previousFormData, this.allFormsData, this.takeAction.bind(this));
|
|
1683
1676
|
(() => __awaiter(this, void 0, void 0, function* () {
|
|
1684
1677
|
yield validations.validateField();
|
|
1685
1678
|
}))();
|
|
1686
1679
|
}
|
|
1687
1680
|
}
|
|
1688
1681
|
if (this.formGroup.invalid) {
|
|
1689
|
-
const controls = new Validations(undefined, formData, this.previousFormData, this.allFormsData, this.takeAction.bind(this)).findInvalidControlsRecursive(this.formGroup);
|
|
1682
|
+
const controls = new Validations$1(undefined, formData, this.previousFormData, this.allFormsData, this.takeAction.bind(this)).findInvalidControlsRecursive(this.formGroup);
|
|
1690
1683
|
let firstFieldWithError = "";
|
|
1691
1684
|
for (let control of controls) {
|
|
1692
1685
|
if (control.invalid && isEmpty(firstFieldWithError)) {
|
|
@@ -1694,6 +1687,7 @@ class KwikIDFormViewComponent {
|
|
|
1694
1687
|
}
|
|
1695
1688
|
this.formFields = setFieldError(this.formFields, this.formGroup.controls[control.key].errors, control.key, control.invalid);
|
|
1696
1689
|
}
|
|
1690
|
+
this.toggleErrorNotification(true);
|
|
1697
1691
|
return;
|
|
1698
1692
|
}
|
|
1699
1693
|
Object.keys(formData).map((key) => {
|
|
@@ -1701,7 +1695,10 @@ class KwikIDFormViewComponent {
|
|
|
1701
1695
|
formData[key] = "";
|
|
1702
1696
|
}
|
|
1703
1697
|
});
|
|
1704
|
-
this.onClickSaveForm.emit({ data: formData });
|
|
1698
|
+
this.onClickSaveForm.emit({ formConfig: this.formConfig, data: formData });
|
|
1699
|
+
}
|
|
1700
|
+
toggleErrorNotification(show) {
|
|
1701
|
+
this.showErrorNotification = show;
|
|
1705
1702
|
}
|
|
1706
1703
|
// Component Helpers
|
|
1707
1704
|
fieldHide(fieldKey) {
|
|
@@ -1871,7 +1868,7 @@ class KwikIDFormViewComponent {
|
|
|
1871
1868
|
this.fieldMessageHide(action.props.fieldKey, action.props.message);
|
|
1872
1869
|
break;
|
|
1873
1870
|
case EActionKey.SET_VALUE:
|
|
1874
|
-
const sources = new Sources(field, this.formData, this.previousFormData, this.allFormsData);
|
|
1871
|
+
const sources = new Sources$1(field, this.formData, this.previousFormData, this.allFormsData);
|
|
1875
1872
|
const sourceValue = yield sources.getValueFromSource(action.props.value.source);
|
|
1876
1873
|
sources.setValueToSource(action.props.value.destination, sourceValue);
|
|
1877
1874
|
field = sources.field;
|
|
@@ -1890,8 +1887,8 @@ class KwikIDFormViewComponent {
|
|
|
1890
1887
|
});
|
|
1891
1888
|
}
|
|
1892
1889
|
}
|
|
1893
|
-
/** @nocollapse */ KwikIDFormViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KwikIDFormViewComponent, deps: [{ token: KwikIDFormViewService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1894
|
-
/** @nocollapse */ KwikIDFormViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: { formConfig: "formConfig", formData: "formData", apiCallResponse: "apiCallResponse", isMobileView: "isMobileView", allFormsData: "allFormsData", formsList: "formsList" }, outputs: { onClickViewForms: "onClickViewForms", onClickSaveForm: "onClickSaveForm", onClickApiCall: "onClickApiCall", getActiveFormData: "getActiveFormData" }, providers: [KwikIDFormViewService], usesOnChanges: true, ngImport: i0, template: "<div\r\n class=\"kwikid-form-container\"\r\n *ngIf=\"!this.loading\"\r\n>\r\n <div id=\"uf-form-fields-header-container\">\r\n <div id=\"uf-form-fields-title\">\r\n {{ this.formConfig.title }}\r\n </div>\r\n <div id=\"uf-form-fields-steps\">\r\n Step {{ this.formConfig.sequenceNo }} of {{ this.formsList.length }}\r\n </div>\r\n <hr />\r\n </div>\r\n <form\r\n class=\"kwikid-form show\"\r\n [formGroup]=\"this.formGroup\"\r\n >\r\n <ng-container *ngFor=\"let field of this.formFields; let i = index\">\r\n <ng-container [ngSwitch]=\"field.type\">\r\n <!-- Form Title -->\r\n <ng-container *ngSwitchCase=\"'title'\">\r\n <div class=\"title\">\r\n <div>\r\n {{ field.label }}\r\n </div>\r\n <kwikui-button\r\n *ngIf=\"field?.reset\"\r\n appearance=\"whiteblock\"\r\n size=\"s\"\r\n label=\"Reset\"\r\n (onClick)=\"this.handleOnClickResetFormFields($event, field)\"\r\n ></kwikui-button>\r\n </div>\r\n </ng-container>\r\n <!-- Input Text -->\r\n <ng-container *ngSwitchCase=\"'text'\">\r\n <div [hidden]=\"field?.hidden\">\r\n <kwikui-input\r\n [case]=\"field?.properties?.case\"\r\n [disabled]=\"field?.disabled\"\r\n [focus]=\"field?.focus\"\r\n [formControl]=\"formGroup.controls[field.key]\"\r\n [formControlName]=\"field.key\"\r\n [id]=\"field.key\"\r\n [invalid]=\"field?.invalid\"\r\n [label]=\"field.label\"\r\n [placeholder]=\"field?.properties?.placeholder\"\r\n [type]=\"'text'\"\r\n [validators]=\"field?.validators\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-input>\r\n <kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n <!-- Checkbox -->\r\n <ng-container *ngSwitchCase=\"'checkbox'\">\r\n <div [hidden]=\"field?.hidden\">\r\n <kwikui-checkbox-block\r\n [contentAlign]=\"field?.properties?.contentAlign ?? 'left'\"\r\n [disabled]=\"field?.disabled\"\r\n [focus]=\"field?.focus\"\r\n [formControl]=\"formGroup.controls[field.key]\"\r\n [formControlName]=\"field.key\"\r\n [id]=\"field.key\"\r\n [invalid]=\"field?.invalid\"\r\n [label]=\"field?.properties?.placeholder\"\r\n [placeholder]=\"field?.properties?.placeholder\"\r\n [properties]=\"field?.properties\"\r\n [size]=\"field?.properties?.size ?? 'l'\"\r\n [validators]=\"field?.validators\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-checkbox-block\r\n ><kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n <!-- Input Number -->\r\n <ng-container *ngSwitchCase=\"'number'\">\r\n <div [hidden]=\"field?.hidden\">\r\n <kwikui-input-number\r\n [decimal]=\"field?.properties?.decimal\"\r\n [disabled]=\"field?.disabled\"\r\n [focus]=\"field?.focus\"\r\n [formControl]=\"formGroup.controls[field.key]\"\r\n [formControlName]=\"field.key\"\r\n [id]=\"field.key\"\r\n [invalid]=\"field?.invalid\"\r\n [label]=\"field?.label\"\r\n [max]=\"field?.properties?.max\"\r\n [min]=\"field?.properties?.min\"\r\n [placeholder]=\"field?.properties?.placeholder\"\r\n [postfix]=\"field?.properties?.postfix ?? ''\"\r\n [precision]=\"field?.properties?.precision\"\r\n [prefix]=\"field?.properties?.prefix ?? ''\"\r\n [properties]=\"field?.properties\"\r\n [validators]=\"field?.validators\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-input-number\r\n ><kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n <!-- Input Date -->\r\n <ng-container *ngSwitchCase=\"'date'\">\r\n <div [hidden]=\"field?.hidden\">\r\n <kwikui-input-date\r\n [disabled]=\"field?.disabled\"\r\n [focus]=\"field?.focus\"\r\n [formControl]=\"formGroup.controls[field.key]\"\r\n [formControlName]=\"field.key\"\r\n [id]=\"field.key\"\r\n [invalid]=\"field?.invalid\"\r\n [label]=\"field.label\"\r\n [max]=\"field?.properties?.max\"\r\n [min]=\"field?.properties?.min\"\r\n [placeholder]=\"field?.placeholder\"\r\n [properties]=\"field?.properties\"\r\n [validators]=\"field?.validators\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-input-date>\r\n <kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n <!-- Input Phone -->\r\n <ng-container *ngSwitchCase=\"'phone'\">\r\n <div [hidden]=\"field?.hidden\">\r\n <kwikui-input-phone\r\n [countryCode]=\"field?.properties?.countryCode\"\r\n [disabled]=\"field?.disabled\"\r\n [focus]=\"field?.focus\"\r\n [formControl]=\"formGroup.controls[field.key]\"\r\n [formControlName]=\"field.key\"\r\n [id]=\"field.key\"\r\n [invalid]=\"field?.invalid\"\r\n [label]=\"field?.label\"\r\n [phoneMaskAfterCountryCode]=\"\r\n field?.properties?.phoneMaskAfterCountryCode\r\n \"\r\n [placeholder]=\"field?.placeholder\"\r\n [validators]=\"field?.validators\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-input-phone>\r\n <kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n <!-- Input Radio -->\r\n <ng-container *ngSwitchCase=\"'radio'\">\r\n <div [hidden]=\"field?.hidden\">\r\n <label\r\n [tuiLabel]=\"labelTemplate\"\r\n style=\"min-height: auto\"\r\n >\r\n <kwikui-radio-list\r\n [disabled]=\"field?.disabled\"\r\n [focus]=\"field?.focus\"\r\n [formControl]=\"formGroup.controls[field.key]\"\r\n [formControlName]=\"field.key\"\r\n [id]=\"field.key\"\r\n [invalid]=\"field?.invalid\"\r\n [items]=\"field?.options\"\r\n [label]=\"field?.label\"\r\n [orientation]=\"field?.properties?.orientation\"\r\n [placeholder]=\"field?.placeholder\"\r\n [properties]=\"field?.properties\"\r\n [size]=\"field?.properties?.size\"\r\n [validators]=\"field?.validators\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-radio-list>\r\n </label>\r\n <ng-template #labelTemplate>\r\n <p\r\n class=\"tui-space_bottom-2\"\r\n [hidden]=\"field?.hidden\"\r\n >\r\n <b>\r\n {{ field.label }}\r\n <span *ngIf=\"field.validators?.required\"></span>\r\n </b>\r\n </p>\r\n </ng-template>\r\n <kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n <!-- Dropdown -->\r\n <ng-container *ngSwitchCase=\"'dropdown-with-search'\">\r\n <div [hidden]=\"field?.hidden\">\r\n <kwikui-select-combobox\r\n [disabled]=\"field?.disabled\"\r\n [focus]=\"field?.focus\"\r\n [formControl]=\"formGroup.controls[field.key]\"\r\n [formControlName]=\"field.key\"\r\n [id]=\"field.key\"\r\n [invalid]=\"field?.invalid\"\r\n [label]=\"field.label\"\r\n [options]=\"field.options\"\r\n [placeholder]=\"field?.properties?.placeholder\"\r\n [properties]=\"field?.properties\"\r\n [validators]=\"field?.validators\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-select-combobox>\r\n <kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n <!-- API Call -->\r\n <ng-container *ngSwitchCase=\"'api-call'\">\r\n <div [hidden]=\"field?.hidden\">\r\n <kwikui-button-api-call\r\n [apiStatus]=\"field?.api?.status?.value\"\r\n [class]=\"field?.class\"\r\n [disabled]=\"field?.disabled\"\r\n [id]=\"field.key\"\r\n [label]=\"field?.api?.status?.labels[field?.api?.status?.value]\"\r\n [showLoader]=\"field?.disabled === 'loading'\"\r\n shape=\"null\"\r\n size=\"m\"\r\n styles=\"width: fit-content\"\r\n (onClick)=\"this.handleOnClickApiCall($event)\"\r\n ></kwikui-button-api-call>\r\n <kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n <!-- Mobile OTP -->\r\n <ng-container *ngSwitchCase=\"'otp'\">\r\n <div [hidden]=\"field?.hidden\">\r\n <kwikui-input-otp\r\n [disabled]=\"field?.disabled\"\r\n [focus]=\"field?.focus\"\r\n [formControl]=\"formGroup.controls[field.key]\"\r\n [formControlName]=\"field.key\"\r\n [id]=\"field.key\"\r\n [invalid]=\"field?.invalid\"\r\n [label]=\"field?.label\"\r\n [mask]=\"field?.properties?.mask\"\r\n [placeholder]=\"field?.properties?.placeholder\"\r\n [properties]=\"field?.properties\"\r\n [validators]=\"field?.validators\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-input-otp>\r\n <kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n <!-- Aadhaar Number -->\r\n <ng-container *ngSwitchCase=\"'aadhaar-number'\">\r\n <div [hidden]=\"field?.hidden\">\r\n <kwikui-input-aadhaar\r\n [disabled]=\"field?.disabled\"\r\n [focus]=\"field?.focus\"\r\n [formControl]=\"formGroup.controls[field.key]\"\r\n [formControlName]=\"field.key\"\r\n [id]=\"field.key\"\r\n [invalid]=\"field?.invalid\"\r\n [label]=\"field?.label\"\r\n [placeholder]=\"field?.placeholder\"\r\n [properties]=\"field?.properties\"\r\n [validators]=\"field?.validators\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-input-aadhaar>\r\n <kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </form>\r\n <div class=\"kwikid-form-buttons\">\r\n <kwikui-button\r\n *ngIf=\"this.isMobileView\"\r\n [disabled]=\"viewFormsButton.disabled\"\r\n id=\"\"\r\n label=\"View Forms\"\r\n [showLoader]=\"viewFormsButton.showLoader\"\r\n styles=\"\"\r\n class=\"\"\r\n type=\"button\"\r\n appearance=\"secondary\"\r\n icon=\"\"\r\n iconRight=\"\"\r\n shape=\"null\"\r\n size=\"m\"\r\n styles=\"width: 100%\"\r\n (onClick)=\"this.handleOnClickViewForms($event)\"\r\n ></kwikui-button>\r\n <kwikui-button\r\n [disabled]=\"saveFormButton.disabled\"\r\n id=\"\"\r\n label=\"Save\"\r\n [showLoader]=\"saveFormButton.showLoader\"\r\n styles=\"\"\r\n class=\"\"\r\n type=\"button\"\r\n appearance=\"primary\"\r\n icon=\"\"\r\n iconRight=\"\"\r\n shape=\"null\"\r\n size=\"m\"\r\n styles=\"width: 100%\"\r\n (onClick)=\"this.handleOnClickSaveForm($event)\"\r\n ></kwikui-button>\r\n </div>\r\n</div>\r\n<div\r\n class=\"kwikid-form-container-loading\"\r\n *ngIf=\"this.loading\"\r\n>\r\n <div\r\n class=\"large-wrapper\"\r\n [class.tui-skeleton]=\"this.loading\"\r\n [class.tui-skeleton_rounded]=\"this.loading\"\r\n ></div>\r\n <div\r\n class=\"large-wrapper\"\r\n [class.tui-skeleton]=\"this.loading\"\r\n [class.tui-skeleton_rounded]=\"this.loading\"\r\n ></div>\r\n <div\r\n class=\"large-wrapper\"\r\n [class.tui-skeleton]=\"this.loading\"\r\n [class.tui-skeleton_rounded]=\"this.loading\"\r\n ></div>\r\n <div\r\n class=\"large-wrapper\"\r\n [class.tui-skeleton]=\"this.loading\"\r\n [class.tui-skeleton_rounded]=\"this.loading\"\r\n ></div>\r\n <div\r\n class=\"large-wrapper\"\r\n [class.tui-skeleton]=\"this.loading\"\r\n [class.tui-skeleton_rounded]=\"this.loading\"\r\n ></div>\r\n <div\r\n class=\"large-wrapper\"\r\n [class.tui-skeleton]=\"this.loading\"\r\n [class.tui-skeleton_rounded]=\"this.loading\"\r\n ></div>\r\n <div\r\n class=\"large-wrapper\"\r\n [class.tui-skeleton]=\"this.loading\"\r\n [class.tui-skeleton_rounded]=\"this.loading\"\r\n ></div>\r\n</div>\r\n", styles: ["::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}.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;grid-row-gap:1rem;row-gap:1rem}.kwikid-form-buttons{width:100%;bottom:0px;padding:1rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;grid-column-gap:10px;column-gap:10px}.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;grid-row-gap:.5rem;row-gap:.5rem;padding:1rem}#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:1em}.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;grid-gap:.5rem;gap:.5rem}.title:not(:first-child){margin-top:.5rem}.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;grid-row-gap:1rem;row-gap:1rem;padding:1rem}\n"], components: [{ type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }, { type: i2.KwikUIInputComponent, selector: "kwikui-input", inputs: ["label", "id", "type", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "validators", "case", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIMessagesComponent, selector: "kwikui-messages", inputs: ["messages", "id"] }, { type: i2.KwikUICheckboxBlockComponent, selector: "kwikui-checkbox-block", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "size", "contentAlign", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputNumberComponent, selector: "kwikui-input-number", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "min", "max", "prefix", "postfix", "precision", "decimal", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputDateComponent, selector: "kwikui-input-date", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "min", "max", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputPhoneComponent, selector: "kwikui-input-phone", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "countryCode", "phoneMaskAfterCountryCode", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i3.TuiLabelComponent, selector: "label[tuiLabel]", inputs: ["tuiLabel", "context"] }, { type: i2.KwikUIRadioListComponent, selector: "kwikui-radio-list", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "size", "items", "orientation", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUISelectComboboxComponent, selector: "kwikui-select-combobox", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "options", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIButtonApiCallComponent, selector: "kwikui-button-api-call", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "shape", "size", "apiStatus"], outputs: ["onClick"] }, { type: i2.KwikUIInputOtpComponent, selector: "kwikui-input-otp", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "mask", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputAadhaarComponent, selector: "kwikui-input-aadhaar", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "mask", "validators", "properties"], outputs: ["getKeyValue"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i5.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
1890
|
+
/** @nocollapse */ KwikIDFormViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KwikIDFormViewComponent, deps: [{ token: TuiPushService }, { token: TuiAlertService }, { token: KwikIDFormViewService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1891
|
+
/** @nocollapse */ KwikIDFormViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: { formConfig: "formConfig", formData: "formData", apiCallResponse: "apiCallResponse", isMobileView: "isMobileView", allFormsData: "allFormsData", formsList: "formsList" }, outputs: { onClickViewForms: "onClickViewForms", onClickSaveForm: "onClickSaveForm", onClickApiCall: "onClickApiCall", getActiveFormData: "getActiveFormData" }, providers: [KwikIDFormViewService], usesOnChanges: true, ngImport: i0, template: "<div\r\n class=\"kwikid-form-container\"\r\n *ngIf=\"!this.loading\"\r\n>\r\n <div id=\"uf-form-fields-header-container\">\r\n <div id=\"uf-form-fields-title\">\r\n {{ this.formConfig.title }}\r\n </div>\r\n <div id=\"uf-form-fields-steps\">\r\n Step {{ this.formConfig.sequenceNo }} of {{ this.formsList.length }}\r\n </div>\r\n <hr />\r\n </div>\r\n <form\r\n class=\"kwikid-form show\"\r\n [formGroup]=\"this.formGroup\"\r\n >\r\n <ng-container *ngFor=\"let field of this.formFields; let i = index\">\r\n <ng-container [ngSwitch]=\"field.type\">\r\n <!-- Form Title -->\r\n <ng-container *ngSwitchCase=\"'title'\">\r\n <div\r\n class=\"title\"\r\n id=\"field_{{ field.key }}\"\r\n >\r\n <div>\r\n {{ field.label }}\r\n </div>\r\n <kwikui-button\r\n *ngIf=\"field?.reset\"\r\n appearance=\"whiteblock\"\r\n size=\"s\"\r\n label=\"Reset\"\r\n (onClick)=\"this.handleOnClickResetFormFields($event, field)\"\r\n ></kwikui-button>\r\n </div>\r\n </ng-container>\r\n <!-- Input Text -->\r\n <ng-container *ngSwitchCase=\"'text'\">\r\n <div\r\n [hidden]=\"field?.hidden\"\r\n id=\"field_{{ field.key }}\"\r\n >\r\n <kwikui-input\r\n [case]=\"field?.properties?.case\"\r\n [disabled]=\"field?.disabled\"\r\n [focus]=\"field?.focus\"\r\n [formControl]=\"formGroup.controls[field.key]\"\r\n [formControlName]=\"field.key\"\r\n [id]=\"field.key\"\r\n [invalid]=\"field?.invalid\"\r\n [label]=\"field.label\"\r\n [placeholder]=\"field?.properties?.placeholder\"\r\n [type]=\"'text'\"\r\n [validators]=\"field?.validators\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-input>\r\n <kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n <!-- Checkbox -->\r\n <ng-container *ngSwitchCase=\"'checkbox'\">\r\n <div\r\n [hidden]=\"field?.hidden\"\r\n id=\"field_{{ field.key }}\"\r\n >\r\n <kwikui-checkbox-block\r\n [contentAlign]=\"field?.properties?.contentAlign ?? 'left'\"\r\n [disabled]=\"field?.disabled\"\r\n [focus]=\"field?.focus\"\r\n [formControl]=\"formGroup.controls[field.key]\"\r\n [formControlName]=\"field.key\"\r\n [id]=\"field.key\"\r\n [invalid]=\"field?.invalid\"\r\n [label]=\"field?.properties?.placeholder\"\r\n [placeholder]=\"field?.properties?.placeholder\"\r\n [properties]=\"field?.properties\"\r\n [size]=\"field?.properties?.size ?? 'l'\"\r\n [validators]=\"field?.validators\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-checkbox-block\r\n ><kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n <!-- Input Number -->\r\n <ng-container *ngSwitchCase=\"'number'\">\r\n <div\r\n [hidden]=\"field?.hidden\"\r\n id=\"field_{{ field.key }}\"\r\n >\r\n <kwikui-input-number\r\n [decimal]=\"field?.properties?.decimal\"\r\n [disabled]=\"field?.disabled\"\r\n [focus]=\"field?.focus\"\r\n [formControl]=\"formGroup.controls[field.key]\"\r\n [formControlName]=\"field.key\"\r\n [id]=\"field.key\"\r\n [invalid]=\"field?.invalid\"\r\n [label]=\"field?.label\"\r\n [max]=\"field?.properties?.max\"\r\n [min]=\"field?.properties?.min\"\r\n [placeholder]=\"field?.properties?.placeholder\"\r\n [postfix]=\"field?.properties?.postfix ?? ''\"\r\n [precision]=\"field?.properties?.precision\"\r\n [prefix]=\"field?.properties?.prefix ?? ''\"\r\n [properties]=\"field?.properties\"\r\n [validators]=\"field?.validators\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-input-number\r\n ><kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n <!-- Input Date -->\r\n <ng-container *ngSwitchCase=\"'date'\">\r\n <div\r\n [hidden]=\"field?.hidden\"\r\n id=\"field_{{ field.key }}\"\r\n >\r\n <kwikui-input-date\r\n [disabled]=\"field?.disabled\"\r\n [focus]=\"field?.focus\"\r\n [formControl]=\"formGroup.controls[field.key]\"\r\n [formControlName]=\"field.key\"\r\n [id]=\"field.key\"\r\n [invalid]=\"field?.invalid\"\r\n [label]=\"field.label\"\r\n [max]=\"field?.properties?.max\"\r\n [min]=\"field?.properties?.min\"\r\n [placeholder]=\"field?.placeholder\"\r\n [properties]=\"field?.properties\"\r\n [validators]=\"field?.validators\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-input-date>\r\n <kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n <!-- Input Phone -->\r\n <ng-container *ngSwitchCase=\"'phone'\">\r\n <div\r\n [hidden]=\"field?.hidden\"\r\n id=\"field_{{ field.key }}\"\r\n >\r\n <kwikui-input-phone\r\n [countryCode]=\"field?.properties?.countryCode\"\r\n [disabled]=\"field?.disabled\"\r\n [focus]=\"field?.focus\"\r\n [formControl]=\"formGroup.controls[field.key]\"\r\n [formControlName]=\"field.key\"\r\n [id]=\"field.key\"\r\n [invalid]=\"field?.invalid\"\r\n [label]=\"field?.label\"\r\n [phoneMaskAfterCountryCode]=\"\r\n field?.properties?.phoneMaskAfterCountryCode\r\n \"\r\n [placeholder]=\"field?.placeholder\"\r\n [validators]=\"field?.validators\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-input-phone>\r\n <kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n <!-- Input Radio -->\r\n <ng-container *ngSwitchCase=\"'radio'\">\r\n <div\r\n [hidden]=\"field?.hidden\"\r\n id=\"field_{{ field.key }}\"\r\n >\r\n <label\r\n [tuiLabel]=\"labelTemplate\"\r\n style=\"min-height: auto\"\r\n >\r\n <kwikui-radio-list\r\n [disabled]=\"field?.disabled\"\r\n [focus]=\"field?.focus\"\r\n [formControl]=\"formGroup.controls[field.key]\"\r\n [formControlName]=\"field.key\"\r\n [id]=\"field.key\"\r\n [invalid]=\"field?.invalid\"\r\n [items]=\"field?.options\"\r\n [label]=\"field?.label\"\r\n [orientation]=\"field?.properties?.orientation\"\r\n [placeholder]=\"field?.placeholder\"\r\n [properties]=\"field?.properties\"\r\n [size]=\"field?.properties?.size\"\r\n [validators]=\"field?.validators\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-radio-list>\r\n </label>\r\n <ng-template #labelTemplate>\r\n <p\r\n class=\"tui-space_bottom-2\"\r\n [hidden]=\"field?.hidden\"\r\n id=\"field_{{ field.key }}\"\r\n >\r\n <b>\r\n {{ field.label }}\r\n <span *ngIf=\"field.validators?.required\"></span>\r\n </b>\r\n </p>\r\n </ng-template>\r\n <kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n <!-- Dropdown -->\r\n <ng-container *ngSwitchCase=\"'dropdown-with-search'\">\r\n <div\r\n [hidden]=\"field?.hidden\"\r\n id=\"field_{{ field.key }}\"\r\n >\r\n <kwikui-select-combobox\r\n [disabled]=\"field?.disabled\"\r\n [focus]=\"field?.focus\"\r\n [formControl]=\"formGroup.controls[field.key]\"\r\n [formControlName]=\"field.key\"\r\n [id]=\"field.key\"\r\n [invalid]=\"field?.invalid\"\r\n [label]=\"field.label\"\r\n [options]=\"field.options\"\r\n [placeholder]=\"field?.properties?.placeholder\"\r\n [properties]=\"field?.properties\"\r\n [validators]=\"field?.validators\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-select-combobox>\r\n <kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n <!-- API Call -->\r\n <ng-container *ngSwitchCase=\"'api-call'\">\r\n <div\r\n [hidden]=\"field?.hidden\"\r\n id=\"field_{{ field.key }}\"\r\n >\r\n <kwikui-button-api-call\r\n [apiStatus]=\"field?.api?.status?.value\"\r\n [class]=\"field?.class\"\r\n [disabled]=\"field?.disabled\"\r\n [id]=\"field.key\"\r\n [label]=\"field?.api?.status?.labels[field?.api?.status?.value]\"\r\n [showLoader]=\"field?.disabled === 'loading'\"\r\n shape=\"null\"\r\n size=\"m\"\r\n styles=\"width: fit-content\"\r\n (onClick)=\"this.handleOnClickApiCall($event)\"\r\n ></kwikui-button-api-call>\r\n <kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n <!-- Mobile OTP -->\r\n <ng-container *ngSwitchCase=\"'otp'\">\r\n <div\r\n [hidden]=\"field?.hidden\"\r\n id=\"field_{{ field.key }}\"\r\n >\r\n <kwikui-input-otp\r\n [disabled]=\"field?.disabled\"\r\n [focus]=\"field?.focus\"\r\n [formControl]=\"formGroup.controls[field.key]\"\r\n [formControlName]=\"field.key\"\r\n [id]=\"field.key\"\r\n [invalid]=\"field?.invalid\"\r\n [label]=\"field?.label\"\r\n [mask]=\"field?.properties?.mask\"\r\n [placeholder]=\"field?.properties?.placeholder\"\r\n [properties]=\"field?.properties\"\r\n [validators]=\"field?.validators\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-input-otp>\r\n <kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n <!-- Aadhaar Number -->\r\n <ng-container *ngSwitchCase=\"'aadhaar-number'\">\r\n <div\r\n [hidden]=\"field?.hidden\"\r\n id=\"field_{{ field.key }}\"\r\n >\r\n <kwikui-input-aadhaar\r\n [disabled]=\"field?.disabled\"\r\n [focus]=\"field?.focus\"\r\n [formControl]=\"formGroup.controls[field.key]\"\r\n [formControlName]=\"field.key\"\r\n [id]=\"field.key\"\r\n [invalid]=\"field?.invalid\"\r\n [label]=\"field?.label\"\r\n [placeholder]=\"field?.placeholder\"\r\n [properties]=\"field?.properties\"\r\n [validators]=\"field?.validators\"\r\n (getKeyValue)=\"handleGetKeyValue($event)\"\r\n ></kwikui-input-aadhaar>\r\n <kwikui-messages\r\n [messages]=\"field.messages\"\r\n [id]=\"field.key\"\r\n ></kwikui-messages>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </form>\r\n <div class=\"kwikid-form-buttons\">\r\n <kwikui-button\r\n *ngIf=\"this.isMobileView\"\r\n [disabled]=\"viewFormsButton.disabled\"\r\n id=\"\"\r\n label=\"View Forms\"\r\n [showLoader]=\"viewFormsButton.showLoader\"\r\n styles=\"\"\r\n class=\"\"\r\n type=\"button\"\r\n appearance=\"secondary\"\r\n icon=\"\"\r\n iconRight=\"\"\r\n shape=\"null\"\r\n size=\"m\"\r\n styles=\"width: 100%\"\r\n (onClick)=\"this.handleOnClickViewForms($event)\"\r\n ></kwikui-button>\r\n <kwikui-button\r\n [disabled]=\"saveFormButton.disabled\"\r\n id=\"\"\r\n label=\"Save\"\r\n [showLoader]=\"saveFormButton.showLoader\"\r\n styles=\"\"\r\n class=\"\"\r\n type=\"button\"\r\n appearance=\"primary\"\r\n icon=\"\"\r\n iconRight=\"\"\r\n shape=\"null\"\r\n size=\"m\"\r\n styles=\"width: 100%\"\r\n (onClick)=\"this.handleOnClickSaveForm($event)\"\r\n ></kwikui-button>\r\n </div>\r\n</div>\r\n<div\r\n class=\"kwikid-form-container-loading\"\r\n *ngIf=\"this.loading\"\r\n>\r\n <div\r\n class=\"large-wrapper\"\r\n [class.tui-skeleton]=\"this.loading\"\r\n [class.tui-skeleton_rounded]=\"this.loading\"\r\n ></div>\r\n <div\r\n class=\"large-wrapper\"\r\n [class.tui-skeleton]=\"this.loading\"\r\n [class.tui-skeleton_rounded]=\"this.loading\"\r\n ></div>\r\n <div\r\n class=\"large-wrapper\"\r\n [class.tui-skeleton]=\"this.loading\"\r\n [class.tui-skeleton_rounded]=\"this.loading\"\r\n ></div>\r\n <div\r\n class=\"large-wrapper\"\r\n [class.tui-skeleton]=\"this.loading\"\r\n [class.tui-skeleton_rounded]=\"this.loading\"\r\n ></div>\r\n <div\r\n class=\"large-wrapper\"\r\n [class.tui-skeleton]=\"this.loading\"\r\n [class.tui-skeleton_rounded]=\"this.loading\"\r\n ></div>\r\n <div\r\n class=\"large-wrapper\"\r\n [class.tui-skeleton]=\"this.loading\"\r\n [class.tui-skeleton_rounded]=\"this.loading\"\r\n ></div>\r\n <div\r\n class=\"large-wrapper\"\r\n [class.tui-skeleton]=\"this.loading\"\r\n [class.tui-skeleton_rounded]=\"this.loading\"\r\n ></div>\r\n</div>\r\n<tui-push\r\n id=\"field-error-notification\"\r\n *tuiPush=\"showErrorNotification\"\r\n heading=\"Missing/Incorrect Fields!\"\r\n type=\"Error\"\r\n (close)=\"toggleErrorNotification(false)\"\r\n>\r\n <tui-svg\r\n src=\"tuiIconCancel\"\r\n style=\"color: #fff !important\"\r\n >\r\n </tui-svg>\r\n</tui-push>\r\n", styles: ["::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}.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;grid-row-gap:1rem;row-gap:1rem}.kwikid-form-buttons{width:100%;bottom:0px;padding:1rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;grid-column-gap:10px;column-gap:10px}.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;grid-row-gap:.5rem;row-gap:.5rem;padding:1rem}#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:1em}.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;grid-gap:.5rem;gap:.5rem}.title:not(:first-child){margin-top:.5rem}.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;grid-row-gap:1rem;row-gap:1rem;padding: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}\n"], components: [{ type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }, { type: i2.KwikUIInputComponent, selector: "kwikui-input", inputs: ["label", "id", "type", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "validators", "case", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIMessagesComponent, selector: "kwikui-messages", inputs: ["messages", "id"] }, { type: i2.KwikUICheckboxBlockComponent, selector: "kwikui-checkbox-block", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "size", "contentAlign", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputNumberComponent, selector: "kwikui-input-number", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "min", "max", "prefix", "postfix", "precision", "decimal", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputDateComponent, selector: "kwikui-input-date", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "min", "max", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputPhoneComponent, selector: "kwikui-input-phone", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "countryCode", "phoneMaskAfterCountryCode", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i3.TuiLabelComponent, selector: "label[tuiLabel]", inputs: ["tuiLabel", "context"] }, { type: i2.KwikUIRadioListComponent, selector: "kwikui-radio-list", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "size", "items", "orientation", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUISelectComboboxComponent, selector: "kwikui-select-combobox", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "options", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIButtonApiCallComponent, selector: "kwikui-button-api-call", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "shape", "size", "apiStatus"], outputs: ["onClick"] }, { type: i2.KwikUIInputOtpComponent, selector: "kwikui-input-otp", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "mask", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputAadhaarComponent, selector: "kwikui-input-aadhaar", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "mask", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i4.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "timestamp"], outputs: ["close"] }, { type: i3.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i6.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i5.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i6.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i4.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i4.TuiPushDirective, selector: "tui-push" }] });
|
|
1895
1892
|
__decorate([
|
|
1896
1893
|
log
|
|
1897
1894
|
], KwikIDFormViewComponent.prototype, "ngOnInit", null);
|
|
@@ -1934,6 +1931,9 @@ __decorate([
|
|
|
1934
1931
|
__decorate([
|
|
1935
1932
|
log
|
|
1936
1933
|
], KwikIDFormViewComponent.prototype, "handleOnClickSaveForm", null);
|
|
1934
|
+
__decorate([
|
|
1935
|
+
log
|
|
1936
|
+
], KwikIDFormViewComponent.prototype, "toggleErrorNotification", null);
|
|
1937
1937
|
__decorate([
|
|
1938
1938
|
log
|
|
1939
1939
|
], KwikIDFormViewComponent.prototype, "fieldHide", null);
|
|
@@ -1990,7 +1990,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
1990
1990
|
styleUrls: ["./form-view.component.scss"],
|
|
1991
1991
|
providers: [KwikIDFormViewService]
|
|
1992
1992
|
}]
|
|
1993
|
-
}], ctorParameters: function () { return [{ type:
|
|
1993
|
+
}], ctorParameters: function () { return [{ type: i4.TuiPushService, decorators: [{
|
|
1994
|
+
type: Inject,
|
|
1995
|
+
args: [TuiPushService]
|
|
1996
|
+
}] }, { type: i3.TuiAlertService, decorators: [{
|
|
1997
|
+
type: Inject,
|
|
1998
|
+
args: [TuiAlertService]
|
|
1999
|
+
}] }, { type: KwikIDFormViewService }]; }, propDecorators: { formConfig: [{
|
|
1994
2000
|
type: Input
|
|
1995
2001
|
}], formData: [{
|
|
1996
2002
|
type: Input
|
|
@@ -2010,7 +2016,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
2010
2016
|
type: Output
|
|
2011
2017
|
}], getActiveFormData: [{
|
|
2012
2018
|
type: Output
|
|
2013
|
-
}], ngOnInit: [], ngAfterViewInit: [], ngOnChanges: [], initFormConfig: [], setFormFieldsFromFormConfig: [], setFormDataFromAllFormsData: [], handleConnectedElementFieldActions: [], handleConnectedElementFields: [], handleConnectedElements: [], handleGetKeyValue: [], handleOnClickResetFormFields: [], handleOnClickApiCall: [], handleOnClickViewForms: [], handleOnClickSaveForm: [], fieldHide: [], fieldShow: [], fieldDisable: [], fieldEnable: [], fieldReset: [], fieldErrorShow: [], fieldErrorHide: [], fieldMessageShow: [], fieldMessageHide: [], setObjectValue: [], patchFieldControlValue: [], isFieldValid: [], isFieldEnabled: [], getFormGroupRawValues: [], handleFieldTypeSearchText: [], takeAction: [] } });
|
|
2019
|
+
}], ngOnInit: [], ngAfterViewInit: [], ngOnChanges: [], initFormConfig: [], setFormFieldsFromFormConfig: [], setFormDataFromAllFormsData: [], handleConnectedElementFieldActions: [], handleConnectedElementFields: [], handleConnectedElements: [], handleGetKeyValue: [], handleOnClickResetFormFields: [], handleOnClickApiCall: [], handleOnClickViewForms: [], handleOnClickSaveForm: [], toggleErrorNotification: [], fieldHide: [], fieldShow: [], fieldDisable: [], fieldEnable: [], fieldReset: [], fieldErrorShow: [], fieldErrorHide: [], fieldMessageShow: [], fieldMessageHide: [], setObjectValue: [], patchFieldControlValue: [], isFieldValid: [], isFieldEnabled: [], getFormGroupRawValues: [], handleFieldTypeSearchText: [], takeAction: [] } });
|
|
2014
2020
|
|
|
2015
2021
|
const hasKey = (object, key) => {
|
|
2016
2022
|
return object.hasOwnProperty(key);
|
|
@@ -2069,7 +2075,7 @@ class KwikIDFormsListComponent {
|
|
|
2069
2075
|
}
|
|
2070
2076
|
}
|
|
2071
2077
|
/** @nocollapse */ KwikIDFormsListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KwikIDFormsListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2072
|
-
/** @nocollapse */ KwikIDFormsListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: KwikIDFormsListComponent, selector: "kwikid-forms-list", inputs: { showFormFields: "showFormFields", userConfig: "userConfig", formsList: "formsList", formsListCompleted: "formsListCompleted", isMobileView: "isMobileView" }, outputs: { onClickSetActiveForm: "onClickSetActiveForm", onClickHideFormsList: "onClickHideFormsList", onClickSubmitForms: "onClickSubmitForms" }, usesOnChanges: true, ngImport: i0, template: "<div id=\"sidebar-container\">\r\n <div id=\"sidebar\">\r\n <div ngClass=\"kwikid-form-header\">\r\n <div id=\"uf-header\">\r\n <div id=\"uf-header-logo-container\">\r\n <img\r\n id=\"uf-header-logo\"\r\n src=\"{{ this.userConfig.theme.clientLogo }}\"\r\n [ngClass]=\"'large-icon'\"\r\n />\r\n </div>\r\n </div>\r\n <hr />\r\n </div>\r\n <div id=\"uf-progress\">\r\n <div id=\"uf-progress-steps\">\r\n {{ this.formsListCompleted.length }} / {{ this.formsList.length }} Steps\r\n Completed\r\n </div>\r\n <kwikui-progress-segmented\r\n [max]=\"this.formsList.length\"\r\n size=\"m\"\r\n [value]=\"this.formsListCompleted.length\"\r\n ></kwikui-progress-segmented>\r\n </div>\r\n <div id=\"uf-sections-container\">\r\n <div\r\n *ngFor=\"let form of formsList; let i = index\"\r\n [class]=\"'uf-section-item'\"\r\n [class.completed]=\"form.status === 'completed' && !form.disabled\"\r\n [class.edit]=\"form.status === 'editable' && !form.disabled\"\r\n [class.locked]=\"form.status === 'locked' && form.disabled\"\r\n (click)=\"\r\n form.status === 'locked' && form.disabled\r\n ? undefined\r\n : handleOnClickSetActiveForm(form.key)\r\n \"\r\n >\r\n <div class=\"uf-form-section-card-title\">\r\n {{ form.title }}\r\n </div>\r\n <div class=\"uf-form-section-card-action\">\r\n <div\r\n *ngIf=\"form.status === 'completed' && !form.disabled\"\r\n class=\"uf-form-section-card-action-img completed\"\r\n >\r\n <tui-svg src=\"tuiIconCheckLarge\"></tui-svg>\r\n </div>\r\n <div\r\n *ngIf=\"form.status !== 'completed' && !form.disabled\"\r\n class=\"uf-form-section-card-action-img edit\"\r\n >\r\n <tui-svg src=\"tuiIconEdit\"></tui-svg>\r\n </div>\r\n <div\r\n *ngIf=\"form.status !== 'completed' && form.disabled\"\r\n class=\"uf-form-section-card-action-img locked\"\r\n >\r\n <tui-svg src=\"tuiIconLock\"></tui-svg>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div id=\"submit-sidebar-btn-container\">\r\n <kwikui-button\r\n [disabled]=\"false\"\r\n id=\"\"\r\n label=\"Submit\"\r\n [showLoader]=\"false\"\r\n styles=\"\"\r\n class=\"\"\r\n type=\"button\"\r\n appearance=\"primary\"\r\n icon=\"\"\r\n iconRight=\"\"\r\n shape=\"null\"\r\n size=\"m\"\r\n styles=\"width: 100%\"\r\n (onClick)=\"handleOnSubmitForms($event)\"\r\n ></kwikui-button>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}#sidebar-container{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center}#sidebar{width:100%;height:100%;display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch}.uf-section-item{width:100%;display:flex;flex-direction:row;align-items:center;justify-content:space-between;align-content:center;padding:1rem;grid-gap:1rem;gap:1rem;cursor:pointer;box-shadow:0 .1rem .5rem -.25rem gray;border-radius:.5rem;background-color:var(--tui-base-02)}.uf-section-item:hover{box-shadow:0 .2rem .75rem -.5rem #656565}#submit-sidebar-btn-container{width:100%;bottom:0px;z-index:1;padding:1rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;grid-gap:1rem;gap:1rem}#submit-sidebar-btn-container *{flex-grow:1}#uf-sections-container{display:flex;flex-direction:column;height:100%;grid-row-gap:20px;row-gap:20px;padding:1rem;overflow-y:auto}.uf-form-section-card{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:10px;column-gap:10px;border:none;border-radius:8px;background-color:#e9e9e9;height:-moz-fit-content;height:fit-content;min-height:60px;padding:10px 15px;width:100%;max-width:350px;margin:0 auto}.uf-section-item.locked{-webkit-user-select:none;user-select:none;cursor:not-allowed}.uf-form-section-card .uf-form-section-card-title{font-size:1.2em;text-align:left;line-height:1.25em}.uf-form-section-card .uf-form-section-card-action{width:30px;height:30px;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.uf-form-section-card .uf-form-section-card-action .uf-form-section-card-action-img{width:30px;height:30px;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;border-radius:100%;color:#fff;font-weight:bold}.uf-form-section-card-action-img.completed{background-color:#228b22;padding:.25rem;border-radius:50%;color:#fff}.uf-form-section-card-action-img.edit{background-color:#dc143c;padding:.25rem;border-radius:50%;color:#fff}.uf-form-section-card-action-img.locked{background-color:gray;padding:.25rem;border-radius:50%;color:#fff}#uf-progress{display:flex;padding:1rem;flex-direction:column;align-content:center;justify-content:center;align-items:stretch;grid-gap:.5rem;gap:.5rem}#uf-progress-steps{font-size:1em;text-align:right;color:#3d3d3d}.uf-form-section-card-title{font-size:1em;font-weight:bold;color:#121212}@media screen and (max-width: 600px){#sidebar-container{max-width:unset}}.kwikid-form-header{height:70px;z-index:6}.kwikid-form-header hr{width:calc(100% - 1rem);margin-left:auto;margin-right:auto}#uf-header{display:flex;flex-direction:row;align-content:center;align-items:center;justify-content:flex-start;grid-column-gap:10px;column-gap:10px;padding:10px 20px;width:100%;max-width:calc(400px + 50vw + 2rem);margin:0 auto;height:70px;z-index:1}#uf-header #uf-header-goback-container{display:none}#uf-header #uf-header-goback-container:hover{border-radius:50%;background-color:#d3d3d3}#uf-header #uf-header-goback-container #uf-header-goback{width:100%;height:auto}#uf-header #uf-header-logo-container{display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}#uf-header #uf-header-logo-container #uf-header-logo.small-icon{width:100%;height:50px}#uf-header #uf-header-logo-container #uf-header-logo.large-icon{width:100%;height:50px}#uf-header #uf-header-title-container{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;grid-row-gap:4px;row-gap:4px}#uf-header #uf-header-title-container #uf-header-title{font-size:1.4em;color:#121212}#uf-header #uf-header-title-container #uf-header-subtitle{font-size:1.2em;color:#121212}\n"], components: [{ type: i2.KwikUIProgressSegmentedComponent, selector: "kwikui-progress-segmented", inputs: ["value", "max", "size", "colors"] }, { type: i3.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }], directives: [{ type:
|
|
2078
|
+
/** @nocollapse */ KwikIDFormsListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: KwikIDFormsListComponent, selector: "kwikid-forms-list", inputs: { showFormFields: "showFormFields", userConfig: "userConfig", formsList: "formsList", formsListCompleted: "formsListCompleted", isMobileView: "isMobileView" }, outputs: { onClickSetActiveForm: "onClickSetActiveForm", onClickHideFormsList: "onClickHideFormsList", onClickSubmitForms: "onClickSubmitForms" }, usesOnChanges: true, ngImport: i0, template: "<div id=\"sidebar-container\">\r\n <div id=\"sidebar\">\r\n <div ngClass=\"kwikid-form-header\">\r\n <div id=\"uf-header\">\r\n <div id=\"uf-header-logo-container\">\r\n <img\r\n id=\"uf-header-logo\"\r\n src=\"{{ this.userConfig.theme.clientLogo }}\"\r\n [ngClass]=\"'large-icon'\"\r\n />\r\n </div>\r\n </div>\r\n <hr />\r\n </div>\r\n <div id=\"uf-progress\">\r\n <div id=\"uf-progress-steps\">\r\n {{ this.formsListCompleted.length }} / {{ this.formsList.length }} Steps\r\n Completed\r\n </div>\r\n <kwikui-progress-segmented\r\n [max]=\"this.formsList.length\"\r\n size=\"m\"\r\n [value]=\"this.formsListCompleted.length\"\r\n ></kwikui-progress-segmented>\r\n </div>\r\n <div id=\"uf-sections-container\">\r\n <div\r\n *ngFor=\"let form of formsList; let i = index\"\r\n [class]=\"'uf-section-item'\"\r\n [class.completed]=\"form.status === 'completed' && !form.disabled\"\r\n [class.edit]=\"form.status === 'editable' && !form.disabled\"\r\n [class.locked]=\"form.status === 'locked' && form.disabled\"\r\n (click)=\"\r\n form.status === 'locked' && form.disabled\r\n ? undefined\r\n : handleOnClickSetActiveForm(form.key)\r\n \"\r\n >\r\n <div class=\"uf-form-section-card-title\">\r\n {{ form.title }}\r\n </div>\r\n <div class=\"uf-form-section-card-action\">\r\n <div\r\n *ngIf=\"form.status === 'completed' && !form.disabled\"\r\n class=\"uf-form-section-card-action-img completed\"\r\n >\r\n <tui-svg src=\"tuiIconCheckLarge\"></tui-svg>\r\n </div>\r\n <div\r\n *ngIf=\"form.status !== 'completed' && !form.disabled\"\r\n class=\"uf-form-section-card-action-img edit\"\r\n >\r\n <tui-svg src=\"tuiIconEdit\"></tui-svg>\r\n </div>\r\n <div\r\n *ngIf=\"form.status !== 'completed' && form.disabled\"\r\n class=\"uf-form-section-card-action-img locked\"\r\n >\r\n <tui-svg src=\"tuiIconLock\"></tui-svg>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div id=\"submit-sidebar-btn-container\">\r\n <kwikui-button\r\n [disabled]=\"false\"\r\n id=\"\"\r\n label=\"Submit\"\r\n [showLoader]=\"false\"\r\n styles=\"\"\r\n class=\"\"\r\n type=\"button\"\r\n appearance=\"primary\"\r\n icon=\"\"\r\n iconRight=\"\"\r\n shape=\"null\"\r\n size=\"m\"\r\n styles=\"width: 100%\"\r\n (onClick)=\"handleOnSubmitForms($event)\"\r\n ></kwikui-button>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}#sidebar-container{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center}#sidebar{width:100%;height:100%;display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch}.uf-section-item{width:100%;display:flex;flex-direction:row;align-items:center;justify-content:space-between;align-content:center;padding:1rem;grid-gap:1rem;gap:1rem;cursor:pointer;box-shadow:0 .1rem .5rem -.25rem gray;border-radius:.5rem;background-color:var(--tui-base-02)}.uf-section-item:hover{box-shadow:0 .2rem .75rem -.5rem #656565}#submit-sidebar-btn-container{width:100%;bottom:0px;z-index:1;padding:1rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;grid-gap:1rem;gap:1rem}#submit-sidebar-btn-container *{flex-grow:1}#uf-sections-container{display:flex;flex-direction:column;height:100%;grid-row-gap:20px;row-gap:20px;padding:1rem;overflow-y:auto}.uf-form-section-card{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:10px;column-gap:10px;border:none;border-radius:8px;background-color:#e9e9e9;height:-moz-fit-content;height:fit-content;min-height:60px;padding:10px 15px;width:100%;max-width:350px;margin:0 auto}.uf-section-item.locked{-webkit-user-select:none;user-select:none;cursor:not-allowed}.uf-form-section-card .uf-form-section-card-title{font-size:1.2em;text-align:left;line-height:1.25em}.uf-form-section-card .uf-form-section-card-action{width:30px;height:30px;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.uf-form-section-card .uf-form-section-card-action .uf-form-section-card-action-img{width:30px;height:30px;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;border-radius:100%;color:#fff;font-weight:bold}.uf-form-section-card-action-img.completed{background-color:#228b22;padding:.25rem;border-radius:50%;color:#fff}.uf-form-section-card-action-img.edit{background-color:#dc143c;padding:.25rem;border-radius:50%;color:#fff}.uf-form-section-card-action-img.locked{background-color:gray;padding:.25rem;border-radius:50%;color:#fff}#uf-progress{display:flex;padding:1rem;flex-direction:column;align-content:center;justify-content:center;align-items:stretch;grid-gap:.5rem;gap:.5rem}#uf-progress-steps{font-size:1em;text-align:right;color:#3d3d3d}.uf-form-section-card-title{font-size:1em;font-weight:bold;color:#121212}@media screen and (max-width: 600px){#sidebar-container{max-width:unset}}.kwikid-form-header{height:70px;z-index:6}.kwikid-form-header hr{width:calc(100% - 1rem);margin-left:auto;margin-right:auto}#uf-header{display:flex;flex-direction:row;align-content:center;align-items:center;justify-content:flex-start;grid-column-gap:10px;column-gap:10px;padding:10px 20px;width:100%;max-width:calc(400px + 50vw + 2rem);margin:0 auto;height:70px;z-index:1}#uf-header #uf-header-goback-container{display:none}#uf-header #uf-header-goback-container:hover{border-radius:50%;background-color:#d3d3d3}#uf-header #uf-header-goback-container #uf-header-goback{width:100%;height:auto}#uf-header #uf-header-logo-container{display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}#uf-header #uf-header-logo-container #uf-header-logo.small-icon{width:100%;height:50px}#uf-header #uf-header-logo-container #uf-header-logo.large-icon{width:100%;height:50px}#uf-header #uf-header-title-container{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;grid-row-gap:4px;row-gap:4px}#uf-header #uf-header-title-container #uf-header-title{font-size:1.4em;color:#121212}#uf-header #uf-header-title-container #uf-header-subtitle{font-size:1.2em;color:#121212}\n"], components: [{ type: i2.KwikUIProgressSegmentedComponent, selector: "kwikui-progress-segmented", inputs: ["value", "max", "size", "colors"] }, { type: i3.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }], directives: [{ type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2073
2079
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KwikIDFormsListComponent, decorators: [{
|
|
2074
2080
|
type: Component,
|
|
2075
2081
|
args: [{
|
|
@@ -2095,6 +2101,239 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
2095
2101
|
type: Output
|
|
2096
2102
|
}] } });
|
|
2097
2103
|
|
|
2104
|
+
class Sources {
|
|
2105
|
+
constructor(userConfig) {
|
|
2106
|
+
this._userConfig = userConfig;
|
|
2107
|
+
}
|
|
2108
|
+
get userConfig() {
|
|
2109
|
+
return this._userConfig;
|
|
2110
|
+
}
|
|
2111
|
+
set userConfig(value) {
|
|
2112
|
+
this._userConfig = value;
|
|
2113
|
+
}
|
|
2114
|
+
getValueFromUserConfig(path) {
|
|
2115
|
+
let value = "";
|
|
2116
|
+
if (isNotEmpty(path)) {
|
|
2117
|
+
value = jpQueryWrapper(this._userConfig, path);
|
|
2118
|
+
}
|
|
2119
|
+
else {
|
|
2120
|
+
value = setEmptyValue(this._userConfig);
|
|
2121
|
+
}
|
|
2122
|
+
return value;
|
|
2123
|
+
}
|
|
2124
|
+
getValueFromBrowserStorage(type, key) {
|
|
2125
|
+
let value = "";
|
|
2126
|
+
switch (type) {
|
|
2127
|
+
case EBrowserStorageType.LOCAL_STORAGE:
|
|
2128
|
+
value = isNotEmptyBrowserStorageValue(localStorage.getItem(key))
|
|
2129
|
+
? localStorage.getItem(key)
|
|
2130
|
+
: "";
|
|
2131
|
+
break;
|
|
2132
|
+
case EBrowserStorageType.SESSION_STORAGE:
|
|
2133
|
+
value = isNotEmptyBrowserStorageValue(sessionStorage.getItem(key))
|
|
2134
|
+
? sessionStorage.getItem(key)
|
|
2135
|
+
: "";
|
|
2136
|
+
break;
|
|
2137
|
+
default:
|
|
2138
|
+
value = "";
|
|
2139
|
+
break;
|
|
2140
|
+
}
|
|
2141
|
+
return value;
|
|
2142
|
+
}
|
|
2143
|
+
getValueFromSource(source) {
|
|
2144
|
+
let value = "";
|
|
2145
|
+
switch (source.key) {
|
|
2146
|
+
case ESourceKey.USER_CONFIG:
|
|
2147
|
+
value = this.getValueFromUserConfig(source.props.path);
|
|
2148
|
+
break;
|
|
2149
|
+
case ESourceKey.BROWSER_STORAGE:
|
|
2150
|
+
value = this.getValueFromBrowserStorage(source.props.browserStorage.type, source.props.browserStorage.key);
|
|
2151
|
+
break;
|
|
2152
|
+
case ESourceKey.PREDEFINED:
|
|
2153
|
+
value = source.value;
|
|
2154
|
+
break;
|
|
2155
|
+
default:
|
|
2156
|
+
value = "";
|
|
2157
|
+
break;
|
|
2158
|
+
}
|
|
2159
|
+
return value;
|
|
2160
|
+
}
|
|
2161
|
+
setValueToUserConfig(path, value) {
|
|
2162
|
+
this._userConfig = setValueToObject(this._userConfig, path, value);
|
|
2163
|
+
}
|
|
2164
|
+
setValueToBrowserStorage(type, key, value) {
|
|
2165
|
+
switch (type) {
|
|
2166
|
+
case EBrowserStorageType.LOCAL_STORAGE:
|
|
2167
|
+
localStorage.setItem(key, value);
|
|
2168
|
+
break;
|
|
2169
|
+
case EBrowserStorageType.SESSION_STORAGE:
|
|
2170
|
+
sessionStorage.setItem(key, value);
|
|
2171
|
+
break;
|
|
2172
|
+
default:
|
|
2173
|
+
break;
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
setValueToSource(source, value) {
|
|
2177
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2178
|
+
switch (source.key) {
|
|
2179
|
+
case ESourceKey.USER_CONFIG:
|
|
2180
|
+
this.setValueToUserConfig(source.props.path, value);
|
|
2181
|
+
break;
|
|
2182
|
+
case ESourceKey.BROWSER_STORAGE:
|
|
2183
|
+
yield this.setValueToBrowserStorage(source.props.browserStorage.type, source.props.browserStorage.key, value);
|
|
2184
|
+
break;
|
|
2185
|
+
default:
|
|
2186
|
+
break;
|
|
2187
|
+
}
|
|
2188
|
+
});
|
|
2189
|
+
}
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
class Condition {
|
|
2193
|
+
constructor(condition, rulesMapping) {
|
|
2194
|
+
this._condition = condition;
|
|
2195
|
+
this._rulesMapping = rulesMapping;
|
|
2196
|
+
}
|
|
2197
|
+
parseKeys(condition, rulesEvaluationMapping) {
|
|
2198
|
+
Object.keys(rulesEvaluationMapping).forEach((key) => {
|
|
2199
|
+
condition = replaceString(condition, key, rulesEvaluationMapping[key]);
|
|
2200
|
+
});
|
|
2201
|
+
return condition;
|
|
2202
|
+
}
|
|
2203
|
+
parseOperators(condition) {
|
|
2204
|
+
return condition.replace(/AND|OR|NOT|XOR|NAND|NOR|XNOR/g, (match) => {
|
|
2205
|
+
switch (match) {
|
|
2206
|
+
case "AND":
|
|
2207
|
+
return "&&";
|
|
2208
|
+
case "OR":
|
|
2209
|
+
return "||";
|
|
2210
|
+
case "NOT":
|
|
2211
|
+
return "!";
|
|
2212
|
+
case "XOR":
|
|
2213
|
+
return "^";
|
|
2214
|
+
case "NAND":
|
|
2215
|
+
return "!&";
|
|
2216
|
+
case "NOR":
|
|
2217
|
+
return "!|";
|
|
2218
|
+
case "XNOR":
|
|
2219
|
+
return "!^";
|
|
2220
|
+
default:
|
|
2221
|
+
return match;
|
|
2222
|
+
}
|
|
2223
|
+
});
|
|
2224
|
+
}
|
|
2225
|
+
evaluate() {
|
|
2226
|
+
this._condition = this.parseKeys(this._condition, this._rulesMapping);
|
|
2227
|
+
this._condition = this.parseOperators(this._condition);
|
|
2228
|
+
return eval(this._condition);
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
class Actions {
|
|
2233
|
+
constructor(action, ruleMapping, userConfig, takeAction) {
|
|
2234
|
+
this._action = action;
|
|
2235
|
+
this._userConfig = userConfig;
|
|
2236
|
+
this._ruleMapping = ruleMapping;
|
|
2237
|
+
this._takeAction = takeAction;
|
|
2238
|
+
}
|
|
2239
|
+
execute() {
|
|
2240
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2241
|
+
const condition = new Condition(this._action.condition, this._ruleMapping);
|
|
2242
|
+
const actionSuccess = condition.evaluate();
|
|
2243
|
+
if (actionSuccess) {
|
|
2244
|
+
return this._takeAction(this._action, this._userConfig);
|
|
2245
|
+
}
|
|
2246
|
+
});
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
|
|
2250
|
+
class Rules {
|
|
2251
|
+
constructor(rules, userConfig) {
|
|
2252
|
+
this._userConfig = userConfig;
|
|
2253
|
+
this._rules = rules;
|
|
2254
|
+
}
|
|
2255
|
+
evaluate(rule) {
|
|
2256
|
+
let ruleType = rule.key;
|
|
2257
|
+
let ruleEvaluationStatus = false;
|
|
2258
|
+
const source = new Sources(this._userConfig);
|
|
2259
|
+
switch (ruleType) {
|
|
2260
|
+
case ERuleKey.OBJECT_PATH_EXISTS:
|
|
2261
|
+
const ruleObjectPathExists = rule;
|
|
2262
|
+
const ruleObjectPathExistsObject = ruleObjectPathExists.props.object;
|
|
2263
|
+
const ruleObjectPathExistsPath = ruleObjectPathExists.props.path;
|
|
2264
|
+
switch (ruleObjectPathExistsObject) {
|
|
2265
|
+
case ESourceKey.USER_CONFIG:
|
|
2266
|
+
ruleEvaluationStatus = hasPath(this._userConfig, ruleObjectPathExistsPath);
|
|
2267
|
+
break;
|
|
2268
|
+
default:
|
|
2269
|
+
ruleEvaluationStatus = false;
|
|
2270
|
+
break;
|
|
2271
|
+
}
|
|
2272
|
+
break;
|
|
2273
|
+
case ERuleKey.VALUE_CHECK:
|
|
2274
|
+
const ruleValueCheck = rule;
|
|
2275
|
+
const ruleValueCheckSource = ruleValueCheck.props.value.source;
|
|
2276
|
+
const ruleValueCheckValue = source.getValueFromSource(ruleValueCheckSource);
|
|
2277
|
+
if (ruleValueCheck.props.pattern.key === EPatternKey.CUSTOM) {
|
|
2278
|
+
var re = new RegExp(ruleValueCheck.props.pattern.pattern);
|
|
2279
|
+
}
|
|
2280
|
+
else {
|
|
2281
|
+
var re = new RegExp(EPattern[ruleValueCheck.props.pattern.key]);
|
|
2282
|
+
}
|
|
2283
|
+
ruleEvaluationStatus = re.test(ruleValueCheckValue);
|
|
2284
|
+
break;
|
|
2285
|
+
case ERuleKey.VALUE_CHANGE:
|
|
2286
|
+
const ruleValueChange = rule;
|
|
2287
|
+
const ruleValueChangeCurrentSource = ruleValueChange.props.value.current.source;
|
|
2288
|
+
const ruleValueChangePreviousSource = ruleValueChange.props.value.previous.source;
|
|
2289
|
+
const previousValue = source.getValueFromSource(ruleValueChangePreviousSource);
|
|
2290
|
+
const currentValue = source.getValueFromSource(ruleValueChangeCurrentSource);
|
|
2291
|
+
ruleEvaluationStatus = previousValue === currentValue;
|
|
2292
|
+
break;
|
|
2293
|
+
default:
|
|
2294
|
+
break;
|
|
2295
|
+
}
|
|
2296
|
+
return ruleEvaluationStatus;
|
|
2297
|
+
}
|
|
2298
|
+
mapping() {
|
|
2299
|
+
let rulesEvaluationMapping = {};
|
|
2300
|
+
for (const rule of this._rules) {
|
|
2301
|
+
const ruleEvaluationStatus = this.evaluate(rule);
|
|
2302
|
+
rulesEvaluationMapping = Object.assign(Object.assign({}, rulesEvaluationMapping), { [rule.id]: ruleEvaluationStatus });
|
|
2303
|
+
}
|
|
2304
|
+
return rulesEvaluationMapping;
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
|
|
2308
|
+
class Validations {
|
|
2309
|
+
constructor(userConfig, takeAction) {
|
|
2310
|
+
this._userConfig = userConfig;
|
|
2311
|
+
this._takeAction = takeAction;
|
|
2312
|
+
}
|
|
2313
|
+
get userConfig() {
|
|
2314
|
+
return this._userConfig;
|
|
2315
|
+
}
|
|
2316
|
+
set userConfig(value) {
|
|
2317
|
+
this._userConfig = value;
|
|
2318
|
+
}
|
|
2319
|
+
validateField() {
|
|
2320
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2321
|
+
const validations = this._userConfig.userFormFieldsConfig.validation;
|
|
2322
|
+
const triggers = validations === null || validations === void 0 ? void 0 : validations.triggers;
|
|
2323
|
+
const rules = validations.rules;
|
|
2324
|
+
const actions = validations.actions;
|
|
2325
|
+
const rulesMapping = new Rules(rules, this._userConfig).mapping();
|
|
2326
|
+
for (let action of actions) {
|
|
2327
|
+
const conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
|
|
2328
|
+
if (conditionEvaluation) {
|
|
2329
|
+
const actions = new Actions(action, rulesMapping, this._userConfig, this._takeAction);
|
|
2330
|
+
yield actions.execute();
|
|
2331
|
+
}
|
|
2332
|
+
}
|
|
2333
|
+
});
|
|
2334
|
+
}
|
|
2335
|
+
}
|
|
2336
|
+
|
|
2098
2337
|
class Converter {
|
|
2099
2338
|
constructor() {
|
|
2100
2339
|
this.getFormFields = (formConfig) => {
|
|
@@ -2187,10 +2426,15 @@ class Converter {
|
|
|
2187
2426
|
field = this.setFieldKeyValue(field, "type", "phone");
|
|
2188
2427
|
field.properties = this.setMissingFieldKeyValue(field.properties, "countryCode", "+91");
|
|
2189
2428
|
field.properties = this.setMissingFieldKeyValue(field.properties, "phoneMaskAfterCountryCode", "####-######");
|
|
2190
|
-
field.properties = this.
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
field.properties = this.
|
|
2429
|
+
field.properties = this.setMissingFieldKeyValue(field.properties, "removeCountryCodeFromValue", true);
|
|
2430
|
+
}
|
|
2431
|
+
if (field.type === "phone" || field.type === "number") {
|
|
2432
|
+
field.properties = this.setMissingFieldKeyValue(field.properties, "decimal", "never");
|
|
2433
|
+
field.properties = this.setMissingFieldKeyValue(field.properties, "prefix", "");
|
|
2434
|
+
field.properties = this.setMissingFieldKeyValue(field.properties, "postfix", "");
|
|
2435
|
+
field.properties = this.setMissingFieldKeyValue(field.properties, "min", -Infinity);
|
|
2436
|
+
field.properties = this.setMissingFieldKeyValue(field.properties, "max", Infinity);
|
|
2437
|
+
field.properties = this.setMissingFieldKeyValue(field.properties, "precision", 2);
|
|
2194
2438
|
}
|
|
2195
2439
|
}
|
|
2196
2440
|
field = this.setFieldKeyValue(field, "hidden", false);
|
|
@@ -2619,11 +2863,6 @@ class Converter {
|
|
|
2619
2863
|
}
|
|
2620
2864
|
return field;
|
|
2621
2865
|
};
|
|
2622
|
-
let fields = this.getFormFields(formConfig);
|
|
2623
|
-
let connectedFieldMapping = {
|
|
2624
|
-
parent: {},
|
|
2625
|
-
child: {}
|
|
2626
|
-
};
|
|
2627
2866
|
const setFormFields = (formConfig, fields) => {
|
|
2628
2867
|
if (hasKey$2(formConfig, "multiForm")) {
|
|
2629
2868
|
formConfig.multiForm["fields"] = fields;
|
|
@@ -2633,6 +2872,11 @@ class Converter {
|
|
|
2633
2872
|
}
|
|
2634
2873
|
return formConfig;
|
|
2635
2874
|
};
|
|
2875
|
+
let connectedFieldMapping = {
|
|
2876
|
+
parent: {},
|
|
2877
|
+
child: {}
|
|
2878
|
+
};
|
|
2879
|
+
let fields = this.getFormFields(formConfig);
|
|
2636
2880
|
for (let field of fields) {
|
|
2637
2881
|
field = updateOnFieldType(field);
|
|
2638
2882
|
field = formatFieldKeys(field);
|
|
@@ -2774,10 +3018,12 @@ class KwikIDFormsRendererComponent {
|
|
|
2774
3018
|
this.getFormData = new EventEmitter();
|
|
2775
3019
|
this.onClickApiCall = new EventEmitter();
|
|
2776
3020
|
this.loading = false;
|
|
3021
|
+
this.loader = false;
|
|
2777
3022
|
// display forms and list conditionally
|
|
2778
3023
|
this.showForm = false;
|
|
2779
3024
|
this.showFormFields = true;
|
|
2780
3025
|
this.showFormSections = true;
|
|
3026
|
+
this.showErrorNotification = false;
|
|
2781
3027
|
}
|
|
2782
3028
|
// The final value should be provided to service, so that it can be used in all components
|
|
2783
3029
|
windowResizeWatcher() {
|
|
@@ -2805,9 +3051,11 @@ class KwikIDFormsRendererComponent {
|
|
|
2805
3051
|
}
|
|
2806
3052
|
}
|
|
2807
3053
|
ngOnInit() {
|
|
3054
|
+
this.loader = true;
|
|
2808
3055
|
this.loading = true;
|
|
2809
3056
|
this.rendererService.setFormsList(this.userConfig.userFormFields);
|
|
2810
3057
|
this.initializeForms();
|
|
3058
|
+
this.loader = false;
|
|
2811
3059
|
}
|
|
2812
3060
|
ngOnChanges(changes) {
|
|
2813
3061
|
const verifyChange = (prop) => {
|
|
@@ -2815,6 +3063,7 @@ class KwikIDFormsRendererComponent {
|
|
|
2815
3063
|
};
|
|
2816
3064
|
if (verifyChange("userConfig")) {
|
|
2817
3065
|
this.userConfig = changes.userConfig.currentValue;
|
|
3066
|
+
this.loader = false;
|
|
2818
3067
|
}
|
|
2819
3068
|
if (verifyChange("formsData")) {
|
|
2820
3069
|
this.formsData = changes.formsData.currentValue;
|
|
@@ -2822,10 +3071,12 @@ class KwikIDFormsRendererComponent {
|
|
|
2822
3071
|
}
|
|
2823
3072
|
if (verifyChange("apiCallResponse")) {
|
|
2824
3073
|
this.apiCallResponse = changes.apiCallResponse.currentValue;
|
|
3074
|
+
this.loader = false;
|
|
2825
3075
|
}
|
|
2826
3076
|
}
|
|
2827
3077
|
initializeForms() {
|
|
2828
3078
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3079
|
+
this.loader = true;
|
|
2829
3080
|
this.rendererService.setAllFormsData(this.formsData);
|
|
2830
3081
|
this.rendererService.updateFormsList();
|
|
2831
3082
|
this.handleResize(this.rendererService.formsList);
|
|
@@ -2837,6 +3088,7 @@ class KwikIDFormsRendererComponent {
|
|
|
2837
3088
|
this.showForm = false;
|
|
2838
3089
|
this.showFormFields = false;
|
|
2839
3090
|
}
|
|
3091
|
+
this.loader = false;
|
|
2840
3092
|
this.loading = false;
|
|
2841
3093
|
});
|
|
2842
3094
|
}
|
|
@@ -2863,6 +3115,7 @@ class KwikIDFormsRendererComponent {
|
|
|
2863
3115
|
var _a;
|
|
2864
3116
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2865
3117
|
this.showForm = false;
|
|
3118
|
+
this.loader = true;
|
|
2866
3119
|
const activeFormConfig = this.rendererService.formsList.find((form) => {
|
|
2867
3120
|
if (form.key === selectedForm) {
|
|
2868
3121
|
return form;
|
|
@@ -2882,25 +3135,40 @@ class KwikIDFormsRendererComponent {
|
|
|
2882
3135
|
this.showFormFields = true;
|
|
2883
3136
|
}
|
|
2884
3137
|
this.showForm = true;
|
|
3138
|
+
this.loader = false;
|
|
2885
3139
|
});
|
|
2886
3140
|
}
|
|
2887
3141
|
// forms-list listener
|
|
2888
3142
|
handleOnClickSubmitForms(e) {
|
|
2889
3143
|
console.log(e);
|
|
2890
|
-
this.
|
|
3144
|
+
if (this.userConfig.userFormFieldsConfig.validation) {
|
|
3145
|
+
const validations = new Validations(this.userConfig, this.takeAction.bind(this));
|
|
3146
|
+
(() => __awaiter(this, void 0, void 0, function* () {
|
|
3147
|
+
yield validations.validateField();
|
|
3148
|
+
if (this.userConfig.userFormFieldsConfig.status === "completed") {
|
|
3149
|
+
this.onClickSubmit.emit(e);
|
|
3150
|
+
}
|
|
3151
|
+
else {
|
|
3152
|
+
this.toggleErrorNotification(true);
|
|
3153
|
+
}
|
|
3154
|
+
}))();
|
|
3155
|
+
}
|
|
2891
3156
|
}
|
|
2892
3157
|
// form-view listener
|
|
2893
3158
|
handleOnClickApiCall(e) {
|
|
3159
|
+
this.loader = true;
|
|
2894
3160
|
this.onClickApiCall.emit(e);
|
|
2895
3161
|
}
|
|
2896
3162
|
// form-view listener
|
|
2897
3163
|
handleGetActiveFormData(e) {
|
|
3164
|
+
this.loader = true;
|
|
2898
3165
|
this.getFormData.emit({
|
|
2899
3166
|
[this.rendererService.activeFormConfig.key]: e["data"]
|
|
2900
3167
|
});
|
|
2901
3168
|
}
|
|
2902
3169
|
// form-view listener
|
|
2903
3170
|
handleOnClickSaveForm(e) {
|
|
3171
|
+
this.loader = true;
|
|
2904
3172
|
this.rendererService.setActiveFormData({});
|
|
2905
3173
|
this.getFormData.emit({
|
|
2906
3174
|
[this.rendererService.activeFormConfig.key]: e["data"]
|
|
@@ -2912,9 +3180,26 @@ class KwikIDFormsRendererComponent {
|
|
|
2912
3180
|
this.showForm = false;
|
|
2913
3181
|
this.showFormFields = false;
|
|
2914
3182
|
}
|
|
3183
|
+
toggleErrorNotification(show) {
|
|
3184
|
+
this.showErrorNotification = show;
|
|
3185
|
+
}
|
|
3186
|
+
takeAction(action, userConfig) {
|
|
3187
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3188
|
+
switch (action.key) {
|
|
3189
|
+
case EActionKey.SET_VALUE:
|
|
3190
|
+
const sources = new Sources(userConfig);
|
|
3191
|
+
const sourceValue = yield sources.getValueFromSource(action.props.value.source);
|
|
3192
|
+
sources.setValueToSource(action.props.value.destination, sourceValue);
|
|
3193
|
+
this.userConfig = sources.userConfig;
|
|
3194
|
+
break;
|
|
3195
|
+
default:
|
|
3196
|
+
break;
|
|
3197
|
+
}
|
|
3198
|
+
});
|
|
3199
|
+
}
|
|
2915
3200
|
}
|
|
2916
3201
|
/** @nocollapse */ KwikIDFormsRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KwikIDFormsRendererComponent, deps: [{ token: KwikIDRendererService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2917
|
-
/** @nocollapse */ KwikIDFormsRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: KwikIDFormsRendererComponent, selector: "kwikid-forms-renderer", inputs: { userConfig: "userConfig", formsData: "formsData", apiCallResponse: "apiCallResponse" }, outputs: { onClickSubmit: "onClickSubmit", getFormData: "getFormData", onClickApiCall: "onClickApiCall" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, providers: [KwikIDRendererService], usesOnChanges: true, ngImport: i0, template: "<div ngClass=\"kwikid-renderer\">\r\n <div\r\n ngClass=\"kwikid-layout-container\"\r\n *ngIf=\"!loading\"\r\n >\r\n <div\r\n ngClass=\"kwikid-sections-container\"\r\n *ngIf=\"showFormSections\"\r\n class=\"active\"\r\n [class.active]=\"showFormSections\"\r\n [class.mobile]=\"rendererService.isMobileView\"\r\n >\r\n <kwikid-forms-list\r\n [showFormFields]=\"this.showFormFields\"\r\n [userConfig]=\"this.userConfig\"\r\n [formsList]=\"this.rendererService.formsList\"\r\n [formsListCompleted]=\"this.rendererService.formsListCompleted\"\r\n [isMobileView]=\"this.rendererService.isMobileView\"\r\n (onClickSetActiveForm)=\"this.handleOnClickSetActiveForm($event)\"\r\n (onClickSubmitForms)=\"this.handleOnClickSubmitForms($event)\"\r\n ></kwikid-forms-list>\r\n </div>\r\n <div\r\n ngClass=\"kwikid-forms-container\"\r\n *ngIf=\"this.showForm && this.showFormFields\"\r\n [class.active]=\"showFormFields\"\r\n [class.mobile]=\"rendererService.isMobileView\"\r\n [@panelInOut]\r\n >\r\n <kwikid-form-view\r\n [formConfig]=\"this.rendererService.activeFormConfig\"\r\n [formData]=\"this.rendererService.activeFormData\"\r\n [apiCallResponse]=\"this.apiCallResponse\"\r\n [formsList]=\"this.rendererService.formsList\"\r\n [allFormsData]=\"this.rendererService.allFormsData\"\r\n [isMobileView]=\"this.rendererService.isMobileView\"\r\n (onClickApiCall)=\"this.handleOnClickApiCall($event)\"\r\n (onClickViewForms)=\"this.handleOnClickViewForms($event)\"\r\n (onClickSaveForm)=\"this.handleOnClickSaveForm($event)\"\r\n (getActiveFormData)=\"this.handleGetActiveFormData($event)\"\r\n ></kwikid-form-view>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".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);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-primary)}.kwikid-sections-container.mobile{position:absolute;top:0;left:0;z-index:5;opacity:1;visibility:visible;transition:all 1s}.kwikid-forms-container{display:block;width:100%;max-width:
|
|
3202
|
+
/** @nocollapse */ KwikIDFormsRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: KwikIDFormsRendererComponent, selector: "kwikid-forms-renderer", inputs: { userConfig: "userConfig", formsData: "formsData", apiCallResponse: "apiCallResponse" }, outputs: { onClickSubmit: "onClickSubmit", getFormData: "getFormData", onClickApiCall: "onClickApiCall" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, providers: [KwikIDRendererService], usesOnChanges: true, ngImport: i0, template: "<div ngClass=\"kwikid-renderer\">\r\n <div\r\n ngClass=\"kwikid-layout-container\"\r\n *ngIf=\"!loading\"\r\n >\r\n <div\r\n ngClass=\"kwikid-sections-container\"\r\n *ngIf=\"showFormSections\"\r\n class=\"active\"\r\n [class.active]=\"showFormSections\"\r\n [class.mobile]=\"rendererService.isMobileView\"\r\n >\r\n <kwikid-forms-list\r\n [showFormFields]=\"this.showFormFields\"\r\n [userConfig]=\"this.userConfig\"\r\n [formsList]=\"this.rendererService.formsList\"\r\n [formsListCompleted]=\"this.rendererService.formsListCompleted\"\r\n [isMobileView]=\"this.rendererService.isMobileView\"\r\n (onClickSetActiveForm)=\"this.handleOnClickSetActiveForm($event)\"\r\n (onClickSubmitForms)=\"this.handleOnClickSubmitForms($event)\"\r\n ></kwikid-forms-list>\r\n </div>\r\n <div\r\n ngClass=\"kwikid-forms-container\"\r\n *ngIf=\"this.showForm && this.showFormFields\"\r\n [class.active]=\"showFormFields\"\r\n [class.mobile]=\"rendererService.isMobileView\"\r\n [@panelInOut]\r\n >\r\n <kwikid-form-view\r\n [formConfig]=\"this.rendererService.activeFormConfig\"\r\n [formData]=\"this.rendererService.activeFormData\"\r\n [apiCallResponse]=\"this.apiCallResponse\"\r\n [formsList]=\"this.rendererService.formsList\"\r\n [allFormsData]=\"this.rendererService.allFormsData\"\r\n [isMobileView]=\"this.rendererService.isMobileView\"\r\n (onClickApiCall)=\"this.handleOnClickApiCall($event)\"\r\n (onClickViewForms)=\"this.handleOnClickViewForms($event)\"\r\n (onClickSaveForm)=\"this.handleOnClickSaveForm($event)\"\r\n (getActiveFormData)=\"this.handleGetActiveFormData($event)\"\r\n ></kwikid-form-view>\r\n </div>\r\n </div>\r\n</div>\r\n<div\r\n ngClass=\"kwikid-forms-renderer-loader\"\r\n *ngIf=\"loader\"\r\n>\r\n <span class=\"loader\"></span>\r\n</div>\r\n<tui-push\r\n id=\"error-notification\"\r\n *tuiPush=\"showErrorNotification\"\r\n heading=\"Please complete the required Forms!\"\r\n type=\"Error\"\r\n (close)=\"toggleErrorNotification(false)\"\r\n>\r\n <tui-svg\r\n src=\"tuiIconCancel\"\r\n style=\"color: #fff !important\"\r\n >\r\n </tui-svg>\r\n</tui-push>\r\n", styles: [":host{position:relative}.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);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-primary)}.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:50%;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}}.kwikid-forms-renderer-loader{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.75);display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;z-index:100}.kwikid-forms-renderer-loader .loader{width:48px;height:48px;border-radius:50%;display:inline-block;position:relative;border:3px solid;border-color:#fff #fff transparent;box-sizing:border-box;animation:rotation 1s linear infinite}.kwikid-forms-renderer-loader .loader:after{content:\"\";box-sizing:border-box;position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;border:3px solid;border-color:transparent var(--tui-primary) var(--tui-primary);width:24px;height:24px;border-radius:50%;animation:rotationBack .5s linear infinite;transform-origin:center center}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotationBack{0%{transform:rotate(0)}to{transform:rotate(-360deg)}}.kwikid-forms-renderer-loader .t-loader{display:none!important}#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}\n"], components: [{ type: KwikIDFormsListComponent, selector: "kwikid-forms-list", inputs: ["showFormFields", "userConfig", "formsList", "formsListCompleted", "isMobileView"], outputs: ["onClickSetActiveForm", "onClickHideFormsList", "onClickSubmitForms"] }, { type: KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: ["formConfig", "formData", "apiCallResponse", "isMobileView", "allFormsData", "formsList"], outputs: ["onClickViewForms", "onClickSaveForm", "onClickApiCall", "getActiveFormData"] }, { type: i4.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "timestamp"], outputs: ["close"] }, { type: i3.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }], directives: [{ type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i4.TuiPushDirective, selector: "tui-push" }], animations: [
|
|
2918
3203
|
trigger("panelInOut", [
|
|
2919
3204
|
transition(":enter", [
|
|
2920
3205
|
style({ transform: "translateY(100%)" }),
|
|
@@ -2983,12 +3268,16 @@ class KwikIDFormViewModule {
|
|
|
2983
3268
|
FormsModule,
|
|
2984
3269
|
ReactiveFormsModule,
|
|
2985
3270
|
TuiLabelModule,
|
|
3271
|
+
TuiPushModule,
|
|
3272
|
+
TuiSvgModule,
|
|
2986
3273
|
KwikUIModule], exports: [KwikIDFormViewComponent] });
|
|
2987
3274
|
/** @nocollapse */ KwikIDFormViewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KwikIDFormViewModule, imports: [[
|
|
2988
3275
|
CommonModule,
|
|
2989
3276
|
FormsModule,
|
|
2990
3277
|
ReactiveFormsModule,
|
|
2991
3278
|
TuiLabelModule,
|
|
3279
|
+
TuiPushModule,
|
|
3280
|
+
TuiSvgModule,
|
|
2992
3281
|
KwikUIModule
|
|
2993
3282
|
]] });
|
|
2994
3283
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KwikIDFormViewModule, decorators: [{
|
|
@@ -3000,6 +3289,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
3000
3289
|
FormsModule,
|
|
3001
3290
|
ReactiveFormsModule,
|
|
3002
3291
|
TuiLabelModule,
|
|
3292
|
+
TuiPushModule,
|
|
3293
|
+
TuiSvgModule,
|
|
3003
3294
|
KwikUIModule
|
|
3004
3295
|
],
|
|
3005
3296
|
exports: [KwikIDFormViewComponent]
|
|
@@ -3043,13 +3334,19 @@ class KwikIDFormRendererModule {
|
|
|
3043
3334
|
HttpClientModule,
|
|
3044
3335
|
KwikIDFormViewModule,
|
|
3045
3336
|
KwikIDFormsListModule,
|
|
3046
|
-
KwikUIModule
|
|
3337
|
+
KwikUIModule,
|
|
3338
|
+
TuiLoaderModule,
|
|
3339
|
+
TuiPushModule,
|
|
3340
|
+
TuiSvgModule], exports: [KwikIDFormsRendererComponent] });
|
|
3047
3341
|
/** @nocollapse */ KwikIDFormRendererModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KwikIDFormRendererModule, providers: [], imports: [[
|
|
3048
3342
|
CommonModule,
|
|
3049
3343
|
HttpClientModule,
|
|
3050
3344
|
KwikIDFormViewModule,
|
|
3051
3345
|
KwikIDFormsListModule,
|
|
3052
|
-
KwikUIModule
|
|
3346
|
+
KwikUIModule,
|
|
3347
|
+
TuiLoaderModule,
|
|
3348
|
+
TuiPushModule,
|
|
3349
|
+
TuiSvgModule
|
|
3053
3350
|
]] });
|
|
3054
3351
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KwikIDFormRendererModule, decorators: [{
|
|
3055
3352
|
type: NgModule,
|
|
@@ -3060,7 +3357,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
3060
3357
|
HttpClientModule,
|
|
3061
3358
|
KwikIDFormViewModule,
|
|
3062
3359
|
KwikIDFormsListModule,
|
|
3063
|
-
KwikUIModule
|
|
3360
|
+
KwikUIModule,
|
|
3361
|
+
TuiLoaderModule,
|
|
3362
|
+
TuiPushModule,
|
|
3363
|
+
TuiSvgModule
|
|
3064
3364
|
],
|
|
3065
3365
|
providers: [],
|
|
3066
3366
|
exports: [KwikIDFormsRendererComponent]
|