@cocreate/unique 1.1.30 → 1.2.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 +12 -0
- package/package.json +4 -4
- package/src/index.js +9 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# [1.2.0](https://github.com/CoCreate-app/CoCreate-unique/compare/v1.1.30...v1.2.0) (2021-10-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* updated dependencies ([485de28](https://github.com/CoCreate-app/CoCreate-unique/commit/485de289b7ccc77db38873a477b1365d4c46b6c3))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* getValue using [@cocreate](https://github.com/cocreate).input to support value-prfix and value-suffix ([e7f8a69](https://github.com/CoCreate-app/CoCreate-unique/commit/e7f8a693cc59f4bbf32e613b7e2f9ac3dbb1b0b0))
|
|
12
|
+
|
|
1
13
|
## [1.1.30](https://github.com/CoCreate-app/CoCreate-unique/compare/v1.1.29...v1.1.30) (2021-10-14)
|
|
2
14
|
|
|
3
15
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/unique",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "A simple unique component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unique",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"webpack-log": "^3.0.1"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@cocreate/crud-client": "^1.4.
|
|
65
|
-
"@cocreate/docs": "^1.2.
|
|
66
|
-
"@cocreate/uuid": "^1.1.
|
|
64
|
+
"@cocreate/crud-client": "^1.4.2",
|
|
65
|
+
"@cocreate/docs": "^1.2.32",
|
|
66
|
+
"@cocreate/uuid": "^1.1.28"
|
|
67
67
|
}
|
|
68
68
|
}
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*globals CoCreate*/
|
|
2
|
+
|
|
3
|
+
import crud from '@cocreate/crud-client';
|
|
4
|
+
import uuid from '@cocreate/uuid';
|
|
3
5
|
|
|
4
6
|
const CoCreateUnique = {
|
|
5
7
|
|
|
@@ -49,27 +51,17 @@ const CoCreateUnique = {
|
|
|
49
51
|
const self = this;
|
|
50
52
|
input.addEventListener('input', function(e) {
|
|
51
53
|
let request_data = {};
|
|
54
|
+
let value = CoCreate.input.getValue(input);
|
|
52
55
|
request_data['organization_id'] = window.config.organization_Id;
|
|
53
56
|
request_data['apiKey'] = window.config.apiKey;
|
|
54
57
|
request_data['collection'] = input.getAttribute('collection');
|
|
55
58
|
request_data['name'] = input.getAttribute('name');
|
|
56
|
-
request_data['value'] = e.target.value;
|
|
59
|
+
request_data['value'] = value || e.target.value;
|
|
57
60
|
request_data['request_id'] = input.getAttribute(self.requestAttr);
|
|
58
61
|
crud.send('checkUnique', request_data);
|
|
59
|
-
})
|
|
60
|
-
|
|
62
|
+
});
|
|
61
63
|
},
|
|
62
|
-
|
|
63
|
-
// checkValidate: function(form) {
|
|
64
|
-
// const items = form.querySelectorAll(this.selector);
|
|
65
|
-
// for (let i = 0; i < items.length; i++) {
|
|
66
|
-
// if (!items[i].classList.contains('data-unique-success')) {
|
|
67
|
-
// return false;
|
|
68
|
-
// }
|
|
69
|
-
// }
|
|
70
|
-
// return true;
|
|
71
|
-
// }
|
|
72
|
-
}
|
|
64
|
+
};
|
|
73
65
|
|
|
74
66
|
CoCreateUnique.init();
|
|
75
|
-
CoCreateUnique.initListener()
|
|
67
|
+
CoCreateUnique.initListener();
|