redux-freeform 5.5.0 → 5.6.0-beta.0

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.
@@ -76,6 +76,20 @@ const ONLY_NATURALS_ERROR = "error/ONLY_NATURALS";
76
76
  const onlyNaturals = createValidator(ONLY_NATURALS, ONLY_NATURALS_ERROR);
77
77
  validatorFns[ONLY_NATURALS] = (value, args, form) => /^(\d+)?$/.test(value);
78
78
 
79
+ /*
80
+ 07/22: experimental expiration date constraint
81
+ should allow entry of expiration date using "/" character
82
+ to accommodate browser autofill
83
+
84
+ not tested as validation function
85
+ to validate exp date instead use combo of:
86
+ required(), hasLength(), isValidMonth(), dateAfterToday()
87
+ */
88
+ const ONLY_EXPIRATION_DATE = "validator/ONLY_EXPIRATION_DATE";
89
+ const ONLY_EXPIRATION_DATE_ERROR = "error/ONLY_EXPIRATION_DATE";
90
+ createValidator(ONLY_EXPIRATION_DATE, ONLY_EXPIRATION_DATE_ERROR);
91
+ validatorFns[ONLY_EXPIRATION_DATE] = (value, args, form) => /^((0[1-9])|(1[0-2])|([1-9]))([\/])?((2[2-9])|(3[0-9])|(4[0-9])|(5[0-9]))$/.test(value);
92
+
79
93
  const NUMBER_LESS_THAN = "validator/NUMBER_LESS_THAN";
80
94
  const NUMBER_LESS_THAN_ERROR = "error/NUMBER_LESS_THAN";
81
95
  const numberLessThan = createValidator(
@@ -72,6 +72,20 @@ const ONLY_NATURALS_ERROR = "error/ONLY_NATURALS";
72
72
  const onlyNaturals = createValidator(ONLY_NATURALS, ONLY_NATURALS_ERROR);
73
73
  validatorFns[ONLY_NATURALS] = (value, args, form) => /^(\d+)?$/.test(value);
74
74
 
75
+ /*
76
+ 07/22: experimental expiration date constraint
77
+ should allow entry of expiration date using "/" character
78
+ to accommodate browser autofill
79
+
80
+ not tested as validation function
81
+ to validate exp date instead use combo of:
82
+ required(), hasLength(), isValidMonth(), dateAfterToday()
83
+ */
84
+ const ONLY_EXPIRATION_DATE = "validator/ONLY_EXPIRATION_DATE";
85
+ const ONLY_EXPIRATION_DATE_ERROR = "error/ONLY_EXPIRATION_DATE";
86
+ createValidator(ONLY_EXPIRATION_DATE, ONLY_EXPIRATION_DATE_ERROR);
87
+ validatorFns[ONLY_EXPIRATION_DATE] = (value, args, form) => /^((0[1-9])|(1[0-2])|([1-9]))([\/])?((2[2-9])|(3[0-9])|(4[0-9])|(5[0-9]))$/.test(value);
88
+
75
89
  const NUMBER_LESS_THAN = "validator/NUMBER_LESS_THAN";
76
90
  const NUMBER_LESS_THAN_ERROR = "error/NUMBER_LESS_THAN";
77
91
  const numberLessThan = createValidator(
@@ -78,6 +78,20 @@
78
78
  const onlyNaturals = createValidator(ONLY_NATURALS, ONLY_NATURALS_ERROR);
79
79
  validatorFns[ONLY_NATURALS] = (value, args, form) => /^(\d+)?$/.test(value);
80
80
 
81
+ /*
82
+ 07/22: experimental expiration date constraint
83
+ should allow entry of expiration date using "/" character
84
+ to accommodate browser autofill
85
+
86
+ not tested as validation function
87
+ to validate exp date instead use combo of:
88
+ required(), hasLength(), isValidMonth(), dateAfterToday()
89
+ */
90
+ const ONLY_EXPIRATION_DATE = "validator/ONLY_EXPIRATION_DATE";
91
+ const ONLY_EXPIRATION_DATE_ERROR = "error/ONLY_EXPIRATION_DATE";
92
+ createValidator(ONLY_EXPIRATION_DATE, ONLY_EXPIRATION_DATE_ERROR);
93
+ validatorFns[ONLY_EXPIRATION_DATE] = (value, args, form) => /^((0[1-9])|(1[0-2])|([1-9]))([\/])?((2[2-9])|(3[0-9])|(4[0-9])|(5[0-9]))$/.test(value);
94
+
81
95
  const NUMBER_LESS_THAN = "validator/NUMBER_LESS_THAN";
82
96
  const NUMBER_LESS_THAN_ERROR = "error/NUMBER_LESS_THAN";
83
97
  const numberLessThan = createValidator(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redux-freeform",
3
- "version": "5.5.0",
3
+ "version": "5.6.0-beta.0",
4
4
  "description": "A small Redux form library that supports purely functional apps, without magic",
5
5
  "main": "dist/redux-freeform.cjs.js",
6
6
  "module": "dist/redux-freeform.esm.js",