j-templates 7.0.87 → 7.0.88
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 +0 -8
- package/Node/nodeConfig.d.ts +0 -1
- package/Node/vNode.js +3 -9
- package/package.json +1 -1
package/DOM/domNodeConfig.js
CHANGED
|
@@ -183,12 +183,4 @@ exports.DOMNodeConfig = {
|
|
|
183
183
|
target.appendChild(child);
|
|
184
184
|
}
|
|
185
185
|
},
|
|
186
|
-
reconcileChild(target, child) {
|
|
187
|
-
const newChild = getHTMLNode(child, target.firstChild);
|
|
188
|
-
if (target.firstChild === newChild)
|
|
189
|
-
return;
|
|
190
|
-
target.appendChild(newChild);
|
|
191
|
-
while (target.firstChild !== newChild)
|
|
192
|
-
target.removeChild(target.firstChild);
|
|
193
|
-
},
|
|
194
186
|
};
|
package/Node/nodeConfig.d.ts
CHANGED
|
@@ -39,6 +39,5 @@ export interface INodeConfig {
|
|
|
39
39
|
getNextSibling(target: any): any;
|
|
40
40
|
replaceChildren(target: any, children: any[]): void;
|
|
41
41
|
reconcileChildren(target: any, children: any[]): void;
|
|
42
|
-
reconcileChild(target: any, child: any): void;
|
|
43
42
|
}
|
|
44
43
|
export declare const NodeConfig: INodeConfig;
|
package/Node/vNode.js
CHANGED
|
@@ -305,7 +305,7 @@ function UpdateChildren(vnode, init = false, skipInit = false) {
|
|
|
305
305
|
if (vnode.children.length === 1 &&
|
|
306
306
|
vnode.children[0][1].length === 1 &&
|
|
307
307
|
vnode.children[0][1][0].node) {
|
|
308
|
-
nodeConfig_1.NodeConfig.
|
|
308
|
+
nodeConfig_1.NodeConfig.reconcileChildren(vnode.node, vnode.children.flatMap((row) => row[1].map((vnode) => vnode.node)));
|
|
309
309
|
return;
|
|
310
310
|
}
|
|
311
311
|
const children = vnode.children;
|
|
@@ -327,19 +327,13 @@ function UpdateChildren(vnode, init = false, skipInit = false) {
|
|
|
327
327
|
if (vnode.destroyed || children !== vnode.children)
|
|
328
328
|
return;
|
|
329
329
|
if (init || !async) {
|
|
330
|
-
|
|
331
|
-
nodeConfig_1.NodeConfig.reconcileChild(vnode.node, vnode.children[0][1][0].node);
|
|
332
|
-
else
|
|
333
|
-
nodeConfig_1.NodeConfig.reconcileChildren(vnode.node, vnode.children.flatMap((row) => row[1].map((vnode) => vnode.node)));
|
|
330
|
+
nodeConfig_1.NodeConfig.reconcileChildren(vnode.node, vnode.children.flatMap((row) => row[1].map((vnode) => vnode.node)));
|
|
334
331
|
}
|
|
335
332
|
else
|
|
336
333
|
nodeConfig_1.NodeConfig.scheduleUpdate(function () {
|
|
337
334
|
if (vnode.destroyed || children !== vnode.children)
|
|
338
335
|
return;
|
|
339
|
-
|
|
340
|
-
nodeConfig_1.NodeConfig.reconcileChild(vnode.node, vnode.children[0][1][0].node);
|
|
341
|
-
else
|
|
342
|
-
nodeConfig_1.NodeConfig.reconcileChildren(vnode.node, vnode.children.flatMap((row) => row[1].map((vnode) => vnode.node)));
|
|
336
|
+
nodeConfig_1.NodeConfig.reconcileChildren(vnode.node, vnode.children.flatMap((row) => row[1].map((vnode) => vnode.node)));
|
|
343
337
|
});
|
|
344
338
|
});
|
|
345
339
|
});
|