@cocreate/render 1.21.6 → 1.21.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 +15 -0
- package/package.json +7 -7
- package/src/index.js +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [1.21.8](https://github.com/CoCreate-app/CoCreate-render/compare/v1.21.7...v1.21.8) (2023-03-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* !updateData attrVaue set to undefined ([44e339f](https://github.com/CoCreate-app/CoCreate-render/commit/44e339fa3e5bd9868a31038a7b2cf0017fb53340))
|
|
7
|
+
* supports empty string ([3dc45a9](https://github.com/CoCreate-app/CoCreate-render/commit/3dc45a92840f722a896f87a8e22a6bb44b5398e7))
|
|
8
|
+
|
|
9
|
+
## [1.21.7](https://github.com/CoCreate-app/CoCreate-render/compare/v1.21.6...v1.21.7) (2023-02-01)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* bump dependencies ([3cf3fe7](https://github.com/CoCreate-app/CoCreate-render/commit/3cf3fe7e7bf3e81665823e44e626dcfc4266a7f6))
|
|
15
|
+
|
|
1
16
|
## [1.21.6](https://github.com/CoCreate-app/CoCreate-render/compare/v1.21.5...v1.21.6) (2023-01-31)
|
|
2
17
|
|
|
3
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/render",
|
|
3
|
-
"version": "1.21.
|
|
3
|
+
"version": "1.21.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",
|
|
@@ -60,11 +60,11 @@
|
|
|
60
60
|
"webpack-log": "^3.0.1"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@cocreate/actions": "^1.5.
|
|
64
|
-
"@cocreate/api": "^1.6.
|
|
65
|
-
"@cocreate/docs": "^1.5.
|
|
66
|
-
"@cocreate/element-prototype": "^1.4.
|
|
67
|
-
"@cocreate/observer": "^1.5.
|
|
68
|
-
"@cocreate/utils": "^1.18.
|
|
63
|
+
"@cocreate/actions": "^1.5.58",
|
|
64
|
+
"@cocreate/api": "^1.6.11",
|
|
65
|
+
"@cocreate/docs": "^1.5.13",
|
|
66
|
+
"@cocreate/element-prototype": "^1.4.10",
|
|
67
|
+
"@cocreate/observer": "^1.5.62",
|
|
68
|
+
"@cocreate/utils": "^1.18.2"
|
|
69
69
|
}
|
|
70
70
|
}
|
package/src/index.js
CHANGED
|
@@ -13,7 +13,7 @@ const CoCreateRender = {
|
|
|
13
13
|
let result = /{{\s*([\w\W]+)\s*}}/g.exec(attrValue);
|
|
14
14
|
if (result) {
|
|
15
15
|
let value = getValueFromObject(data, result[1].trim());
|
|
16
|
-
if (!value) {
|
|
16
|
+
if (!value && value !== '') {
|
|
17
17
|
let parentTemplate
|
|
18
18
|
if (el && el.nodeType == 1) {
|
|
19
19
|
if (el.hasAttribute('templateid') && el.parentElement)
|
|
@@ -63,7 +63,7 @@ const CoCreateRender = {
|
|
|
63
63
|
for (let placeholder of placeholders) {
|
|
64
64
|
let value = this.__getValue(data, placeholder, el);
|
|
65
65
|
|
|
66
|
-
if (value) {
|
|
66
|
+
if (value || value === "") {
|
|
67
67
|
if (typeof(value) == "object")
|
|
68
68
|
value = this.generateString(value)
|
|
69
69
|
|
|
@@ -285,8 +285,8 @@ const CoCreateRender = {
|
|
|
285
285
|
// else
|
|
286
286
|
// updateData = {[renderKey]: data}
|
|
287
287
|
// }
|
|
288
|
-
|
|
289
|
-
|
|
288
|
+
if (updateData)
|
|
289
|
+
attrValue = that.__replaceValue(updateData, temp, renderKey, el);
|
|
290
290
|
if (attrValue == attr.value)
|
|
291
291
|
attrValue = undefined
|
|
292
292
|
}
|
|
@@ -398,6 +398,7 @@ const CoCreateRender = {
|
|
|
398
398
|
let template = queryDocumentSelector(selector);
|
|
399
399
|
if (!template) return;
|
|
400
400
|
if (template.tagName == 'TEMPLATE' || template.hasAttribute('template') || template.classList.contains('template')) {
|
|
401
|
+
template.renderedKeys = undefined
|
|
401
402
|
this.render(template, data);
|
|
402
403
|
}
|
|
403
404
|
else
|