@cocreate/validation 1.4.21 → 1.4.24
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 +22 -0
- package/docs/index.html +1 -1
- package/package.json +5 -5
- package/src/validations/subdomain.js +21 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## [1.4.24](https://github.com/CoCreate-app/CoCreate-validation/compare/v1.4.23...v1.4.24) (2022-05-23)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* bump all dependencies ([854503a](https://github.com/CoCreate-app/CoCreate-validation/commit/854503ae40883bc24f0cdd3b2eeaa58cde84f4f9))
|
|
7
|
+
|
|
8
|
+
## [1.4.23](https://github.com/CoCreate-app/CoCreate-validation/compare/v1.4.22...v1.4.23) (2022-05-18)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* typo resulted in more then 1 level subdomain not throwing validating ([e227091](https://github.com/CoCreate-app/CoCreate-validation/commit/e22709163d5110520e8f059977ee854705095318))
|
|
14
|
+
|
|
15
|
+
## [1.4.22](https://github.com/CoCreate-app/CoCreate-validation/compare/v1.4.21...v1.4.22) (2022-05-17)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* subdomain validation for alpanumeric characters. minimum 2 characters ([e35ad42](https://github.com/CoCreate-app/CoCreate-validation/commit/e35ad42a7c66d61bb39262d18bfb1632cd5750b4))
|
|
21
|
+
* update document_id on link index.css ([727d3ab](https://github.com/CoCreate-app/CoCreate-validation/commit/727d3abe1a9bf8ed0b743001169f152bc78e09fe))
|
|
22
|
+
|
|
1
23
|
## [1.4.21](https://github.com/CoCreate-app/CoCreate-validation/compare/v1.4.20...v1.4.21) (2022-05-06)
|
|
2
24
|
|
|
3
25
|
|
package/docs/index.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<meta name="keywords" content="helper classes, utility classes, css framework, css library, inline style classes" />
|
|
11
11
|
<meta name="robots" content="index,follow" />
|
|
12
12
|
|
|
13
|
-
<link rel="stylesheet" href="/docs/index.css" collection="files" document_id="
|
|
13
|
+
<link rel="stylesheet" href="/docs/index.css" collection="files" document_id="62827d7e8082ce05b081430b" name="src" type="text/css" save="true" />
|
|
14
14
|
|
|
15
15
|
</head>
|
|
16
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/validation",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.24",
|
|
4
4
|
"description": "A simple validation component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"validation",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"webpack-log": "^3.0.1"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@cocreate/actions": "^1.
|
|
65
|
-
"@cocreate/docs": "^1.
|
|
66
|
-
"@cocreate/hosting": "^1.
|
|
67
|
-
"@cocreate/render": "^1.
|
|
64
|
+
"@cocreate/actions": "^1.4.1",
|
|
65
|
+
"@cocreate/docs": "^1.3.1",
|
|
66
|
+
"@cocreate/hosting": "^1.3.1",
|
|
67
|
+
"@cocreate/render": "^1.8.0"
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -12,19 +12,34 @@ function validateSubdomainEvent(e){
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
function validateSubdomain(element){
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
let subdomain = element.getValue(element);
|
|
16
|
+
let validation = 'false';
|
|
17
|
+
|
|
18
|
+
let array = subdomain.split('.');
|
|
19
|
+
if (array.length -1 == 2){
|
|
20
|
+
validation = 'true';
|
|
18
21
|
}
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
|
|
23
|
+
const pattern = /^[a-z0-9][a-z0-9\-]*[a-z0-9]$/;
|
|
24
|
+
if (validation != 'false' && pattern.test(array[0])){
|
|
25
|
+
validation = 'true';
|
|
21
26
|
}
|
|
27
|
+
else
|
|
28
|
+
validation = 'false';
|
|
29
|
+
// let array = subdomain.split('.').length -1;
|
|
30
|
+
// if (validation && array == 2){
|
|
31
|
+
// validation = 'true';
|
|
32
|
+
// }
|
|
33
|
+
|
|
34
|
+
element.setAttribute('validation', validation);
|
|
35
|
+
return validation;
|
|
22
36
|
}
|
|
23
37
|
|
|
24
38
|
function subdomain(elements){
|
|
25
39
|
let failedElements = [];
|
|
26
40
|
for (let element of elements) {
|
|
27
|
-
let isValid = element.getAttribute('
|
|
41
|
+
// let isValid = element.getAttribute('subdomain');
|
|
42
|
+
let isValid = validateSubdomain(element);
|
|
28
43
|
if (isValid == 'false'){
|
|
29
44
|
failedElements.push(element);
|
|
30
45
|
}
|