@cocreate/render 1.24.13 → 1.24.15
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/.github/FUNDING.yml +3 -3
- package/.github/workflows/automated.yml +95 -95
- package/.github/workflows/manual.yml +44 -44
- package/CHANGELOG.md +1464 -1449
- package/CONTRIBUTING.md +96 -96
- package/CoCreate.config.js +26 -26
- package/LICENSE +21 -21
- package/README.md +85 -85
- package/demo/fetch.string.html +51 -47
- package/demo/index.html +121 -95
- package/demo/render.array.html +70 -50
- package/demo/render.html +48 -43
- package/demo/render.object.html +57 -47
- package/demo/renderKey.html +31 -31
- package/docs/index.html +582 -270
- package/package.json +69 -69
- package/release.config.js +21 -21
- package/src/index.js +530 -530
- package/webpack.config.js +84 -84
package/docs/index.html
CHANGED
|
@@ -1,270 +1,582 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
+
<title>CoCreate-render Documentation | CoCreateJS</title>
|
|
8
|
+
<link
|
|
9
|
+
rel="icon"
|
|
10
|
+
type="image/png"
|
|
11
|
+
sizes="32x32"
|
|
12
|
+
href="https://cocreate.app/images/favicon.ico" />
|
|
13
|
+
<meta
|
|
14
|
+
name="description"
|
|
15
|
+
content="A simple yet powerful drag-and-drop solution powered by javascript." />
|
|
16
|
+
<meta
|
|
17
|
+
name="keywords"
|
|
18
|
+
content="drag and drop, colaboration, dnd utility, drag and drop utility" />
|
|
19
|
+
<meta name="robots" content="index,follow" />
|
|
20
|
+
<meta
|
|
21
|
+
property="og:image"
|
|
22
|
+
content="https://cdn.cocreate.app/docs/render.png" />
|
|
23
|
+
|
|
24
|
+
<!-- CoCreate CSS -->
|
|
25
|
+
<link
|
|
26
|
+
rel="stylesheet"
|
|
27
|
+
href="https://cdn.cocreate.app/latest/CoCreate.min.css"
|
|
28
|
+
type="text/css" />
|
|
29
|
+
<link
|
|
30
|
+
rel="stylesheet"
|
|
31
|
+
href="/docs/index.css"
|
|
32
|
+
collection="files"
|
|
33
|
+
document_id="60888216117c640e7596303f"
|
|
34
|
+
name="src"
|
|
35
|
+
type="text/css"
|
|
36
|
+
save="true" />
|
|
37
|
+
<link rel="manifest" href="/manifest.webmanifest" />
|
|
38
|
+
</head>
|
|
39
|
+
|
|
40
|
+
<body>
|
|
41
|
+
<nav
|
|
42
|
+
class="nav display:flex align-items:center left:0px background:whitesmoke padding-top:10px padding-bottom:10px"
|
|
43
|
+
content_id="content"
|
|
44
|
+
scroll="sticky-nav,hide-nav"
|
|
45
|
+
scroll-up="10"
|
|
46
|
+
scroll-down="10"
|
|
47
|
+
collection="files"
|
|
48
|
+
document_id="60395ef42b3ac232657040fd"
|
|
49
|
+
name="src"></nav>
|
|
50
|
+
<sidenav
|
|
51
|
+
id="menuL"
|
|
52
|
+
class="position:fixed top:0px left:0px overflow:hidden background:whitesmoke height:100vh width:0px width:300px@xl"
|
|
53
|
+
resizable
|
|
54
|
+
resize-target="[content_id='content']"
|
|
55
|
+
resize-property="margin-left"
|
|
56
|
+
resize-value="width">
|
|
57
|
+
<menu
|
|
58
|
+
collection="files"
|
|
59
|
+
document_id="603717b07de7fb350ae9fec8"
|
|
60
|
+
name="src"></menu>
|
|
61
|
+
<div resize="right"></div>
|
|
62
|
+
</sidenav>
|
|
63
|
+
<main
|
|
64
|
+
class="padding-top:15px padding:15px@lg@xl"
|
|
65
|
+
content_id="content"
|
|
66
|
+
id="CoCreate-render">
|
|
67
|
+
<div
|
|
68
|
+
class="display:flex flex-wrap:wrap justify-content:space-between position:relative margin:10px">
|
|
69
|
+
<div class="display:flex align-items:center">
|
|
70
|
+
<h2>CoCreate-render</h2>
|
|
71
|
+
</div>
|
|
72
|
+
<div
|
|
73
|
+
class="display:flex align-items:center font-size:20px position:absolute right:0 padding:5px background:white">
|
|
74
|
+
<div
|
|
75
|
+
class="display:flex align-items:center transition:0.3s padding-left:10px"
|
|
76
|
+
share-network="true"
|
|
77
|
+
share-text="Enter decription here"
|
|
78
|
+
share-title="testing im a title"
|
|
79
|
+
share-height="600"
|
|
80
|
+
share-width="700"
|
|
81
|
+
share-media="https://cdn.cocreate.app/docs/render.png"
|
|
82
|
+
hover="display:block!important"
|
|
83
|
+
hover-target=".social-networks">
|
|
84
|
+
<div class="display:none social-networks">
|
|
85
|
+
<a
|
|
86
|
+
class="margin-right:15px"
|
|
87
|
+
share-network="twitter"
|
|
88
|
+
title="Share on twitter"
|
|
89
|
+
><i
|
|
90
|
+
class="height:20px fill:#505050"
|
|
91
|
+
src="/assets/svg/twitter.svg"></i
|
|
92
|
+
></a>
|
|
93
|
+
<a
|
|
94
|
+
class="margin-right:15px"
|
|
95
|
+
share-network="facebook"
|
|
96
|
+
title="Share on Facebook"
|
|
97
|
+
><i
|
|
98
|
+
class="height:20px fill:#505050"
|
|
99
|
+
src="/assets/svg/facebook.svg"></i
|
|
100
|
+
></a>
|
|
101
|
+
<a
|
|
102
|
+
class="margin-right:15px"
|
|
103
|
+
share-network="instagram"
|
|
104
|
+
title="Share on instagram"
|
|
105
|
+
><i
|
|
106
|
+
class="height:20px fill:#505050"
|
|
107
|
+
src="/assets/svg/instagram.svg"></i
|
|
108
|
+
></a>
|
|
109
|
+
</div>
|
|
110
|
+
<a
|
|
111
|
+
class="margin-right:15px"
|
|
112
|
+
share-network="share"
|
|
113
|
+
title="Share on share"
|
|
114
|
+
><i
|
|
115
|
+
class="height:20px fill:#505050"
|
|
116
|
+
src="/assets/svg/share-alt.svg"></i
|
|
117
|
+
></a>
|
|
118
|
+
</div>
|
|
119
|
+
<a
|
|
120
|
+
href="https://github.com/CoCreate-app/CoCreate-dnd"
|
|
121
|
+
target="_blank"
|
|
122
|
+
class=""
|
|
123
|
+
><i
|
|
124
|
+
class="height:20px fill:#505050"
|
|
125
|
+
src="/assets/svg/github.svg"></i
|
|
126
|
+
></a>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
<h1
|
|
130
|
+
class="max-width:500px margin:20px_10px line-height:1.5 font-size:16px font-weight:100">
|
|
131
|
+
CoCreate-render javascript component. Easy configuration using
|
|
132
|
+
HTML5 attributes or Javscript api and highly styleable.
|
|
133
|
+
</h1>
|
|
134
|
+
<div id="render-section" class="display:flex flex-wrap:wrap">
|
|
135
|
+
<div
|
|
136
|
+
class="flex-grow:1 width:400px width:300px@xs padding:0px_10px margin-top:60px">
|
|
137
|
+
<div
|
|
138
|
+
id="render-install"
|
|
139
|
+
class="border-bottom:1px_solid_lightgrey"
|
|
140
|
+
scroll
|
|
141
|
+
scroll-intersect="color:dodgerblue"
|
|
142
|
+
scroll-target="#render-install-section">
|
|
143
|
+
<span
|
|
144
|
+
class="display:flex align-items:center width:fit-content"
|
|
145
|
+
hover="display:block!important"
|
|
146
|
+
hover-target="[href='#render-install']">
|
|
147
|
+
<h2 class="padding:5px_0px">Install</h2>
|
|
148
|
+
<a
|
|
149
|
+
class="margin-left:10px display:none"
|
|
150
|
+
href="#render-install"
|
|
151
|
+
><i
|
|
152
|
+
class="height:20px fill:#505050"
|
|
153
|
+
src="/assets/svg/link.svg"></i
|
|
154
|
+
></a>
|
|
155
|
+
</span>
|
|
156
|
+
</div>
|
|
157
|
+
<pre><code class="language-bash">npm i @cocreate/render</code></pre>
|
|
158
|
+
<p class="padding:10px_0px line-height:1.5">
|
|
159
|
+
Or you can use cdn link:
|
|
160
|
+
</p>
|
|
161
|
+
<pre><code class="language-html"><script>https://cdn.cocreate.app/render/latest/CoCreate-render.min.js</script></code></pre>
|
|
162
|
+
<p class="padding:10px_0px line-height:1.5">
|
|
163
|
+
for styling please refer to #id-style
|
|
164
|
+
</p>
|
|
165
|
+
|
|
166
|
+
<div
|
|
167
|
+
id="render-usage"
|
|
168
|
+
class="margin-top:80px border-bottom:1px_solid_lightgrey"
|
|
169
|
+
scroll
|
|
170
|
+
scroll-intersect="color:dodgerblue"
|
|
171
|
+
scroll-target="#render-usage-section">
|
|
172
|
+
<span
|
|
173
|
+
class="display:flex align-items:center width:fit-content"
|
|
174
|
+
hover="display:block!important"
|
|
175
|
+
hover-target="[href='#render-usage']">
|
|
176
|
+
<h2 class="padding:5px_0px">Usage</h2>
|
|
177
|
+
<a
|
|
178
|
+
class="margin-left:10px display:none"
|
|
179
|
+
href="#render-usage"
|
|
180
|
+
><i
|
|
181
|
+
class="height:20px fill:#505050"
|
|
182
|
+
src="/assets/svg/link.svg"></i
|
|
183
|
+
></a>
|
|
184
|
+
</span>
|
|
185
|
+
</div>
|
|
186
|
+
<p class="padding:10px_0px line-height:1.5">
|
|
187
|
+
CoCreate-render would use that set attributes and
|
|
188
|
+
renders the elements based on html and json data.
|
|
189
|
+
</p>
|
|
190
|
+
|
|
191
|
+
<h3
|
|
192
|
+
class="border-bottom:1px_solid_lightgrey margin-top:40px padding:5px_0px">
|
|
193
|
+
Example
|
|
194
|
+
</h3>
|
|
195
|
+
<p class="padding:10px_0px line-height:1.5"></p>
|
|
196
|
+
|
|
197
|
+
<h4 class="margin-top:20px padding:5px_0px">
|
|
198
|
+
HTML Template
|
|
199
|
+
</h4>
|
|
200
|
+
|
|
201
|
+
<div class="margin-top:10px">
|
|
202
|
+
<pre><code class="language-html">
|
|
203
|
+
<div template_id="abc1" fetch-collection="render_test">
|
|
204
|
+
<div class="template card {{render2.collection}} card margin:10px firstname"
|
|
205
|
+
value="{{render2.data._id}}"
|
|
206
|
+
template_id="abc1"
|
|
207
|
+
render-array="render2.data">
|
|
208
|
+
<div class="card-body padding:15px" collection="{{render2.collection}}">
|
|
209
|
+
<h3 class="{{render2.data.firstname}} blue" value="{{render2.data.lastname}} - {{render2.data.firstname}}">--</h3>
|
|
210
|
+
<h3 value="{{ render2.data.lastname }}" value="{{lastname}}"></h3>
|
|
211
|
+
<input value="{{ render2.collection }}"/>
|
|
212
|
+
<h3 class="email" value="{{render2.data.email}}">--</h3>
|
|
213
|
+
<textarea value="{{render2.data.lastname}}"></textarea>
|
|
214
|
+
<h3 data-attribute="{{render2.data.personal_info.email}}" name="email" value="{{render2.data.personal_info.email}}"></h3>
|
|
215
|
+
|
|
216
|
+
<div class="template card "
|
|
217
|
+
render-array="render2.data.testing_array">
|
|
218
|
+
|
|
219
|
+
<h3 data-attribute="{{render2.data.testing_array.email}}" name="email" class="{{render2.data.testing_array.email}}" value="{{render2.data.testing_array.email}}"></h3>
|
|
220
|
+
<h3 value="{{render2.collection}}"></h3>
|
|
221
|
+
|
|
222
|
+
<h3 value="{{render2.data.personal_info.email}}"></h3>
|
|
223
|
+
</div>
|
|
224
|
+
<div class="template card "
|
|
225
|
+
render-array="render2.data.string_array" render-key="string_">
|
|
226
|
+
|
|
227
|
+
<h3 name="test"
|
|
228
|
+
data-attribute="{{string_.--}}"
|
|
229
|
+
class="{{string_.--}}"
|
|
230
|
+
value="{{string_.--}}"></h3>
|
|
231
|
+
</div>
|
|
232
|
+
</div>
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
</code></pre>
|
|
236
|
+
</div>
|
|
237
|
+
|
|
238
|
+
<h4 class="margin-top:40px padding:5px_0px">
|
|
239
|
+
CoCreate-render usage
|
|
240
|
+
</h4>
|
|
241
|
+
<p class="padding:10px_0px line-height:1.5">Description.</p>
|
|
242
|
+
<pre><code class="language-html">
|
|
243
|
+
CoCreate.render.data({
|
|
244
|
+
selector: '[template=abc1]',
|
|
245
|
+
data: {
|
|
246
|
+
render2: {
|
|
247
|
+
collection : 'dededede',
|
|
248
|
+
data: [{
|
|
249
|
+
_id : '123kijfhgfkel45',
|
|
250
|
+
firstname : 'Jin',
|
|
251
|
+
lastname : 'codingmachinine',
|
|
252
|
+
personal_info : {email:'jeanmendozar@gmail.com','phone':'56666'},
|
|
253
|
+
email: 'tesing@gamil.com',
|
|
254
|
+
testing_array : [
|
|
255
|
+
{email:'jeanmendozar@gmail.com','phone':'0','home':'home1'},
|
|
256
|
+
{email:'frank@gmail.com','phone':'1','home':'home2'},
|
|
257
|
+
{email:'jose@gmail.com','phone':'2','home':'home3'},
|
|
258
|
+
],
|
|
259
|
+
string_array: ['string1', 'string2', 1, 3]
|
|
260
|
+
},{
|
|
261
|
+
_id : '5678efe32qd2ol',
|
|
262
|
+
firstname : 'jean',
|
|
263
|
+
lastname : 'Mendoza',
|
|
264
|
+
personal_info : {email:'jeanmendozar@gmail.com','phone':'56666'},
|
|
265
|
+
email: 'tesing2@gamil.com',
|
|
266
|
+
testing_array : [
|
|
267
|
+
{email:'1ana@gmail.com','phone':'16','home':'home17'},
|
|
268
|
+
{email:'1rosa@gmail.com','phone':'17','home':'home18'},
|
|
269
|
+
{email:'1nuevo@gmail.com','phone':'18','home':'home19'}
|
|
270
|
+
],
|
|
271
|
+
string_array: ['string1', 'string2', 1, 3]
|
|
272
|
+
},
|
|
273
|
+
]}
|
|
274
|
+
})
|
|
275
|
+
</code></pre>
|
|
276
|
+
|
|
277
|
+
<div
|
|
278
|
+
id="render-attributes"
|
|
279
|
+
class="margin-top:80px border-bottom:1px_solid_lightgrey"
|
|
280
|
+
scroll
|
|
281
|
+
scroll-intersect="color:dodgerblue"
|
|
282
|
+
scroll-target="#render-attributes-section">
|
|
283
|
+
<span
|
|
284
|
+
class="display:flex align-items:center width:fit-content"
|
|
285
|
+
hover="display:block!important"
|
|
286
|
+
hover-target="[href='#render-attributes']">
|
|
287
|
+
<h2 class="padding:5px_0px">Attributes</h2>
|
|
288
|
+
<a
|
|
289
|
+
class="margin-left:10px display:none"
|
|
290
|
+
href="#render-attributes"
|
|
291
|
+
><i
|
|
292
|
+
class="height:20px fill:#505050"
|
|
293
|
+
src="/assets/svg/link.svg"></i
|
|
294
|
+
></a>
|
|
295
|
+
</span>
|
|
296
|
+
</div>
|
|
297
|
+
<ul class="list-style-type:none">
|
|
298
|
+
<li
|
|
299
|
+
class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
300
|
+
<h4>
|
|
301
|
+
<span>render-array</span>
|
|
302
|
+
<span class="cocreate-badge warning"
|
|
303
|
+
>optional</span
|
|
304
|
+
><span class="cocreate-badge danger"
|
|
305
|
+
>required</span
|
|
306
|
+
>
|
|
307
|
+
</h4>
|
|
308
|
+
<p>
|
|
309
|
+
To render the array data, this attribute should
|
|
310
|
+
define by the object selector path
|
|
311
|
+
</p>
|
|
312
|
+
</li>
|
|
313
|
+
<li
|
|
314
|
+
class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
315
|
+
<h4>
|
|
316
|
+
<span>render-key</span>
|
|
317
|
+
<span class="cocreate-badge warning"
|
|
318
|
+
>optional</span
|
|
319
|
+
><span class="cocreate-badge"
|
|
320
|
+
>Default: render-array's value</span
|
|
321
|
+
>
|
|
322
|
+
</h4>
|
|
323
|
+
<p>
|
|
324
|
+
If render-array defined, this attribute can
|
|
325
|
+
define
|
|
326
|
+
</p>
|
|
327
|
+
<p>Default value is value of render-array</p>
|
|
328
|
+
</li>
|
|
329
|
+
</ul>
|
|
330
|
+
|
|
331
|
+
<h4
|
|
332
|
+
class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">
|
|
333
|
+
Funcations
|
|
334
|
+
</h4>
|
|
335
|
+
<ul class="list-style-type:none">
|
|
336
|
+
<li
|
|
337
|
+
class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
338
|
+
<h4>
|
|
339
|
+
<span>setValue(elements, data, [passTo])</span>
|
|
340
|
+
</h4>
|
|
341
|
+
<p>This is main function.</p>
|
|
342
|
+
<div>
|
|
343
|
+
<p>
|
|
344
|
+
<strong>elements</strong>
|
|
345
|
+
<span class="cocreate-badge warning"
|
|
346
|
+
>Type:NoteList</span
|
|
347
|
+
><span class="cocreate-badge danager"
|
|
348
|
+
>required</span
|
|
349
|
+
>
|
|
350
|
+
</p>
|
|
351
|
+
<p>Dom elements for render</p>
|
|
352
|
+
</div>
|
|
353
|
+
<div>
|
|
354
|
+
<p>
|
|
355
|
+
<strong>data</strong>
|
|
356
|
+
<span class="cocreate-badge warning"
|
|
357
|
+
>Type:object</span
|
|
358
|
+
><span class="cocreate-badge danager"
|
|
359
|
+
>required</span
|
|
360
|
+
>
|
|
361
|
+
</p>
|
|
362
|
+
<p>Data to render</p>
|
|
363
|
+
</div>
|
|
364
|
+
<div>
|
|
365
|
+
<p>
|
|
366
|
+
<strong>passTo</strong
|
|
367
|
+
><span class="cocreate-badge warning"
|
|
368
|
+
>Type:string</span
|
|
369
|
+
><span class="cocreate-badge warning"
|
|
370
|
+
>optional</span
|
|
371
|
+
>
|
|
372
|
+
</p>
|
|
373
|
+
</div>
|
|
374
|
+
</li>
|
|
375
|
+
<li
|
|
376
|
+
class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
377
|
+
<h4>
|
|
378
|
+
<span>render(selector, data)</span>
|
|
379
|
+
</h4>
|
|
380
|
+
<div>
|
|
381
|
+
<p>
|
|
382
|
+
<strong>selector</strong>
|
|
383
|
+
<span class="cocreate-badge warning"
|
|
384
|
+
>Type:String</span
|
|
385
|
+
><span class="cocreate-badge danager"
|
|
386
|
+
>required</span
|
|
387
|
+
>
|
|
388
|
+
</p>
|
|
389
|
+
<p>The selector of element to render</p>
|
|
390
|
+
</div>
|
|
391
|
+
<div>
|
|
392
|
+
<p>
|
|
393
|
+
<strong>data</strong>
|
|
394
|
+
<span class="cocreate-badge warning"
|
|
395
|
+
>Type:object</span
|
|
396
|
+
><span class="cocreate-badge danager"
|
|
397
|
+
>required</span
|
|
398
|
+
>
|
|
399
|
+
</p>
|
|
400
|
+
<p>Data to render</p>
|
|
401
|
+
</div>
|
|
402
|
+
</li>
|
|
403
|
+
<li
|
|
404
|
+
class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
405
|
+
<h4>
|
|
406
|
+
<span>setArray(element, data)</span>
|
|
407
|
+
</h4>
|
|
408
|
+
<div>
|
|
409
|
+
<p>
|
|
410
|
+
<strong>element</strong>
|
|
411
|
+
<span class="cocreate-badge warning"
|
|
412
|
+
>Type:Node</span
|
|
413
|
+
><span class="cocreate-badge danager"
|
|
414
|
+
>required</span
|
|
415
|
+
>
|
|
416
|
+
</p>
|
|
417
|
+
<p>
|
|
418
|
+
Element to render the array. Geneeral it
|
|
419
|
+
will be template.
|
|
420
|
+
</p>
|
|
421
|
+
</div>
|
|
422
|
+
<div>
|
|
423
|
+
<p>
|
|
424
|
+
<strong>data</strong>
|
|
425
|
+
<span class="cocreate-badge warning"
|
|
426
|
+
>Type:object</span
|
|
427
|
+
><span class="cocreate-badge danager"
|
|
428
|
+
>required</span
|
|
429
|
+
>
|
|
430
|
+
</p>
|
|
431
|
+
<p>Data to render</p>
|
|
432
|
+
</div>
|
|
433
|
+
</li>
|
|
434
|
+
</ul>
|
|
435
|
+
|
|
436
|
+
<h2
|
|
437
|
+
class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">
|
|
438
|
+
How Does It Works
|
|
439
|
+
</h2>
|
|
440
|
+
<p>
|
|
441
|
+
CoCreate-render works based on attributes and template,
|
|
442
|
+
The attributes to render should be wrapper "{{ }}", and
|
|
443
|
+
attributes can include the combine "{{}}" wrapper.
|
|
444
|
+
</p>
|
|
445
|
+
|
|
446
|
+
<p>
|
|
447
|
+
To render the array data, Render need to define
|
|
448
|
+
<code class="language-js">class="template"</code>.
|
|
449
|
+
<code class="language-js">render-array</code>
|
|
450
|
+
</p>
|
|
451
|
+
|
|
452
|
+
<h2
|
|
453
|
+
class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">
|
|
454
|
+
Effects and Styles
|
|
455
|
+
</h2>
|
|
456
|
+
|
|
457
|
+
<h2
|
|
458
|
+
class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">
|
|
459
|
+
Events
|
|
460
|
+
</h2>
|
|
461
|
+
</div>
|
|
462
|
+
<div
|
|
463
|
+
class="flex-grow:1 width:300px padding:0px_10px margin-top:60px border-bottom:1px_solid_lightgrey">
|
|
464
|
+
<!-- SandBox -->
|
|
465
|
+
<div
|
|
466
|
+
id="render-demo"
|
|
467
|
+
class="border-bottom:1px_solid_lightgrey"
|
|
468
|
+
scroll
|
|
469
|
+
scroll-intersect="color:dodgerblue"
|
|
470
|
+
scroll-target="#render-demo-section">
|
|
471
|
+
<span
|
|
472
|
+
class="display:flex align-items:center width:fit-content"
|
|
473
|
+
hover="display:block!important"
|
|
474
|
+
hover-target="[href='#render-demo']">
|
|
475
|
+
<h2 class="padding:5px_0px">Demo</h2>
|
|
476
|
+
<a
|
|
477
|
+
class="margin-left:10px display:none"
|
|
478
|
+
href="#render-demo"
|
|
479
|
+
><i
|
|
480
|
+
class="height:20px fill:#505050"
|
|
481
|
+
src="/assets/svg/link.svg"></i
|
|
482
|
+
></a>
|
|
483
|
+
</span>
|
|
484
|
+
</div>
|
|
485
|
+
<div
|
|
486
|
+
class="position:sticky top:0 padding:15px_0px height:100vh">
|
|
487
|
+
<!-- SandBox -->
|
|
488
|
+
<div
|
|
489
|
+
class="display:flex flex-direction:column position:relative overflow:hidden card border-radius:2px width:auto height:600px margin-top:20px"
|
|
490
|
+
id="playground">
|
|
491
|
+
<div
|
|
492
|
+
id="demo-code"
|
|
493
|
+
resizable
|
|
494
|
+
class="position:relative height:50%">
|
|
495
|
+
<textarea
|
|
496
|
+
type="code"
|
|
497
|
+
lang="html"
|
|
498
|
+
collection="demos"
|
|
499
|
+
document_id=""
|
|
500
|
+
name="demo"
|
|
501
|
+
save="false"
|
|
502
|
+
id="demo"
|
|
503
|
+
class="height:100% width:100% outline:none border:none resize:none padding:5px"></textarea>
|
|
504
|
+
<div
|
|
505
|
+
resize="bottom"
|
|
506
|
+
class="background:lightgrey"></div>
|
|
507
|
+
</div>
|
|
508
|
+
|
|
509
|
+
<div
|
|
510
|
+
id="demo-preview"
|
|
511
|
+
class="position:relative overflow:auto background-color:white">
|
|
512
|
+
<div class="demopreview padding:20px"></div>
|
|
513
|
+
</div>
|
|
514
|
+
|
|
515
|
+
<div
|
|
516
|
+
class="font-size:20px position:absolute top:10px right:10px opacity:0.6">
|
|
517
|
+
<a
|
|
518
|
+
class="margin-right:10px"
|
|
519
|
+
id="eye"
|
|
520
|
+
show="#eye-slash"
|
|
521
|
+
hide="#eye, #demo-preview"
|
|
522
|
+
toggle="code-height"
|
|
523
|
+
toggle-target="#demo-code"
|
|
524
|
+
><i
|
|
525
|
+
class="height:18px fill:#505050"
|
|
526
|
+
src="/assets/svg/eye.svg"></i
|
|
527
|
+
></a>
|
|
528
|
+
<a
|
|
529
|
+
class="margin-right:10px"
|
|
530
|
+
hidden
|
|
531
|
+
id="eye-slash"
|
|
532
|
+
show="#eye, #demo-preview"
|
|
533
|
+
hide="#eye-slash"
|
|
534
|
+
toggle="code-height"
|
|
535
|
+
toggle-target="#demo-code"
|
|
536
|
+
><i
|
|
537
|
+
class="height:20px fill:#505050"
|
|
538
|
+
src="/assets/svg/eye-slash.svg"></i
|
|
539
|
+
></a>
|
|
540
|
+
<a
|
|
541
|
+
class="margin-right:10px"
|
|
542
|
+
id="code"
|
|
543
|
+
show="#code-slash"
|
|
544
|
+
hide="#code, #demo-code"
|
|
545
|
+
><i
|
|
546
|
+
class="height:20px fill:#505050"
|
|
547
|
+
src="/assets/svg/code.svg"></i
|
|
548
|
+
></a>
|
|
549
|
+
<a
|
|
550
|
+
class="margin-right:10px"
|
|
551
|
+
hidden
|
|
552
|
+
id="code-slash"
|
|
553
|
+
show="#code, #demo-code"
|
|
554
|
+
hide="#code-slash"
|
|
555
|
+
><i
|
|
556
|
+
class="display:flex height:18px fill:#505050"
|
|
557
|
+
src="/assets/svg/code.svg"></i
|
|
558
|
+
></a>
|
|
559
|
+
<a
|
|
560
|
+
class="margin-right:5px"
|
|
561
|
+
fullscreen
|
|
562
|
+
fullscreen-target="#playground"></a>
|
|
563
|
+
</div>
|
|
564
|
+
</div>
|
|
565
|
+
<!-- End SandBox -->
|
|
566
|
+
</div>
|
|
567
|
+
</div>
|
|
568
|
+
</div>
|
|
569
|
+
<button
|
|
570
|
+
href="https://github.com/CoCreate-app/CoCreate-render/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..."
|
|
571
|
+
target="_blank"
|
|
572
|
+
class="position:fixed bottom:15px right:15px padding:15px background:dodgerblue color:#fff font-size:1.5rem grow-hover border-radius:50% border-width:0 box-shadow:0px_2px_10px_0px_rgba(0,_0,_0,_0.4)">
|
|
573
|
+
<i
|
|
574
|
+
class="height:20px fill:#505050"
|
|
575
|
+
src="/assets/svg/pencil-alt.svg"></i>
|
|
576
|
+
</button>
|
|
577
|
+
</main>
|
|
578
|
+
|
|
579
|
+
<script src="./apikey.js"></script>
|
|
580
|
+
<script src="https://cdn.cocreate.app/latest/CoCreate.min.js"></script>
|
|
581
|
+
</body>
|
|
582
|
+
</html>
|