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