@cocreate/validation 1.6.6 → 1.8.0
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 +14 -0
- package/demo/index.html +1 -0
- package/docs/index.html +2 -1
- package/package.json +1 -1
- package/src/index.js +5 -6
- package/src/validations/subdomain.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [1.8.0](https://github.com/CoCreate-app/CoCreate-validation/compare/v1.7.0...v1.8.0) (2023-04-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* added pwa manifest ([c8b9f19](https://github.com/CoCreate-app/CoCreate-validation/commit/c8b9f19e3295f0823b582ced0c3430a543e6e175))
|
|
7
|
+
|
|
8
|
+
# [1.7.0](https://github.com/CoCreate-app/CoCreate-validation/compare/v1.6.6...v1.7.0) (2023-04-13)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* params now handeld and returned by action ([68f611b](https://github.com/CoCreate-app/CoCreate-validation/commit/68f611b11ef8df52141f36fd5abe9b985df32892))
|
|
14
|
+
|
|
1
15
|
## [1.6.6](https://github.com/CoCreate-app/CoCreate-validation/compare/v1.6.5...v1.6.6) (2023-04-11)
|
|
2
16
|
|
|
3
17
|
|
package/demo/index.html
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
8
|
<link rel="icon" href="https://cdn.cocreate.app/favicon.ico" type="image/ico" sizes="16x16">
|
|
9
9
|
<title>validation | CoCreateJS</title>
|
|
10
|
+
<link rel="manifest" href="/manifest.json">
|
|
10
11
|
</head>
|
|
11
12
|
|
|
12
13
|
<body>
|
package/docs/index.html
CHANGED
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
<link rel="stylesheet" href="/docs/index.css" collection="files" document_id="60888216117c640e7596303f" name="src" type="text/css" save="true" />
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
<link rel="manifest" href="/manifest.json" />
|
|
16
|
+
</head>
|
|
16
17
|
|
|
17
18
|
<body>
|
|
18
19
|
<nav class="nav display:flex align-items:center left:0px background:whitesmoke padding-top:10px padding-bottom:10px" content_id="content" scroll="sticky-nav,hide-nav" scroll-up="10" scroll-down="10" collection="files" document_id="60395ef42b3ac232657040fd" name="src">
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -21,13 +21,13 @@ validations.set('unique', unique);
|
|
|
21
21
|
|
|
22
22
|
const selectors = '[matches], [required], [unique], [subdomain]';
|
|
23
23
|
|
|
24
|
-
function validate(btn) {
|
|
24
|
+
function validate(btn, params) {
|
|
25
25
|
let validateElements;
|
|
26
26
|
let validateSelectors = [];
|
|
27
27
|
let failedElements = [];
|
|
28
28
|
|
|
29
|
-
if (
|
|
30
|
-
let selector =
|
|
29
|
+
if (params){
|
|
30
|
+
let selector = params
|
|
31
31
|
for (let [validation] of validations){
|
|
32
32
|
let vSelctor = `${selector}[${validation}]`;
|
|
33
33
|
validateSelectors.push(vSelctor);
|
|
@@ -74,9 +74,8 @@ function validate(btn) {
|
|
|
74
74
|
|
|
75
75
|
action.init({
|
|
76
76
|
name: "validate",
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
validate(btn);
|
|
77
|
+
callback: (btn, params) => {
|
|
78
|
+
validate(btn, params);
|
|
80
79
|
}
|
|
81
80
|
});
|
|
82
81
|
|
|
@@ -14,7 +14,8 @@ function validateSubdomainEvent(e){
|
|
|
14
14
|
function validateSubdomain(element){
|
|
15
15
|
let subdomain = element.getValue();
|
|
16
16
|
let validation = 'false';
|
|
17
|
-
|
|
17
|
+
if (Array.isArray(subdomain))
|
|
18
|
+
subdomain = subdomain[0]
|
|
18
19
|
let array = subdomain.split('.');
|
|
19
20
|
if (array.length -1 == 2){
|
|
20
21
|
validation = 'true';
|