@cocreate/render 1.17.14 → 1.18.0

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 CHANGED
@@ -1,3 +1,10 @@
1
+ # [1.18.0](https://github.com/CoCreate-app/CoCreate-render/compare/v1.17.14...v1.18.0) (2023-01-01)
2
+
3
+
4
+ ### Features
5
+
6
+ * supports template="" to define template and id. replaces .template template_id ([40c29e6](https://github.com/CoCreate-app/CoCreate-render/commit/40c29e60e066f2e790cd10d0c7ac43bed5d3ff4c))
7
+
1
8
  ## [1.17.14](https://github.com/CoCreate-app/CoCreate-render/compare/v1.17.13...v1.17.14) (2022-12-31)
2
9
 
3
10
 
@@ -18,12 +18,11 @@
18
18
  <input value="{{renderKey.name}}">
19
19
  <button actions='renderKey' href="https://{{renderKey.name}}/admin/signin.html">Create Form</button>
20
20
  </div>
21
-
22
21
  </form>
23
22
 
24
- <!--<script src="../dist/CoCreate-render-key.js"></script>-->
23
+ <!-- <script src="../dist/CoCreate-render-key.js"></script> -->
25
24
  <script src="https://cdn.cocreate.app/latest/CoCreate.min.js"></script>
26
- <!-- <script src="https://cdn.cocreate.app/latest/CoCreate.min.js"></script> -->
25
+ <!-- <script src="../../../CoCreateJS/dist/CoCreate.js"></script> -->
27
26
 
28
27
  </body>
29
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/render",
3
- "version": "1.17.14",
3
+ "version": "1.18.0",
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",
package/src/index.js CHANGED
@@ -183,9 +183,13 @@ const CoCreateRender = {
183
183
  let cloneEl = template.cloneNode(true);
184
184
 
185
185
  let templateId = cloneEl.getAttribute('template_id');
186
+ if (!templateId)
187
+ templateId = cloneEl.getAttribute('template');
188
+
186
189
  if (templateId) {
187
190
  cloneEl.setAttribute('templateId', templateId);
188
191
  cloneEl.removeAttribute('template_id');
192
+ cloneEl.removeAttribute('template');
189
193
  }
190
194
 
191
195
  if (cloneEl.tagName == 'TEMPLATE'){