@cocreate/render 1.16.0 → 1.16.2
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 +16 -0
- package/demo/fetch.string.html +2 -2
- package/demo/render.html +2 -2
- package/demo/render.object.html +1 -1
- package/package.json +6 -5
- package/src/index.js +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## [1.16.2](https://github.com/CoCreate-app/CoCreate-render/compare/v1.16.1...v1.16.2) (2022-11-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* bump d@cocreate ependencies ([01decf7](https://github.com/CoCreate-app/CoCreate-render/commit/01decf7c4d526e190b76fe27dacff7918223131f))
|
|
7
|
+
|
|
8
|
+
## [1.16.1](https://github.com/CoCreate-app/CoCreate-render/compare/v1.16.0...v1.16.1) (2022-11-21)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* data.document._id ([b416a9c](https://github.com/CoCreate-app/CoCreate-render/commit/b416a9cfe975d8454a34d176a60c326a4dbf82c4))
|
|
14
|
+
* improved handling of data structure, added @cocreate/element-prototype ([e458cfc](https://github.com/CoCreate-app/CoCreate-render/commit/e458cfc7fbf034701cc7e90bacc625d6705c4259))
|
|
15
|
+
* renamed {{data.key}} to {{document.key}} ([f108b83](https://github.com/CoCreate-app/CoCreate-render/commit/f108b8324f80f22b3b784f02738949e7b357912f))
|
|
16
|
+
|
|
1
17
|
# [1.16.0](https://github.com/CoCreate-app/CoCreate-render/compare/v1.15.11...v1.16.0) (2022-10-03)
|
|
2
18
|
|
|
3
19
|
|
package/demo/fetch.string.html
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
<cocreate-select name="current_org" template_id="abc1">
|
|
14
14
|
<selected class="template" template_id="abc1" render-array="data">
|
|
15
|
-
<cc-option class="template" value="{{
|
|
16
|
-
<h3>{{
|
|
15
|
+
<cc-option class="template" value="{{document.current_org}}">
|
|
16
|
+
<h3>{{document.current_org}}</h3>
|
|
17
17
|
</cc-option>
|
|
18
18
|
</selected>
|
|
19
19
|
</cocreate-select>
|
package/demo/render.html
CHANGED
package/demo/render.object.html
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
<div class="template" template_id="abc1">
|
|
14
14
|
<!-- <div>{{data}}</div>
|
|
15
|
-
<h1> {{
|
|
15
|
+
<h1> {{document.collection}} {{document._id}}</h1> -->
|
|
16
16
|
<div class="template" render-object="" render-key="one">
|
|
17
17
|
<h5>{{one.key}}: {{one.value}}</h5>
|
|
18
18
|
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/render",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.2",
|
|
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,9 +61,10 @@
|
|
|
61
61
|
"webpack-log": "^3.0.1"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@cocreate/actions": "^1.5.
|
|
65
|
-
"@cocreate/api": "^1.
|
|
66
|
-
"@cocreate/docs": "^1.3.
|
|
67
|
-
"@cocreate/
|
|
64
|
+
"@cocreate/actions": "^1.5.13",
|
|
65
|
+
"@cocreate/api": "^1.5.0",
|
|
66
|
+
"@cocreate/docs": "^1.3.20",
|
|
67
|
+
"@cocreate/element-prototype": "^1.0.0",
|
|
68
|
+
"@cocreate/utils": "^1.10.14"
|
|
68
69
|
}
|
|
69
70
|
}
|
package/src/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import action from '@cocreate/actions';
|
|
|
3
3
|
import observer from '@cocreate/observer';
|
|
4
4
|
import uuid from '@cocreate/uuid';
|
|
5
5
|
import { queryDocumentSelector } from '@cocreate/utils';
|
|
6
|
+
import '@cocreate/element-prototype';
|
|
6
7
|
import './index.css';
|
|
7
|
-
// import { getValue } from '../../CoCreate-elements/src/getValue';
|
|
8
8
|
// import api from '@cocreate/api';
|
|
9
9
|
|
|
10
10
|
const CoCreateRender = {
|
|
@@ -70,11 +70,11 @@ const CoCreateRender = {
|
|
|
70
70
|
variables.forEach((attr) => {
|
|
71
71
|
let value;
|
|
72
72
|
|
|
73
|
-
if (attr == "{{data._id}}" || attr == `{{${renderKey}._id}}` || attr == "{{document_id}}")
|
|
74
|
-
|
|
75
|
-
else if (attr == "{{collection}" || attr == `{{${renderKey}.collection}}`)
|
|
76
|
-
|
|
77
|
-
else
|
|
73
|
+
// if (attr == "{{data._id}}" || attr == `{{${renderKey}._id}}` || attr == "{{document_id}}" || attr == "{{document._id}}")
|
|
74
|
+
// value = this.document_id;
|
|
75
|
+
// else if (attr == "{{collection}" || attr == `{{${renderKey}.collection}}`)
|
|
76
|
+
// value = this.collection;
|
|
77
|
+
// else
|
|
78
78
|
value = self.__getValue(data, attr);
|
|
79
79
|
|
|
80
80
|
if (value) {
|
|
@@ -234,11 +234,11 @@ const CoCreateRender = {
|
|
|
234
234
|
if (data.renderKey)
|
|
235
235
|
isRenderKey = true
|
|
236
236
|
|
|
237
|
-
if (data.
|
|
238
|
-
|
|
237
|
+
// if (data.document._id)
|
|
238
|
+
// this.document_id = data.document._id;
|
|
239
239
|
|
|
240
|
-
if (data.collection)
|
|
241
|
-
|
|
240
|
+
// if (data.collection)
|
|
241
|
+
// this.collection = data.collection;
|
|
242
242
|
|
|
243
243
|
const that = this;
|
|
244
244
|
Array.from(els).forEach(el => {
|