@cocreate/elements 1.6.2 → 1.6.6

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,31 @@
1
+ ## [1.6.6](https://github.com/CoCreate-app/CoCreate-elements/compare/v1.6.5...v1.6.6) (2022-02-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update dependency versions ([00b9a75](https://github.com/CoCreate-app/CoCreate-elements/commit/00b9a7552ffa4650a28022d08a2d8aa442830bc6))
7
+
8
+ ## [1.6.5](https://github.com/CoCreate-app/CoCreate-elements/compare/v1.6.4...v1.6.5) (2022-01-27)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * getValue from element ([44fd22d](https://github.com/CoCreate-app/CoCreate-elements/commit/44fd22df7f5159a6f94e0bedfd381526d7b42a94))
14
+
15
+ ## [1.6.4](https://github.com/CoCreate-app/CoCreate-elements/compare/v1.6.3...v1.6.4) (2022-01-16)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * updated saveDocument to save and createDocument replaced with save, reset ([749a02f](https://github.com/CoCreate-app/CoCreate-elements/commit/749a02f28f156eb36344863b9e77120eba8e08c1))
21
+
22
+ ## [1.6.3](https://github.com/CoCreate-app/CoCreate-elements/compare/v1.6.2...v1.6.3) (2022-01-16)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * update class overflow:overlay to overflow:auto ([111577e](https://github.com/CoCreate-app/CoCreate-elements/commit/111577e6c6642a85af1e33b67f0267e6471da4fb))
28
+
1
29
  ## [1.6.2](https://github.com/CoCreate-app/CoCreate-elements/compare/v1.6.1...v1.6.2) (2022-01-11)
2
30
 
3
31
 
@@ -20,7 +20,7 @@
20
20
  <!--<textarea type="text" placeholder="description" name="description"></textarea>-->
21
21
  <!-- <cocreate-select class="floating-label" collection="apples3" name="industry" placeholder="Industry">-->
22
22
  <!-- <input placeholder="Search" template_id="industries">-->
23
- <!--<cc-options fetch-collection="apples3" template_id="industries" class="options overflow:overlay">-->
23
+ <!--<cc-options fetch-collection="apples3" template_id="industries" class="options overflow:auto">-->
24
24
  <!-- <cc-option class="template" template_id="industries" value="{{data._id}}">-->
25
25
  <!-- <h4 collection="apples3" document_id="{{data._id}}" name="name">industry name</h4>-->
26
26
  <!-- </cc-option>-->
@@ -39,7 +39,7 @@
39
39
  <!-- </cc-option>-->
40
40
  <!-- </cc-options>-->
41
41
  <!--</cocreate-select>-->
42
- <button class="position:fixed bottom:15px right:15px bg-blue grow-hover round opacity-08" actions="saveDocument"><i class="far fa-save"></i></button>
42
+ <button class="position:fixed bottom:15px right:15px bg-blue grow-hover round opacity-08" actions="save"><i class="far fa-save"></i></button>
43
43
  </form>
44
44
  <!--<cocreate-select id="margin-right-unit" class="styleunit remove-none border:none padding:0 min-height:24px!important background:#eee" collection="builder" document_id="null" attributes="attributes_unit" attributes_target="#margin-right">-->
45
45
  <!-- <ul class="options overflow:auto padding:0px z-index:7" fetch-collection="modules" filter-value="5ff747727005da1c27274193" filter-name="_id" filter-operator="$eq" fetch-name="units" template_id="units2">-->
