@cocreate/validation 1.15.2 → 1.15.4

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.4](https://github.com/CoCreate-app/CoCreate-validation/compare/v1.15.3...v1.15.4) (2024-04-29)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * bump cocreate dependencies ([235b7a3](https://github.com/CoCreate-app/CoCreate-validation/commit/235b7a37246c239bbc2eeb3c59005e76b6777f32))
7
+
8
+ ## [1.15.3](https://github.com/CoCreate-app/CoCreate-validation/compare/v1.15.2...v1.15.3) (2024-02-17)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * if attribute empty string request isUnique ([067ecce](https://github.com/CoCreate-app/CoCreate-validation/commit/067ecce1313d1cbc8f41d5e1aebde73e822db12c))
14
+
1
15
  ## [1.15.2](https://github.com/CoCreate-app/CoCreate-validation/compare/v1.15.1...v1.15.2) (2024-02-13)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/validation",
3
- "version": "1.15.2",
3
+ "version": "1.15.4",
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",
@@ -58,7 +58,7 @@
58
58
  "webpack-log": "^3.0.1"
59
59
  },
60
60
  "dependencies": {
61
- "@cocreate/actions": "^1.14.0",
62
- "@cocreate/render": "^1.35.0"
61
+ "@cocreate/actions": "^1.18.1",
62
+ "@cocreate/render": "^1.40.3"
63
63
  }
64
64
  }
@@ -1,10 +1,12 @@
1
1
  import { render } from '@cocreate/render';
2
2
 
3
- export const unique = (elements) => {
3
+ export const unique = async (elements) => {
4
4
  let failedElements = [];
5
5
  for (let element of elements) {
6
6
  let unique = element.getAttribute('unique');
7
- if (unique == 'false') {
7
+ if (unique === '')
8
+ unique = await CoCreate.unique.isUnique(element)
9
+ if (unique === 'false' || unique === false) {
8
10
  failedElements.push(element);
9
11
  }
10
12
  }