@cocreate/render 1.16.7 → 1.16.8

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,10 @@
1
+ ## [1.16.8](https://github.com/CoCreate-app/CoCreate-render/compare/v1.16.7...v1.16.8) (2022-11-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * bumped [@cocreate](https://github.com/cocreate) dependencies ([512d1bb](https://github.com/CoCreate-app/CoCreate-render/commit/512d1bbb6f104fab976266e5426dcece64bfed51))
7
+
1
8
  ## [1.16.7](https://github.com/CoCreate-app/CoCreate-render/compare/v1.16.6...v1.16.7) (2022-11-22)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/render",
3
- "version": "1.16.7",
3
+ "version": "1.16.8",
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,10 +61,10 @@
61
61
  "webpack-log": "^3.0.1"
62
62
  },
63
63
  "dependencies": {
64
- "@cocreate/actions": "^1.5.19",
65
- "@cocreate/api": "^1.5.6",
66
- "@cocreate/docs": "^1.4.1",
67
- "@cocreate/element-prototype": "^1.1.4",
68
- "@cocreate/utils": "^1.10.20"
64
+ "@cocreate/actions": "^1.5.20",
65
+ "@cocreate/api": "^1.5.7",
66
+ "@cocreate/docs": "^1.4.2",
67
+ "@cocreate/element-prototype": "^1.1.5",
68
+ "@cocreate/utils": "^1.10.21"
69
69
  }
70
70
  }
package/src/index.js CHANGED
@@ -11,7 +11,7 @@ const CoCreateRender = {
11
11
  // Can be called from crud getObjectValueByPath
12
12
  __getValueFromObject: function(json, path) {
13
13
  try {
14
- if(typeof json == 'undefined' || !path)
14
+ if (typeof json == 'undefined' || !path)
15
15
  return false;
16
16
  if (path.indexOf('.') == -1 && path.includes('collection'))
17
17
  json = this.dataOriginal
@@ -166,7 +166,7 @@ const CoCreateRender = {
166
166
  if (!Array.isArray(arrayData))
167
167
  arrayData = [arrayData]
168
168
 
169
- if(type && Array.isArray(arrayData)) {
169
+ if (type && Array.isArray(arrayData)) {
170
170
  arrayData.forEach((item) => {
171
171
  if (!template.renderedKeys.has(item)){
172
172
  template.renderedKeys.set(item, '')
@@ -206,7 +206,7 @@ const CoCreateRender = {
206
206
  cloneEl.removeAttribute('template_id');
207
207
  }
208
208
 
209
- if(cloneEl.tagName == 'TEMPLATE'){
209
+ if (cloneEl.tagName == 'TEMPLATE'){
210
210
  cloneEl = template.content.firstElementChild
211
211
  for (let attribute of template.attributes){
212
212
  let attrName = attribute.name;
@@ -276,7 +276,7 @@ const CoCreateRender = {
276
276
  else
277
277
  that.renderMap(attr, attr.value, renderArray, renderKey)
278
278
 
279
- if(placeholder && !isRenderKey){
279
+ if (placeholder && !isRenderKey){
280
280
  let updateData = data;
281
281
  // let oldValue = attrValue
282
282
  let temp = placeholder.placeholder;
@@ -304,7 +304,7 @@ const CoCreateRender = {
304
304
  }
305
305
  });
306
306
 
307
- if(el.childNodes.length > 0) {
307
+ if (el.childNodes.length > 0) {
308
308
  that.setValue(el.childNodes, updateData || data, renderArray, renderKey);
309
309
  }
310
310
  if ((el.tagName == 'TEMPLATE' || el.hasAttribute('template') || el.classList.contains('template')) && !el.hasAttribute('template_id')) {
@@ -453,7 +453,7 @@ observer.init({
453
453
  renderData.set(data, '')
454
454
 
455
455
  let parentKey = el.getAttribute('parentKey')
456
- if(parentKey && parentKey != null) {
456
+ if (parentKey && parentKey != null) {
457
457
  if (/^\d+$/.test(parentKey))
458
458
  parentKey = `[${parentKey}]`
459
459
  parentKeys.push(parentKey)
@@ -465,7 +465,7 @@ observer.init({
465
465
 
466
466
  let parentKey;
467
467
  parentKey = parentElement.getAttribute('parentKey')
468
- if(renderKey == '$auto' || parentKey || parentKeys) {
468
+ if (renderKey == '$auto' || parentKey || parentKeys) {
469
469
  let template = element.outerHTML
470
470
  if (renderKey) {
471
471
  template = template.replace(/\$auto/g, uuid.generate(6));