@cocreate/render 1.3.15 → 1.3.19

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,32 @@
1
+ ## [1.3.19](https://github.com/CoCreate-app/CoCreate-render/compare/v1.3.18...v1.3.19) (2021-11-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * docs sidenav width ([9d92d7c](https://github.com/CoCreate-app/CoCreate-render/commit/9d92d7c3d45cdbccf9ee24e437a218a38599d107))
7
+ * updated action dependency to actions ([e82967f](https://github.com/CoCreate-app/CoCreate-render/commit/e82967f7399ee2c3de20f3bec4321eb753cb1280))
8
+
9
+ ## [1.3.18](https://github.com/CoCreate-app/CoCreate-render/compare/v1.3.17...v1.3.18) (2021-11-23)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * update dependencies ([a1b32d4](https://github.com/CoCreate-app/CoCreate-render/commit/a1b32d4d98c3788e96852a5e3769374f78ed2fc9))
15
+
16
+ ## [1.3.17](https://github.com/CoCreate-app/CoCreate-render/compare/v1.3.16...v1.3.17) (2021-11-20)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * update dependencies ([b46ab83](https://github.com/CoCreate-app/CoCreate-render/commit/b46ab837ba56f96988a70622918c7e5055327dc8))
22
+
23
+ ## [1.3.16](https://github.com/CoCreate-app/CoCreate-render/compare/v1.3.15...v1.3.16) (2021-11-19)
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * if element has class template cloneEl then insert values ([7556035](https://github.com/CoCreate-app/CoCreate-render/commit/75560356eaa9cec8db27a73acb60bd9a44c27d7b))
29
+
1
30
  ## [1.3.15](https://github.com/CoCreate-app/CoCreate-render/compare/v1.3.14...v1.3.15) (2021-11-18)
2
31
 
3
32
 
package/docs/index.html CHANGED
@@ -21,7 +21,7 @@
21
21
 
22
22
  <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">
23
23
  </nav>
24
- <sidenav id="menuL" class="position:fixed top:0px left:0px background:whitesmoke height:100vh width:300px width:300px:hover width:0px@xs" resizable resize-target="[content_id='content']" resize-property="margin-left" resize-value="width">
24
+ <sidenav id="menuL" class="position:fixed top:0px left:0px overflow:hidden background:whitesmoke height:100vh width:0px width:300px@xl" resizable resize-target="[content_id='content']" resize-property="margin-left" resize-value="width">
25
25
  <menu collection="files" document_id="603717b07de7fb350ae9fec8" name="src"></menu>
26
26
  <div resize="right"></div>
27
27
  </sidenav>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/render",
3
- "version": "1.3.15",
3
+ "version": "1.3.19",
4
4
  "description": "A simple render component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "render",
@@ -61,8 +61,8 @@
61
61
  "webpack-log": "^3.0.1"
62
62
  },
63
63
  "dependencies": {
64
- "@cocreate/action": "^1.3.13",
65
- "@cocreate/api": "^1.2.8",
66
- "@cocreate/docs": "^1.2.51"
64
+ "@cocreate/actions": "^1.3.17",
65
+ "@cocreate/api": "^1.2.10",
66
+ "@cocreate/docs": "^1.2.55"
67
67
  }
68
68
  }
package/src/index.js CHANGED
@@ -83,6 +83,7 @@ const CoCreateRender = {
83
83
  if (!arrayData){
84
84
  let cloneEl = this.cloneEl(template);
85
85
  cloneEl.classList.add('cloned');
86
+ self.setValue([cloneEl], data);
86
87
  template.insertAdjacentHTML('beforebegin', cloneEl.outerHTML);
87
88
  }
88
89
  if (type && Array.isArray(arrayData)) {
@@ -117,10 +118,14 @@ const CoCreateRender = {
117
118
  if (!data) return;
118
119
  const that = this;
119
120
  Array.from(els).forEach(el => {
121
+
120
122
  // let passId = e.getAttribute('pass_id');
121
123
  // if (passTo && passId != passTo) {
122
124
  // return;
123
125
  // }
126
+ // if (el.classList.contains('template')) {
127
+ // el = this.cloneEl(el);
128
+ // }
124
129
  Array.from(el.attributes).forEach(attr=>{
125
130
  let attr_name = attr.name.toLowerCase();
126
131
  // let isPass = false;
@@ -170,10 +175,15 @@ const CoCreateRender = {
170
175
  if (selector) {
171
176
  let template = document.querySelector(selector)
172
177
  if (!template) return;
173
- this.setValue([template], data, passTo, template);
178
+ if (template.classList.contains('template')) {
179
+ this.render(template, data)
180
+ }
181
+ else
182
+ this.setValue([template], data, passTo, template);
174
183
  } else if (elements) {
175
184
  this.setValue(elements, data, passTo);
176
185
  }
186
+
177
187
  }
178
188
 
179
189
  }