aefis-core-ui 2.1.8-rc5 → 2.1.10

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.
@@ -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 = {};