j-templates 7.0.10 → 7.0.11
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/DOM/domNodeConfig.js +8 -3
- package/Node/vNode.js +1 -2
- package/package.json +1 -1
package/DOM/domNodeConfig.js
CHANGED
|
@@ -142,8 +142,13 @@ exports.DOMNodeConfig = {
|
|
|
142
142
|
target.replaceChildren(...children);
|
|
143
143
|
},
|
|
144
144
|
reconcileChildren(target, children) {
|
|
145
|
-
if (
|
|
146
|
-
|
|
145
|
+
if (!target.firstChild) {
|
|
146
|
+
for (let x = 0; x < children.length; x++)
|
|
147
|
+
target.insertBefore(children[x], null);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (children.length === 0) {
|
|
151
|
+
target.replaceChildren();
|
|
147
152
|
return;
|
|
148
153
|
}
|
|
149
154
|
let actualNode = target.firstChild;
|
|
@@ -168,6 +173,6 @@ exports.DOMNodeConfig = {
|
|
|
168
173
|
while (target.lastChild !== children[x - 1])
|
|
169
174
|
target.removeChild(target.lastChild);
|
|
170
175
|
for (; x < children.length; x++)
|
|
171
|
-
target.
|
|
176
|
+
target.insertBefore(children[x], null);
|
|
172
177
|
}
|
|
173
178
|
};
|
package/Node/vNode.js
CHANGED
|
@@ -143,8 +143,7 @@ function StaticChildren(vnode, children) {
|
|
|
143
143
|
const childrenScope = Store_1.ObservableScope.Create(WrapStaticChildren(vnode.injector, children));
|
|
144
144
|
vnode.scopes.push(childrenScope);
|
|
145
145
|
const child = Store_1.ObservableScope.Peek(childrenScope);
|
|
146
|
-
|
|
147
|
-
switch (type) {
|
|
146
|
+
switch (typeof child) {
|
|
148
147
|
case 'string': {
|
|
149
148
|
const node = vNode.Create({
|
|
150
149
|
type: "text",
|