aefis-core-ui 2.1.8-rc5 → 2.1.11
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/dist/index.modern.js +18 -2
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -15278,6 +15278,20 @@ const isNotNegativeNumber = () => fieldValue => {
|
|
|
15278
15278
|
if (isValid && parseFloat(fieldValue) < 0) return "should be positive number";
|
|
15279
15279
|
if (!isValid) return "should be number";
|
|
15280
15280
|
};
|
|
15281
|
+
const characterLimitLessThan = ruleValue => fieldValue => {
|
|
15282
|
+
// INFO: fasly values ("", undefined, null) are assumed to be to be 0
|
|
15283
|
+
if (!fieldValue) return;
|
|
15284
|
+
const isValid = fieldValue.length < ruleValue;
|
|
15285
|
+
if (!isValid) return `should not exceed ${ruleValue - 1} characters`;
|
|
15286
|
+
};
|
|
15287
|
+
const characterLimitMoreThan = ruleValue => fieldValue => {
|
|
15288
|
+
const message = `should be more than ${ruleValue} characters`;
|
|
15289
|
+
|
|
15290
|
+
// INFO: fasly values ("", undefined, null) are assumed to be to be 0
|
|
15291
|
+
if (!fieldValue) return message;
|
|
15292
|
+
const isValid = fieldValue.length > ruleValue;
|
|
15293
|
+
if (!isValid) return message;
|
|
15294
|
+
};
|
|
15281
15295
|
const Rules = {
|
|
15282
15296
|
moreThan,
|
|
15283
15297
|
moreThanOrEqual,
|
|
@@ -15289,7 +15303,9 @@ const Rules = {
|
|
|
15289
15303
|
required,
|
|
15290
15304
|
isInvalidDate,
|
|
15291
15305
|
isNumber,
|
|
15292
|
-
isNotNegativeNumber
|
|
15306
|
+
isNotNegativeNumber,
|
|
15307
|
+
characterLimitLessThan,
|
|
15308
|
+
characterLimitMoreThan
|
|
15293
15309
|
};
|
|
15294
15310
|
|
|
15295
15311
|
const configurationParameters = {};
|
|
@@ -17509,7 +17525,7 @@ const withEvalDisable = () => Component => {
|
|
|
17509
17525
|
|
|
17510
17526
|
// TODO: use lazyEval
|
|
17511
17527
|
return safeEval(code, formState);
|
|
17512
|
-
}, [formState.formData, formState.formContext]);
|
|
17528
|
+
}, [formState.formData, formState.formContext, props.disabled]);
|
|
17513
17529
|
return /*#__PURE__*/jsx(MemoizedComponent, _extends({}, props, {
|
|
17514
17530
|
disabled: isDisabled
|
|
17515
17531
|
}));
|