@thecb/components 6.1.3 → 6.1.4-beta.1
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.esm.js
CHANGED
|
@@ -34722,6 +34722,24 @@ const ONLY_NATURALS_ERROR = "error/ONLY_NATURALS";
|
|
|
34722
34722
|
const onlyNaturals = createValidator(ONLY_NATURALS, ONLY_NATURALS_ERROR);
|
|
34723
34723
|
validatorFns[ONLY_NATURALS] = (value, args, form) => /^(\d+)?$/.test(value);
|
|
34724
34724
|
|
|
34725
|
+
/*
|
|
34726
|
+
07/22: experimental expiration date constraint
|
|
34727
|
+
should allow entry of expiration date using "/" character
|
|
34728
|
+
to accommodate browser autofill
|
|
34729
|
+
|
|
34730
|
+
not tested as validation function
|
|
34731
|
+
to validate exp date instead use combo of:
|
|
34732
|
+
required(), hasLength(), isValidMonth(), dateAfterToday()
|
|
34733
|
+
*/
|
|
34734
|
+
const ONLY_EXPIRATION_DATE = "validator/ONLY_EXPIRATION_DATE";
|
|
34735
|
+
const ONLY_EXPIRATION_DATE_ERROR = "error/ONLY_EXPIRATION_DATE";
|
|
34736
|
+
const onlyExpirationDate = createValidator(
|
|
34737
|
+
ONLY_EXPIRATION_DATE,
|
|
34738
|
+
ONLY_EXPIRATION_DATE_ERROR
|
|
34739
|
+
);
|
|
34740
|
+
validatorFns[ONLY_EXPIRATION_DATE] = (value, args, form) =>
|
|
34741
|
+
/^(\d?\d?\/?\d?\d?)?$/.test(value);
|
|
34742
|
+
|
|
34725
34743
|
const NUMBER_LESS_THAN = "validator/NUMBER_LESS_THAN";
|
|
34726
34744
|
const NUMBER_LESS_THAN_ERROR = "error/NUMBER_LESS_THAN";
|
|
34727
34745
|
const numberLessThan = createValidator(
|
|
@@ -42291,7 +42309,7 @@ var formConfig$8 = {
|
|
|
42291
42309
|
},
|
|
42292
42310
|
expirationDate: {
|
|
42293
42311
|
validators: [required(), hasLength(4, 4), isValidMonth(0), dateAfterToday("MMYY", "month", true)],
|
|
42294
|
-
constraints: [
|
|
42312
|
+
constraints: [onlyExpirationDate(), hasLength(0, 4)]
|
|
42295
42313
|
},
|
|
42296
42314
|
cvv: {
|
|
42297
42315
|
validators: [required(), hasLength(3, 4)],
|