@cocreate/validation 1.15.0 → 1.15.2
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.15.2](https://github.com/CoCreate-app/CoCreate-validation/compare/v1.15.1...v1.15.2) (2024-02-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* required value returns true if value 0 or fasle ([84646ad](https://github.com/CoCreate-app/CoCreate-validation/commit/84646ad071f0c262882870f6dcde38886dba6ae5))
|
|
7
|
+
|
|
8
|
+
## [1.15.1](https://github.com/CoCreate-app/CoCreate-validation/compare/v1.15.0...v1.15.1) (2024-01-30)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* template selector ([b135e76](https://github.com/CoCreate-app/CoCreate-validation/commit/b135e76a4e123ae86fc304a8807152ee938baffe))
|
|
14
|
+
|
|
1
15
|
# [1.15.0](https://github.com/CoCreate-app/CoCreate-validation/compare/v1.14.1...v1.15.0) (2023-12-18)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
package/src/validations/email.js
CHANGED
|
@@ -6,17 +6,16 @@ export var required = async (elements) => {
|
|
|
6
6
|
let failedElements = [];
|
|
7
7
|
for (let element of elements) {
|
|
8
8
|
let value = await element.getValue();
|
|
9
|
-
if (value) {
|
|
9
|
+
if (value || value === 0 || value === false) {
|
|
10
10
|
element.setAttribute('validation', 'true');
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
11
|
+
} else {
|
|
13
12
|
element.setAttribute('validation', 'false');
|
|
14
13
|
failedElements.push(element);
|
|
15
14
|
}
|
|
16
15
|
}
|
|
17
16
|
if (failedElements.length) {
|
|
18
17
|
render({
|
|
19
|
-
selector: "[template
|
|
18
|
+
selector: "[template*='validate']",
|
|
20
19
|
data: [{
|
|
21
20
|
type: 'unique',
|
|
22
21
|
status: 'failed',
|