Skip to content
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1a6372f
Add phone validator
martijn00 May 24, 2024
6ddcac4
Add creditcard validators
martijn00 May 24, 2024
b23b9ed
Format
martijn00 May 24, 2024
a72c313
Add color code check
martijn00 May 24, 2024
f8f76b7
Format
martijn00 May 24, 2024
6976dbf
Add more
martijn00 May 24, 2024
b6c188e
add notMatch to FormFieldValidator; scenario: require password not to…
falconwoods Aug 7, 2023
2e2394c
Add readme for not match
martijn00 May 24, 2024
3813c27
Update changelog
martijn00 May 24, 2024
1171dbc
Format
martijn00 May 24, 2024
fa61a91
Update changelog
martijn00 May 24, 2024
ea3c57b
Merge branch 'notmatch-pr' into validators
martijn00 May 24, 2024
7b556b8
Add fileSize
martijn00 May 24, 2024
d1898d0
Add more
martijn00 May 24, 2024
ce8dbaa
More
martijn00 May 24, 2024
4f3a54a
Add tests
martijn00 May 24, 2024
608fa12
Fix tests
martijn00 May 24, 2024
5f7c10c
Add password
martijn00 May 24, 2024
e8102f5
Revert to dateString
martijn00 May 25, 2024
4829585
Update README.md
martijn00 May 25, 2024
f99a0be
Add checks
martijn00 May 25, 2024
5cc6aa4
Add assert
martijn00 May 25, 2024
5698e39
Color check
martijn00 May 25, 2024
cbf450c
Update version
martijn00 May 25, 2024
564c2f4
Clean test
martijn00 May 25, 2024
6f493e1
Using string for files
martijn00 May 25, 2024
410698f
Check credit card
martijn00 May 25, 2024
a3efb01
Update test
martijn00 May 25, 2024
e19d17d
Fix date range
martijn00 May 26, 2024
c7274d4
Add cc check test
martijn00 May 26, 2024
1a36a44
More tests
martijn00 May 26, 2024
862cb5c
Improve bytes
martijn00 May 26, 2024
927a761
Update changelog
martijn00 May 26, 2024
77b67de
More
martijn00 May 26, 2024
3536f88
Format
martijn00 May 26, 2024
2e7070f
Add or
martijn00 May 26, 2024
42ca441
Add extensions
martijn00 May 26, 2024
ec00125
Format
martijn00 May 26, 2024
7ca36a0
Translations
martijn00 May 26, 2024
d501e65
Add case
martijn00 May 26, 2024
2bd2e8b
Merge
martijn00 May 26, 2024
d69546e
Fix
martijn00 May 26, 2024
54b24b5
Add more phone tests
martijn00 May 26, 2024
925ade1
Format
martijn00 May 26, 2024
5ce3ef1
Fix test
martijn00 May 26, 2024
e8b7d34
Add more to example
martijn00 May 26, 2024
bc3523f
Add some
martijn00 May 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
## 10.0.2
* Reland generated l10n files
## 10.1.0

* Re-land generated l10n files
* Add Bulgarian
* Add creditCardExpirationDate
* Add creditCardCVC
* Add colorCode
* Add phoneNumber
* Add uppercase
* Add lowercase
* Add file extension
* Add max file size
* Add notMatch
* Add range
* Add date range
* Add must be true
* Add must be false
* Add special characters
* Add numeric characters
* Add lowercase characters
* Add uppercase characters
* Add password
* Add alphabetical
* Add uuid
* Add json
* Add latitude
* Add longitude
* Add base64
* Add path
* Add port number
* Add mac address
* Add startWith
* Add endWith
* Add contains
* Add between
* Add inList

## 10.0.1
* Fix regression (include l10n files)
Expand Down
49 changes: 44 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,20 @@ Also included is the `l10n` / `i18n` of error text messages to multiple language
This package comes with several most common `FormFieldValidator`s such as required, numeric, mail,
URL, min, max, minLength, maxLength, minWordsCount, maxWordsCount, IP, credit card, etc., with default `errorText` messages.

Available built-in validators include:
Available built-in helper validators:

- `FormBuilderValidators.compose()` - runs each validator against the value provided.
- `FormBuilderValidators.conditional()` - conditionally runs a validator against the value provided.
- `FormBuilderValidators.or()` - runs each validator against the value provided and passes when any works.

Available built-in type validators include:

