kwikid-forms 0.1.2 → 0.1.4
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 +411 -1039
- package/bundles/kwikid-forms.umd.js.map +1 -1
- package/esm2015/lib/renderer/form-view/definitions/apis/form-view.apis.type.definitions.js +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.type.definitions.js +1 -1
- package/esm2015/lib/renderer/form-view/definitions/validations/form-view.validations.type.definitions.js +1 -1
- package/esm2015/lib/renderer/form-view/form-view.component.js +121 -95
- package/esm2015/lib/renderer/form-view/form-view.service.js +3 -3
- package/esm2015/lib/renderer/form-view/helpers/form-view.apis.helper.js +51 -19
- package/esm2015/lib/renderer/form-view/helpers/form-view.defaults.helper.js +21 -10
- package/esm2015/lib/renderer/form-view/helpers/form-view.fields.helper.js +7 -7
- package/esm2015/lib/renderer/form-view/helpers/form-view.validations.helper.js +37 -31
- package/esm2015/lib/renderer/forms-list/forms-list.component.js +9 -5
- package/esm2015/lib/renderer/renderer.component.js +20 -10
- package/esm2015/lib/renderer/renderer.config-converter.helper.js +62 -59
- package/esm2015/lib/renderer/renderer.service.js +47 -6
- package/fesm2015/kwikid-forms.js +374 -877
- package/fesm2015/kwikid-forms.js.map +1 -1
- package/lib/renderer/form-view/definitions/apis/form-view.apis.type.definitions.d.ts +1 -1
- package/lib/renderer/form-view/definitions/fields/form-view.fields.type.definitions.d.ts +1 -2
- package/lib/renderer/form-view/definitions/sources/form-view.sources.type.definitions.d.ts +2 -2
- package/lib/renderer/form-view/definitions/validations/form-view.validations.type.definitions.d.ts +1 -2
- package/lib/renderer/form-view/form-view.component.d.ts +2 -2
- package/lib/renderer/renderer.component.d.ts +1 -1
- package/package.json +3 -2
- package/esm2015/lib/renderer/form-view/definitions/rules/form-view.rules.enum.definitions.js +0 -7
- package/esm2015/lib/renderer/form-view/definitions/rules/form-view.rules.type.definitions.js +0 -2
- package/esm2015/lib/renderer/form-view/definitions/sources/form-view.sources.enum.definitions.js +0 -17
- package/esm2015/lib/renderer/form-view/form-view.decorators.js +0 -93
- package/esm2015/lib/renderer/form-view/helpers/form-view.actions.helper.js +0 -27
- package/esm2015/lib/renderer/form-view/helpers/form-view.condition.helper.js +0 -46
- package/esm2015/lib/renderer/form-view/helpers/form-view.rules.helper.js +0 -83
- package/esm2015/lib/renderer/form-view/helpers/form-view.sources.helper.js +0 -161
- package/esm2015/lib/renderer/forms-list/forms-list.helper.js +0 -4
- package/esm2015/lib/renderer/helpers/renderer.actions.helper.js +0 -20
- package/esm2015/lib/renderer/helpers/renderer.condition.helper.js +0 -41
- package/esm2015/lib/renderer/helpers/renderer.rules.helper.js +0 -63
- package/esm2015/lib/renderer/helpers/renderer.sources.helper.js +0 -91
- package/esm2015/lib/renderer/helpers/renderer.validations.helper.js +0 -33
- package/lib/renderer/form-view/definitions/rules/form-view.rules.enum.definitions.d.ts +0 -5
- package/lib/renderer/form-view/definitions/rules/form-view.rules.type.definitions.d.ts +0 -41
- package/lib/renderer/form-view/definitions/sources/form-view.sources.enum.definitions.d.ts +0 -14
- package/lib/renderer/form-view/form-view.decorators.d.ts +0 -7
- package/lib/renderer/form-view/helpers/form-view.actions.helper.d.ts +0 -13
- package/lib/renderer/form-view/helpers/form-view.condition.helper.d.ts +0 -8
- package/lib/renderer/form-view/helpers/form-view.rules.helper.d.ts +0 -12
- package/lib/renderer/form-view/helpers/form-view.sources.helper.d.ts +0 -29
- package/lib/renderer/forms-list/forms-list.helper.d.ts +0 -1
- package/lib/renderer/helpers/renderer.actions.helper.d.ts +0 -8
- package/lib/renderer/helpers/renderer.condition.helper.d.ts +0 -8
- package/lib/renderer/helpers/renderer.rules.helper.d.ts +0 -8
- package/lib/renderer/helpers/renderer.sources.helper.d.ts +0 -13
- package/lib/renderer/helpers/renderer.validations.helper.d.ts +0 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/drag-drop'), require('@angular/core'), require('@angular/forms'), require('kwikui'), require('lodash'), require('@taiga-ui/core'), require('@taiga-ui/kit'), require('rxjs/operators'), require('jsonpath'), require('@taiga-ui/cdk'), require('@angular/common'), require('@angular/animations'), require('@angular/common/http')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('kwikid-forms', ['exports', '@angular/cdk/drag-drop', '@angular/core', '@angular/forms', 'kwikui', 'lodash', '@taiga-ui/core', '@taiga-ui/kit', 'rxjs/operators', 'jsonpath', '@taiga-ui/cdk', '@angular/common', '@angular/animations', '@angular/common/http'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["kwikid-forms"] = {}, global.ng.cdk.dragDrop, global.ng.core, global.ng.forms, global.
|
|
5
|
-
})(this, (function (exports, dragDrop, i0, i6, i2, _, i3, i4, operators, jp, cdk, i5, animations, http) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/drag-drop'), require('@angular/core'), require('@angular/forms'), require('kwikui'), require('lodash'), require('@taiga-ui/core'), require('@taiga-ui/kit'), require('kwikid-toolkit'), require('rxjs/operators'), require('jsonpath'), require('@taiga-ui/cdk'), require('@angular/common'), require('@angular/animations'), require('@angular/common/http')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('kwikid-forms', ['exports', '@angular/cdk/drag-drop', '@angular/core', '@angular/forms', 'kwikui', 'lodash', '@taiga-ui/core', '@taiga-ui/kit', 'kwikid-toolkit', 'rxjs/operators', 'jsonpath', '@taiga-ui/cdk', '@angular/common', '@angular/animations', '@angular/common/http'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["kwikid-forms"] = {}, global.ng.cdk.dragDrop, global.ng.core, global.ng.forms, global.kwikui, global.lodash, global["@taiga-ui/core"], global["@taiga-ui/kit"], global["kwikid-toolkit"], global.rxjs.operators, global.jsonpath, global["@taiga-ui/cdk"], global.ng.common, global.ng.animations, global.ng.common.http));
|
|
5
|
+
})(this, (function (exports, dragDrop, i0, i6, i2, _, i3, i4, kwikidToolkit, operators, jp, cdk, i5, animations, http) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -659,104 +659,7 @@
|
|
|
659
659
|
EFieldType["AADHAAR_NUMBER"] = "aadhaar-number";
|
|
660
660
|
})(EFieldType || (EFieldType = {}));
|
|
661
661
|
|
|
662
|
-
|
|
663
|
-
* A function that logs the execution of a method.
|
|
664
|
-
* @param {any} target - The object the method belongs to.
|
|
665
|
-
* @param {string} propertyKey - The name of the method.
|
|
666
|
-
* @param {PropertyDescriptor} descriptor - The property descriptor for the method.
|
|
667
|
-
*/
|
|
668
|
-
function log(target, propertyKey, descriptor) {
|
|
669
|
-
// save a reference to the original method
|
|
670
|
-
var originalMethod = descriptor.value;
|
|
671
|
-
// update the descriptor value with a new function that will log and execute the original method
|
|
672
|
-
descriptor.value = function () {
|
|
673
|
-
var args = [];
|
|
674
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
675
|
-
args[_i] = arguments[_i];
|
|
676
|
-
}
|
|
677
|
-
console.group("Logging Method"); // start a new logging group
|
|
678
|
-
console.time("Execution Time:"); // start a timer
|
|
679
|
-
var result; // declare result variable
|
|
680
|
-
try {
|
|
681
|
-
// execute the original method and save the result
|
|
682
|
-
result = originalMethod.apply(this, args);
|
|
683
|
-
}
|
|
684
|
-
catch (error) {
|
|
685
|
-
// if an error is thrown, log the error and throw it again
|
|
686
|
-
logSyncMethodError(target.constructor.name, propertyKey, args, error);
|
|
687
|
-
console.timeEnd("Execution Time:"); // stop the timer
|
|
688
|
-
console.groupEnd(); // end the logging group
|
|
689
|
-
throw error;
|
|
690
|
-
}
|
|
691
|
-
// if the result is a Promise, handle it as an async method
|
|
692
|
-
if (result instanceof Promise) {
|
|
693
|
-
result = result
|
|
694
|
-
.then(function (resolvedValue) {
|
|
695
|
-
// on success, log the resolved value and return it
|
|
696
|
-
logAsyncMethod(target.constructor.name, propertyKey, args, resolvedValue);
|
|
697
|
-
console.timeEnd("Execution Time:"); // stop the timer
|
|
698
|
-
console.groupEnd(); // end the logging group
|
|
699
|
-
return resolvedValue;
|
|
700
|
-
})
|
|
701
|
-
.catch(function (error) {
|
|
702
|
-
// on error, log the error and throw it again
|
|
703
|
-
logAsyncMethodError(target.constructor.name, propertyKey, args, error);
|
|
704
|
-
console.timeEnd("Execution Time:"); // stop the timer
|
|
705
|
-
console.groupEnd(); // end the logging group
|
|
706
|
-
throw error;
|
|
707
|
-
});
|
|
708
|
-
}
|
|
709
|
-
else {
|
|
710
|
-
// if the result is not a Promise, handle it as a sync method
|
|
711
|
-
logSyncMethod(target.constructor.name, propertyKey, args, result);
|
|
712
|
-
console.timeEnd("Execution Time:");
|
|
713
|
-
console.groupEnd();
|
|
714
|
-
}
|
|
715
|
-
return result;
|
|
716
|
-
};
|
|
717
|
-
}
|
|
718
|
-
/**
|
|
719
|
-
* This function logs a sync method's information to the console.
|
|
720
|
-
* @param {string} className - The name of the class where the method belongs.
|
|
721
|
-
* @param {string} methodName - The name of the method being called.
|
|
722
|
-
* @param {any[]} args - An array of arguments passed to the method.
|
|
723
|
-
* @param {any} result - The result of the method.
|
|
724
|
-
*/
|
|
725
|
-
function logSyncMethod(className, methodName, args, result) {
|
|
726
|
-
console.log("%cType: Sync Method -", "color: #0d47a1; font-weight: bold;", "\nClass:", className, "\nMethod:", methodName, "\nArgs:", args, "\nReturn:", result);
|
|
727
|
-
}
|
|
728
|
-
/**
|
|
729
|
-
* Logs an error that occurred during the execution of a synchronous method.
|
|
730
|
-
* @param {string} className - The name of the class the method belongs to.
|
|
731
|
-
* @param {string} methodName - The name of the method.
|
|
732
|
-
* @param {any[]} args - The arguments passed to the method.
|
|
733
|
-
* @param {Error} error - The error that occurred.
|
|
734
|
-
*/
|
|
735
|
-
function logSyncMethodError(className, methodName, args, error) {
|
|
736
|
-
console.log("%cType: Sync Method -", "color: #0d47a1; font-weight: bold;", "\nClass:", className, "\nMethod:", methodName, "\nArgs:", args, "\nError:", error);
|
|
737
|
-
}
|
|
738
|
-
/**
|
|
739
|
-
* Logs the result of the execution of an asynchronous method.
|
|
740
|
-
* @param {string} className - The name of the class the method belongs to.
|
|
741
|
-
* @param {string} methodName - The name of the method.
|
|
742
|
-
* @param {any[]} args - The arguments passed to the method.
|
|
743
|
-
* @param {any} result - The result of the method execution.
|
|
744
|
-
*/
|
|
745
|
-
function logAsyncMethod(className, methodName, args, result) {
|
|
746
|
-
console.log("%cType: Async Method -", "color: #1565c0; font-weight: bold;", "\nClass:", className, "\nMethod:", methodName, "\nArgs:", args, "\nReturn:", result);
|
|
747
|
-
}
|
|
748
|
-
/**
|
|
749
|
-
* Logs an error that occurred during the execution of an asynchronous method.
|
|
750
|
-
* @param {string} className - The name of the class the method belongs to.
|
|
751
|
-
* @param {string} methodName - The name of the method.
|
|
752
|
-
* @param {any[]} args - The arguments passed to the method.
|
|
753
|
-
* @param {Error} error - The error that occurred.
|
|
754
|
-
*/
|
|
755
|
-
function logAsyncMethodError(className, methodName, args, error) {
|
|
756
|
-
console.log("%cType: Async Method -", "color: #1565c0; font-weight: bold;", "\nClass:", className, "\nMethod:", methodName, "\nArgs:", args, "\nError:", error);
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
var hasKey$2 = function (object, key) {
|
|
662
|
+
var hasKey$1 = function (object, key) {
|
|
760
663
|
return object.hasOwnProperty(key);
|
|
761
664
|
};
|
|
762
665
|
var isEmpty$1 = function (value) {
|
|
@@ -805,7 +708,7 @@
|
|
|
805
708
|
return formsList.length === 1;
|
|
806
709
|
};
|
|
807
710
|
|
|
808
|
-
var hasKey
|
|
711
|
+
var hasKey = function (object, key) {
|
|
809
712
|
return object.hasOwnProperty(key);
|
|
810
713
|
};
|
|
811
714
|
var hasPath = function (object, path) {
|
|
@@ -937,379 +840,6 @@
|
|
|
937
840
|
return value;
|
|
938
841
|
};
|
|
939
842
|
|
|
940
|
-
var Condition$1 = /** @class */ (function () {
|
|
941
|
-
function Condition(condition, rulesMapping) {
|
|
942
|
-
this._condition = condition;
|
|
943
|
-
this._rulesMapping = rulesMapping;
|
|
944
|
-
}
|
|
945
|
-
Condition.prototype.parseKeys = function (condition, rulesEvaluationMapping) {
|
|
946
|
-
Object.keys(rulesEvaluationMapping).forEach(function (key) {
|
|
947
|
-
condition = replaceString(condition, key, rulesEvaluationMapping[key]);
|
|
948
|
-
});
|
|
949
|
-
return condition;
|
|
950
|
-
};
|
|
951
|
-
Condition.prototype.parseOperators = function (condition) {
|
|
952
|
-
return condition.replace(/AND|OR|NOT|XOR|NAND|NOR|XNOR/g, function (match) {
|
|
953
|
-
switch (match) {
|
|
954
|
-
case "AND":
|
|
955
|
-
return "&&";
|
|
956
|
-
case "OR":
|
|
957
|
-
return "||";
|
|
958
|
-
case "NOT":
|
|
959
|
-
return "!";
|
|
960
|
-
case "XOR":
|
|
961
|
-
return "^";
|
|
962
|
-
case "NAND":
|
|
963
|
-
return "!&";
|
|
964
|
-
case "NOR":
|
|
965
|
-
return "!|";
|
|
966
|
-
case "XNOR":
|
|
967
|
-
return "!^";
|
|
968
|
-
default:
|
|
969
|
-
return match;
|
|
970
|
-
}
|
|
971
|
-
});
|
|
972
|
-
};
|
|
973
|
-
Condition.prototype.evaluate = function () {
|
|
974
|
-
this._condition = this.parseKeys(this._condition, this._rulesMapping);
|
|
975
|
-
this._condition = this.parseOperators(this._condition);
|
|
976
|
-
return eval(this._condition);
|
|
977
|
-
};
|
|
978
|
-
return Condition;
|
|
979
|
-
}());
|
|
980
|
-
__decorate([
|
|
981
|
-
log
|
|
982
|
-
], Condition$1.prototype, "evaluate", null);
|
|
983
|
-
|
|
984
|
-
var Actions$1 = /** @class */ (function () {
|
|
985
|
-
function Actions(action, field, ruleMapping, allFormsData, formData, previousFormData, takeAction) {
|
|
986
|
-
this._action = action;
|
|
987
|
-
this._field = field;
|
|
988
|
-
this._ruleMapping = ruleMapping;
|
|
989
|
-
this._allFormsData = allFormsData;
|
|
990
|
-
this._formData = formData;
|
|
991
|
-
this._previousFormData = previousFormData;
|
|
992
|
-
this._takeAction = takeAction;
|
|
993
|
-
}
|
|
994
|
-
Actions.prototype.execute = function () {
|
|
995
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
996
|
-
var condition, actionSuccess;
|
|
997
|
-
return __generator(this, function (_a) {
|
|
998
|
-
condition = new Condition$1(this._action.condition, this._ruleMapping);
|
|
999
|
-
actionSuccess = condition.evaluate();
|
|
1000
|
-
if (actionSuccess) {
|
|
1001
|
-
return [2 /*return*/, this._takeAction(this._action, this._field, this._allFormsData, this._formData, this._previousFormData)];
|
|
1002
|
-
}
|
|
1003
|
-
return [2 /*return*/];
|
|
1004
|
-
});
|
|
1005
|
-
});
|
|
1006
|
-
};
|
|
1007
|
-
return Actions;
|
|
1008
|
-
}());
|
|
1009
|
-
__decorate([
|
|
1010
|
-
log
|
|
1011
|
-
], Actions$1.prototype, "execute", null);
|
|
1012
|
-
|
|
1013
|
-
var ERuleKey;
|
|
1014
|
-
(function (ERuleKey) {
|
|
1015
|
-
ERuleKey["OBJECT_PATH_EXISTS"] = "OBJECT_PATH_EXISTS";
|
|
1016
|
-
ERuleKey["VALUE_CHECK"] = "VALUE_CHECK";
|
|
1017
|
-
ERuleKey["VALUE_CHANGE"] = "VALUE_CHANGE";
|
|
1018
|
-
})(ERuleKey || (ERuleKey = {}));
|
|
1019
|
-
|
|
1020
|
-
var ESourceKey;
|
|
1021
|
-
(function (ESourceKey) {
|
|
1022
|
-
ESourceKey["FIELD_CONFIG"] = "FIELD_CONFIG";
|
|
1023
|
-
ESourceKey["FORM_DATA"] = "FORM_DATA";
|
|
1024
|
-
ESourceKey["PREVIOUS_FORM_DATA"] = "PREVIOUS_FORM_DATA";
|
|
1025
|
-
ESourceKey["ALL_FORMS_DATA"] = "ALL_FORMS_DATA";
|
|
1026
|
-
ESourceKey["BROWSER_STORAGE"] = "BROWSER_STORAGE";
|
|
1027
|
-
ESourceKey["PREDEFINED"] = "PREDEFINED";
|
|
1028
|
-
ESourceKey["USER_CONFIG"] = "USER_CONFIG";
|
|
1029
|
-
ESourceKey["CUSTOM"] = "CUSTOM";
|
|
1030
|
-
})(ESourceKey || (ESourceKey = {}));
|
|
1031
|
-
var EBrowserStorageType;
|
|
1032
|
-
(function (EBrowserStorageType) {
|
|
1033
|
-
EBrowserStorageType["LOCAL_STORAGE"] = "LOCAL_STORAGE";
|
|
1034
|
-
EBrowserStorageType["SESSION_STORAGE"] = "SESSION_STORAGE";
|
|
1035
|
-
})(EBrowserStorageType || (EBrowserStorageType = {}));
|
|
1036
|
-
|
|
1037
|
-
var Sources$1 = /** @class */ (function () {
|
|
1038
|
-
function Sources(field, formData, previousFormData, allFormsData) {
|
|
1039
|
-
this._field = field;
|
|
1040
|
-
this._formData = formData;
|
|
1041
|
-
this._previousFormData = previousFormData;
|
|
1042
|
-
this._allFormsData = allFormsData;
|
|
1043
|
-
}
|
|
1044
|
-
Object.defineProperty(Sources.prototype, "formData", {
|
|
1045
|
-
get: function () {
|
|
1046
|
-
return this._formData;
|
|
1047
|
-
},
|
|
1048
|
-
set: function (value) {
|
|
1049
|
-
this._formData = value;
|
|
1050
|
-
},
|
|
1051
|
-
enumerable: false,
|
|
1052
|
-
configurable: true
|
|
1053
|
-
});
|
|
1054
|
-
Object.defineProperty(Sources.prototype, "previousFormData", {
|
|
1055
|
-
get: function () {
|
|
1056
|
-
return this._previousFormData;
|
|
1057
|
-
},
|
|
1058
|
-
set: function (value) {
|
|
1059
|
-
this._previousFormData = value;
|
|
1060
|
-
},
|
|
1061
|
-
enumerable: false,
|
|
1062
|
-
configurable: true
|
|
1063
|
-
});
|
|
1064
|
-
Object.defineProperty(Sources.prototype, "allFormsData", {
|
|
1065
|
-
get: function () {
|
|
1066
|
-
return this._allFormsData;
|
|
1067
|
-
},
|
|
1068
|
-
set: function (value) {
|
|
1069
|
-
this._allFormsData = value;
|
|
1070
|
-
},
|
|
1071
|
-
enumerable: false,
|
|
1072
|
-
configurable: true
|
|
1073
|
-
});
|
|
1074
|
-
Object.defineProperty(Sources.prototype, "field", {
|
|
1075
|
-
get: function () {
|
|
1076
|
-
return this._field;
|
|
1077
|
-
},
|
|
1078
|
-
set: function (value) {
|
|
1079
|
-
this._field = value;
|
|
1080
|
-
},
|
|
1081
|
-
enumerable: false,
|
|
1082
|
-
configurable: true
|
|
1083
|
-
});
|
|
1084
|
-
Sources.prototype.getValueFromFieldConfig = function (path) {
|
|
1085
|
-
var value = "";
|
|
1086
|
-
if (isNotEmpty(path)) {
|
|
1087
|
-
value = jpQueryWrapper(this._field, path);
|
|
1088
|
-
}
|
|
1089
|
-
else {
|
|
1090
|
-
value = setEmptyValue(this._field);
|
|
1091
|
-
}
|
|
1092
|
-
return value;
|
|
1093
|
-
};
|
|
1094
|
-
Sources.prototype.getValueFromFormData = function (path) {
|
|
1095
|
-
var value;
|
|
1096
|
-
value = jpQueryWrapper(this._formData, path);
|
|
1097
|
-
return value;
|
|
1098
|
-
};
|
|
1099
|
-
Sources.prototype.getValueFromPreviousFormData = function (path) {
|
|
1100
|
-
var value;
|
|
1101
|
-
value = jpQueryWrapper(this._previousFormData, path);
|
|
1102
|
-
return value;
|
|
1103
|
-
};
|
|
1104
|
-
Sources.prototype.getValueFromAllFormsData = function (path) {
|
|
1105
|
-
var value;
|
|
1106
|
-
value = jpQueryWrapper(this._allFormsData, path);
|
|
1107
|
-
return value;
|
|
1108
|
-
};
|
|
1109
|
-
Sources.prototype.getValueFromBrowserStorage = function (type, key) {
|
|
1110
|
-
var value = "";
|
|
1111
|
-
switch (type) {
|
|
1112
|
-
case EBrowserStorageType.LOCAL_STORAGE:
|
|
1113
|
-
value = isNotEmptyBrowserStorageValue(localStorage.getItem(key))
|
|
1114
|
-
? localStorage.getItem(key)
|
|
1115
|
-
: "";
|
|
1116
|
-
break;
|
|
1117
|
-
case EBrowserStorageType.SESSION_STORAGE:
|
|
1118
|
-
value = isNotEmptyBrowserStorageValue(sessionStorage.getItem(key))
|
|
1119
|
-
? sessionStorage.getItem(key)
|
|
1120
|
-
: "";
|
|
1121
|
-
break;
|
|
1122
|
-
default:
|
|
1123
|
-
value = "";
|
|
1124
|
-
break;
|
|
1125
|
-
}
|
|
1126
|
-
return value;
|
|
1127
|
-
};
|
|
1128
|
-
Sources.prototype.getValueFromSource = function (source) {
|
|
1129
|
-
var value = "";
|
|
1130
|
-
switch (source.key) {
|
|
1131
|
-
case ESourceKey.FIELD_CONFIG:
|
|
1132
|
-
value = this.getValueFromFieldConfig(source.props.path);
|
|
1133
|
-
break;
|
|
1134
|
-
case ESourceKey.FORM_DATA:
|
|
1135
|
-
value = this.getValueFromFormData(source.props.path);
|
|
1136
|
-
break;
|
|
1137
|
-
case ESourceKey.ALL_FORMS_DATA:
|
|
1138
|
-
value = this.getValueFromAllFormsData(source.props.path);
|
|
1139
|
-
break;
|
|
1140
|
-
case ESourceKey.PREVIOUS_FORM_DATA:
|
|
1141
|
-
value = this.getValueFromPreviousFormData(source.props.path);
|
|
1142
|
-
break;
|
|
1143
|
-
case ESourceKey.BROWSER_STORAGE:
|
|
1144
|
-
value = this.getValueFromBrowserStorage(source.props.browserStorage.type, source.props.browserStorage.key);
|
|
1145
|
-
break;
|
|
1146
|
-
case ESourceKey.PREDEFINED:
|
|
1147
|
-
value = source.value;
|
|
1148
|
-
break;
|
|
1149
|
-
default:
|
|
1150
|
-
value = "";
|
|
1151
|
-
break;
|
|
1152
|
-
}
|
|
1153
|
-
return value;
|
|
1154
|
-
};
|
|
1155
|
-
Sources.prototype.setValueToFieldConfig = function (path, value) {
|
|
1156
|
-
this._field = setValueToObject(this._field, path, value);
|
|
1157
|
-
};
|
|
1158
|
-
Sources.prototype.setValueToFormData = function (path, value) {
|
|
1159
|
-
this._formData = setValueToObject(this._formData, path, value);
|
|
1160
|
-
};
|
|
1161
|
-
Sources.prototype.setValueToAllFormsData = function (path, value) {
|
|
1162
|
-
this._allFormsData = setValueToObject(this._allFormsData, path, value);
|
|
1163
|
-
};
|
|
1164
|
-
Sources.prototype.setValueToPreviousFromData = function (path, value) {
|
|
1165
|
-
this._previousFormData = setValueToObject(this._previousFormData, path, value);
|
|
1166
|
-
};
|
|
1167
|
-
Sources.prototype.setValueToBrowserStorage = function (type, key, value) {
|
|
1168
|
-
switch (type) {
|
|
1169
|
-
case EBrowserStorageType.LOCAL_STORAGE:
|
|
1170
|
-
localStorage.setItem(key, value);
|
|
1171
|
-
break;
|
|
1172
|
-
case EBrowserStorageType.SESSION_STORAGE:
|
|
1173
|
-
sessionStorage.setItem(key, value);
|
|
1174
|
-
break;
|
|
1175
|
-
default:
|
|
1176
|
-
break;
|
|
1177
|
-
}
|
|
1178
|
-
};
|
|
1179
|
-
Sources.prototype.setValueToSource = function (source, value) {
|
|
1180
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1181
|
-
var _a;
|
|
1182
|
-
return __generator(this, function (_b) {
|
|
1183
|
-
switch (_b.label) {
|
|
1184
|
-
case 0:
|
|
1185
|
-
_a = source.key;
|
|
1186
|
-
switch (_a) {
|
|
1187
|
-
case ESourceKey.FIELD_CONFIG: return [3 /*break*/, 1];
|
|
1188
|
-
case ESourceKey.FORM_DATA: return [3 /*break*/, 2];
|
|
1189
|
-
case ESourceKey.ALL_FORMS_DATA: return [3 /*break*/, 3];
|
|
1190
|
-
case ESourceKey.PREVIOUS_FORM_DATA: return [3 /*break*/, 4];
|
|
1191
|
-
case ESourceKey.BROWSER_STORAGE: return [3 /*break*/, 5];
|
|
1192
|
-
}
|
|
1193
|
-
return [3 /*break*/, 7];
|
|
1194
|
-
case 1:
|
|
1195
|
-
this._field = this.setValueToFieldConfig(source.props.path, value);
|
|
1196
|
-
return [3 /*break*/, 8];
|
|
1197
|
-
case 2:
|
|
1198
|
-
this._formData = this.setValueToFormData(source.props.path, value);
|
|
1199
|
-
return [3 /*break*/, 8];
|
|
1200
|
-
case 3:
|
|
1201
|
-
this._allFormsData = this.setValueToAllFormsData(source.props.path, value);
|
|
1202
|
-
return [3 /*break*/, 8];
|
|
1203
|
-
case 4:
|
|
1204
|
-
this._previousFormData = this.setValueToPreviousFromData(source.props.path, value);
|
|
1205
|
-
return [3 /*break*/, 8];
|
|
1206
|
-
case 5: return [4 /*yield*/, this.setValueToBrowserStorage(source.props.browserStorage.type, source.props.browserStorage.key, value)];
|
|
1207
|
-
case 6:
|
|
1208
|
-
_b.sent();
|
|
1209
|
-
return [3 /*break*/, 8];
|
|
1210
|
-
case 7: return [3 /*break*/, 8];
|
|
1211
|
-
case 8: return [2 /*return*/];
|
|
1212
|
-
}
|
|
1213
|
-
});
|
|
1214
|
-
});
|
|
1215
|
-
};
|
|
1216
|
-
return Sources;
|
|
1217
|
-
}());
|
|
1218
|
-
__decorate([
|
|
1219
|
-
log
|
|
1220
|
-
], Sources$1.prototype, "getValueFromSource", null);
|
|
1221
|
-
__decorate([
|
|
1222
|
-
log
|
|
1223
|
-
], Sources$1.prototype, "setValueToSource", null);
|
|
1224
|
-
|
|
1225
|
-
var Rules$1 = /** @class */ (function () {
|
|
1226
|
-
function Rules(rules, field, formData, previousFormData, allFormsData) {
|
|
1227
|
-
this._field = field;
|
|
1228
|
-
this._formData = formData;
|
|
1229
|
-
this._previousFormData = previousFormData;
|
|
1230
|
-
this._allFormsData = allFormsData;
|
|
1231
|
-
this._rules = rules;
|
|
1232
|
-
}
|
|
1233
|
-
Rules.prototype.evaluate = function (rule) {
|
|
1234
|
-
var ruleType = rule.key;
|
|
1235
|
-
var ruleEvaluationStatus = false;
|
|
1236
|
-
var source = new Sources$1(this._field, this._formData, this._previousFormData, this._allFormsData);
|
|
1237
|
-
switch (ruleType) {
|
|
1238
|
-
case ERuleKey.OBJECT_PATH_EXISTS:
|
|
1239
|
-
var ruleObjectPathExists = rule;
|
|
1240
|
-
var ruleObjectPathExistsObject = ruleObjectPathExists.props.object;
|
|
1241
|
-
var ruleObjectPathExistsPath = ruleObjectPathExists.props.path;
|
|
1242
|
-
switch (ruleObjectPathExistsObject) {
|
|
1243
|
-
case ESourceKey.ALL_FORMS_DATA:
|
|
1244
|
-
ruleEvaluationStatus = hasPath(this._allFormsData, ruleObjectPathExistsPath);
|
|
1245
|
-
break;
|
|
1246
|
-
case ESourceKey.FORM_DATA:
|
|
1247
|
-
ruleEvaluationStatus = hasPath(this._formData, ruleObjectPathExistsPath);
|
|
1248
|
-
break;
|
|
1249
|
-
case ESourceKey.PREVIOUS_FORM_DATA:
|
|
1250
|
-
ruleEvaluationStatus = hasPath(this._previousFormData, ruleObjectPathExistsPath);
|
|
1251
|
-
break;
|
|
1252
|
-
case ESourceKey.FIELD_CONFIG:
|
|
1253
|
-
ruleEvaluationStatus = hasPath(this._field, ruleObjectPathExistsPath);
|
|
1254
|
-
break;
|
|
1255
|
-
default:
|
|
1256
|
-
ruleEvaluationStatus = false;
|
|
1257
|
-
break;
|
|
1258
|
-
}
|
|
1259
|
-
break;
|
|
1260
|
-
case ERuleKey.VALUE_CHECK:
|
|
1261
|
-
var ruleValueCheck = rule;
|
|
1262
|
-
var ruleValueCheckSource = ruleValueCheck.props.value.source;
|
|
1263
|
-
var ruleValueCheckValue = source.getValueFromSource(ruleValueCheckSource);
|
|
1264
|
-
if (ruleValueCheck.props.pattern.key === EPatternKey.CUSTOM) {
|
|
1265
|
-
var re = new RegExp(ruleValueCheck.props.pattern.pattern);
|
|
1266
|
-
}
|
|
1267
|
-
else {
|
|
1268
|
-
var re = new RegExp(EPattern[ruleValueCheck.props.pattern.key]);
|
|
1269
|
-
}
|
|
1270
|
-
ruleEvaluationStatus = re.test(ruleValueCheckValue);
|
|
1271
|
-
break;
|
|
1272
|
-
case ERuleKey.VALUE_CHANGE:
|
|
1273
|
-
var ruleValueChange = rule;
|
|
1274
|
-
var ruleValueChangeCurrentSource = ruleValueChange.props.value.current.source;
|
|
1275
|
-
var ruleValueChangePreviousSource = ruleValueChange.props.value.previous.source;
|
|
1276
|
-
var previousValue = source.getValueFromSource(ruleValueChangePreviousSource);
|
|
1277
|
-
var currentValue = source.getValueFromSource(ruleValueChangeCurrentSource);
|
|
1278
|
-
ruleEvaluationStatus = previousValue === currentValue;
|
|
1279
|
-
break;
|
|
1280
|
-
default:
|
|
1281
|
-
break;
|
|
1282
|
-
}
|
|
1283
|
-
return ruleEvaluationStatus;
|
|
1284
|
-
};
|
|
1285
|
-
Rules.prototype.mapping = function () {
|
|
1286
|
-
var e_1, _a, _b;
|
|
1287
|
-
var rulesEvaluationMapping = {};
|
|
1288
|
-
try {
|
|
1289
|
-
for (var _c = __values(this._rules), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
1290
|
-
var rule = _d.value;
|
|
1291
|
-
var ruleEvaluationStatus = this.evaluate(rule);
|
|
1292
|
-
rulesEvaluationMapping = Object.assign(Object.assign({}, rulesEvaluationMapping), (_b = {}, _b[rule.id] = ruleEvaluationStatus, _b));
|
|
1293
|
-
}
|
|
1294
|
-
}
|
|
1295
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1296
|
-
finally {
|
|
1297
|
-
try {
|
|
1298
|
-
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
1299
|
-
}
|
|
1300
|
-
finally { if (e_1) throw e_1.error; }
|
|
1301
|
-
}
|
|
1302
|
-
return rulesEvaluationMapping;
|
|
1303
|
-
};
|
|
1304
|
-
return Rules;
|
|
1305
|
-
}());
|
|
1306
|
-
__decorate([
|
|
1307
|
-
log
|
|
1308
|
-
], Rules$1.prototype, "evaluate", null);
|
|
1309
|
-
__decorate([
|
|
1310
|
-
log
|
|
1311
|
-
], Rules$1.prototype, "mapping", null);
|
|
1312
|
-
|
|
1313
843
|
var Defaults = /** @class */ (function () {
|
|
1314
844
|
function Defaults(field, allFormsData, formData, previousFormData, takeAction) {
|
|
1315
845
|
this._field = field;
|
|
@@ -1335,7 +865,12 @@
|
|
|
1335
865
|
case 2:
|
|
1336
866
|
if (!!sources_1_1.done) return [3 /*break*/, 12];
|
|
1337
867
|
source = sources_1_1.value;
|
|
1338
|
-
sources_2 = new Sources
|
|
868
|
+
sources_2 = new kwikidToolkit.Sources({
|
|
869
|
+
FIELD_CONFIG: this._field,
|
|
870
|
+
FORM_DATA: this._formData,
|
|
871
|
+
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
872
|
+
ALL_FORMS_DATA: this._allFormsData
|
|
873
|
+
});
|
|
1339
874
|
value = sources_2.getValueFromSource(source);
|
|
1340
875
|
// Set the Value of current source.
|
|
1341
876
|
this._field = setValueToObject(this._field, "default.value.sources.[" + sourceIndex + "].value", value);
|
|
@@ -1343,7 +878,12 @@
|
|
|
1343
878
|
triggers = validation.triggers;
|
|
1344
879
|
rules = validation.rules;
|
|
1345
880
|
actions = validation.actions;
|
|
1346
|
-
rulesMapping = new Rules
|
|
881
|
+
rulesMapping = new kwikidToolkit.Rules(rules, {
|
|
882
|
+
FIELD_CONFIG: this._field,
|
|
883
|
+
FORM_DATA: this._formData,
|
|
884
|
+
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
885
|
+
ALL_FORMS_DATA: this._allFormsData
|
|
886
|
+
}).mapping();
|
|
1347
887
|
_c.label = 3;
|
|
1348
888
|
case 3:
|
|
1349
889
|
_c.trys.push([3, 8, 9, 10]);
|
|
@@ -1352,9 +892,14 @@
|
|
|
1352
892
|
case 4:
|
|
1353
893
|
if (!!actions_1_1.done) return [3 /*break*/, 7];
|
|
1354
894
|
action = actions_1_1.value;
|
|
1355
|
-
conditionEvaluation = new Condition
|
|
895
|
+
conditionEvaluation = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
1356
896
|
if (!conditionEvaluation) return [3 /*break*/, 6];
|
|
1357
|
-
actions_2 = new Actions
|
|
897
|
+
actions_2 = new kwikidToolkit.Actions(action, rulesMapping, {
|
|
898
|
+
FIELD_CONFIG: this._field,
|
|
899
|
+
FORM_DATA: this._formData,
|
|
900
|
+
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
901
|
+
ALL_FORMS_DATA: this._allFormsData
|
|
902
|
+
}, this._takeAction);
|
|
1358
903
|
return [4 /*yield*/, actions_2.execute()];
|
|
1359
904
|
case 5:
|
|
1360
905
|
_c.sent();
|
|
@@ -1403,7 +948,7 @@
|
|
|
1403
948
|
return Defaults;
|
|
1404
949
|
}());
|
|
1405
950
|
__decorate([
|
|
1406
|
-
|
|
951
|
+
kwikidToolkit.logMethod
|
|
1407
952
|
], Defaults.prototype, "getDefaultValue", null);
|
|
1408
953
|
|
|
1409
954
|
var findFieldFromKey = function (fields, key) {
|
|
@@ -1451,7 +996,7 @@
|
|
|
1451
996
|
var getSearchTextOptionsFromFieldConfig = function (field, childField, formGroup) {
|
|
1452
997
|
var options;
|
|
1453
998
|
var fieldValue = formGroup.controls[field.key].value;
|
|
1454
|
-
if (
|
|
999
|
+
if (kwikidToolkit.isNotEmptyValue(childField["json"])) {
|
|
1455
1000
|
options = childField["json"][fieldValue];
|
|
1456
1001
|
}
|
|
1457
1002
|
return options;
|
|
@@ -1483,7 +1028,7 @@
|
|
|
1483
1028
|
});
|
|
1484
1029
|
};
|
|
1485
1030
|
field["messages"] = [];
|
|
1486
|
-
if (
|
|
1031
|
+
if (kwikidToolkit.checkObjectKeyExists(field, "messages")) {
|
|
1487
1032
|
if (!isDuplicateMessage(field["messages"], message)) {
|
|
1488
1033
|
field["messages"].push({
|
|
1489
1034
|
type: message.type,
|
|
@@ -1577,7 +1122,7 @@
|
|
|
1577
1122
|
};
|
|
1578
1123
|
var convertValueFromKwikUIFormatToBasicFormat = function (field, value) {
|
|
1579
1124
|
var convertedValue = value;
|
|
1580
|
-
if (
|
|
1125
|
+
if (kwikidToolkit.isNotEmptyValue(value)) {
|
|
1581
1126
|
switch (field.type) {
|
|
1582
1127
|
case EFieldType.DATE:
|
|
1583
1128
|
convertedValue = convertTuiDayFormatToDateString(value);
|
|
@@ -1592,10 +1137,10 @@
|
|
|
1592
1137
|
};
|
|
1593
1138
|
var convertValueFromBasicFormatToKwikUIFormat = function (field, value) {
|
|
1594
1139
|
var convertedValue = value;
|
|
1595
|
-
if (
|
|
1140
|
+
if (kwikidToolkit.isNotEmptyValue(value)) {
|
|
1596
1141
|
switch (field.type) {
|
|
1597
1142
|
case EFieldType.RADIO:
|
|
1598
|
-
if (!
|
|
1143
|
+
if (!kwikidToolkit.checkObjectKeyExists(value, "label")) {
|
|
1599
1144
|
var convertedLabelValue = {
|
|
1600
1145
|
label: value,
|
|
1601
1146
|
disabled: false
|
|
@@ -1615,7 +1160,7 @@
|
|
|
1615
1160
|
return convertedValue;
|
|
1616
1161
|
};
|
|
1617
1162
|
|
|
1618
|
-
var Validations
|
|
1163
|
+
var Validations = /** @class */ (function () {
|
|
1619
1164
|
function Validations(field, formData, previousFormData, allFormsData, takeAction) {
|
|
1620
1165
|
this._field = field;
|
|
1621
1166
|
this._formData = formData;
|
|
@@ -1665,36 +1210,36 @@
|
|
|
1665
1210
|
});
|
|
1666
1211
|
Validations.prototype.getFieldValidators = function (field) {
|
|
1667
1212
|
var validators = [];
|
|
1668
|
-
if (
|
|
1669
|
-
|
|
1670
|
-
|
|
1213
|
+
if (kwikidToolkit.checkObjectKeyExists(field, "validators") &&
|
|
1214
|
+
kwikidToolkit.checkObjectKeyExists(field.validators, "min") &&
|
|
1215
|
+
kwikidToolkit.isNotEmptyValue(field.validators.min)) {
|
|
1671
1216
|
validators.push(i6.Validators.min(field.validators.min));
|
|
1672
1217
|
}
|
|
1673
|
-
if (
|
|
1674
|
-
|
|
1675
|
-
|
|
1218
|
+
if (kwikidToolkit.checkObjectKeyExists(field, "validators") &&
|
|
1219
|
+
kwikidToolkit.checkObjectKeyExists(field.validators, "max") &&
|
|
1220
|
+
kwikidToolkit.isNotEmptyValue(field.validators.max)) {
|
|
1676
1221
|
validators.push(i6.Validators.max(field.validators.max));
|
|
1677
1222
|
}
|
|
1678
|
-
if ((
|
|
1679
|
-
(
|
|
1680
|
-
|
|
1223
|
+
if ((kwikidToolkit.checkObjectKeyExists(field, "required") && field.required) ||
|
|
1224
|
+
(kwikidToolkit.checkObjectKeyExists(field, "validators") &&
|
|
1225
|
+
kwikidToolkit.checkObjectKeyExists(field.validators, "required") &&
|
|
1681
1226
|
field.validators.required)) {
|
|
1682
1227
|
validators.push(i6.Validators.required);
|
|
1683
1228
|
}
|
|
1684
|
-
if (
|
|
1685
|
-
|
|
1686
|
-
|
|
1229
|
+
if (kwikidToolkit.checkObjectKeyExists(field, "validators") &&
|
|
1230
|
+
kwikidToolkit.checkObjectKeyExists(field.validators, "minLength") &&
|
|
1231
|
+
kwikidToolkit.isNotEmptyValue(field.validators.minLength)) {
|
|
1687
1232
|
validators.push(i6.Validators.minLength(field.validators.minLength));
|
|
1688
1233
|
}
|
|
1689
|
-
if (
|
|
1690
|
-
|
|
1691
|
-
|
|
1234
|
+
if (kwikidToolkit.checkObjectKeyExists(field, "validators") &&
|
|
1235
|
+
kwikidToolkit.checkObjectKeyExists(field.validators, "maxLength") &&
|
|
1236
|
+
kwikidToolkit.isNotEmptyValue(field.validators.maxLength)) {
|
|
1692
1237
|
validators.push(i6.Validators.maxLength(field.validators.maxLength));
|
|
1693
1238
|
}
|
|
1694
|
-
if (
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
if (
|
|
1239
|
+
if (kwikidToolkit.checkObjectKeyExists(field, "validators") &&
|
|
1240
|
+
kwikidToolkit.checkObjectKeyExists(field.validators, "pattern") &&
|
|
1241
|
+
kwikidToolkit.isNotEmptyValue(field.validators.pattern)) {
|
|
1242
|
+
if (kwikidToolkit.checkObjectKeyExists(field.validators.pattern, "key")) {
|
|
1698
1243
|
if (field.validators.pattern.key === EPatternKey.CUSTOM) {
|
|
1699
1244
|
validators.push(i6.Validators.pattern(field.validators.pattern.pattern));
|
|
1700
1245
|
}
|
|
@@ -1762,7 +1307,12 @@
|
|
|
1762
1307
|
triggers = validations.triggers;
|
|
1763
1308
|
rules = validations.rules;
|
|
1764
1309
|
actions = validations.actions;
|
|
1765
|
-
rulesMapping = new Rules
|
|
1310
|
+
rulesMapping = new kwikidToolkit.Rules(rules, {
|
|
1311
|
+
FIELD_CONFIG: this._field,
|
|
1312
|
+
FORM_DATA: this._formData,
|
|
1313
|
+
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
1314
|
+
ALL_FORMS_DATA: this._allFormsData
|
|
1315
|
+
}).mapping();
|
|
1766
1316
|
_b.label = 1;
|
|
1767
1317
|
case 1:
|
|
1768
1318
|
_b.trys.push([1, 6, 7, 8]);
|
|
@@ -1771,9 +1321,14 @@
|
|
|
1771
1321
|
case 2:
|
|
1772
1322
|
if (!!actions_1_1.done) return [3 /*break*/, 5];
|
|
1773
1323
|
action = actions_1_1.value;
|
|
1774
|
-
conditionEvaluation = new Condition
|
|
1324
|
+
conditionEvaluation = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
1775
1325
|
if (!conditionEvaluation) return [3 /*break*/, 4];
|
|
1776
|
-
actions_2 = new Actions
|
|
1326
|
+
actions_2 = new kwikidToolkit.Actions(action, rulesMapping, {
|
|
1327
|
+
FIELD_CONFIG: this._field,
|
|
1328
|
+
FORM_DATA: this._formData,
|
|
1329
|
+
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
1330
|
+
ALL_FORMS_DATA: this._allFormsData
|
|
1331
|
+
}, this._takeAction);
|
|
1777
1332
|
return [4 /*yield*/, actions_2.execute()];
|
|
1778
1333
|
case 3:
|
|
1779
1334
|
_b.sent();
|
|
@@ -1800,17 +1355,17 @@
|
|
|
1800
1355
|
return Validations;
|
|
1801
1356
|
}());
|
|
1802
1357
|
__decorate([
|
|
1803
|
-
|
|
1804
|
-
], Validations
|
|
1358
|
+
kwikidToolkit.logMethod
|
|
1359
|
+
], Validations.prototype, "getFieldValidators", null);
|
|
1805
1360
|
__decorate([
|
|
1806
|
-
|
|
1807
|
-
], Validations
|
|
1361
|
+
kwikidToolkit.logMethod
|
|
1362
|
+
], Validations.prototype, "getFormValidationErrors", null);
|
|
1808
1363
|
__decorate([
|
|
1809
|
-
|
|
1810
|
-
], Validations
|
|
1364
|
+
kwikidToolkit.logMethod
|
|
1365
|
+
], Validations.prototype, "findInvalidControlsRecursive", null);
|
|
1811
1366
|
__decorate([
|
|
1812
|
-
|
|
1813
|
-
], Validations
|
|
1367
|
+
kwikidToolkit.logMethod
|
|
1368
|
+
], Validations.prototype, "validateField", null);
|
|
1814
1369
|
|
|
1815
1370
|
var KwikIDFormViewService = /** @class */ (function () {
|
|
1816
1371
|
function KwikIDFormViewService() {
|
|
@@ -1838,7 +1393,7 @@
|
|
|
1838
1393
|
case 3:
|
|
1839
1394
|
value = _b.sent();
|
|
1840
1395
|
value = convertValueFromBasicFormatToKwikUIFormat(field, value);
|
|
1841
|
-
validators = new Validations
|
|
1396
|
+
validators = new Validations(field, formData, previousFormData, allFormsData, takeAction).getFieldValidators(field);
|
|
1842
1397
|
formGroup.addControl(field.key, new i6.FormControl({ value: value, disabled: field.disabled }, { validators: validators }));
|
|
1843
1398
|
_b.label = 4;
|
|
1844
1399
|
case 4:
|
|
@@ -1863,7 +1418,7 @@
|
|
|
1863
1418
|
return KwikIDFormViewService;
|
|
1864
1419
|
}());
|
|
1865
1420
|
__decorate([
|
|
1866
|
-
|
|
1421
|
+
kwikidToolkit.logMethod
|
|
1867
1422
|
], KwikIDFormViewService.prototype, "createFormGroup", null);
|
|
1868
1423
|
|
|
1869
1424
|
var Apis = /** @class */ (function () {
|
|
@@ -1879,102 +1434,117 @@
|
|
|
1879
1434
|
this._status = field.api.status;
|
|
1880
1435
|
}
|
|
1881
1436
|
Apis.prototype.setRequestBodyParams = function () {
|
|
1882
|
-
var _a, _b, _c;
|
|
1437
|
+
var _a, _b, _c, _d;
|
|
1883
1438
|
return __awaiter(this, void 0, void 0, function () {
|
|
1884
1439
|
var params, paramIndex, params_1, params_1_1, param, sources, sourceIndex, sources_1, sources_1_1, source, sources_2, value, validation, triggers, rules, actions, rulesMapping, actions_1, actions_1_1, action, conditionEvaluation, actions_2, e_1_1, e_2_1, e_3_1;
|
|
1885
|
-
var e_3,
|
|
1886
|
-
return __generator(this, function (
|
|
1887
|
-
switch (
|
|
1440
|
+
var e_3, _e, e_2, _f, e_1, _g;
|
|
1441
|
+
return __generator(this, function (_h) {
|
|
1442
|
+
switch (_h.label) {
|
|
1888
1443
|
case 0:
|
|
1889
1444
|
params = this._request.body.params;
|
|
1890
1445
|
paramIndex = 0;
|
|
1891
|
-
|
|
1446
|
+
_h.label = 1;
|
|
1892
1447
|
case 1:
|
|
1893
|
-
|
|
1448
|
+
_h.trys.push([1, 20, 21, 22]);
|
|
1894
1449
|
params_1 = __values(params), params_1_1 = params_1.next();
|
|
1895
|
-
|
|
1450
|
+
_h.label = 2;
|
|
1896
1451
|
case 2:
|
|
1897
1452
|
if (!!params_1_1.done) return [3 /*break*/, 19];
|
|
1898
1453
|
param = params_1_1.value;
|
|
1899
1454
|
sources = param.sources;
|
|
1900
1455
|
sourceIndex = 0;
|
|
1901
|
-
|
|
1456
|
+
_h.label = 3;
|
|
1902
1457
|
case 3:
|
|
1903
|
-
|
|
1458
|
+
_h.trys.push([3, 15, 16, 17]);
|
|
1904
1459
|
sources_1 = (e_2 = void 0, __values(sources)), sources_1_1 = sources_1.next();
|
|
1905
|
-
|
|
1460
|
+
_h.label = 4;
|
|
1906
1461
|
case 4:
|
|
1907
1462
|
if (!!sources_1_1.done) return [3 /*break*/, 14];
|
|
1908
1463
|
source = sources_1_1.value;
|
|
1909
|
-
sources_2 = new Sources
|
|
1464
|
+
sources_2 = new kwikidToolkit.Sources({
|
|
1465
|
+
FIELD_CONFIG: this._field,
|
|
1466
|
+
FORM_DATA: this._formData,
|
|
1467
|
+
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
1468
|
+
ALL_FORMS_DATA: this._allFormsData
|
|
1469
|
+
});
|
|
1910
1470
|
value = sources_2.getValueFromSource(source);
|
|
1911
1471
|
// Set the Value of current source.
|
|
1912
1472
|
this._field = setValueToObject(this._field, "api.request.body.params[" + paramIndex + "].sources[" + sourceIndex + "].value", value);
|
|
1913
1473
|
validation = source.validation;
|
|
1914
1474
|
triggers = (_a = validation === null || validation === void 0 ? void 0 : validation.triggers) !== null && _a !== void 0 ? _a : [];
|
|
1915
1475
|
rules = (_b = validation === null || validation === void 0 ? void 0 : validation.rules) !== null && _b !== void 0 ? _b : [];
|
|
1916
|
-
actions = (_c = validation === null ||
|
|
1917
|
-
rulesMapping = new Rules
|
|
1918
|
-
|
|
1476
|
+
actions = (_d = (_c = validation) === null || _c === void 0 ? void 0 : _c.actions) !== null && _d !== void 0 ? _d : [];
|
|
1477
|
+
rulesMapping = new kwikidToolkit.Rules(rules, {
|
|
1478
|
+
FIELD_CONFIG: this._field,
|
|
1479
|
+
FORM_DATA: this._formData,
|
|
1480
|
+
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
1481
|
+
ALL_FORMS_DATA: this._allFormsData
|
|
1482
|
+
}).mapping();
|
|
1483
|
+
_h.label = 5;
|
|
1919
1484
|
case 5:
|
|
1920
|
-
|
|
1485
|
+
_h.trys.push([5, 10, 11, 12]);
|
|
1921
1486
|
actions_1 = (e_1 = void 0, __values(actions)), actions_1_1 = actions_1.next();
|
|
1922
|
-
|
|
1487
|
+
_h.label = 6;
|
|
1923
1488
|
case 6:
|
|
1924
1489
|
if (!!actions_1_1.done) return [3 /*break*/, 9];
|
|
1925
1490
|
action = actions_1_1.value;
|
|
1926
|
-
conditionEvaluation = new Condition
|
|
1491
|
+
conditionEvaluation = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
1927
1492
|
if (!conditionEvaluation) return [3 /*break*/, 8];
|
|
1928
|
-
actions_2 = new Actions
|
|
1493
|
+
actions_2 = new kwikidToolkit.Actions(action, rulesMapping, {
|
|
1494
|
+
FIELD_CONFIG: this._field,
|
|
1495
|
+
FORM_DATA: this._formData,
|
|
1496
|
+
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
1497
|
+
ALL_FORMS_DATA: this._allFormsData
|
|
1498
|
+
}, this._takeAction);
|
|
1929
1499
|
return [4 /*yield*/, actions_2.execute()];
|
|
1930
1500
|
case 7:
|
|
1931
|
-
|
|
1932
|
-
|
|
1501
|
+
_h.sent();
|
|
1502
|
+
_h.label = 8;
|
|
1933
1503
|
case 8:
|
|
1934
1504
|
actions_1_1 = actions_1.next();
|
|
1935
1505
|
return [3 /*break*/, 6];
|
|
1936
1506
|
case 9: return [3 /*break*/, 12];
|
|
1937
1507
|
case 10:
|
|
1938
|
-
e_1_1 =
|
|
1508
|
+
e_1_1 = _h.sent();
|
|
1939
1509
|
e_1 = { error: e_1_1 };
|
|
1940
1510
|
return [3 /*break*/, 12];
|
|
1941
1511
|
case 11:
|
|
1942
1512
|
try {
|
|
1943
|
-
if (actions_1_1 && !actions_1_1.done && (
|
|
1513
|
+
if (actions_1_1 && !actions_1_1.done && (_g = actions_1.return)) _g.call(actions_1);
|
|
1944
1514
|
}
|
|
1945
1515
|
finally { if (e_1) throw e_1.error; }
|
|
1946
1516
|
return [7 /*endfinally*/];
|
|
1947
1517
|
case 12:
|
|
1948
1518
|
sourceIndex++;
|
|
1949
|
-
|
|
1519
|
+
_h.label = 13;
|
|
1950
1520
|
case 13:
|
|
1951
1521
|
sources_1_1 = sources_1.next();
|
|
1952
1522
|
return [3 /*break*/, 4];
|
|
1953
1523
|
case 14: return [3 /*break*/, 17];
|
|
1954
1524
|
case 15:
|
|
1955
|
-
e_2_1 =
|
|
1525
|
+
e_2_1 = _h.sent();
|
|
1956
1526
|
e_2 = { error: e_2_1 };
|
|
1957
1527
|
return [3 /*break*/, 17];
|
|
1958
1528
|
case 16:
|
|
1959
1529
|
try {
|
|
1960
|
-
if (sources_1_1 && !sources_1_1.done && (
|
|
1530
|
+
if (sources_1_1 && !sources_1_1.done && (_f = sources_1.return)) _f.call(sources_1);
|
|
1961
1531
|
}
|
|
1962
1532
|
finally { if (e_2) throw e_2.error; }
|
|
1963
1533
|
return [7 /*endfinally*/];
|
|
1964
1534
|
case 17:
|
|
1965
1535
|
paramIndex++;
|
|
1966
|
-
|
|
1536
|
+
_h.label = 18;
|
|
1967
1537
|
case 18:
|
|
1968
1538
|
params_1_1 = params_1.next();
|
|
1969
1539
|
return [3 /*break*/, 2];
|
|
1970
1540
|
case 19: return [3 /*break*/, 22];
|
|
1971
1541
|
case 20:
|
|
1972
|
-
e_3_1 =
|
|
1542
|
+
e_3_1 = _h.sent();
|
|
1973
1543
|
e_3 = { error: e_3_1 };
|
|
1974
1544
|
return [3 /*break*/, 22];
|
|
1975
1545
|
case 21:
|
|
1976
1546
|
try {
|
|
1977
|
-
if (params_1_1 && !params_1_1.done && (
|
|
1547
|
+
if (params_1_1 && !params_1_1.done && (_e = params_1.return)) _e.call(params_1);
|
|
1978
1548
|
}
|
|
1979
1549
|
finally { if (e_3) throw e_3.error; }
|
|
1980
1550
|
return [7 /*endfinally*/];
|
|
@@ -1984,44 +1554,55 @@
|
|
|
1984
1554
|
});
|
|
1985
1555
|
};
|
|
1986
1556
|
Apis.prototype.validateRequestBody = function () {
|
|
1557
|
+
var _a;
|
|
1987
1558
|
return __awaiter(this, void 0, void 0, function () {
|
|
1988
1559
|
var body, validation, triggers, rules, actions, rulesMapping, actions_3, actions_3_1, action, conditionSuccess, actions_4, e_4_1;
|
|
1989
|
-
var e_4,
|
|
1990
|
-
return __generator(this, function (
|
|
1991
|
-
switch (
|
|
1560
|
+
var e_4, _e;
|
|
1561
|
+
return __generator(this, function (_f) {
|
|
1562
|
+
switch (_f.label) {
|
|
1992
1563
|
case 0:
|
|
1993
1564
|
body = this._request.body;
|
|
1994
1565
|
validation = body.validation;
|
|
1995
1566
|
triggers = validation.triggers;
|
|
1996
1567
|
rules = validation.rules;
|
|
1997
|
-
actions = validation.actions;
|
|
1998
|
-
rulesMapping = new Rules
|
|
1999
|
-
|
|
1568
|
+
actions = (_a = validation) === null || _a === void 0 ? void 0 : _a.actions;
|
|
1569
|
+
rulesMapping = new kwikidToolkit.Rules(rules, {
|
|
1570
|
+
FIELD_CONFIG: this._field,
|
|
1571
|
+
FORM_DATA: this._formData,
|
|
1572
|
+
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
1573
|
+
ALL_FORMS_DATA: this._allFormsData
|
|
1574
|
+
}).mapping();
|
|
1575
|
+
_f.label = 1;
|
|
2000
1576
|
case 1:
|
|
2001
|
-
|
|
1577
|
+
_f.trys.push([1, 6, 7, 8]);
|
|
2002
1578
|
actions_3 = __values(actions), actions_3_1 = actions_3.next();
|
|
2003
|
-
|
|
1579
|
+
_f.label = 2;
|
|
2004
1580
|
case 2:
|
|
2005
1581
|
if (!!actions_3_1.done) return [3 /*break*/, 5];
|
|
2006
1582
|
action = actions_3_1.value;
|
|
2007
|
-
conditionSuccess = new Condition
|
|
1583
|
+
conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
2008
1584
|
if (!conditionSuccess) return [3 /*break*/, 4];
|
|
2009
|
-
actions_4 = new Actions
|
|
1585
|
+
actions_4 = new kwikidToolkit.Actions(action, rulesMapping, {
|
|
1586
|
+
FIELD_CONFIG: this._field,
|
|
1587
|
+
FORM_DATA: this._formData,
|
|
1588
|
+
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
1589
|
+
ALL_FORMS_DATA: this._allFormsData
|
|
1590
|
+
}, this._takeAction);
|
|
2010
1591
|
return [4 /*yield*/, actions_4.execute()];
|
|
2011
1592
|
case 3:
|
|
2012
|
-
|
|
2013
|
-
|
|
1593
|
+
_f.sent();
|
|
1594
|
+
_f.label = 4;
|
|
2014
1595
|
case 4:
|
|
2015
1596
|
actions_3_1 = actions_3.next();
|
|
2016
1597
|
return [3 /*break*/, 2];
|
|
2017
1598
|
case 5: return [3 /*break*/, 8];
|
|
2018
1599
|
case 6:
|
|
2019
|
-
e_4_1 =
|
|
1600
|
+
e_4_1 = _f.sent();
|
|
2020
1601
|
e_4 = { error: e_4_1 };
|
|
2021
1602
|
return [3 /*break*/, 8];
|
|
2022
1603
|
case 7:
|
|
2023
1604
|
try {
|
|
2024
|
-
if (actions_3_1 && !actions_3_1.done && (
|
|
1605
|
+
if (actions_3_1 && !actions_3_1.done && (_e = actions_3.return)) _e.call(actions_3);
|
|
2025
1606
|
}
|
|
2026
1607
|
finally { if (e_4) throw e_4.error; }
|
|
2027
1608
|
return [7 /*endfinally*/];
|
|
@@ -2033,41 +1614,51 @@
|
|
|
2033
1614
|
Apis.prototype.validateApiCallResponse = function () {
|
|
2034
1615
|
return __awaiter(this, void 0, void 0, function () {
|
|
2035
1616
|
var validation, triggers, rules, actions, rulesMapping, actions_5, actions_5_1, action, conditionSuccess, actions_6, e_5_1;
|
|
2036
|
-
var e_5,
|
|
2037
|
-
return __generator(this, function (
|
|
2038
|
-
switch (
|
|
1617
|
+
var e_5, _e;
|
|
1618
|
+
return __generator(this, function (_f) {
|
|
1619
|
+
switch (_f.label) {
|
|
2039
1620
|
case 0:
|
|
2040
1621
|
validation = this._response.validation;
|
|
2041
1622
|
triggers = validation.triggers;
|
|
2042
1623
|
rules = validation.rules;
|
|
2043
1624
|
actions = validation.actions;
|
|
2044
|
-
rulesMapping = new Rules
|
|
2045
|
-
|
|
1625
|
+
rulesMapping = new kwikidToolkit.Rules(rules, {
|
|
1626
|
+
FIELD_CONFIG: this._field,
|
|
1627
|
+
FORM_DATA: this._formData,
|
|
1628
|
+
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
1629
|
+
ALL_FORMS_DATA: this._allFormsData
|
|
1630
|
+
}).mapping();
|
|
1631
|
+
_f.label = 1;
|
|
2046
1632
|
case 1:
|
|
2047
|
-
|
|
1633
|
+
_f.trys.push([1, 6, 7, 8]);
|
|
2048
1634
|
actions_5 = __values(actions), actions_5_1 = actions_5.next();
|
|
2049
|
-
|
|
1635
|
+
_f.label = 2;
|
|
2050
1636
|
case 2:
|
|
2051
1637
|
if (!!actions_5_1.done) return [3 /*break*/, 5];
|
|
2052
1638
|
action = actions_5_1.value;
|
|
2053
|
-
conditionSuccess = new Condition
|
|
1639
|
+
conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
2054
1640
|
if (!conditionSuccess) return [3 /*break*/, 4];
|
|
2055
|
-
actions_6 = new Actions
|
|
1641
|
+
actions_6 = new kwikidToolkit.Actions(action, rulesMapping, {
|
|
1642
|
+
FIELD_CONFIG: this._field,
|
|
1643
|
+
FORM_DATA: this._formData,
|
|
1644
|
+
PREVIOUS_FORM_DATA: this._previousFormData,
|
|
1645
|
+
ALL_FORMS_DATA: this._allFormsData
|
|
1646
|
+
}, this._takeAction);
|
|
2056
1647
|
return [4 /*yield*/, actions_6.execute()];
|
|
2057
1648
|
case 3:
|
|
2058
|
-
|
|
2059
|
-
|
|
1649
|
+
_f.sent();
|
|
1650
|
+
_f.label = 4;
|
|
2060
1651
|
case 4:
|
|
2061
1652
|
actions_5_1 = actions_5.next();
|
|
2062
1653
|
return [3 /*break*/, 2];
|
|
2063
1654
|
case 5: return [3 /*break*/, 8];
|
|
2064
1655
|
case 6:
|
|
2065
|
-
e_5_1 =
|
|
1656
|
+
e_5_1 = _f.sent();
|
|
2066
1657
|
e_5 = { error: e_5_1 };
|
|
2067
1658
|
return [3 /*break*/, 8];
|
|
2068
1659
|
case 7:
|
|
2069
1660
|
try {
|
|
2070
|
-
if (actions_5_1 && !actions_5_1.done && (
|
|
1661
|
+
if (actions_5_1 && !actions_5_1.done && (_e = actions_5.return)) _e.call(actions_5);
|
|
2071
1662
|
}
|
|
2072
1663
|
finally { if (e_5) throw e_5.error; }
|
|
2073
1664
|
return [7 /*endfinally*/];
|
|
@@ -2087,13 +1678,13 @@
|
|
|
2087
1678
|
return Apis;
|
|
2088
1679
|
}());
|
|
2089
1680
|
__decorate([
|
|
2090
|
-
|
|
1681
|
+
kwikidToolkit.logMethod
|
|
2091
1682
|
], Apis.prototype, "setRequestBodyParams", null);
|
|
2092
1683
|
__decorate([
|
|
2093
|
-
|
|
1684
|
+
kwikidToolkit.logMethod
|
|
2094
1685
|
], Apis.prototype, "validateRequestBody", null);
|
|
2095
1686
|
__decorate([
|
|
2096
|
-
|
|
1687
|
+
kwikidToolkit.logMethod
|
|
2097
1688
|
], Apis.prototype, "validateApiCallResponse", null);
|
|
2098
1689
|
|
|
2099
1690
|
var KwikIDFormViewComponent = /** @class */ (function () {
|
|
@@ -2141,7 +1732,7 @@
|
|
|
2141
1732
|
var _a, _b;
|
|
2142
1733
|
var _this = this;
|
|
2143
1734
|
var verifyChange = function (key) {
|
|
2144
|
-
return
|
|
1735
|
+
return kwikidToolkit.checkObjectKeyExists(changes, key) && !changes[key].firstChange;
|
|
2145
1736
|
};
|
|
2146
1737
|
if (verifyChange("formData")) {
|
|
2147
1738
|
this.formData = Object.assign(Object.assign({}, this.formData), changes.formData.currentValue);
|
|
@@ -2267,11 +1858,11 @@
|
|
|
2267
1858
|
});
|
|
2268
1859
|
};
|
|
2269
1860
|
KwikIDFormViewComponent.prototype.setFormFieldsFromFormConfig = function (formConfig) {
|
|
2270
|
-
if (
|
|
1861
|
+
if (kwikidToolkit.checkObjectKeyExists(formConfig, "fields")) {
|
|
2271
1862
|
this.formFields = formConfig.fields;
|
|
2272
1863
|
}
|
|
2273
|
-
else if (
|
|
2274
|
-
|
|
1864
|
+
else if (kwikidToolkit.checkObjectKeyExists(formConfig, "multiForm") &&
|
|
1865
|
+
kwikidToolkit.checkObjectKeyExists(formConfig.multiForm, "fields")) {
|
|
2275
1866
|
this.formFields = formConfig.multiForm.fields;
|
|
2276
1867
|
}
|
|
2277
1868
|
};
|
|
@@ -2279,7 +1870,7 @@
|
|
|
2279
1870
|
this.fieldGroups = formConfig.fieldGroups;
|
|
2280
1871
|
};
|
|
2281
1872
|
KwikIDFormViewComponent.prototype.setFormDataFromAllFormsData = function () {
|
|
2282
|
-
if (
|
|
1873
|
+
if (kwikidToolkit.checkObjectKeyExists(this.allFormsData, this.formConfig.key)) {
|
|
2283
1874
|
this.formData = this.allFormsData[this.formConfig.key];
|
|
2284
1875
|
}
|
|
2285
1876
|
else {
|
|
@@ -2293,8 +1884,13 @@
|
|
|
2293
1884
|
return __generator(this, function (_d) {
|
|
2294
1885
|
switch (_d.label) {
|
|
2295
1886
|
case 0:
|
|
2296
|
-
if (!
|
|
2297
|
-
rulesMapping = new Rules
|
|
1887
|
+
if (!kwikidToolkit.checkObjectKeyExists(childFieldGroupConfig, "rules")) return [3 /*break*/, 8];
|
|
1888
|
+
rulesMapping = new kwikidToolkit.Rules(childFieldGroupConfig.rules, {
|
|
1889
|
+
FIELD_CONFIG: parentField,
|
|
1890
|
+
FORM_DATA: this.formData,
|
|
1891
|
+
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
1892
|
+
ALL_FORMS_DATA: this.allFormsData
|
|
1893
|
+
}).mapping();
|
|
2298
1894
|
_d.label = 1;
|
|
2299
1895
|
case 1:
|
|
2300
1896
|
_d.trys.push([1, 6, 7, 8]);
|
|
@@ -2303,9 +1899,14 @@
|
|
|
2303
1899
|
case 2:
|
|
2304
1900
|
if (!!_b.done) return [3 /*break*/, 5];
|
|
2305
1901
|
action = _b.value;
|
|
2306
|
-
conditionSuccess = new Condition
|
|
1902
|
+
conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
2307
1903
|
if (!conditionSuccess) return [3 /*break*/, 4];
|
|
2308
|
-
actions = new Actions
|
|
1904
|
+
actions = new kwikidToolkit.Actions(action, rulesMapping, {
|
|
1905
|
+
FIELD_CONFIG: parentField,
|
|
1906
|
+
FORM_DATA: this.formData,
|
|
1907
|
+
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
1908
|
+
ALL_FORMS_DATA: this.allFormsData
|
|
1909
|
+
}, this.takeActionOnFieldGroup.bind(this));
|
|
2309
1910
|
return [4 /*yield*/, actions.execute()];
|
|
2310
1911
|
case 3:
|
|
2311
1912
|
_d.sent();
|
|
@@ -2343,7 +1944,7 @@
|
|
|
2343
1944
|
}
|
|
2344
1945
|
return [3 /*break*/, 9];
|
|
2345
1946
|
case 1:
|
|
2346
|
-
if (!(
|
|
1947
|
+
if (!(kwikidToolkit.checkObjectKeyExists(connectedFieldGroupConfig, "triggers") &&
|
|
2347
1948
|
connectedFieldGroupConfig.triggers.includes("INIT"))) return [3 /*break*/, 3];
|
|
2348
1949
|
return [4 /*yield*/, this.handleConnectedElementFieldGroupActions(connectedFieldGroupConfig, currentField)];
|
|
2349
1950
|
case 2:
|
|
@@ -2351,7 +1952,7 @@
|
|
|
2351
1952
|
_b.label = 3;
|
|
2352
1953
|
case 3: return [3 /*break*/, 12];
|
|
2353
1954
|
case 4:
|
|
2354
|
-
if (!(
|
|
1955
|
+
if (!(kwikidToolkit.checkObjectKeyExists(connectedFieldGroupConfig, "triggers") &&
|
|
2355
1956
|
connectedFieldGroupConfig.triggers.includes("VALUE_CHANGE"))) return [3 /*break*/, 6];
|
|
2356
1957
|
return [4 /*yield*/, this.handleConnectedElementFieldGroupActions(connectedFieldGroupConfig, currentField)];
|
|
2357
1958
|
case 5:
|
|
@@ -2359,14 +1960,14 @@
|
|
|
2359
1960
|
_b.label = 6;
|
|
2360
1961
|
case 6: return [3 /*break*/, 12];
|
|
2361
1962
|
case 7:
|
|
2362
|
-
if (!(
|
|
1963
|
+
if (!(kwikidToolkit.checkObjectKeyExists(connectedFieldGroupConfig, "triggers") &&
|
|
2363
1964
|
connectedFieldGroupConfig.triggers.includes("NESTED_LINK"))) return [3 /*break*/, 9];
|
|
2364
1965
|
return [4 /*yield*/, this.handleConnectedElementFieldGroupActions(connectedFieldGroupConfig, currentField)];
|
|
2365
1966
|
case 8:
|
|
2366
1967
|
_b.sent();
|
|
2367
1968
|
_b.label = 9;
|
|
2368
1969
|
case 9:
|
|
2369
|
-
if (!
|
|
1970
|
+
if (!kwikidToolkit.checkObjectKeyExists(connectedFieldGroupConfig, "triggers")) return [3 /*break*/, 11];
|
|
2370
1971
|
return [4 /*yield*/, this.handleConnectedElementFieldGroupActions(connectedFieldGroupConfig, currentField)];
|
|
2371
1972
|
case 10:
|
|
2372
1973
|
_b.sent();
|
|
@@ -2384,8 +1985,13 @@
|
|
|
2384
1985
|
return __generator(this, function (_d) {
|
|
2385
1986
|
switch (_d.label) {
|
|
2386
1987
|
case 0:
|
|
2387
|
-
if (!
|
|
2388
|
-
rulesMapping = new Rules
|
|
1988
|
+
if (!kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "rules")) return [3 /*break*/, 8];
|
|
1989
|
+
rulesMapping = new kwikidToolkit.Rules(connectedFieldConfig.rules, {
|
|
1990
|
+
FIELD_CONFIG: connectedField,
|
|
1991
|
+
FORM_DATA: this.formData,
|
|
1992
|
+
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
1993
|
+
ALL_FORMS_DATA: this.allFormsData
|
|
1994
|
+
}).mapping();
|
|
2389
1995
|
_d.label = 1;
|
|
2390
1996
|
case 1:
|
|
2391
1997
|
_d.trys.push([1, 6, 7, 8]);
|
|
@@ -2394,9 +2000,14 @@
|
|
|
2394
2000
|
case 2:
|
|
2395
2001
|
if (!!_b.done) return [3 /*break*/, 5];
|
|
2396
2002
|
action = _b.value;
|
|
2397
|
-
conditionSuccess = new Condition
|
|
2003
|
+
conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
2398
2004
|
if (!conditionSuccess) return [3 /*break*/, 4];
|
|
2399
|
-
actions = new Actions
|
|
2005
|
+
actions = new kwikidToolkit.Actions(action, rulesMapping, {
|
|
2006
|
+
FIELD_CONFIG: connectedField,
|
|
2007
|
+
FORM_DATA: this.formData,
|
|
2008
|
+
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
2009
|
+
ALL_FORMS_DATA: this.allFormsData
|
|
2010
|
+
}, this.takeAction.bind(this));
|
|
2400
2011
|
return [4 /*yield*/, actions.execute()];
|
|
2401
2012
|
case 3:
|
|
2402
2013
|
_d.sent();
|
|
@@ -2436,10 +2047,10 @@
|
|
|
2436
2047
|
}
|
|
2437
2048
|
return [3 /*break*/, 17];
|
|
2438
2049
|
case 1:
|
|
2439
|
-
if (!(
|
|
2050
|
+
if (!(kwikidToolkit.checkObjectKeyExists(connectedField, "triggers") &&
|
|
2440
2051
|
connectedField.triggers.includes("INIT"))) return [3 /*break*/, 7];
|
|
2441
2052
|
if (!this.isFieldEnabled(connectedField.key)) return [3 /*break*/, 5];
|
|
2442
|
-
if (!
|
|
2053
|
+
if (!kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "connectedParentFields")) return [3 /*break*/, 5];
|
|
2443
2054
|
_b = connectedFieldConfig.type;
|
|
2444
2055
|
switch (_b) {
|
|
2445
2056
|
case "dropdown-with-search": return [3 /*break*/, 2];
|
|
@@ -2456,7 +2067,7 @@
|
|
|
2456
2067
|
_g.label = 7;
|
|
2457
2068
|
case 7: return [3 /*break*/, 20];
|
|
2458
2069
|
case 8:
|
|
2459
|
-
if (!(
|
|
2070
|
+
if (!(kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "triggers") &&
|
|
2460
2071
|
connectedFieldConfig.triggers.includes("VALUE_CHANGE"))) return [3 /*break*/, 14];
|
|
2461
2072
|
_c = connectedField.type;
|
|
2462
2073
|
switch (_c) {
|
|
@@ -2474,22 +2085,22 @@
|
|
|
2474
2085
|
_g.label = 14;
|
|
2475
2086
|
case 14: return [3 /*break*/, 20];
|
|
2476
2087
|
case 15:
|
|
2477
|
-
if (!(
|
|
2088
|
+
if (!(kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "triggers") &&
|
|
2478
2089
|
connectedFieldConfig.triggers.includes("NESTED_LINK"))) return [3 /*break*/, 17];
|
|
2479
2090
|
return [4 /*yield*/, this.handleConnectedElementFieldActions(connectedFieldConfig, connectedField)];
|
|
2480
2091
|
case 16:
|
|
2481
2092
|
connectedField = _g.sent();
|
|
2482
2093
|
_g.label = 17;
|
|
2483
2094
|
case 17:
|
|
2484
|
-
if (!
|
|
2095
|
+
if (!kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "triggers")) return [3 /*break*/, 19];
|
|
2485
2096
|
return [4 /*yield*/, this.handleConnectedElementFieldActions(connectedFieldConfig, connectedField)];
|
|
2486
2097
|
case 18:
|
|
2487
2098
|
connectedField = _g.sent();
|
|
2488
2099
|
_g.label = 19;
|
|
2489
2100
|
case 19: return [3 /*break*/, 20];
|
|
2490
2101
|
case 20:
|
|
2491
|
-
if (
|
|
2492
|
-
if (
|
|
2102
|
+
if (kwikidToolkit.checkObjectKeyExists(connectedField, "connectedElements")) {
|
|
2103
|
+
if (kwikidToolkit.checkObjectKeyExists(connectedField.connectedElements, "connectedFields")) {
|
|
2493
2104
|
try {
|
|
2494
2105
|
for (_d = __values(connectedField.connectedElements
|
|
2495
2106
|
.connectedFields), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
@@ -2519,8 +2130,9 @@
|
|
|
2519
2130
|
switch (_c.label) {
|
|
2520
2131
|
case 0:
|
|
2521
2132
|
currentField = findFieldFromKey(this.formFields, e.key);
|
|
2522
|
-
if (!
|
|
2523
|
-
if (!
|
|
2133
|
+
if (!(currentField !== undefined)) return [3 /*break*/, 17];
|
|
2134
|
+
if (!kwikidToolkit.checkObjectKeyExists(currentField, "connectedElements")) return [3 /*break*/, 16];
|
|
2135
|
+
if (!kwikidToolkit.checkObjectKeyExists(currentField.connectedElements, "connectedFieldGroups")) return [3 /*break*/, 8];
|
|
2524
2136
|
connectedFieldGroups = currentField.connectedElements.connectedFieldGroups;
|
|
2525
2137
|
_c.label = 1;
|
|
2526
2138
|
case 1:
|
|
@@ -2549,7 +2161,7 @@
|
|
|
2549
2161
|
finally { if (e_6) throw e_6.error; }
|
|
2550
2162
|
return [7 /*endfinally*/];
|
|
2551
2163
|
case 8:
|
|
2552
|
-
if (!
|
|
2164
|
+
if (!kwikidToolkit.checkObjectKeyExists(currentField.connectedElements, "connectedFields")) return [3 /*break*/, 16];
|
|
2553
2165
|
connectedFields = currentField.connectedElements.connectedFields;
|
|
2554
2166
|
_c.label = 9;
|
|
2555
2167
|
case 9:
|
|
@@ -2577,7 +2189,9 @@
|
|
|
2577
2189
|
}
|
|
2578
2190
|
finally { if (e_7) throw e_7.error; }
|
|
2579
2191
|
return [7 /*endfinally*/];
|
|
2580
|
-
case 16: return [
|
|
2192
|
+
case 16: return [3 /*break*/, 18];
|
|
2193
|
+
case 17: throw new Error("Field for the given key ['" + e.key + "'] is not found with eventType: '" + eventType + "'.");
|
|
2194
|
+
case 18: return [2 /*return*/];
|
|
2581
2195
|
}
|
|
2582
2196
|
});
|
|
2583
2197
|
});
|
|
@@ -2593,7 +2207,7 @@
|
|
|
2593
2207
|
var field = findFieldFromKey(this.formFields, e.key);
|
|
2594
2208
|
if (field.type !== "title" &&
|
|
2595
2209
|
field.validation.triggers.includes("ON_CHANGE")) {
|
|
2596
|
-
var validations_1 = new Validations
|
|
2210
|
+
var validations_1 = new Validations(field, this.formData, this.previousFormData, this.allFormsData, this.takeAction.bind(this));
|
|
2597
2211
|
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
2598
2212
|
return __generator(this, function (_a) {
|
|
2599
2213
|
switch (_a.label) {
|
|
@@ -2612,7 +2226,7 @@
|
|
|
2612
2226
|
};
|
|
2613
2227
|
KwikIDFormViewComponent.prototype.handleOnClickResetFormFields = function (e, field) {
|
|
2614
2228
|
return __awaiter(this, void 0, void 0, function () {
|
|
2615
|
-
var _a, _b, f, _c, _d,
|
|
2229
|
+
var _a, _b, f, _c, _d, action, resetField, actions, e_8_1, e_9_1;
|
|
2616
2230
|
var e_9, _e, e_8, _f;
|
|
2617
2231
|
return __generator(this, function (_g) {
|
|
2618
2232
|
switch (_g.label) {
|
|
@@ -2630,9 +2244,14 @@
|
|
|
2630
2244
|
_g.label = 3;
|
|
2631
2245
|
case 3:
|
|
2632
2246
|
if (!!_d.done) return [3 /*break*/, 6];
|
|
2633
|
-
|
|
2634
|
-
resetField = findFieldFromKey(this.formFields,
|
|
2635
|
-
actions = new Actions
|
|
2247
|
+
action = _d.value;
|
|
2248
|
+
resetField = findFieldFromKey(this.formFields, action.props.fieldKey);
|
|
2249
|
+
actions = new kwikidToolkit.Actions(action, {}, {
|
|
2250
|
+
FIELD_CONFIG: resetField,
|
|
2251
|
+
FORM_DATA: this.formData,
|
|
2252
|
+
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
2253
|
+
ALL_FORMS_DATA: this.allFormsData
|
|
2254
|
+
}, this.takeAction.bind(this));
|
|
2636
2255
|
return [4 /*yield*/, actions.execute()];
|
|
2637
2256
|
case 4:
|
|
2638
2257
|
_g.sent();
|
|
@@ -2755,7 +2374,7 @@
|
|
|
2755
2374
|
var _loop_3 = function (field) {
|
|
2756
2375
|
if (field.type !== EFieldType.TITLE &&
|
|
2757
2376
|
field.validation.triggers.includes("ON_SAVE")) {
|
|
2758
|
-
var validations_2 = new Validations
|
|
2377
|
+
var validations_2 = new Validations(field, formData, this_2.previousFormData, this_2.allFormsData, this_2.takeAction.bind(this_2));
|
|
2759
2378
|
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
2760
2379
|
return __generator(this, function (_a) {
|
|
2761
2380
|
switch (_a.label) {
|
|
@@ -2783,12 +2402,12 @@
|
|
|
2783
2402
|
finally { if (e_11) throw e_11.error; }
|
|
2784
2403
|
}
|
|
2785
2404
|
if (this.formGroup.invalid) {
|
|
2786
|
-
var controls = new Validations
|
|
2405
|
+
var controls = new Validations(undefined, formData, this.previousFormData, this.allFormsData, this.takeAction.bind(this)).findInvalidControlsRecursive(this.formGroup);
|
|
2787
2406
|
var firstFieldWithError = "";
|
|
2788
2407
|
try {
|
|
2789
2408
|
for (var controls_1 = __values(controls), controls_1_1 = controls_1.next(); !controls_1_1.done; controls_1_1 = controls_1.next()) {
|
|
2790
2409
|
var control = controls_1_1.value;
|
|
2791
|
-
if (control.invalid &&
|
|
2410
|
+
if (control.invalid && kwikidToolkit.isEmptyValue(firstFieldWithError)) {
|
|
2792
2411
|
firstFieldWithError = control.key;
|
|
2793
2412
|
}
|
|
2794
2413
|
this.formFields = setFieldError(this.formFields, this.formGroup.controls[control.key].errors, control.key, control.invalid);
|
|
@@ -2808,7 +2427,7 @@
|
|
|
2808
2427
|
return;
|
|
2809
2428
|
}
|
|
2810
2429
|
Object.keys(formData).map(function (key) {
|
|
2811
|
-
if (
|
|
2430
|
+
if (kwikidToolkit.isEmptyValue(formData[key])) {
|
|
2812
2431
|
formData[key] = "";
|
|
2813
2432
|
}
|
|
2814
2433
|
});
|
|
@@ -2873,7 +2492,7 @@
|
|
|
2873
2492
|
});
|
|
2874
2493
|
if (field.type !== EFieldType.TITLE) {
|
|
2875
2494
|
this.formFields[fieldIndex]["disabled"] = true;
|
|
2876
|
-
if (
|
|
2495
|
+
if (kwikidToolkit.isNotEmptyValue(this.formGroup.controls)) {
|
|
2877
2496
|
this.formGroup.controls[field.key].disable({
|
|
2878
2497
|
emitEvent: false
|
|
2879
2498
|
});
|
|
@@ -2904,7 +2523,7 @@
|
|
|
2904
2523
|
});
|
|
2905
2524
|
if (field.type !== EFieldType.TITLE) {
|
|
2906
2525
|
this.formFields[fieldIndex]["disabled"] = false;
|
|
2907
|
-
if (
|
|
2526
|
+
if (kwikidToolkit.isNotEmptyValue(this.formGroup.controls)) {
|
|
2908
2527
|
this.formGroup.controls[field.key].enable({
|
|
2909
2528
|
emitEvent: false
|
|
2910
2529
|
});
|
|
@@ -3021,10 +2640,10 @@
|
|
|
3021
2640
|
return __generator(this, function (_b) {
|
|
3022
2641
|
switch (_b.label) {
|
|
3023
2642
|
case 0:
|
|
3024
|
-
if (
|
|
2643
|
+
if (kwikidToolkit.checkObjectKeyExists(childField, "json")) {
|
|
3025
2644
|
childField.options = getSearchTextOptionsFromFieldConfig(field, childField, this.formGroup);
|
|
3026
2645
|
}
|
|
3027
|
-
if (!
|
|
2646
|
+
if (!kwikidToolkit.checkObjectKeyExists(childField, "fetchJsonFromRemote")) return [3 /*break*/, 2];
|
|
3028
2647
|
_a = childField;
|
|
3029
2648
|
return [4 /*yield*/, getSearchTextOptionsFromRemoteFile(field, childField, this.formGroup)];
|
|
3030
2649
|
case 1:
|
|
@@ -3058,7 +2677,7 @@
|
|
|
3058
2677
|
});
|
|
3059
2678
|
});
|
|
3060
2679
|
};
|
|
3061
|
-
KwikIDFormViewComponent.prototype.takeAction = function (action,
|
|
2680
|
+
KwikIDFormViewComponent.prototype.takeAction = function (action, object) {
|
|
3062
2681
|
return __awaiter(this, void 0, void 0, function () {
|
|
3063
2682
|
var _a, sources, sourceValue;
|
|
3064
2683
|
return __generator(this, function (_b) {
|
|
@@ -3108,18 +2727,18 @@
|
|
|
3108
2727
|
this.fieldMessageHide(action.props.fieldKey, action.props.message);
|
|
3109
2728
|
return [3 /*break*/, 15];
|
|
3110
2729
|
case 10:
|
|
3111
|
-
sources = new Sources
|
|
2730
|
+
sources = new kwikidToolkit.Sources(object);
|
|
3112
2731
|
return [4 /*yield*/, sources.getValueFromSource(action.props.value.source)];
|
|
3113
2732
|
case 11:
|
|
3114
2733
|
sourceValue = _b.sent();
|
|
3115
2734
|
sources.setValueToSource(action.props.value.destination, sourceValue);
|
|
3116
|
-
|
|
3117
|
-
this.formData = sources.
|
|
3118
|
-
this.allFormsData = sources.
|
|
3119
|
-
this.previousFormData = sources.
|
|
2735
|
+
object.FIELD_CONFIG = sources.object.FIELD_CONFIG;
|
|
2736
|
+
this.formData = sources.object.FORM_DATA;
|
|
2737
|
+
this.allFormsData = sources.object.ALL_FORMS_DATA;
|
|
2738
|
+
this.previousFormData = sources.object.PREVIOUS_FORM_DATA;
|
|
3120
2739
|
return [3 /*break*/, 15];
|
|
3121
2740
|
case 12:
|
|
3122
|
-
this.handleConnectedElements({ key:
|
|
2741
|
+
this.handleConnectedElements({ key: action.props.fieldKey }, "ACTION");
|
|
3123
2742
|
return [3 /*break*/, 15];
|
|
3124
2743
|
case 13: return [3 /*break*/, 15];
|
|
3125
2744
|
case 14: return [3 /*break*/, 15];
|
|
@@ -3131,123 +2750,123 @@
|
|
|
3131
2750
|
return KwikIDFormViewComponent;
|
|
3132
2751
|
}());
|
|
3133
2752
|
/** @nocollapse */ KwikIDFormViewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KwikIDFormViewComponent, deps: [{ token: i4.TuiPushService }, { token: i3.TuiAlertService }, { token: KwikIDFormViewService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3134
|
-
/** @nocollapse */ KwikIDFormViewComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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 [class.hidden]=\"field?.hidden\"\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?.properties?.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}.title.hidden{display:none}.large-wrapper{width:100%;height:60px}.large-wrapper:first-child{margin-bottom:auto}.large-wrapper:last-child{margin-top:auto}.kwikid-form-container-loading{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;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__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }, { type: i2__namespace.KwikUIInputComponent, selector: "kwikui-input", inputs: ["label", "id", "type", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "validators", "case", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIMessagesComponent, selector: "kwikui-messages", inputs: ["messages", "id"] }, { type: i2__namespace.KwikUICheckboxBlockComponent, selector: "kwikui-checkbox-block", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "size", "contentAlign", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIInputNumberComponent, selector: "kwikui-input-number", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "min", "max", "prefix", "postfix", "precision", "decimal", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIInputDateComponent, selector: "kwikui-input-date", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "min", "max", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIInputPhoneComponent, selector: "kwikui-input-phone", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "countryCode", "phoneMaskAfterCountryCode", "removeCountryCodeFromValue", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i3__namespace.TuiLabelComponent, selector: "label[tuiLabel]", inputs: ["tuiLabel", "context"] }, { type: i2__namespace.KwikUIRadioListComponent, selector: "kwikui-radio-list", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "size", "orientation", "items", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUISelectComboboxComponent, selector: "kwikui-select-combobox", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "options", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIButtonApiCallComponent, selector: "kwikui-button-api-call", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "shape", "size", "apiStatus"], outputs: ["onClick"] }, { type: i2__namespace.KwikUIInputOtpComponent, selector: "kwikui-input-otp", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "mask", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIInputAadhaarComponent, selector: "kwikui-input-aadhaar", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "mask", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i4__namespace.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "timestamp"], outputs: ["close"] }, { type: i3__namespace.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }], directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i6__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i6__namespace.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i5__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6__namespace.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i6__namespace.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i4__namespace.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i4__namespace.TuiPushDirective, selector: "tui-push" }] });
|
|
2753
|
+
/** @nocollapse */ KwikIDFormViewComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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 [class.hidden]=\"field?.hidden\"\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?.properties?.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?.properties?.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}.title.hidden{display:none}.large-wrapper{width:100%;height:60px}.large-wrapper:first-child{margin-bottom:auto}.large-wrapper:last-child{margin-top:auto}.kwikid-form-container-loading{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;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__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }, { type: i2__namespace.KwikUIInputComponent, selector: "kwikui-input", inputs: ["label", "id", "type", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "validators", "case", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIMessagesComponent, selector: "kwikui-messages", inputs: ["messages", "id"] }, { type: i2__namespace.KwikUICheckboxBlockComponent, selector: "kwikui-checkbox-block", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "size", "contentAlign", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIInputNumberComponent, selector: "kwikui-input-number", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "min", "max", "prefix", "postfix", "precision", "decimal", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIInputDateComponent, selector: "kwikui-input-date", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "min", "max", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIInputPhoneComponent, selector: "kwikui-input-phone", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "countryCode", "phoneMaskAfterCountryCode", "removeCountryCodeFromValue", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i3__namespace.TuiLabelComponent, selector: "label[tuiLabel]", inputs: ["tuiLabel", "context"] }, { type: i2__namespace.KwikUIRadioListComponent, selector: "kwikui-radio-list", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "size", "orientation", "items", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUISelectComboboxComponent, selector: "kwikui-select-combobox", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "options", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIButtonApiCallComponent, selector: "kwikui-button-api-call", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "shape", "size", "apiStatus"], outputs: ["onClick"] }, { type: i2__namespace.KwikUIInputOtpComponent, selector: "kwikui-input-otp", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "mask", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIInputAadhaarComponent, selector: "kwikui-input-aadhaar", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "mask", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i4__namespace.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "timestamp"], outputs: ["close"] }, { type: i3__namespace.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }], directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i6__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i6__namespace.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i5__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6__namespace.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i6__namespace.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i4__namespace.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i4__namespace.TuiPushDirective, selector: "tui-push" }] });
|
|
3135
2754
|
__decorate([
|
|
3136
|
-
|
|
2755
|
+
kwikidToolkit.logMethod
|
|
3137
2756
|
], KwikIDFormViewComponent.prototype, "ngOnInit", null);
|
|
3138
2757
|
__decorate([
|
|
3139
|
-
|
|
2758
|
+
kwikidToolkit.logMethod
|
|
3140
2759
|
], KwikIDFormViewComponent.prototype, "ngAfterViewInit", null);
|
|
3141
2760
|
__decorate([
|
|
3142
|
-
|
|
2761
|
+
kwikidToolkit.logMethod
|
|
3143
2762
|
], KwikIDFormViewComponent.prototype, "ngOnChanges", null);
|
|
3144
2763
|
__decorate([
|
|
3145
|
-
|
|
2764
|
+
kwikidToolkit.logMethod
|
|
3146
2765
|
], KwikIDFormViewComponent.prototype, "initFormConfig", null);
|
|
3147
2766
|
__decorate([
|
|
3148
|
-
|
|
2767
|
+
kwikidToolkit.logMethod
|
|
3149
2768
|
], KwikIDFormViewComponent.prototype, "setFormFieldsFromFormConfig", null);
|
|
3150
2769
|
__decorate([
|
|
3151
|
-
|
|
2770
|
+
kwikidToolkit.logMethod
|
|
3152
2771
|
], KwikIDFormViewComponent.prototype, "setFormFieldGroupsFromFormConfig", null);
|
|
3153
2772
|
__decorate([
|
|
3154
|
-
|
|
2773
|
+
kwikidToolkit.logMethod
|
|
3155
2774
|
], KwikIDFormViewComponent.prototype, "setFormDataFromAllFormsData", null);
|
|
3156
2775
|
__decorate([
|
|
3157
|
-
|
|
2776
|
+
kwikidToolkit.logMethod
|
|
3158
2777
|
], KwikIDFormViewComponent.prototype, "handleConnectedElementFieldGroupActions", null);
|
|
3159
2778
|
__decorate([
|
|
3160
|
-
|
|
2779
|
+
kwikidToolkit.logMethod
|
|
3161
2780
|
], KwikIDFormViewComponent.prototype, "handleConnectedElementFieldGroup", null);
|
|
3162
2781
|
__decorate([
|
|
3163
|
-
|
|
2782
|
+
kwikidToolkit.logMethod
|
|
3164
2783
|
], KwikIDFormViewComponent.prototype, "handleConnectedElementFieldActions", null);
|
|
3165
2784
|
__decorate([
|
|
3166
|
-
|
|
2785
|
+
kwikidToolkit.logMethod
|
|
3167
2786
|
], KwikIDFormViewComponent.prototype, "handleConnectedElementFields", null);
|
|
3168
2787
|
__decorate([
|
|
3169
|
-
|
|
2788
|
+
kwikidToolkit.logMethod
|
|
3170
2789
|
], KwikIDFormViewComponent.prototype, "handleConnectedElements", null);
|
|
3171
2790
|
__decorate([
|
|
3172
|
-
|
|
2791
|
+
kwikidToolkit.logMethod
|
|
3173
2792
|
], KwikIDFormViewComponent.prototype, "handleGetKeyValue", null);
|
|
3174
2793
|
__decorate([
|
|
3175
|
-
|
|
2794
|
+
kwikidToolkit.logMethod
|
|
3176
2795
|
], KwikIDFormViewComponent.prototype, "handleOnClickResetFormFields", null);
|
|
3177
2796
|
__decorate([
|
|
3178
|
-
|
|
2797
|
+
kwikidToolkit.logMethod
|
|
3179
2798
|
], KwikIDFormViewComponent.prototype, "handleOnClickApiCall", null);
|
|
3180
2799
|
__decorate([
|
|
3181
|
-
|
|
2800
|
+
kwikidToolkit.logMethod
|
|
3182
2801
|
], KwikIDFormViewComponent.prototype, "handleOnClickViewForms", null);
|
|
3183
2802
|
__decorate([
|
|
3184
|
-
|
|
2803
|
+
kwikidToolkit.logMethod
|
|
3185
2804
|
], KwikIDFormViewComponent.prototype, "handleOnClickSaveForm", null);
|
|
3186
2805
|
__decorate([
|
|
3187
|
-
|
|
2806
|
+
kwikidToolkit.logMethod
|
|
3188
2807
|
], KwikIDFormViewComponent.prototype, "toggleErrorNotification", null);
|
|
3189
2808
|
__decorate([
|
|
3190
|
-
|
|
2809
|
+
kwikidToolkit.logMethod
|
|
3191
2810
|
], KwikIDFormViewComponent.prototype, "fieldHide", null);
|
|
3192
2811
|
__decorate([
|
|
3193
|
-
|
|
2812
|
+
kwikidToolkit.logMethod
|
|
3194
2813
|
], KwikIDFormViewComponent.prototype, "fieldGroupHide", null);
|
|
3195
2814
|
__decorate([
|
|
3196
|
-
|
|
2815
|
+
kwikidToolkit.logMethod
|
|
3197
2816
|
], KwikIDFormViewComponent.prototype, "fieldShow", null);
|
|
3198
2817
|
__decorate([
|
|
3199
|
-
|
|
2818
|
+
kwikidToolkit.logMethod
|
|
3200
2819
|
], KwikIDFormViewComponent.prototype, "fieldGroupShow", null);
|
|
3201
2820
|
__decorate([
|
|
3202
|
-
|
|
2821
|
+
kwikidToolkit.logMethod
|
|
3203
2822
|
], KwikIDFormViewComponent.prototype, "fieldDisable", null);
|
|
3204
2823
|
__decorate([
|
|
3205
|
-
|
|
2824
|
+
kwikidToolkit.logMethod
|
|
3206
2825
|
], KwikIDFormViewComponent.prototype, "fieldGroupDisable", null);
|
|
3207
2826
|
__decorate([
|
|
3208
|
-
|
|
2827
|
+
kwikidToolkit.logMethod
|
|
3209
2828
|
], KwikIDFormViewComponent.prototype, "fieldEnable", null);
|
|
3210
2829
|
__decorate([
|
|
3211
|
-
|
|
2830
|
+
kwikidToolkit.logMethod
|
|
3212
2831
|
], KwikIDFormViewComponent.prototype, "fieldGroupEnable", null);
|
|
3213
2832
|
__decorate([
|
|
3214
|
-
|
|
2833
|
+
kwikidToolkit.logMethod
|
|
3215
2834
|
], KwikIDFormViewComponent.prototype, "fieldReset", null);
|
|
3216
2835
|
__decorate([
|
|
3217
|
-
|
|
2836
|
+
kwikidToolkit.logMethod
|
|
3218
2837
|
], KwikIDFormViewComponent.prototype, "fieldErrorShow", null);
|
|
3219
2838
|
__decorate([
|
|
3220
|
-
|
|
2839
|
+
kwikidToolkit.logMethod
|
|
3221
2840
|
], KwikIDFormViewComponent.prototype, "fieldErrorHide", null);
|
|
3222
2841
|
__decorate([
|
|
3223
|
-
|
|
2842
|
+
kwikidToolkit.logMethod
|
|
3224
2843
|
], KwikIDFormViewComponent.prototype, "fieldMessageShow", null);
|
|
3225
2844
|
__decorate([
|
|
3226
|
-
|
|
2845
|
+
kwikidToolkit.logMethod
|
|
3227
2846
|
], KwikIDFormViewComponent.prototype, "fieldMessageHide", null);
|
|
3228
2847
|
__decorate([
|
|
3229
|
-
|
|
2848
|
+
kwikidToolkit.logMethod
|
|
3230
2849
|
], KwikIDFormViewComponent.prototype, "setObjectValue", null);
|
|
3231
2850
|
__decorate([
|
|
3232
|
-
|
|
2851
|
+
kwikidToolkit.logMethod
|
|
3233
2852
|
], KwikIDFormViewComponent.prototype, "patchFieldControlValue", null);
|
|
3234
2853
|
__decorate([
|
|
3235
|
-
|
|
2854
|
+
kwikidToolkit.logMethod
|
|
3236
2855
|
], KwikIDFormViewComponent.prototype, "isFieldValid", null);
|
|
3237
2856
|
__decorate([
|
|
3238
|
-
|
|
2857
|
+
kwikidToolkit.logMethod
|
|
3239
2858
|
], KwikIDFormViewComponent.prototype, "isFieldEnabled", null);
|
|
3240
2859
|
__decorate([
|
|
3241
|
-
|
|
2860
|
+
kwikidToolkit.logMethod
|
|
3242
2861
|
], KwikIDFormViewComponent.prototype, "getFormGroupRawValues", null);
|
|
3243
2862
|
__decorate([
|
|
3244
|
-
|
|
2863
|
+
kwikidToolkit.logMethod
|
|
3245
2864
|
], KwikIDFormViewComponent.prototype, "handleFieldTypeSearchText", null);
|
|
3246
2865
|
__decorate([
|
|
3247
|
-
|
|
2866
|
+
kwikidToolkit.logMethod
|
|
3248
2867
|
], KwikIDFormViewComponent.prototype, "takeActionOnFieldGroup", null);
|
|
3249
2868
|
__decorate([
|
|
3250
|
-
|
|
2869
|
+
kwikidToolkit.logMethod
|
|
3251
2870
|
], KwikIDFormViewComponent.prototype, "takeAction", null);
|
|
3252
2871
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KwikIDFormViewComponent, decorators: [{
|
|
3253
2872
|
type: i0.Component,
|
|
@@ -3287,10 +2906,6 @@
|
|
|
3287
2906
|
type: i0.Output
|
|
3288
2907
|
}], ngOnInit: [], ngAfterViewInit: [], ngOnChanges: [], initFormConfig: [], setFormFieldsFromFormConfig: [], setFormFieldGroupsFromFormConfig: [], setFormDataFromAllFormsData: [], handleConnectedElementFieldGroupActions: [], handleConnectedElementFieldGroup: [], handleConnectedElementFieldActions: [], handleConnectedElementFields: [], handleConnectedElements: [], handleGetKeyValue: [], handleOnClickResetFormFields: [], handleOnClickApiCall: [], handleOnClickViewForms: [], handleOnClickSaveForm: [], toggleErrorNotification: [], fieldHide: [], fieldGroupHide: [], fieldShow: [], fieldGroupShow: [], fieldDisable: [], fieldGroupDisable: [], fieldEnable: [], fieldGroupEnable: [], fieldReset: [], fieldErrorShow: [], fieldErrorHide: [], fieldMessageShow: [], fieldMessageHide: [], setObjectValue: [], patchFieldControlValue: [], isFieldValid: [], isFieldEnabled: [], getFormGroupRawValues: [], handleFieldTypeSearchText: [], takeActionOnFieldGroup: [], takeAction: [] } });
|
|
3289
2908
|
|
|
3290
|
-
var hasKey = function (object, key) {
|
|
3291
|
-
return object.hasOwnProperty(key);
|
|
3292
|
-
};
|
|
3293
|
-
|
|
3294
2909
|
var KwikIDFormsListComponent = /** @class */ (function () {
|
|
3295
2910
|
function KwikIDFormsListComponent() {
|
|
3296
2911
|
this.showFormFields = {};
|
|
@@ -3309,7 +2924,7 @@
|
|
|
3309
2924
|
};
|
|
3310
2925
|
KwikIDFormsListComponent.prototype.ngOnChanges = function (changes) {
|
|
3311
2926
|
var verifyChange = function (key) {
|
|
3312
|
-
return
|
|
2927
|
+
return kwikidToolkit.checkObjectKeyExists(changes, key) && !changes[key].firstChange;
|
|
3313
2928
|
};
|
|
3314
2929
|
if (verifyChange("showFormFields")) {
|
|
3315
2930
|
this.showFormFields = changes.showFormFields.currentValue;
|
|
@@ -3356,7 +2971,10 @@
|
|
|
3356
2971
|
return KwikIDFormsListComponent;
|
|
3357
2972
|
}());
|
|
3358
2973
|
/** @nocollapse */ KwikIDFormsListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KwikIDFormsListComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3359
|
-
/** @nocollapse */ KwikIDFormsListComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.KwikUIProgressSegmentedComponent, selector: "kwikui-progress-segmented", inputs: ["value", "max", "size", "colors"] }, { type: i3__namespace.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i2__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }], directives: [{ type: i5__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2974
|
+
/** @nocollapse */ KwikIDFormsListComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.KwikUIProgressSegmentedComponent, selector: "kwikui-progress-segmented", inputs: ["id", "value", "max", "size", "colors"] }, { type: i3__namespace.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i2__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }], directives: [{ type: i5__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2975
|
+
__decorate([
|
|
2976
|
+
kwikidToolkit.logMethod
|
|
2977
|
+
], KwikIDFormsListComponent.prototype, "ngOnChanges", null);
|
|
3360
2978
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KwikIDFormsListComponent, decorators: [{
|
|
3361
2979
|
type: i0.Component,
|
|
3362
2980
|
args: [{
|
|
@@ -3380,315 +2998,13 @@
|
|
|
3380
2998
|
type: i0.Output
|
|
3381
2999
|
}], onClickSubmitForms: [{
|
|
3382
3000
|
type: i0.Output
|
|
3383
|
-
}] } });
|
|
3384
|
-
|
|
3385
|
-
var Sources = /** @class */ (function () {
|
|
3386
|
-
function Sources(userConfig) {
|
|
3387
|
-
this._userConfig = userConfig;
|
|
3388
|
-
}
|
|
3389
|
-
Object.defineProperty(Sources.prototype, "userConfig", {
|
|
3390
|
-
get: function () {
|
|
3391
|
-
return this._userConfig;
|
|
3392
|
-
},
|
|
3393
|
-
set: function (value) {
|
|
3394
|
-
this._userConfig = value;
|
|
3395
|
-
},
|
|
3396
|
-
enumerable: false,
|
|
3397
|
-
configurable: true
|
|
3398
|
-
});
|
|
3399
|
-
Sources.prototype.getValueFromUserConfig = function (path) {
|
|
3400
|
-
var value = "";
|
|
3401
|
-
if (isNotEmpty(path)) {
|
|
3402
|
-
value = jpQueryWrapper(this._userConfig, path);
|
|
3403
|
-
}
|
|
3404
|
-
else {
|
|
3405
|
-
value = setEmptyValue(this._userConfig);
|
|
3406
|
-
}
|
|
3407
|
-
return value;
|
|
3408
|
-
};
|
|
3409
|
-
Sources.prototype.getValueFromBrowserStorage = function (type, key) {
|
|
3410
|
-
var value = "";
|
|
3411
|
-
switch (type) {
|
|
3412
|
-
case EBrowserStorageType.LOCAL_STORAGE:
|
|
3413
|
-
value = isNotEmptyBrowserStorageValue(localStorage.getItem(key))
|
|
3414
|
-
? localStorage.getItem(key)
|
|
3415
|
-
: "";
|
|
3416
|
-
break;
|
|
3417
|
-
case EBrowserStorageType.SESSION_STORAGE:
|
|
3418
|
-
value = isNotEmptyBrowserStorageValue(sessionStorage.getItem(key))
|
|
3419
|
-
? sessionStorage.getItem(key)
|
|
3420
|
-
: "";
|
|
3421
|
-
break;
|
|
3422
|
-
default:
|
|
3423
|
-
value = "";
|
|
3424
|
-
break;
|
|
3425
|
-
}
|
|
3426
|
-
return value;
|
|
3427
|
-
};
|
|
3428
|
-
Sources.prototype.getValueFromSource = function (source) {
|
|
3429
|
-
var value = "";
|
|
3430
|
-
switch (source.key) {
|
|
3431
|
-
case ESourceKey.USER_CONFIG:
|
|
3432
|
-
value = this.getValueFromUserConfig(source.props.path);
|
|
3433
|
-
break;
|
|
3434
|
-
case ESourceKey.BROWSER_STORAGE:
|
|
3435
|
-
value = this.getValueFromBrowserStorage(source.props.browserStorage.type, source.props.browserStorage.key);
|
|
3436
|
-
break;
|
|
3437
|
-
case ESourceKey.PREDEFINED:
|
|
3438
|
-
value = source.value;
|
|
3439
|
-
break;
|
|
3440
|
-
default:
|
|
3441
|
-
value = "";
|
|
3442
|
-
break;
|
|
3443
|
-
}
|
|
3444
|
-
return value;
|
|
3445
|
-
};
|
|
3446
|
-
Sources.prototype.setValueToUserConfig = function (path, value) {
|
|
3447
|
-
this._userConfig = setValueToObject(this._userConfig, path, value);
|
|
3448
|
-
};
|
|
3449
|
-
Sources.prototype.setValueToBrowserStorage = function (type, key, value) {
|
|
3450
|
-
switch (type) {
|
|
3451
|
-
case EBrowserStorageType.LOCAL_STORAGE:
|
|
3452
|
-
localStorage.setItem(key, value);
|
|
3453
|
-
break;
|
|
3454
|
-
case EBrowserStorageType.SESSION_STORAGE:
|
|
3455
|
-
sessionStorage.setItem(key, value);
|
|
3456
|
-
break;
|
|
3457
|
-
default:
|
|
3458
|
-
break;
|
|
3459
|
-
}
|
|
3460
|
-
};
|
|
3461
|
-
Sources.prototype.setValueToSource = function (source, value) {
|
|
3462
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
3463
|
-
var _a;
|
|
3464
|
-
return __generator(this, function (_b) {
|
|
3465
|
-
switch (_b.label) {
|
|
3466
|
-
case 0:
|
|
3467
|
-
_a = source.key;
|
|
3468
|
-
switch (_a) {
|
|
3469
|
-
case ESourceKey.USER_CONFIG: return [3 /*break*/, 1];
|
|
3470
|
-
case ESourceKey.BROWSER_STORAGE: return [3 /*break*/, 2];
|
|
3471
|
-
}
|
|
3472
|
-
return [3 /*break*/, 4];
|
|
3473
|
-
case 1:
|
|
3474
|
-
this.setValueToUserConfig(source.props.path, value);
|
|
3475
|
-
return [3 /*break*/, 5];
|
|
3476
|
-
case 2: return [4 /*yield*/, this.setValueToBrowserStorage(source.props.browserStorage.type, source.props.browserStorage.key, value)];
|
|
3477
|
-
case 3:
|
|
3478
|
-
_b.sent();
|
|
3479
|
-
return [3 /*break*/, 5];
|
|
3480
|
-
case 4: return [3 /*break*/, 5];
|
|
3481
|
-
case 5: return [2 /*return*/];
|
|
3482
|
-
}
|
|
3483
|
-
});
|
|
3484
|
-
});
|
|
3485
|
-
};
|
|
3486
|
-
return Sources;
|
|
3487
|
-
}());
|
|
3488
|
-
|
|
3489
|
-
var Condition = /** @class */ (function () {
|
|
3490
|
-
function Condition(condition, rulesMapping) {
|
|
3491
|
-
this._condition = condition;
|
|
3492
|
-
this._rulesMapping = rulesMapping;
|
|
3493
|
-
}
|
|
3494
|
-
Condition.prototype.parseKeys = function (condition, rulesEvaluationMapping) {
|
|
3495
|
-
Object.keys(rulesEvaluationMapping).forEach(function (key) {
|
|
3496
|
-
condition = replaceString(condition, key, rulesEvaluationMapping[key]);
|
|
3497
|
-
});
|
|
3498
|
-
return condition;
|
|
3499
|
-
};
|
|
3500
|
-
Condition.prototype.parseOperators = function (condition) {
|
|
3501
|
-
return condition.replace(/AND|OR|NOT|XOR|NAND|NOR|XNOR/g, function (match) {
|
|
3502
|
-
switch (match) {
|
|
3503
|
-
case "AND":
|
|
3504
|
-
return "&&";
|
|
3505
|
-
case "OR":
|
|
3506
|
-
return "||";
|
|
3507
|
-
case "NOT":
|
|
3508
|
-
return "!";
|
|
3509
|
-
case "XOR":
|
|
3510
|
-
return "^";
|
|
3511
|
-
case "NAND":
|
|
3512
|
-
return "!&";
|
|
3513
|
-
case "NOR":
|
|
3514
|
-
return "!|";
|
|
3515
|
-
case "XNOR":
|
|
3516
|
-
return "!^";
|
|
3517
|
-
default:
|
|
3518
|
-
return match;
|
|
3519
|
-
}
|
|
3520
|
-
});
|
|
3521
|
-
};
|
|
3522
|
-
Condition.prototype.evaluate = function () {
|
|
3523
|
-
this._condition = this.parseKeys(this._condition, this._rulesMapping);
|
|
3524
|
-
this._condition = this.parseOperators(this._condition);
|
|
3525
|
-
return eval(this._condition);
|
|
3526
|
-
};
|
|
3527
|
-
return Condition;
|
|
3528
|
-
}());
|
|
3529
|
-
|
|
3530
|
-
var Actions = /** @class */ (function () {
|
|
3531
|
-
function Actions(action, ruleMapping, userConfig, takeAction) {
|
|
3532
|
-
this._action = action;
|
|
3533
|
-
this._userConfig = userConfig;
|
|
3534
|
-
this._ruleMapping = ruleMapping;
|
|
3535
|
-
this._takeAction = takeAction;
|
|
3536
|
-
}
|
|
3537
|
-
Actions.prototype.execute = function () {
|
|
3538
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
3539
|
-
var condition, actionSuccess;
|
|
3540
|
-
return __generator(this, function (_a) {
|
|
3541
|
-
condition = new Condition(this._action.condition, this._ruleMapping);
|
|
3542
|
-
actionSuccess = condition.evaluate();
|
|
3543
|
-
if (actionSuccess) {
|
|
3544
|
-
return [2 /*return*/, this._takeAction(this._action, this._userConfig)];
|
|
3545
|
-
}
|
|
3546
|
-
return [2 /*return*/];
|
|
3547
|
-
});
|
|
3548
|
-
});
|
|
3549
|
-
};
|
|
3550
|
-
return Actions;
|
|
3551
|
-
}());
|
|
3552
|
-
|
|
3553
|
-
var Rules = /** @class */ (function () {
|
|
3554
|
-
function Rules(rules, userConfig) {
|
|
3555
|
-
this._userConfig = userConfig;
|
|
3556
|
-
this._rules = rules;
|
|
3557
|
-
}
|
|
3558
|
-
Rules.prototype.evaluate = function (rule) {
|
|
3559
|
-
var ruleType = rule.key;
|
|
3560
|
-
var ruleEvaluationStatus = false;
|
|
3561
|
-
var source = new Sources(this._userConfig);
|
|
3562
|
-
switch (ruleType) {
|
|
3563
|
-
case ERuleKey.OBJECT_PATH_EXISTS:
|
|
3564
|
-
var ruleObjectPathExists = rule;
|
|
3565
|
-
var ruleObjectPathExistsObject = ruleObjectPathExists.props.object;
|
|
3566
|
-
var ruleObjectPathExistsPath = ruleObjectPathExists.props.path;
|
|
3567
|
-
switch (ruleObjectPathExistsObject) {
|
|
3568
|
-
case ESourceKey.USER_CONFIG:
|
|
3569
|
-
ruleEvaluationStatus = hasPath(this._userConfig, ruleObjectPathExistsPath);
|
|
3570
|
-
break;
|
|
3571
|
-
default:
|
|
3572
|
-
ruleEvaluationStatus = false;
|
|
3573
|
-
break;
|
|
3574
|
-
}
|
|
3575
|
-
break;
|
|
3576
|
-
case ERuleKey.VALUE_CHECK:
|
|
3577
|
-
var ruleValueCheck = rule;
|
|
3578
|
-
var ruleValueCheckSource = ruleValueCheck.props.value.source;
|
|
3579
|
-
var ruleValueCheckValue = source.getValueFromSource(ruleValueCheckSource);
|
|
3580
|
-
if (ruleValueCheck.props.pattern.key === EPatternKey.CUSTOM) {
|
|
3581
|
-
var re = new RegExp(ruleValueCheck.props.pattern.pattern);
|
|
3582
|
-
}
|
|
3583
|
-
else {
|
|
3584
|
-
var re = new RegExp(EPattern[ruleValueCheck.props.pattern.key]);
|
|
3585
|
-
}
|
|
3586
|
-
ruleEvaluationStatus = re.test(ruleValueCheckValue);
|
|
3587
|
-
break;
|
|
3588
|
-
case ERuleKey.VALUE_CHANGE:
|
|
3589
|
-
var ruleValueChange = rule;
|
|
3590
|
-
var ruleValueChangeCurrentSource = ruleValueChange.props.value.current.source;
|
|
3591
|
-
var ruleValueChangePreviousSource = ruleValueChange.props.value.previous.source;
|
|
3592
|
-
var previousValue = source.getValueFromSource(ruleValueChangePreviousSource);
|
|
3593
|
-
var currentValue = source.getValueFromSource(ruleValueChangeCurrentSource);
|
|
3594
|
-
ruleEvaluationStatus = previousValue === currentValue;
|
|
3595
|
-
break;
|
|
3596
|
-
default:
|
|
3597
|
-
break;
|
|
3598
|
-
}
|
|
3599
|
-
return ruleEvaluationStatus;
|
|
3600
|
-
};
|
|
3601
|
-
Rules.prototype.mapping = function () {
|
|
3602
|
-
var e_1, _a, _b;
|
|
3603
|
-
var rulesEvaluationMapping = {};
|
|
3604
|
-
try {
|
|
3605
|
-
for (var _c = __values(this._rules), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
3606
|
-
var rule = _d.value;
|
|
3607
|
-
var ruleEvaluationStatus = this.evaluate(rule);
|
|
3608
|
-
rulesEvaluationMapping = Object.assign(Object.assign({}, rulesEvaluationMapping), (_b = {}, _b[rule.id] = ruleEvaluationStatus, _b));
|
|
3609
|
-
}
|
|
3610
|
-
}
|
|
3611
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
3612
|
-
finally {
|
|
3613
|
-
try {
|
|
3614
|
-
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
3615
|
-
}
|
|
3616
|
-
finally { if (e_1) throw e_1.error; }
|
|
3617
|
-
}
|
|
3618
|
-
return rulesEvaluationMapping;
|
|
3619
|
-
};
|
|
3620
|
-
return Rules;
|
|
3621
|
-
}());
|
|
3622
|
-
|
|
3623
|
-
var Validations = /** @class */ (function () {
|
|
3624
|
-
function Validations(userConfig, takeAction) {
|
|
3625
|
-
this._userConfig = userConfig;
|
|
3626
|
-
this._takeAction = takeAction;
|
|
3627
|
-
}
|
|
3628
|
-
Object.defineProperty(Validations.prototype, "userConfig", {
|
|
3629
|
-
get: function () {
|
|
3630
|
-
return this._userConfig;
|
|
3631
|
-
},
|
|
3632
|
-
set: function (value) {
|
|
3633
|
-
this._userConfig = value;
|
|
3634
|
-
},
|
|
3635
|
-
enumerable: false,
|
|
3636
|
-
configurable: true
|
|
3637
|
-
});
|
|
3638
|
-
Validations.prototype.validateField = function () {
|
|
3639
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
3640
|
-
var validations, triggers, rules, actions, rulesMapping, actions_1, actions_1_1, action, conditionEvaluation, actions_2, e_1_1;
|
|
3641
|
-
var e_1, _a;
|
|
3642
|
-
return __generator(this, function (_b) {
|
|
3643
|
-
switch (_b.label) {
|
|
3644
|
-
case 0:
|
|
3645
|
-
validations = this._userConfig.userFormFieldsConfig.validation;
|
|
3646
|
-
triggers = validations === null || validations === void 0 ? void 0 : validations.triggers;
|
|
3647
|
-
rules = validations.rules;
|
|
3648
|
-
actions = validations.actions;
|
|
3649
|
-
rulesMapping = new Rules(rules, this._userConfig).mapping();
|
|
3650
|
-
_b.label = 1;
|
|
3651
|
-
case 1:
|
|
3652
|
-
_b.trys.push([1, 6, 7, 8]);
|
|
3653
|
-
actions_1 = __values(actions), actions_1_1 = actions_1.next();
|
|
3654
|
-
_b.label = 2;
|
|
3655
|
-
case 2:
|
|
3656
|
-
if (!!actions_1_1.done) return [3 /*break*/, 5];
|
|
3657
|
-
action = actions_1_1.value;
|
|
3658
|
-
conditionEvaluation = new Condition(action.condition, rulesMapping).evaluate();
|
|
3659
|
-
if (!conditionEvaluation) return [3 /*break*/, 4];
|
|
3660
|
-
actions_2 = new Actions(action, rulesMapping, this._userConfig, this._takeAction);
|
|
3661
|
-
return [4 /*yield*/, actions_2.execute()];
|
|
3662
|
-
case 3:
|
|
3663
|
-
_b.sent();
|
|
3664
|
-
_b.label = 4;
|
|
3665
|
-
case 4:
|
|
3666
|
-
actions_1_1 = actions_1.next();
|
|
3667
|
-
return [3 /*break*/, 2];
|
|
3668
|
-
case 5: return [3 /*break*/, 8];
|
|
3669
|
-
case 6:
|
|
3670
|
-
e_1_1 = _b.sent();
|
|
3671
|
-
e_1 = { error: e_1_1 };
|
|
3672
|
-
return [3 /*break*/, 8];
|
|
3673
|
-
case 7:
|
|
3674
|
-
try {
|
|
3675
|
-
if (actions_1_1 && !actions_1_1.done && (_a = actions_1.return)) _a.call(actions_1);
|
|
3676
|
-
}
|
|
3677
|
-
finally { if (e_1) throw e_1.error; }
|
|
3678
|
-
return [7 /*endfinally*/];
|
|
3679
|
-
case 8: return [2 /*return*/];
|
|
3680
|
-
}
|
|
3681
|
-
});
|
|
3682
|
-
});
|
|
3683
|
-
};
|
|
3684
|
-
return Validations;
|
|
3685
|
-
}());
|
|
3001
|
+
}], ngOnChanges: [] } });
|
|
3686
3002
|
|
|
3687
3003
|
var Converter = /** @class */ (function () {
|
|
3688
3004
|
function Converter() {
|
|
3689
3005
|
this.getFormFields = function (formConfig) {
|
|
3690
3006
|
var fields;
|
|
3691
|
-
if (
|
|
3007
|
+
if (kwikidToolkit.checkObjectKeyExists(formConfig, "multiForm")) {
|
|
3692
3008
|
fields = formConfig.multiForm.fields;
|
|
3693
3009
|
}
|
|
3694
3010
|
else {
|
|
@@ -3697,7 +3013,7 @@
|
|
|
3697
3013
|
return fields;
|
|
3698
3014
|
};
|
|
3699
3015
|
this.setMissingFieldKeyValue = function (field, key, value) {
|
|
3700
|
-
if (!
|
|
3016
|
+
if (!kwikidToolkit.checkObjectKeyExists(field, key)) {
|
|
3701
3017
|
field[key] = value;
|
|
3702
3018
|
}
|
|
3703
3019
|
return field;
|
|
@@ -3707,7 +3023,7 @@
|
|
|
3707
3023
|
return field;
|
|
3708
3024
|
};
|
|
3709
3025
|
this.removeFieldKey = function (field, key) {
|
|
3710
|
-
if (
|
|
3026
|
+
if (kwikidToolkit.checkObjectKeyExists(field, key)) {
|
|
3711
3027
|
delete field[key];
|
|
3712
3028
|
}
|
|
3713
3029
|
return field;
|
|
@@ -3730,7 +3046,8 @@
|
|
|
3730
3046
|
return { label: x, disabled: false };
|
|
3731
3047
|
}
|
|
3732
3048
|
else {
|
|
3733
|
-
if (
|
|
3049
|
+
if (kwikidToolkit.checkObjectKeyExists(x, "label") &&
|
|
3050
|
+
kwikidToolkit.checkObjectKeyExists(x, "disabled")) {
|
|
3734
3051
|
return x;
|
|
3735
3052
|
}
|
|
3736
3053
|
}
|
|
@@ -3743,14 +3060,14 @@
|
|
|
3743
3060
|
return field;
|
|
3744
3061
|
};
|
|
3745
3062
|
var formatFieldTypeDate = function (field) {
|
|
3746
|
-
if (
|
|
3063
|
+
if (kwikidToolkit.checkObjectKeyExists(field, "min")) {
|
|
3747
3064
|
var tuiDay = convertDateStringToTuiDayFormat(field["min"]);
|
|
3748
3065
|
field.properties = _this.setFieldKeyValue(field.properties, "min", tuiDay);
|
|
3749
3066
|
}
|
|
3750
3067
|
else {
|
|
3751
3068
|
field.properties = _this.setMissingFieldKeyValue(field.properties, "min", new cdk.TuiDay(0, 0, 1)); // Year - 0000, Month - 0 (0 Indexing), Day - 1
|
|
3752
3069
|
}
|
|
3753
|
-
if (
|
|
3070
|
+
if (kwikidToolkit.checkObjectKeyExists(field, "max")) {
|
|
3754
3071
|
var tuiDay = convertDateStringToTuiDayFormat(field["max"]);
|
|
3755
3072
|
field.properties = _this.setFieldKeyValue(field.properties, "max", tuiDay);
|
|
3756
3073
|
}
|
|
@@ -3760,11 +3077,12 @@
|
|
|
3760
3077
|
new Date().getDate() // Day - 31
|
|
3761
3078
|
));
|
|
3762
3079
|
}
|
|
3080
|
+
field.properties = _this.setMissingFieldKeyValue(field.properties, "placeholder", "");
|
|
3763
3081
|
field = _this.setFieldKeyValue(field, "hidden", false);
|
|
3764
3082
|
return field;
|
|
3765
3083
|
};
|
|
3766
3084
|
var formatFieldTypeNumber = function (field) {
|
|
3767
|
-
if (
|
|
3085
|
+
if (kwikidToolkit.checkObjectKeyExists(field, "key")) {
|
|
3768
3086
|
if (field.key === "aadhaar_number") {
|
|
3769
3087
|
field = _this.setFieldKeyValue(field, "type", "aadhaar_number");
|
|
3770
3088
|
}
|
|
@@ -3787,16 +3105,16 @@
|
|
|
3787
3105
|
return field;
|
|
3788
3106
|
};
|
|
3789
3107
|
var formatFieldTypeApiCall = function (field) {
|
|
3790
|
-
if (!
|
|
3108
|
+
if (!kwikidToolkit.checkObjectKeyExists(field.properties, "shape")) {
|
|
3791
3109
|
field.properties = _this.setFieldKeyValue(field.properties, "shape", null);
|
|
3792
3110
|
}
|
|
3793
|
-
if (!
|
|
3111
|
+
if (!kwikidToolkit.checkObjectKeyExists(field, "showLoader")) {
|
|
3794
3112
|
field = _this.setFieldKeyValue(field, "showLoader", false);
|
|
3795
3113
|
}
|
|
3796
|
-
if (!
|
|
3114
|
+
if (!kwikidToolkit.checkObjectKeyExists(field.properties, "size")) {
|
|
3797
3115
|
field.properties = _this.setFieldKeyValue(field.properties, "size", "m");
|
|
3798
3116
|
}
|
|
3799
|
-
if (!
|
|
3117
|
+
if (!kwikidToolkit.checkObjectKeyExists(field, "api")) {
|
|
3800
3118
|
field = _this.setFieldKeyValue(field, "api", {});
|
|
3801
3119
|
field.api = _this.setMissingFieldKeyValue(field.api, "url", "");
|
|
3802
3120
|
field.api = _this.setMissingFieldKeyValue(field.api, "request", "");
|
|
@@ -3813,7 +3131,7 @@
|
|
|
3813
3131
|
return field;
|
|
3814
3132
|
};
|
|
3815
3133
|
var formatFieldTypeSearchText = function (field) {
|
|
3816
|
-
if (
|
|
3134
|
+
if (kwikidToolkit.checkObjectKeyExists(field, "type")) {
|
|
3817
3135
|
if (field.type === "search-text") {
|
|
3818
3136
|
field = _this.setFieldKeyValue(field, "type", "dropdown-with-search");
|
|
3819
3137
|
}
|
|
@@ -3859,7 +3177,7 @@
|
|
|
3859
3177
|
return object;
|
|
3860
3178
|
};
|
|
3861
3179
|
var formatFieldKeys = function (field) {
|
|
3862
|
-
if (
|
|
3180
|
+
if (kwikidToolkit.checkObjectKeyExists(field, "connectedTo")) {
|
|
3863
3181
|
if (typeof field["connectedTo"] === "string") {
|
|
3864
3182
|
field["connectedElements"] = [
|
|
3865
3183
|
getConnectedElementKeyValueObject(field["connectedTo"])
|
|
@@ -3873,7 +3191,7 @@
|
|
|
3873
3191
|
}
|
|
3874
3192
|
}
|
|
3875
3193
|
_this.removeFieldKey(field, "connectedTo");
|
|
3876
|
-
if (
|
|
3194
|
+
if (kwikidToolkit.checkObjectKeyExists(field, "connectedToParent")) {
|
|
3877
3195
|
if (typeof field["connectedToParent"] === "string") {
|
|
3878
3196
|
field["connectedParentFields"] = [
|
|
3879
3197
|
getConnectedElementKeyValueObject(field["connectedToParent"])
|
|
@@ -3889,10 +3207,10 @@
|
|
|
3889
3207
|
};
|
|
3890
3208
|
var getConnectedElementFieldMapping = function (field, connectedFieldMapping) {
|
|
3891
3209
|
var getConnectedElementChildFieldMapping = function (field, connectedFieldMapping) {
|
|
3892
|
-
if (
|
|
3210
|
+
if (kwikidToolkit.checkObjectKeyExists(field, "connectedElements")) {
|
|
3893
3211
|
connectedFieldMapping["child"][field.key] = field.connectedElements;
|
|
3894
3212
|
}
|
|
3895
|
-
else if (
|
|
3213
|
+
else if (kwikidToolkit.checkObjectKeyExists(connectedFieldMapping["child"], field.key)) {
|
|
3896
3214
|
field["connectedElements"] =
|
|
3897
3215
|
connectedFieldMapping["child"][field.key];
|
|
3898
3216
|
}
|
|
@@ -3900,11 +3218,11 @@
|
|
|
3900
3218
|
};
|
|
3901
3219
|
var getConnectedElementParentFieldMapping = function (field, connectedFieldMapping) {
|
|
3902
3220
|
var e_2, _f;
|
|
3903
|
-
if (
|
|
3221
|
+
if (kwikidToolkit.checkObjectKeyExists(connectedFieldMapping["child"], field.key)) {
|
|
3904
3222
|
try {
|
|
3905
3223
|
for (var _g = __values(connectedFieldMapping["child"][field.key]), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
3906
3224
|
var connectedParentKey = _h.value;
|
|
3907
|
-
if (
|
|
3225
|
+
if (kwikidToolkit.checkObjectKeyExists(connectedFieldMapping["parent"], connectedParentKey["key"])) {
|
|
3908
3226
|
connectedFieldMapping["parent"][connectedParentKey["key"]].push(field.key);
|
|
3909
3227
|
}
|
|
3910
3228
|
else {
|
|
@@ -3935,10 +3253,10 @@
|
|
|
3935
3253
|
return connectedFieldMapping;
|
|
3936
3254
|
};
|
|
3937
3255
|
var updateConnectedElementsKeyValue = function (field, connectedFieldMapping) {
|
|
3938
|
-
if (
|
|
3256
|
+
if (kwikidToolkit.checkObjectKeyExists(connectedFieldMapping["child"], field.key)) {
|
|
3939
3257
|
field["connectedElements"] = connectedFieldMapping["child"][field.key];
|
|
3940
3258
|
}
|
|
3941
|
-
if (
|
|
3259
|
+
if (kwikidToolkit.checkObjectKeyExists(connectedFieldMapping["parent"], field.key)) {
|
|
3942
3260
|
field["connectedParentFields"] =
|
|
3943
3261
|
connectedFieldMapping["parent"][field.key];
|
|
3944
3262
|
}
|
|
@@ -3947,45 +3265,47 @@
|
|
|
3947
3265
|
var updateFieldValidatorConfig = function (field) {
|
|
3948
3266
|
var _a, _b, _c, _d, _e;
|
|
3949
3267
|
if (field.type !== "title") {
|
|
3950
|
-
var validators =
|
|
3268
|
+
var validators = kwikidToolkit.checkObjectKeyExists(field, "validators")
|
|
3269
|
+
? field.validators
|
|
3270
|
+
: {};
|
|
3951
3271
|
field = _this.setMissingFieldKeyValue(field, "validators", {});
|
|
3952
|
-
field = _this.setFieldKeyValue(field, "validators", Object.assign(Object.assign({}, field["validators"]), { min:
|
|
3953
|
-
?
|
|
3272
|
+
field = _this.setFieldKeyValue(field, "validators", Object.assign(Object.assign({}, field["validators"]), { min: kwikidToolkit.checkObjectKeyExists(validators, "min")
|
|
3273
|
+
? kwikidToolkit.isNotEmptyValue(validators.min)
|
|
3954
3274
|
? Number(validators.min)
|
|
3955
3275
|
: null
|
|
3956
|
-
:
|
|
3276
|
+
: kwikidToolkit.checkObjectKeyExists(field, "min")
|
|
3957
3277
|
? Number(field.min)
|
|
3958
|
-
: null, max:
|
|
3959
|
-
?
|
|
3278
|
+
: null, max: kwikidToolkit.checkObjectKeyExists(validators, "max")
|
|
3279
|
+
? kwikidToolkit.isNotEmptyValue(validators.max)
|
|
3960
3280
|
? Number(validators.max)
|
|
3961
3281
|
: null
|
|
3962
|
-
:
|
|
3282
|
+
: kwikidToolkit.checkObjectKeyExists(field, "max")
|
|
3963
3283
|
? Number(field.max)
|
|
3964
|
-
: null, required:
|
|
3284
|
+
: null, required: kwikidToolkit.checkObjectKeyExists(validators, "required")
|
|
3965
3285
|
? Boolean(validators.required)
|
|
3966
|
-
:
|
|
3286
|
+
: kwikidToolkit.checkObjectKeyExists(field, "required")
|
|
3967
3287
|
? Boolean(field.required)
|
|
3968
|
-
: false, minLength:
|
|
3969
|
-
?
|
|
3288
|
+
: false, minLength: kwikidToolkit.checkObjectKeyExists(validators, "minLength")
|
|
3289
|
+
? kwikidToolkit.isNotEmptyValue(validators.minLength)
|
|
3970
3290
|
? Number(validators.minLength)
|
|
3971
3291
|
: null
|
|
3972
|
-
:
|
|
3292
|
+
: kwikidToolkit.checkObjectKeyExists(field, "minLength")
|
|
3973
3293
|
? Number(field.minLength)
|
|
3974
|
-
: null, maxLength:
|
|
3975
|
-
?
|
|
3294
|
+
: null, maxLength: kwikidToolkit.checkObjectKeyExists(validators, "maxLength")
|
|
3295
|
+
? kwikidToolkit.isNotEmptyValue(validators.maxLength)
|
|
3976
3296
|
? Number(validators.maxLength)
|
|
3977
3297
|
: null
|
|
3978
|
-
:
|
|
3298
|
+
: kwikidToolkit.checkObjectKeyExists(field, "length")
|
|
3979
3299
|
? Number(field.length)
|
|
3980
|
-
:
|
|
3300
|
+
: kwikidToolkit.checkObjectKeyExists(field, "maxLength")
|
|
3981
3301
|
? Number(field.maxLength)
|
|
3982
|
-
: null, pattern:
|
|
3983
|
-
?
|
|
3302
|
+
: null, pattern: kwikidToolkit.checkObjectKeyExists(validators, "pattern")
|
|
3303
|
+
? kwikidToolkit.isNotEmptyValue(validators.pattern)
|
|
3984
3304
|
? validators.pattern
|
|
3985
3305
|
: undefined
|
|
3986
|
-
:
|
|
3306
|
+
: kwikidToolkit.checkObjectKeyExists(field, "pattern")
|
|
3987
3307
|
? { key: "CUSTOM", pattern: String(field.pattern) }
|
|
3988
|
-
:
|
|
3308
|
+
: kwikidToolkit.checkObjectKeyExists(field, "regex")
|
|
3989
3309
|
? { key: "CUSTOM", pattern: String(field.regex) }
|
|
3990
3310
|
: undefined }));
|
|
3991
3311
|
delete field.min;
|
|
@@ -4004,19 +3324,19 @@
|
|
|
4004
3324
|
default:
|
|
4005
3325
|
break;
|
|
4006
3326
|
}
|
|
4007
|
-
if (
|
|
3327
|
+
if (kwikidToolkit.isEmptyValue((_a = field.validators) === null || _a === void 0 ? void 0 : _a.min)) {
|
|
4008
3328
|
delete field.validators.min;
|
|
4009
3329
|
}
|
|
4010
|
-
if (
|
|
3330
|
+
if (kwikidToolkit.isEmptyValue((_b = field.validators) === null || _b === void 0 ? void 0 : _b.max)) {
|
|
4011
3331
|
delete field.validators.min;
|
|
4012
3332
|
}
|
|
4013
|
-
if (
|
|
3333
|
+
if (kwikidToolkit.isEmptyValue((_c = field.validators) === null || _c === void 0 ? void 0 : _c.minLength)) {
|
|
4014
3334
|
delete field.validators.minLength;
|
|
4015
3335
|
}
|
|
4016
|
-
if (
|
|
3336
|
+
if (kwikidToolkit.isEmptyValue((_d = field.validators) === null || _d === void 0 ? void 0 : _d.maxLength)) {
|
|
4017
3337
|
delete field.validators.maxLength;
|
|
4018
3338
|
}
|
|
4019
|
-
if (
|
|
3339
|
+
if (kwikidToolkit.isEmptyValue((_e = field.validators) === null || _e === void 0 ? void 0 : _e.pattern)) {
|
|
4020
3340
|
delete field.validators.pattern;
|
|
4021
3341
|
}
|
|
4022
3342
|
field.focus = false;
|
|
@@ -4026,14 +3346,14 @@
|
|
|
4026
3346
|
};
|
|
4027
3347
|
var updateFieldDefaultValueConfig = function (field) {
|
|
4028
3348
|
if (field.type !== "title") {
|
|
4029
|
-
if (
|
|
3349
|
+
if (kwikidToolkit.checkObjectKeyExists(field, "defaultValue")) {
|
|
4030
3350
|
return field;
|
|
4031
3351
|
}
|
|
4032
|
-
else if (
|
|
3352
|
+
else if (kwikidToolkit.checkObjectKeyExists(field, "default")) {
|
|
4033
3353
|
return field;
|
|
4034
3354
|
}
|
|
4035
3355
|
else {
|
|
4036
|
-
if (
|
|
3356
|
+
if (kwikidToolkit.checkObjectKeyExists(field, "defaultVal")) {
|
|
4037
3357
|
// Currently below line is commented because it caused issues in setting Default Value.
|
|
4038
3358
|
// field["defaultValue"] = field["defaultVal"];
|
|
4039
3359
|
// delete field["defaultVal"];
|
|
@@ -4078,8 +3398,8 @@
|
|
|
4078
3398
|
]
|
|
4079
3399
|
};
|
|
4080
3400
|
}
|
|
4081
|
-
else if (
|
|
4082
|
-
if (
|
|
3401
|
+
else if (kwikidToolkit.checkObjectKeyExists(field, "autofill")) {
|
|
3402
|
+
if (kwikidToolkit.checkObjectKeyExists(field.autofill, "type")) {
|
|
4083
3403
|
if (field.autofill.type === "storage") {
|
|
4084
3404
|
field["defaultValue"] = {
|
|
4085
3405
|
is_found: false,
|
|
@@ -4212,9 +3532,9 @@
|
|
|
4212
3532
|
};
|
|
4213
3533
|
var updateFieldResetButton = function (field) {
|
|
4214
3534
|
if (field.type === "title") {
|
|
4215
|
-
if (
|
|
3535
|
+
if (kwikidToolkit.checkObjectKeyExists(field, "action") &&
|
|
4216
3536
|
field.action === "reset" &&
|
|
4217
|
-
|
|
3537
|
+
kwikidToolkit.checkObjectKeyExists(field, "fields")) {
|
|
4218
3538
|
field = _this.setFieldKeyValue(field, "reset", {
|
|
4219
3539
|
fields: field.fields
|
|
4220
3540
|
});
|
|
@@ -4223,7 +3543,7 @@
|
|
|
4223
3543
|
return field;
|
|
4224
3544
|
};
|
|
4225
3545
|
var setFormFields = function (formConfig, fields) {
|
|
4226
|
-
if (
|
|
3546
|
+
if (kwikidToolkit.checkObjectKeyExists(formConfig, "multiForm")) {
|
|
4227
3547
|
formConfig.multiForm["fields"] = fields;
|
|
4228
3548
|
}
|
|
4229
3549
|
else {
|
|
@@ -4236,8 +3556,8 @@
|
|
|
4236
3556
|
return formConfig;
|
|
4237
3557
|
};
|
|
4238
3558
|
var updateFormFieldGroups = function (fieldGroups, field) {
|
|
4239
|
-
if (
|
|
4240
|
-
if (
|
|
3559
|
+
if (kwikidToolkit.checkObjectKeyExists(field, "groupKey")) {
|
|
3560
|
+
if (kwikidToolkit.checkObjectKeyExists(fieldGroups, field.groupKey)) {
|
|
4241
3561
|
fieldGroups[field.groupKey].push(field.key);
|
|
4242
3562
|
}
|
|
4243
3563
|
else {
|
|
@@ -4283,7 +3603,7 @@
|
|
|
4283
3603
|
return Converter;
|
|
4284
3604
|
}());
|
|
4285
3605
|
__decorate([
|
|
4286
|
-
|
|
3606
|
+
kwikidToolkit.logMethod
|
|
4287
3607
|
], Converter.prototype, "convertFormConfig", null);
|
|
4288
3608
|
|
|
4289
3609
|
var KwikIDRendererService = /** @class */ (function () {
|
|
@@ -4347,6 +3667,7 @@
|
|
|
4347
3667
|
for (var formsList_1 = __values(formsList), formsList_1_1 = formsList_1.next(); !formsList_1_1.done; formsList_1_1 = formsList_1.next()) {
|
|
4348
3668
|
var form = formsList_1_1.value;
|
|
4349
3669
|
if (formsListCompleted.includes(form.key)) {
|
|
3670
|
+
console.log(formsListCompleted.includes(form.key));
|
|
4350
3671
|
form = setValueToObject(form, "status", "completed");
|
|
4351
3672
|
form = setValueToObject(form, "disabled", false);
|
|
4352
3673
|
}
|
|
@@ -4367,7 +3688,7 @@
|
|
|
4367
3688
|
for (var formsList_2 = __values(formsList), formsList_2_1 = formsList_2.next(); !formsList_2_1.done; formsList_2_1 = formsList_2.next()) {
|
|
4368
3689
|
var form = formsList_2_1.value;
|
|
4369
3690
|
if (form.status !== "completed") {
|
|
4370
|
-
if (
|
|
3691
|
+
if (kwikidToolkit.checkObjectKeyExists(form, "dependentOn")) {
|
|
4371
3692
|
var isDependent = form.dependentOn.every(function (r) { return formsListCompleted.includes(r); });
|
|
4372
3693
|
if (isDependent) {
|
|
4373
3694
|
form = setValueToObject(form, "status", "editable");
|
|
@@ -4419,7 +3740,7 @@
|
|
|
4419
3740
|
try {
|
|
4420
3741
|
for (var formsList_4 = __values(formsList), formsList_4_1 = formsList_4.next(); !formsList_4_1.done; formsList_4_1 = formsList_4.next()) {
|
|
4421
3742
|
var form = formsList_4_1.value;
|
|
4422
|
-
if (
|
|
3743
|
+
if (kwikidToolkit.checkObjectKeyExists(allFormsData, form.key)) {
|
|
4423
3744
|
currentUserFormAllFormsData = Object.assign(Object.assign({}, currentUserFormAllFormsData), (_b = {}, _b[form.key] = allFormsData[form.key], _b));
|
|
4424
3745
|
}
|
|
4425
3746
|
}
|
|
@@ -4445,6 +3766,7 @@
|
|
|
4445
3766
|
* this particular User Form only has to LOCAL METHOD Variable.
|
|
4446
3767
|
*/
|
|
4447
3768
|
var currentUserFormAllFormsData = this.filterAllFormsData(this.allFormsData, formsList);
|
|
3769
|
+
console.log(JSON.parse(JSON.stringify(formsList)));
|
|
4448
3770
|
formsListCompleted = this.findCompletedFormsList(currentUserFormAllFormsData);
|
|
4449
3771
|
formsList = this.markFormInFormsListAsCompleted(formsList, formsListCompleted);
|
|
4450
3772
|
formsList = this.markFormInFormsListAsDisabled(formsList, formsListCompleted);
|
|
@@ -4459,12 +3781,51 @@
|
|
|
4459
3781
|
}());
|
|
4460
3782
|
/** @nocollapse */ KwikIDRendererService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KwikIDRendererService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
4461
3783
|
/** @nocollapse */ KwikIDRendererService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KwikIDRendererService, providedIn: "root" });
|
|
3784
|
+
__decorate([
|
|
3785
|
+
kwikidToolkit.logMethod
|
|
3786
|
+
], KwikIDRendererService.prototype, "setFormsList", null);
|
|
3787
|
+
__decorate([
|
|
3788
|
+
kwikidToolkit.logMethod
|
|
3789
|
+
], KwikIDRendererService.prototype, "setFormsListCompleted", null);
|
|
3790
|
+
__decorate([
|
|
3791
|
+
kwikidToolkit.logMethod
|
|
3792
|
+
], KwikIDRendererService.prototype, "setAllFormsData", null);
|
|
3793
|
+
__decorate([
|
|
3794
|
+
kwikidToolkit.logMethod
|
|
3795
|
+
], KwikIDRendererService.prototype, "setActiveFormConfig", null);
|
|
3796
|
+
__decorate([
|
|
3797
|
+
kwikidToolkit.logMethod
|
|
3798
|
+
], KwikIDRendererService.prototype, "setActiveFormFields", null);
|
|
3799
|
+
__decorate([
|
|
3800
|
+
kwikidToolkit.logMethod
|
|
3801
|
+
], KwikIDRendererService.prototype, "setActiveFormData", null);
|
|
3802
|
+
__decorate([
|
|
3803
|
+
kwikidToolkit.logMethod
|
|
3804
|
+
], KwikIDRendererService.prototype, "findActiveFormConfig", null);
|
|
3805
|
+
__decorate([
|
|
3806
|
+
kwikidToolkit.logMethod
|
|
3807
|
+
], KwikIDRendererService.prototype, "findCompletedFormsList", null);
|
|
3808
|
+
__decorate([
|
|
3809
|
+
kwikidToolkit.logMethod
|
|
3810
|
+
], KwikIDRendererService.prototype, "markFormInFormsListAsCompleted", null);
|
|
3811
|
+
__decorate([
|
|
3812
|
+
kwikidToolkit.logMethod
|
|
3813
|
+
], KwikIDRendererService.prototype, "markFormInFormsListAsDisabled", null);
|
|
3814
|
+
__decorate([
|
|
3815
|
+
kwikidToolkit.logMethod
|
|
3816
|
+
], KwikIDRendererService.prototype, "assignSequenceNoToForm", null);
|
|
3817
|
+
__decorate([
|
|
3818
|
+
kwikidToolkit.logMethod
|
|
3819
|
+
], KwikIDRendererService.prototype, "filterAllFormsData", null);
|
|
3820
|
+
__decorate([
|
|
3821
|
+
kwikidToolkit.logMethod
|
|
3822
|
+
], KwikIDRendererService.prototype, "updateFormsList", null);
|
|
4462
3823
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KwikIDRendererService, decorators: [{
|
|
4463
3824
|
type: i0.Injectable,
|
|
4464
3825
|
args: [{
|
|
4465
3826
|
providedIn: "root"
|
|
4466
3827
|
}]
|
|
4467
|
-
}], ctorParameters: function () { return []; } });
|
|
3828
|
+
}], ctorParameters: function () { return []; }, propDecorators: { setFormsList: [], setFormsListCompleted: [], setAllFormsData: [], setActiveFormConfig: [], setActiveFormFields: [], setActiveFormData: [], findActiveFormConfig: [], findCompletedFormsList: [], markFormInFormsListAsCompleted: [], markFormInFormsListAsDisabled: [], assignSequenceNoToForm: [], filterAllFormsData: [], updateFormsList: [] } });
|
|
4468
3829
|
|
|
4469
3830
|
var KwikIDFormsRendererComponent = /** @class */ (function () {
|
|
4470
3831
|
function KwikIDFormsRendererComponent(rendererService, hostElement) {
|
|
@@ -4539,6 +3900,7 @@
|
|
|
4539
3900
|
case 0:
|
|
4540
3901
|
this.loader = true;
|
|
4541
3902
|
this.rendererService.setAllFormsData(this.formsData);
|
|
3903
|
+
console.log(JSON.parse(JSON.stringify(this.rendererService.formsList)));
|
|
4542
3904
|
this.rendererService.updateFormsList();
|
|
4543
3905
|
this.handleResize(this.rendererService.formsList);
|
|
4544
3906
|
if (!(this.rendererService.formsList.length !==
|
|
@@ -4619,12 +3981,15 @@
|
|
|
4619
3981
|
var _this = this;
|
|
4620
3982
|
console.log(e);
|
|
4621
3983
|
if (this.userConfig.userFormFieldsConfig.validation) {
|
|
4622
|
-
var validations_1 = new Validations(
|
|
3984
|
+
var validations_1 = new kwikidToolkit.Validations({
|
|
3985
|
+
USER_CONFIG: this.userConfig,
|
|
3986
|
+
ALL_FORMS_DATA: this.formsData
|
|
3987
|
+
}, this.takeAction.bind(this));
|
|
4623
3988
|
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
4624
3989
|
var _this = this;
|
|
4625
3990
|
return __generator(this, function (_b) {
|
|
4626
3991
|
switch (_b.label) {
|
|
4627
|
-
case 0: return [4 /*yield*/, validations_1.
|
|
3992
|
+
case 0: return [4 /*yield*/, validations_1.validate(this.userConfig.userFormFieldsConfig.validation)];
|
|
4628
3993
|
case 1:
|
|
4629
3994
|
_b.sent();
|
|
4630
3995
|
if (this.userConfig.userFormFieldsConfig.status === "completed") {
|
|
@@ -4673,7 +4038,7 @@
|
|
|
4673
4038
|
KwikIDFormsRendererComponent.prototype.toggleErrorNotification = function (show) {
|
|
4674
4039
|
this.showErrorNotification = show;
|
|
4675
4040
|
};
|
|
4676
|
-
KwikIDFormsRendererComponent.prototype.takeAction = function (action, userConfig) {
|
|
4041
|
+
KwikIDFormsRendererComponent.prototype.takeAction = function (action, userConfig, formsData) {
|
|
4677
4042
|
return __awaiter(this, void 0, void 0, function () {
|
|
4678
4043
|
var _b, sources, sourceValue;
|
|
4679
4044
|
return __generator(this, function (_c) {
|
|
@@ -4685,12 +4050,16 @@
|
|
|
4685
4050
|
}
|
|
4686
4051
|
return [3 /*break*/, 3];
|
|
4687
4052
|
case 1:
|
|
4688
|
-
sources = new Sources(
|
|
4053
|
+
sources = new kwikidToolkit.Sources({
|
|
4054
|
+
USER_CONFIG: this.userConfig,
|
|
4055
|
+
ALL_FORMS_DATA: this.formsData
|
|
4056
|
+
});
|
|
4689
4057
|
return [4 /*yield*/, sources.getValueFromSource(action.props.value.source)];
|
|
4690
4058
|
case 2:
|
|
4691
4059
|
sourceValue = _c.sent();
|
|
4692
4060
|
sources.setValueToSource(action.props.value.destination, sourceValue);
|
|
4693
|
-
this.userConfig = sources.
|
|
4061
|
+
this.userConfig = sources.object.USER_CONFIG;
|
|
4062
|
+
this.formsData = sources.object.ALL_FORMS_DATA;
|
|
4694
4063
|
return [3 /*break*/, 4];
|
|
4695
4064
|
case 3: return [3 /*break*/, 4];
|
|
4696
4065
|
case 4: return [2 /*return*/];
|
|
@@ -4712,6 +4081,9 @@
|
|
|
4712
4081
|
])
|
|
4713
4082
|
])
|
|
4714
4083
|
] });
|
|
4084
|
+
__decorate([
|
|
4085
|
+
kwikidToolkit.logMethod
|
|
4086
|
+
], KwikIDFormsRendererComponent.prototype, "handleOnClickSetActiveForm", null);
|
|
4715
4087
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: KwikIDFormsRendererComponent, decorators: [{
|
|
4716
4088
|
type: i0.Component,
|
|
4717
4089
|
args: [{
|
|
@@ -4746,7 +4118,7 @@
|
|
|
4746
4118
|
type: i0.Output
|
|
4747
4119
|
}], onClickApiCall: [{
|
|
4748
4120
|
type: i0.Output
|
|
4749
|
-
}] } });
|
|
4121
|
+
}], handleOnClickSetActiveForm: [] } });
|
|
4750
4122
|
|
|
4751
4123
|
var KwikIDFormBuilderModule = /** @class */ (function () {
|
|
4752
4124
|
function KwikIDFormBuilderModule() {
|