Skip to content

Commit 4d610e8

Browse files
committed
fix: remove data- from fetch, pass and filter
1 parent 14192f6 commit 4d610e8

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

demo/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ <h1>Form Demo</h1>
3131
</div>
3232
<input data-xxx="xxxCreateRequest.email">
3333

34-
<div data-template_id="xxxCreateCard" data-render_array="data.card" data-render_key="c" data-xxx="xxxCreateCard.card" data-xxx_array="card">
34+
<div template_id="xxxCreateCard" render-array="data.card" render-key="c" data-xxx="xxxCreateCard.card" data-xxx_array="card">
3535
<input data-xxx="card.number" value="c.number">
3636
<input data-xxx="card.cvv" value="c.cvv">
3737
<input data-xxx="card.expiry" value="c.expiry">
3838
</div>
3939

4040

41-
<button data-actions='xxxCreateRequest, xxxCreateCard'>Create Form</button>
41+
<button actions='xxxCreateRequest, xxxCreateCard'>Create Form</button>
4242
</form>
4343

4444
<h1>Result</h1>

docs/form.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ <h2 class="padding:5px_0px">Demo</h2>
180180
<div class="position:sticky top:0 padding:15px_0px height:100vh">
181181
<div class="container svColumn overflow:hidden card border-radius:2px width:auto height:100%" id="sandbox">
182182
<div class="font-size:20px position:absolute top:10px right:10px opacity:0.6 z-index:7"> <a class="margin-right:10px" id="preview" data-show="preview" data-hide="code"><i class="far fa-eye"></i></a> <a class="margin-right:10px hidden" id="code" data-show="code" data-hide="preview"><i class="fas fa-code"></i></a>
183-
<!--<a class="margin-right:10px"><i class="far fa-window-maximize"></i></a>--><a target="modal" href="module_activity_datatable.html" data-pass_collection="modules" data-pass_document_id="" data-pass_fetch_value="" data-pass_prefix="" data-pass_to="render" data-modal_width="600px" data-modal_height="400px" data-modal_color="#229954"
184-
data-modal_header="false" class="margin-right:10px">
183+
<!--<a class="margin-right:10px"><i class="far fa-window-maximize"></i></a>--><a target="modal" href="module_activity_datatable.html" pass-collection="modules" pass-document_id="" pass-fetch_value="" pass-prefix="" pass_to="render" modal-width="600px" modal-height="400px" modal-color="#229954"
184+
modal-header="false" class="margin-right:10px">
185185
<i class="fas fa-external-link-alt"></i>
186186
</a> <a class="margin-right:5px" data-fullscreen target="#sandbox"><i class="fas fa-expand"></i></a> </div>
187187
<div class="svRow">

docs/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ <h4><span>getFormData(moudle_name, action_name, container)</span> <span class="c
177177
&lt;input data-stripe=&quot;b.code.postal&quot;&gt;
178178
&lt;/div&gt;
179179
&lt;/div&gt;
180-
&lt;button data-actions=&#39;createCustomer&#39;&gt;Create Form&lt;/button&gt;
180+
&lt;button actions=&#39;createCustomer&#39;&gt;Create Form&lt;/button&gt;
181181
&lt;/form&gt;
182182
</code></pre>
183183
</p>
@@ -187,7 +187,7 @@ <h4><span>getFormData(moudle_name, action_name, container)</span> <span class="c
187187
<h2 class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">How Does It Works</h2>
188188
<p>CoCreate-fetch works based on cocreate.js and template. </p>
189189

190-
<p>To fetch the array data, the template wrapper should define <code class="language-js">data-fetch_document</code>. <code class="language-js">data-template_id</code></p>
190+
<p>To fetch the array data, the template wrapper should define <code class="language-js">data-fetch_document</code>. <code class="language-js">template_id</code></p>
191191

192192
<h2 class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">Effects and Styles</h2>
193193

@@ -208,8 +208,8 @@ <h2 class="padding:5px_0px">Demo</h2>
208208
<div class="position:sticky top:0 padding:15px_0px height:100vh">
209209
<div class="container svColumn overflow:hidden card border-radius:2px width:auto height:100%" id="sandbox">
210210
<div class="font-size:20px position:absolute top:10px right:10px opacity:0.6 z-index:7"> <a class="margin-right:10px" id="preview" data-show="preview" data-hide="code"><i class="far fa-eye"></i></a> <a class="margin-right:10px hidden" id="code" data-show="code" data-hide="preview"><i class="fas fa-code"></i></a>
211-
<!--<a class="margin-right:10px"><i class="far fa-window-maximize"></i></a>--><a target="modal" href="module_activity_datatable.html" data-pass_collection="modules" data-pass_document_id="" data-pass_fetch_value="" data-pass_prefix="" data-pass_to="render" data-modal_width="600px" data-modal_height="400px" data-modal_color="#229954"
212-
data-modal_header="false" class="margin-right:10px">
211+
<!--<a class="margin-right:10px"><i class="far fa-window-maximize"></i></a>--><a target="modal" href="module_activity_datatable.html" pass-collection="modules" pass-document_id="" pass-fetch_value="" pass-prefix="" pass_to="render" modal-width="600px" modal-height="400px" modal-color="#229954"
212+
modal-header="false" class="margin-right:10px">
213213
<i class="fas fa-external-link-alt"></i>
214214
</a> <a class="margin-right:5px" data-fullscreen target="#sandbox"><i class="fas fa-expand"></i></a> </div>
215215
<div class="svRow">