- `FormBuilderValidators.creditCard()` - requires the field's value to be a valid credit card number.
- `FormBuilderValidators.date()` - requires the field's value to be a valid date string.
- `FormBuilderValidators.email()` - requires the field's value to be a valid email address.
- `FormBuilderValidators.equal()` - requires the field's value to be equal to the provided object.
- `FormBuilderValidators.integer()` - requires the field's value to be an integer.
- `FormBuilderValidators.ip()` - requires the field's value to be a valid IP address.
- `FormBuilderValidators.date()` - requires the field's value to be a valid date string.
- `FormBuilderValidators.dateRange()` - requires the field's value to be a within a date range.
- `FormBuilderValidators.match()` - requires the field's value to match the provided regex pattern.
- `FormBuilderValidators.notMatch()` - requires the field's value to not match the provided regex pattern.
- `FormBuilderValidators.max()` - requires the field's value to be less than or equal to the provided number.
- `FormBuilderValidators.maxLength()` - requires the length of the field's value to be less than or equal to the provided maximum size.
- `FormBuilderValidators.maxWordsCount()` - requires the word count of the field's value to be less than or equal to the provided maximum count.
Expand All @@ -64,7 +69,41 @@ Available built-in validators include:
- `FormBuilderValidators.equalLength()` - requires the length of the field's value to be equal to the provided minimum length.
- `FormBuilderValidators.numeric()` - requires the field's value to be a valid number.
- `FormBuilderValidators.required()` - requires the field to have a non-empty value.
- `FormBuilderValidators.uppercase()` - requires the field's value to be uppercase.
- `FormBuilderValidators.lowercase()` - requires the field's value to be lowercase.
- `FormBuilderValidators.mustBeTrue()` - requires the field's to be true.
- `FormBuilderValidators.mustBeFalse()` - requires the field's to be false.
- `FormBuilderValidators.hasSpecialChars()` - requires the field's to contain a specified number of special characters.
- `FormBuilderValidators.hasUppercaseChars()` - requires the field's to contain a specified number of uppercase characters.
- `FormBuilderValidators.hasLowercaseChars()` - requires the field's to contain a specified number of lowercase characters.
- `FormBuilderValidators.hasNumericChars()` - requires the field's to contain a specified number of numeric characters.
- `FormBuilderValidators.conditional()` - requires the field's to validate with another validator conditionally.
- `FormBuilderValidators.alphabetical()` - requires the field's to contain only alphabetical characters.
- `FormBuilderValidators.oddNumber()` - requires the field's to be an odd number.
- `FormBuilderValidators.evenNumber()` - requires the field's to be an even number.
- `FormBuilderValidators.between()` - requires the field's to be between two numbers.
- `FormBuilderValidators.inList()` - requires the field's to be in the provided list.

Available built-in use-case validators include:

- `FormBuilderValidators.creditCard()` - requires the field's value to be a valid credit card number.
- `FormBuilderValidators.creditCardExpirationDate()` - requires the field's value to be a valid credit card expiration date and can check if not expired yet.
- `FormBuilderValidators.creditCardCVC()` - requires the field's value to be a valid credit card CVC number.
- `FormBuilderValidators.colorCode()` - requires the field's value to be a valid color code.
- `FormBuilderValidators.email()` - requires the field's value to be a valid email address.
- `FormBuilderValidators.ip()` - requires the field's value to be a valid IP address.
- `FormBuilderValidators.url()` - requires the field's value to be a valid URL.
- `FormBuilderValidators.fileExtension()` - requires the field's value to a valid file extension.
- `FormBuilderValidators.fileSize()` - requires the field's to be less than the max size.
- `FormBuilderValidators.password()` - requires the field's to be a valid password that matched required conditions.
- `FormBuilderValidators.uuid()` - requires the field's to be a valid uuid.
- `FormBuilderValidators.json()` - requires the field's to be a valid json string.
- `FormBuilderValidators.latitude()` - requires the field's to be a valid latitude.
- `FormBuilderValidators.longitude()` - requires the field's to be a valid longitude.
- `FormBuilderValidators.base64()` - requires the field's to be a valid base64 string.
- `FormBuilderValidators.path()` - requires the field's to be a valid file or folder path.
- `FormBuilderValidators.portNumber()` - requires the field's to be an valid port number.
- `FormBuilderValidators.macAddress()` - requires the field's to be an valid MAC address.

### Supported languages

Expand Down
34 changes: 33 additions & 1 deletion lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,37 @@
"notEqualErrorText": "This field value must not be equal to {value}.",
"numericErrorText": "Value must be numeric.",
"requiredErrorText": "This field cannot be empty.",
"urlErrorText": "This field requires a valid URL address."
"urlErrorText": "This field requires a valid URL address.",
"phoneErrorText": "This field requires a valid phone number.",
"creditCardExpirationDateErrorText": "This field requires a valid expiration date.",
"creditCardExpiredErrorText": "This credit card has expired.",
"creditCardCVCErrorText": "This field requires a valid CVC code.",
"colorCodeErrorText": "Value should be a valid {colorCode} color code.",
"uppercaseErrorText": "Value must be uppercase.",
"lowercaseErrorText": "Value must be lowercase.",
"fileExtensionErrorText": "File extension must be {extensions}",
"fileSizeErrorText": "File size must be less than {maxSize} while it is {fileSize}",
"dateRangeErrorText": "Date must be in range {min} - {max}",
"mustBeTrueErrorText": "This field must be true.",
"mustBeFalseErrorText": "This field must be false.",
"containsSpecialCharErrorText": "Value must contain at least {min} special characters.",
"containsUppercaseCharErrorText": "Value must contain at least {min} uppercase characters.",
"containsLowercaseCharErrorText": "Value must contain at least {min} lowercase characters.",
"containsNumberErrorText": "Value must contain at least {min} numbers.",
"alphabeticalErrorText": "Value must be alphabetical.",
"uuidErrorText": "Value must be a valid UUID.",
"jsonErrorText": "Value must be valid JSON.",
"latitudeErrorText": "Value must be a valid latitude.",
"longitudeErrorText": "Value must be a valid longitude.",
"base64ErrorText": "Value must be a valid base64 string.",
"pathErrorText": "Value must be a valid path.",
"oddNumberErrorText": "Value must be an odd number.",
"evenNumberErrorText": "Value must be an even number.",
"portNumberErrorText": "Value must be a valid port number between {min} and {max}.",
"macAddressErrorText": "Value must be a valid MAC address.",
"startsWithErrorText": "Value must start with {value}.",
"endsWithErrorText": "Value must end with {value}.",
"containsErrorText": "Value must contain {value}.",
"betweenErrorText": "Value must be between {min} and {max}.",
"valueInListErrorText": "Value must be in list."
}
Loading