@cocreate/unique 1.1.27 → 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 CHANGED
@@ -1,3 +1,36 @@
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
+
13
+ ## [1.1.30](https://github.com/CoCreate-app/CoCreate-unique/compare/v1.1.29...v1.1.30) (2021-10-14)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * updated action name in demo to removeElement ([4ecbdf4](https://github.com/CoCreate-app/CoCreate-unique/commit/4ecbdf48347524283aba663822076fbdb4d97eeb))
19
+
20
+ ## [1.1.29](https://github.com/CoCreate-app/CoCreate-unique/compare/v1.1.28...v1.1.29) (2021-10-13)
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * update descriptions ([0e19355](https://github.com/CoCreate-app/CoCreate-unique/commit/0e1935537b0f16962903310c02c1da7c368f7ecf))
26
+
27
+ ## [1.1.28](https://github.com/CoCreate-app/CoCreate-unique/compare/v1.1.27...v1.1.28) (2021-10-13)
28
+
29
+
30
+ ### Bug Fixes
31
+
32
+ * update dependencies ([561d460](https://github.com/CoCreate-app/CoCreate-unique/commit/561d460c438f8ef350ea63a6203c3c790599ceb2))
33
+
1
34
  ## [1.1.27](https://github.com/CoCreate-app/CoCreate-unique/compare/v1.1.26...v1.1.27) (2021-10-12)
2
35
 
3
36
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # CoCreate-unique
2
2
 
3
- A simple unique component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API. Take it for a spin in our [playground!](https://cocreate.app/docs/unique)
3
+ A simple unique component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API. Take it for a spin in our [playground!](https://cocreate.app/docs/unique)
4
4
 
5
5
  ![minified](https://img.badgesize.io/https://cdn.cocreate.app/unique/latest/CoCreate-unique.min.js?style=flat-square&label=minified&color=orange)
6
6
  ![gzip](https://img.badgesize.io/https://cdn.cocreate.app/unique/latest/CoCreate-unique.min.js?compression=gzip&style=flat-square&label=gzip&color=yellow)
package/demo/index.html CHANGED
@@ -40,11 +40,9 @@
40
40
  </button>
41
41
  </form>
42
42
 
43
- <!--<div template_id="validate">-->
44
- <div template_id="validate" render-array="data" class="template card {{type}} margin:10px">
45
- <p class="{{status}} {{type}}">{{message}}</p><a actions="remove">X</a>
46
- </div>
47
- <!--</div>-->
43
+ <div template_id="validate" class="template card {{type}} margin:10px">
44
+ <p class="{{status}} {{type}}">{{message}}</p><a actions="removeElement">X</a>
45
+ </div>
48
46
 
49
47
  <!--<script src="../dist/CoCreate-unique.js"></script>-->
50
48
  <script src="../../../CoCreateJS/dist/CoCreate.js"></script>
package/docs/index.html CHANGED
@@ -6,14 +6,14 @@
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1">
7
7
  <title>CoCreate-unique Documentation | CoCreateJS </title>
8
8
  <link rel="icon" type="image/png" sizes="32x32" href="https://cocreate.app/images/favicon.ico">
9
- <meta name="description" content="A simple HTML5 and pure javascript component. Easy configuration using data-attributes and highly styleable." />
9
+ <meta name="description" content="A simple HTML5 and pure javascript component. Easy configuration using HTML5 attributes or Javscript api and highly styleable." />
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
  <meta property="og:image" content="https://cdn.cocreate.app/docs/unique.png">
13
13
 
14
14
  <!-- CoCreate CSS -->
15
15
  <link rel="stylesheet" href="https://cdn.cocreate.app/latest/CoCreate.min.css" type="text/css"/>
16
- <link rel="stylesheet" href="/docs/index.css" collection="files" document_id="60888216117c640e7596303f" name="src" type="text/css" data-save="true"/>
16
+ <link rel="stylesheet" href="/docs/index.css" collection="files" document_id="60888216117c640e7596303f" name="src" type="text/css" save="true"/>
17
17
  </head>
18
18
 
19
19
  <body>
@@ -40,7 +40,7 @@
40
40
  <a href="https://github.com/CoCreate-app/CoCreate-unique" target="_blank" class="margin-right:15px"><i class="fab fa-github"></i></a>
41
41
  </div>
42
42
  </div>
43
- <h1 class="max-width:500px margin:20px_10px line-height:1.5 font-size:16px font-weight:100">A simple HTML5, CSS and pure javascript component. Easy configuration using data-attributes and highly styleable.</h1>
43
+ <h1 class="max-width:500px margin:20px_10px line-height:1.5 font-size:16px font-weight:100">A headless vinilla javascript micro component. Easy configuration using HTML5 attributes or Javscript api.</h1>
44
44
  <div id="unique-section" class="display:flex flex-wrap:wrap">
45
45
  <div class="flex-grow:1 width:400px width:300px@xs padding:0px_10px margin-top:60px">
46
46
  <div id="unique-install" class="border-bottom:1px_solid_lightgrey" scroll scroll-intersect="color:dodgerblue" scroll-target="#unique-install-section">
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cocreate/unique",
3
- "version": "1.1.27",
4
- "description": "A simple unique component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
3
+ "version": "1.2.0",
4
+ "description": "A simple unique component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "unique",
7
7
  "cocreate",
@@ -61,8 +61,8 @@
61
61
  "webpack-log": "^3.0.1"
62
62
  },
63
63
  "dependencies": {
64
- "@cocreate/crud-client": "^1.2.33",
65
- "@cocreate/docs": "^1.2.29",
66
- "@cocreate/uuid": "^1.1.25"
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
- import crud from '@cocreate/crud-client'
2
- import uuid from '@cocreate/uuid'
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();