docs/module.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ <h4>Action function</h4>
122122
// data: data to receive from previous action
123123
function action_{action_name}(element, data)
124124
--------------------HTML------------------------
125-
&lt;button data-actions=&quot;{action_name}, {action_name1}, ...&quot;&gt;Run&lt;/button&gt;
125+
&lt;button actions=&quot;{action_name}, {action_name1}, ...&quot;&gt;Run&lt;/button&gt;
126126

127127
Example:
128128
action_CreateCard: function(element, data) {}
129-
&lt;button data-actions=&quot;CreateCustomer, CreateCard&quot;&gt;Run&lt;/button&gt;
129+
&lt;button actions=&quot;CreateCustomer, CreateCard&quot;&gt;Run&lt;/button&gt;
130130
</code></pre>
131131
<h4>Pre-processing function</h4>
132132
<pre><code class="language-javascript">
@@ -170,8 +170,8 @@ <h2 class="padding:5px_0px">Demo</h2>
170170
<div class="position:sticky top:0 padding:15px_0px height:100vh">
171171
<div class="container svColumn overflow:hidden card border-radius:2px width:auto height:100%" id="sandbox">
172172
<div class="font-size:20px position:absolute top:10px right:10px opacity:0.6 z-index:7"> <a class="margin-right:10px" id="preview" data-show="preview" data-hide="code"><i class="far fa-eye"></i></a> <a class="margin-right:10px hidden" id="code" data-show="code" data-hide="preview"><i class="fas fa-code"></i></a>
173-
<!--<a class="margin-right:10px"><i class="far fa-window-maximize"></i></a>--><a target="modal" href="module_activity_datatable.html" data-pass_collection="modules" data-pass_document_id="" data-pass_fetch_value="" data-pass_prefix="" data-pass_to="render" data-modal_width="600px" data-modal_height="400px" data-modal_color="#229954"
174-
data-modal_header="false" class="margin-right:10px">
173+
<!--<a class="margin-right:10px"><i class="far fa-window-maximize"></i></a>--><a target="modal" href="module_activity_datatable.html" pass-collection="modules" pass-document_id="" pass-fetch_value="" pass-prefix="" pass_to="render" modal-width="600px" modal-height="400px" modal-color="#229954"
174+
modal-header="false" class="margin-right:10px">
175175
<i class="fas fa-external-link-alt"></i>
176176
</a> <a class="margin-right:5px" data-fullscreen target="#sandbox"><i class="fas fa-expand"></i></a> </div>
177177
<div class="svRow">

docs/server.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ <h2 class="padding:5px_0px">Demo</h2>
181181
<div class="position:sticky top:0 padding:15px_0px height:100vh">
182182
<div class="container svColumn overflow:hidden card border-radius:2px width:auto height:100%" id="sandbox">
183183
<div class="font-size:20px position:absolute top:10px right:10px opacity:0.6 z-index:7"> <a class="margin-right:10px" id="preview" data-show="preview" data-hide="code"><i class="far fa-eye"></i></a> <a class="margin-right:10px hidden" id="code" data-show="code" data-hide="preview"><i class="fas fa-code"></i></a>
184-
<!--<a class="margin-right:10px"><i class="far fa-window-maximize"></i></a>--><a target="modal" href="module_activity_datatable.html" data-pass_collection="modules" data-pass_document_id="" data-pass_fetch_value="" data-pass_prefix="" data-pass_to="render" data-modal_width="600px" data-modal_height="400px" data-modal_color="#229954"
185-
data-modal_header="false" class="margin-right:10px">
184+
<!--<a class="margin-right:10px"><i class="far fa-window-maximize"></i></a>--><a target="modal" href="module_activity_datatable.html" pass-collection="modules" pass-document_id="" pass-fetch_value="" pass-prefix="" pass_to="render" modal-width="600px" modal-height="400px" modal-color="#229954"
185+
modal-header="false" class="margin-right:10px">
186186
<i class="fas fa-external-link-alt"></i>
187187
</a> <a class="margin-right:5px" data-fullscreen target="#sandbox"><i class="fas fa-expand"></i></a> </div>
188188
<div class="svRow">

src/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ const CoCreateApi = {
170170

171171
render: function(action, data) {
172172
CoCreateRender.data({
173-
selector: `[data-template_id="${action}"]`,
173+
selector: `[template_id="${action}"]`,
174174
data: data
175175
});
176176
},

0 commit comments

Comments
 (0)