@@ -0,0 +1,41 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Value | CoCreateJS</title>
5
+
6
+ <!-- CoCreate Favicon -->
7
+ <link rel="icon" href="https://cdn.cocreate.app/favicon.ico" type="image/ico" sizes="16x16">
8
+ <!-- CoCreate CSS CDN -->
9
+ <link rel="stylesheet" href="https://cdn.cocreate.app/logic/latest/CoCreate-logic.min.css" type="text/css"/>
10
+ </head>
11
+ <body>
12
+ <!-- windows -->
13
+ <!--<ul get-value="##a123"> </ul>-->
14
+ <!--<ul id="a123"> hello </ul>-->
15
+
16
+ <cocreate-select class="floating-label" id="collection" placeholder="collection:" set-value="#document_id" set-value-key="setcollection" active>
17
+ <ul fetch-collections template_id="collection" class="options z-index:7 margin-top:5px">
18
+ <cc-option class="option template" template_id="collection" value="{{data.name}}">
19
+ <span>{{data.name}}</span>
20
+ </cc-option>
21
+ </ul>
22
+ </cocreate-select>
23
+
24
+ <cocreate-select class="floating-label" id="document_id" placeholder="document_id:" active>
25
+ <ul fetch-collection="{{setcollection}}" template_id="document_id" class="options z-index:7 margin-top:5px">
26
+ <cc-option class="option template" template_id="document_id" value="{{data._id}}">
27
+ <span>{{data._id}}</span>
28
+ </cc-option>
29
+ </ul>
30
+ </cocreate-select>
31
+
32
+ <input value="new" set-value="#testing" set-value-key="ty">
33
+ <h1 id="testing" class="{{ty}}" test="{{ty}}">{{ty}}</h1>
34
+
35
+
36
+
37
+ <!--<script src="https://cdn.cocreate.app/latest/CoCreate.min.js"></script>-->
38
+ <script src="../../../CoCreateJS/dist/CoCreate.js" ></script>
39
+
40
+ </body>
41
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/elements",
3
- "version": "1.6.2",
3
+ "version": "1.6.6",
4
4
  "description": "Fetch content into any html element by using html5 attributes to query data stored in CoCreate headless CMS. If data is changed it will instantly reflect in html tags as changes are broadcasted in realtime",
5
5
  "keywords": [
6
6
  "elements",
@@ -61,9 +61,9 @@
61
61
  "webpack-log": "^3.0.1"
62
62
  },
63
63
  "dependencies": {
64
- "@cocreate/actions": "^1.3.25",
65
- "@cocreate/crud-client": "^1.4.40",
66
- "@cocreate/docs": "^1.2.62",
67
- "@cocreate/observer": "^1.3.54"
64
+ "@cocreate/actions": "^1.3.28",
65
+ "@cocreate/crud-client": "^1.4.43",
66
+ "@cocreate/docs": "^1.2.65",
67
+ "@cocreate/observer": "^1.4.0"
68
68
  }
69
69
  }
package/src/getValue.js CHANGED
@@ -48,7 +48,7 @@ function initEvents(valueEl, element){
48
48
  }
49
49
 
50
50
  function setValueByFind(valueEl) {
51
- let value = getValue(valueEl);
51
+ let value = valueEl.getValue(valueEl);
52
52
  if (!value) return;
53
53
  let elements = valueEls.get(valueEl);
54
54
 
package/src/setValue.js CHANGED
@@ -27,11 +27,12 @@ function initEvents(element){
27
27
  });
28
28
  }
29
29
 
30
+ const setValueMap = new Map();
30
31
  function setValueByFind(element){
31
32
  let key = element.getAttribute('set-value-key');
32
33
  if (key)
33
34
  key = `{{${key}}}`;
34
- let value = getValue(element);
35
+ let value = element.getValue(element);
35
36
  if (!value) return;
36
37
  let selector = element.getAttribute('set-value');
37
38
  if(!selector) return;
@@ -39,6 +40,8 @@ function setValueByFind(element){
39
40
 
40
41
  for(let element of elements){
41
42
  if (key){
43
+ if (setValueMap.has(element))
44
+ key = setValueMap.get(element);
42
45
  const regex = new RegExp(key, "g");
43
46
  for (let attribute of element.attributes){
44
47
  let attrName = attribute.name;
@@ -61,6 +64,7 @@ function setValueByFind(element){
61
64
  html = html.replace(regex, value);
62
65
  element.innerHTML = html;
63
66
  }
67
+ setValueMap.set(element, value)
64
68
  }
65
69
  else
66
70
  setValue(element, value);