@symbiotejs/symbiote 3.3.7 → 3.3.8

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.
@@ -15,6 +15,7 @@ export function itemizeProcessor(fr, fnCtx) {
15
15
  return !el.matches(`[${DICT.LIST_ATTR}] [${DICT.LIST_ATTR}]`);
16
16
  }).forEach((el) => {
17
17
  let itemTag = el.getAttribute(DICT.LIST_ITEM_TAG_ATTR);
18
+ let repeatDataKey = el.getAttribute(DICT.LIST_ATTR);
18
19
  let itemClass;
19
20
  if (itemTag) {
20
21
  itemClass = window.customElements.get(itemTag);
@@ -34,7 +35,14 @@ export function itemizeProcessor(fr, fnCtx) {
34
35
  }
35
36
  }
36
37
  };
37
- itemClass.template = el.children[0].innerHTML;
38
+ let tpl = document.createElement('template');
39
+ // @ts-expect-error
40
+ tpl.innerHTML = fnCtx.constructor.template;
41
+ let staticEl = tpl.content.querySelector(
42
+ `[${DICT.LIST_ATTR}="${repeatDataKey}"]`
43
+ );
44
+ itemClass.template = staticEl?.querySelector('template')?.innerHTML
45
+ || el.children[0].innerHTML;
38
46
  itemClass.reg(ssrTag);
39
47
  }
40
48
  } else {
@@ -55,7 +63,6 @@ export function itemizeProcessor(fr, fnCtx) {
55
63
  el.firstChild.remove();
56
64
  }
57
65
  }
58
- let repeatDataKey = el.getAttribute(DICT.LIST_ATTR);
59
66
  if (!fnCtx.has(repeatDataKey) && fnCtx.allowTemplateInits) {
60
67
  initPropFallback(fnCtx, repeatDataKey);
61
68
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@symbiotejs/symbiote",
4
- "version": "3.3.7",
4
+ "version": "3.3.8",
5
5
  "description": "Symbiote.js - zero-dependency close-to-platform frontend library to build super-powered web components",
6
6
  "author": "team@rnd-pro.com",
7
7
  "license": "MIT",
@@ -1 +1 @@
1
- {"version":3,"file":"itemizeProcessor.d.ts","sourceRoot":"","sources":["../../core/itemizeProcessor.js"],"names":[],"mappings":"AAUA,iCAJgD,CAAC,SAApC,qCAAkC,MACpC,gBAAgB,SAChB,CAAC,QA8GX"}
1
+ {"version":3,"file":"itemizeProcessor.d.ts","sourceRoot":"","sources":["../../core/itemizeProcessor.js"],"names":[],"mappings":"AAUA,iCAJgD,CAAC,SAApC,qCAAkC,MACpC,gBAAgB,SAChB,CAAC,QAqHX"}