@cocreate/validation 1.4.19 → 1.4.22
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/CoCreate.config.js +2 -2
- package/demo/index.html +1 -1
- package/docs/index.html +1 -1
- package/package.json +1 -1
- package/src/validations/subdomain.js +21 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## [1.4.22](https://github.com/CoCreate-app/CoCreate-validation/compare/v1.4.21...v1.4.22) (2022-05-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* subdomain validation for alpanumeric characters. minimum 2 characters ([e35ad42](https://github.com/CoCreate-app/CoCreate-validation/commit/e35ad42a7c66d61bb39262d18bfb1632cd5750b4))
|
|
7
|
+
* update document_id on link index.css ([727d3ab](https://github.com/CoCreate-app/CoCreate-validation/commit/727d3abe1a9bf8ed0b743001169f152bc78e09fe))
|
|
8
|
+
|
|
9
|
+
## [1.4.21](https://github.com/CoCreate-app/CoCreate-validation/compare/v1.4.20...v1.4.21) (2022-05-06)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* update config organization_Id to organization_id ([5be30f1](https://github.com/CoCreate-app/CoCreate-validation/commit/5be30f1f5a94d2631b2eb872b277fda905903de3))
|
|
15
|
+
|
|
16
|
+
## [1.4.20](https://github.com/CoCreate-app/CoCreate-validation/compare/v1.4.19...v1.4.20) (2022-02-24)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* CoCreate.config replace CoCreate.app with * ([93cdaf3](https://github.com/CoCreate-app/CoCreate-validation/commit/93cdaf315bf548d0f1a0f712cef67a9c537ba141))
|
|
22
|
+
|
|
1
23
|
## [1.4.19](https://github.com/CoCreate-app/CoCreate-validation/compare/v1.4.18...v1.4.19) (2022-02-16)
|
|
2
24
|
|
|
3
25
|
|
package/CoCreate.config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"config": {
|
|
3
3
|
"apiKey": "2061acef-0451-4545-f754-60cf8160",
|
|
4
|
-
"
|
|
4
|
+
"organization_id": "5ff747727005da1c272740ab",
|
|
5
5
|
"host": "general.cocreate.app"
|
|
6
6
|
},
|
|
7
7
|
|
|
@@ -14,7 +14,7 @@ module.exports = {
|
|
|
14
14
|
"name": "index.html",
|
|
15
15
|
"path": "/docs/validation/index.html",
|
|
16
16
|
"domains": [
|
|
17
|
-
"
|
|
17
|
+
"*",
|
|
18
18
|
"general.cocreate.app"
|
|
19
19
|
],
|
|
20
20
|
"directory": "/docs/validation",
|
package/demo/index.html
CHANGED
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
|
@@ -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 && 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
|
}
|