@bolttech/form-engine-core 1.0.0-beta.15 → 1.0.0-beta.16
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/index.esm.js +11 -11
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -48,8 +48,8 @@ const DEFAULT_API_DEBOUNCE_TIME = 1000;
|
|
|
48
48
|
const DEFAULT_STATE_REFRESH_TIME = 100;
|
|
49
49
|
const TEMPLATE_REGEX_STRING_CONCATENATION_DETECTOR = /^\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}$/;
|
|
50
50
|
const TEMPLATE_REGEX_DELIMITATOR = /\$\{((?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*)\}/g;
|
|
51
|
-
const TEMPLATE_REGEX_OPERATOR_SPLITTER = /\s*(
|
|
52
|
-
const TEMPLATE_REGEX_OPERATOR_MATCHER =
|
|
51
|
+
const TEMPLATE_REGEX_OPERATOR_SPLITTER = /\s*(\|\||&&|!+)\s*/g;
|
|
52
|
+
const TEMPLATE_REGEX_OPERATOR_MATCHER = /^\|\||&&|!+$/;
|
|
53
53
|
const TEMPLATE_AVALIABLE_SCOPES = ['fields', 'iVars', 'form'];
|
|
54
54
|
const ALLOWED_RESET_PROPS_MUTATIONS = ['api', 'apiSchema', 'props', 'validations', 'visibilityConditions', 'resetValues'];
|
|
55
55
|
const DEFAULT_LOG_VERBOSE = false;
|
|
@@ -578,7 +578,7 @@ const formatters = {
|
|
|
578
578
|
* console.log(maskedValue); // Output: 'ab***gh###'
|
|
579
579
|
* ```
|
|
580
580
|
*/
|
|
581
|
-
var generic = (
|
|
581
|
+
var generic = (value, masks) => {
|
|
582
582
|
if (!(masks === null || masks === void 0 ? void 0 : masks.generic)) return value;
|
|
583
583
|
let masked = value;
|
|
584
584
|
masks.generic.forEach(item => {
|
|
@@ -597,7 +597,7 @@ var generic = ((value, masks) => {
|
|
|
597
597
|
masked = masked.slice(0, from - 1) + maskedPortion + masked.slice(to);
|
|
598
598
|
});
|
|
599
599
|
return masked;
|
|
600
|
-
}
|
|
600
|
+
};
|
|
601
601
|
|
|
602
602
|
/**
|
|
603
603
|
* Replaces all characters in a string with a specified replacement string or character.
|
|
@@ -882,7 +882,7 @@ const masks = {
|
|
|
882
882
|
* console.log(isValid); // Output: true or false based on validation
|
|
883
883
|
* ```
|
|
884
884
|
*/
|
|
885
|
-
var length = (
|
|
885
|
+
var length = (value, validations) => {
|
|
886
886
|
if (!validations.length || !value) return false;
|
|
887
887
|
let targetValue = value;
|
|
888
888
|
// We want length even if it is a numeric
|
|
@@ -898,7 +898,7 @@ var length = ((value, validations) => {
|
|
|
898
898
|
greaterOrEqual: targetValue.length < validations.length.target
|
|
899
899
|
};
|
|
900
900
|
return condition[validations.length.rule];
|
|
901
|
-
}
|
|
901
|
+
};
|
|
902
902
|
|
|
903
903
|
/**
|
|
904
904
|
* Validates a Spanish NIF (Número de Identificación Fiscal).
|
|
@@ -1136,7 +1136,7 @@ const CIF = value => {
|
|
|
1136
1136
|
* console.log(isValid); // Output: true or false based on validation
|
|
1137
1137
|
* ```
|
|
1138
1138
|
*/
|
|
1139
|
-
var document = (
|
|
1139
|
+
var document = (value, validations) => {
|
|
1140
1140
|
if (!value || !validations.document) return true;
|
|
1141
1141
|
const validation = {
|
|
1142
1142
|
NIF: (value, locale) => NIF(value, locale),
|
|
@@ -1145,7 +1145,7 @@ var document = ((value, validations) => {
|
|
|
1145
1145
|
IBAN: value => IBAN(value)
|
|
1146
1146
|
};
|
|
1147
1147
|
return validation[validations.document.type](value, validations.document.locale);
|
|
1148
|
-
}
|
|
1148
|
+
};
|
|
1149
1149
|
|
|
1150
1150
|
/**
|
|
1151
1151
|
* Validates if a value exceeds the maximum allowed value.
|
|
@@ -2263,10 +2263,10 @@ function run$1(value, handlers, validations) {
|
|
|
2263
2263
|
* const isValid = validateValue(value, methods);
|
|
2264
2264
|
* console.log(isValid); // Output: true
|
|
2265
2265
|
*/
|
|
2266
|
-
var namedRule = (
|
|
2266
|
+
var namedRule = (value, methods, validations) => {
|
|
2267
2267
|
if (!methods) return false;
|
|
2268
2268
|
return run$1(value, methods, validations).some(validation => validation);
|
|
2269
|
-
}
|
|
2269
|
+
};
|
|
2270
2270
|
|
|
2271
2271
|
/**
|
|
2272
2272
|
* @internal
|
|
@@ -3822,7 +3822,7 @@ class FormCore {
|
|
|
3822
3822
|
value
|
|
3823
3823
|
}) {
|
|
3824
3824
|
const field = this.fields.get(key);
|
|
3825
|
-
if (!field
|
|
3825
|
+
if (!field) {
|
|
3826
3826
|
this.queuedFieldResetPropertyEvents.set(key, {
|
|
3827
3827
|
property,
|
|
3828
3828
|
path,
|