mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] compiler: improve generated compiled code
This commit is contained in:
committed by
Aaron Bohy
parent
bd5637c0a3
commit
c7af885f43
@@ -76,10 +76,10 @@ exports[`basics can be clicked on and updated 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/><button block-handler-1=\\"click\\">Inc</button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].counter;
|
||||
let txt1 = ctx['state'].counter;
|
||||
const v1 = ctx['state'];
|
||||
let d2 = [()=>v1.counter++, ctx];
|
||||
return block1([d1, d2]);
|
||||
let hdlr2 = [()=>v1.counter++, ctx];
|
||||
return block1([txt1, hdlr2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -106,8 +106,8 @@ exports[`basics can handle empty props 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -133,8 +133,8 @@ exports[`basics can inject values in tagged templates 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].n;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['state'].n;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -198,8 +198,8 @@ exports[`basics can mount a simple component with props 1`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].value;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].value;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -234,8 +234,8 @@ exports[`basics class component with dynamic text 1`] = `
|
||||
let block1 = createBlock(\`<span>My value: <block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['value'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -259,8 +259,8 @@ exports[`basics class parent, class child component with props 2`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].value;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].value;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -273,8 +273,8 @@ exports[`basics component with dynamic content can be updated 1`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['value'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -300,8 +300,8 @@ exports[`basics do not remove previously rendered dom if not necessary, variatio
|
||||
let block1 = createBlock(\`<div><h1>h1</h1><span><block-text-0/></span></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].value;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['state'].value;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -494,10 +494,10 @@ exports[`basics rerendering a widget with a sub widget 2`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/><button block-handler-1=\\"click\\">Inc</button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].counter;
|
||||
let txt1 = ctx['state'].counter;
|
||||
const v1 = ctx['state'];
|
||||
let d2 = [()=>v1.counter++, ctx];
|
||||
return block1([d1, d2]);
|
||||
let hdlr2 = [()=>v1.counter++, ctx];
|
||||
return block1([txt1, hdlr2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -527,8 +527,8 @@ exports[`basics same t-keys in two different places 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].blip;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].blip;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -541,8 +541,8 @@ exports[`basics simple component with a dynamic text 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['value'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -555,8 +555,8 @@ exports[`basics simple component, useState 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].value;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['state'].value;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -786,8 +786,8 @@ exports[`basics text after a conditional component 1`] = `
|
||||
if (ctx['state'].hasChild) {
|
||||
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
|
||||
}
|
||||
let d1 = ctx['state'].text;
|
||||
return block1([d1], [b2]);
|
||||
let txt1 = ctx['state'].text;
|
||||
return block1([txt1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -901,9 +901,9 @@ exports[`basics update props of component without concrete own node 3`] = `
|
||||
let block1 = createBlock(\`<div class=\\"widget-subkey\\"><block-text-0/>__<block-text-1/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].key;
|
||||
let d2 = ctx['props'].subKey;
|
||||
return block1([d1, d2]);
|
||||
let txt1 = ctx['props'].key;
|
||||
let txt2 = ctx['props'].subKey;
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -44,8 +44,8 @@ exports[`calling render in destroy 3`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].fromA;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].fromA;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -58,8 +58,8 @@ exports[`change state and call manually render: no unnecessary rendering 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['value'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -89,8 +89,8 @@ exports[`changing state before first render does not trigger a render (with pare
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['value'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -103,8 +103,8 @@ exports[`changing state before first render does not trigger a render 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['value'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -145,9 +145,9 @@ exports[`concurrent renderings scenario 1 3`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].fromA;
|
||||
let d2 = ctx['someValue']();
|
||||
return block1([d1, d2]);
|
||||
let txt1 = ctx['props'].fromA;
|
||||
let txt2 = ctx['someValue']();
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -160,9 +160,9 @@ exports[`concurrent renderings scenario 2 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].fromA;
|
||||
let txt1 = ctx['state'].fromA;
|
||||
let b2 = component(\`ComponentB\`, {fromA: ctx['state'].fromA}, key + \`__1\`, node, ctx);
|
||||
return block1([d1], [b2]);
|
||||
return block1([txt1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -189,9 +189,9 @@ exports[`concurrent renderings scenario 2 3`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].fromA;
|
||||
let d2 = ctx['props'].fromB;
|
||||
return block1([d1, d2]);
|
||||
let txt1 = ctx['props'].fromA;
|
||||
let txt2 = ctx['props'].fromB;
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -232,9 +232,9 @@ exports[`concurrent renderings scenario 2bis 3`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].fromA;
|
||||
let d2 = ctx['props'].fromB;
|
||||
return block1([d1, d2]);
|
||||
let txt1 = ctx['props'].fromA;
|
||||
let txt2 = ctx['props'].fromB;
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -289,9 +289,9 @@ exports[`concurrent renderings scenario 3 4`] = `
|
||||
let block1 = createBlock(\`<i><block-text-0/><block-text-1/></i>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].fromA;
|
||||
let d2 = ctx['someValue']();
|
||||
return block1([d1, d2]);
|
||||
let txt1 = ctx['props'].fromA;
|
||||
let txt2 = ctx['someValue']();
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -346,9 +346,9 @@ exports[`concurrent renderings scenario 4 4`] = `
|
||||
let block1 = createBlock(\`<i><block-text-0/><block-text-1/></i>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].fromA;
|
||||
let d2 = ctx['someValue']();
|
||||
return block1([d1, d2]);
|
||||
let txt1 = ctx['props'].fromA;
|
||||
let txt2 = ctx['someValue']();
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -375,8 +375,8 @@ exports[`concurrent renderings scenario 5 2`] = `
|
||||
let block1 = createBlock(\`<p><block-text-0/></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['someValue']();
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['someValue']();
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -403,8 +403,8 @@ exports[`concurrent renderings scenario 6 2`] = `
|
||||
let block1 = createBlock(\`<p><block-text-0/></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['someValue']();
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['someValue']();
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -431,9 +431,9 @@ exports[`concurrent renderings scenario 7 2`] = `
|
||||
let block1 = createBlock(\`<p><block-text-0/><block-text-1/></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].fromA;
|
||||
let d2 = ctx['someValue']();
|
||||
return block1([d1, d2]);
|
||||
let txt1 = ctx['props'].fromA;
|
||||
let txt2 = ctx['someValue']();
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -460,9 +460,9 @@ exports[`concurrent renderings scenario 8 2`] = `
|
||||
let block1 = createBlock(\`<p><block-text-0/><block-text-1/></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].fromA;
|
||||
let d2 = ctx['state'].fromB;
|
||||
return block1([d1, d2]);
|
||||
let txt1 = ctx['props'].fromA;
|
||||
let txt2 = ctx['state'].fromB;
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -475,10 +475,10 @@ exports[`concurrent renderings scenario 9 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/><block-child-0/><block-child-1/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].fromA;
|
||||
let txt1 = ctx['state'].fromA;
|
||||
let b2 = component(\`ComponentB\`, {fromA: ctx['state'].fromA}, key + \`__1\`, node, ctx);
|
||||
let b3 = component(\`ComponentC\`, {fromA: ctx['state'].fromA}, key + \`__2\`, node, ctx);
|
||||
return block1([d1], [b2, b3]);
|
||||
return block1([txt1], [b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -491,8 +491,8 @@ exports[`concurrent renderings scenario 9 2`] = `
|
||||
let block1 = createBlock(\`<b><block-text-0/></b>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].fromA;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].fromA;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -519,9 +519,9 @@ exports[`concurrent renderings scenario 9 4`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].fromA;
|
||||
let d2 = ctx['props'].fromC;
|
||||
return block1([d1, d2]);
|
||||
let txt1 = ctx['props'].fromA;
|
||||
let txt2 = ctx['props'].fromC;
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -565,8 +565,8 @@ exports[`concurrent renderings scenario 10 3`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['value'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -593,9 +593,9 @@ exports[`concurrent renderings scenario 11 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/>|<block-text-1/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
let d2 = ctx['val'];
|
||||
return block1([d1, d2]);
|
||||
let txt1 = ctx['props'].val;
|
||||
let txt2 = ctx['val'];
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -622,8 +622,8 @@ exports[`concurrent renderings scenario 12 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -654,8 +654,8 @@ exports[`concurrent renderings scenario 13 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['state'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -696,10 +696,10 @@ exports[`concurrent renderings scenario 14 3`] = `
|
||||
let block1 = createBlock(\`<p><span><block-text-0/></span><span><block-text-1/></span><span><block-text-2/></span></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].fromA;
|
||||
let d2 = ctx['props'].fromB;
|
||||
let d3 = ctx['state'].fromC;
|
||||
return block1([d1, d2, d3]);
|
||||
let txt1 = ctx['props'].fromA;
|
||||
let txt2 = ctx['props'].fromB;
|
||||
let txt3 = ctx['state'].fromC;
|
||||
return block1([txt1, txt2, txt3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -740,10 +740,10 @@ exports[`concurrent renderings scenario 15 3`] = `
|
||||
let block1 = createBlock(\`<p><span><block-text-0/></span><span><block-text-1/></span><span><block-text-2/></span></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].fromA;
|
||||
let d2 = ctx['props'].fromB;
|
||||
let d3 = ctx['state'].fromC;
|
||||
return block1([d1, d2, d3]);
|
||||
let txt1 = ctx['props'].fromA;
|
||||
let txt2 = ctx['props'].fromB;
|
||||
let txt3 = ctx['state'].fromC;
|
||||
return block1([txt1, txt2, txt3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -828,8 +828,8 @@ exports[`creating two async components, scenario 1 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['getValue']();
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['getValue']();
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -873,8 +873,8 @@ exports[`creating two async components, scenario 2 2`] = `
|
||||
let block1 = createBlock(\`<span>a<block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -887,8 +887,8 @@ exports[`creating two async components, scenario 2 3`] = `
|
||||
let block1 = createBlock(\`<span>b<block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -919,8 +919,8 @@ exports[`creating two async components, scenario 3 (patching in the same frame)
|
||||
let block1 = createBlock(\`<span>a<block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -933,8 +933,8 @@ exports[`creating two async components, scenario 3 (patching in the same frame)
|
||||
let block1 = createBlock(\`<span>b<block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1040,8 +1040,8 @@ exports[`destroying/recreating a subwidget with different props (if start is not
|
||||
let block1 = createBlock(\`<span>child:<block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1121,11 +1121,11 @@ exports[`rendering component again in next microtick 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2;
|
||||
let d1 = [ctx['onClick'], ctx];
|
||||
let hdlr1 = [ctx['onClick'], ctx];
|
||||
if (ctx['env'].config.flag) {
|
||||
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
|
||||
}
|
||||
return block1([d1], [b2]);
|
||||
return block1([hdlr1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1169,9 +1169,9 @@ exports[`two renderings initiated between willPatch and patched 2`] = `
|
||||
let block1 = createBlock(\`<abc><block-text-0/><block-text-1/></abc>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
let d2 = ctx['mounted'];
|
||||
return block1([d1, d2]);
|
||||
let txt1 = ctx['props'].val;
|
||||
let txt2 = ctx['mounted'];
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1220,8 +1220,8 @@ exports[`update a sub-component twice in the same frame 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1248,8 +1248,8 @@ exports[`update a sub-component twice in the same frame, 2 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['val']();
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['val']();
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -33,8 +33,8 @@ exports[`basics no component catching error lead to full app destruction 2`] = `
|
||||
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].flag&&ctx['state'].this.will.crash;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].flag&&ctx['state'].this.will.crash;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -66,8 +66,8 @@ exports[`basics simple catchError 2`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['a'].b.c;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['a'].b.c;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -118,8 +118,8 @@ exports[`can catch errors can catch an error in a component render function 3`]
|
||||
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].flag&&ctx['state'].this.will.crash;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].flag&&ctx['state'].this.will.crash;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -287,8 +287,8 @@ exports[`can catch errors can catch an error in the initial call of a component
|
||||
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].this.will.crash;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['state'].this.will.crash;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -342,8 +342,8 @@ exports[`can catch errors can catch an error in the initial call of a component
|
||||
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].this.will.crash;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['state'].this.will.crash;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -500,9 +500,9 @@ exports[`can catch errors can catch an error in the willPatch call 1`] = `
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].message;
|
||||
let txt1 = ctx['state'].message;
|
||||
let b3 = component(\`ErrorBoundary\`, {slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__3\`, node, ctx);
|
||||
return block1([d1], [b3]);
|
||||
return block1([txt1], [b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -535,8 +535,8 @@ exports[`can catch errors can catch an error in the willPatch call 3`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].message;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].message;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -699,8 +699,8 @@ exports[`can catch errors catchError in catchError 3`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['a'].b.c;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['a'].b.c;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -925,8 +925,8 @@ exports[`errors and promises a rendering error in a sub component will reject th
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = this.will.crash;
|
||||
return block1([d1]);
|
||||
let txt1 = this.will.crash;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -939,8 +939,8 @@ exports[`errors and promises a rendering error will reject the mount promise 1`]
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = this.will.crash;
|
||||
return block1([d1]);
|
||||
let txt1 = this.will.crash;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -954,8 +954,8 @@ exports[`errors and promises a rendering error will reject the render promise (w
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
|
||||
let d1 = ctx['x'].y;
|
||||
return block1([d1], [b2]);
|
||||
let txt1 = ctx['x'].y;
|
||||
return block1([txt1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1011,8 +1011,8 @@ exports[`errors and promises an error in patched call will reject the render pro
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['val'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['val'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1025,8 +1025,8 @@ exports[`errors and promises an error in willPatch call will reject the render p
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['val'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['val'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1052,8 +1052,8 @@ exports[`errors and promises errors in rerender 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].a.b;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['state'].a.b;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -8,10 +8,10 @@ exports[`event handling handler receive the event as argument 1`] = `
|
||||
let block1 = createBlock(\`<span block-handler-0=\\"click\\"><block-child-0/><block-text-1/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['inc'], ctx];
|
||||
let hdlr1 = [ctx['inc'], ctx];
|
||||
let b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
|
||||
let d2 = ctx['state'].value;
|
||||
return block1([d1, d2], [b2]);
|
||||
let txt2 = ctx['state'].value;
|
||||
return block1([hdlr1, txt2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -46,8 +46,8 @@ exports[`event handling objects from scope are properly captured by t-on 1`] = `
|
||||
let key1 = ctx['item'];
|
||||
const v1 = ctx['onClick'];
|
||||
const v2 = ctx['item'];
|
||||
let d1 = [ev=>v1(v2.val,ev), ctx];
|
||||
c_block2[i1] = withKey(block3([d1]), key1);
|
||||
let hdlr1 = [ev=>v1(v2.val,ev), ctx];
|
||||
c_block2[i1] = withKey(block3([hdlr1]), key1);
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
@@ -63,9 +63,9 @@ exports[`event handling support for callable expression in event handler 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/><input type=\\"text\\" block-handler-1=\\"input\\"/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].value;
|
||||
let d2 = [ctx['obj'].onInput, ctx];
|
||||
return block1([d1, d2]);
|
||||
let txt1 = ctx['state'].value;
|
||||
let hdlr2 = [ctx['obj'].onInput, ctx];
|
||||
return block1([txt1, hdlr2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -87,8 +87,8 @@ exports[`event handling t-on with handler bound to dynamic argument on a t-forea
|
||||
let key1 = ctx['item'];
|
||||
const v1 = ctx['onClick'];
|
||||
const v2 = ctx['item'];
|
||||
let d1 = [ev=>v1(v2,ev), ctx];
|
||||
c_block2[i1] = withKey(block3([d1]), key1);
|
||||
let hdlr1 = [ev=>v1(v2,ev), ctx];
|
||||
c_block2[i1] = withKey(block3([hdlr1]), key1);
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
|
||||
@@ -19,8 +19,8 @@ exports[`basics basic use 2`] = `
|
||||
let block1 = createBlock(\`<span>child<block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].p;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].p;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -132,9 +132,9 @@ exports[`basics sub widget is interactive 2`] = `
|
||||
let block1 = createBlock(\`<span><button block-handler-0=\\"click\\">click</button>child<block-text-1/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['inc'], ctx];
|
||||
let d2 = ctx['state'].val;
|
||||
return block1([d1, d2]);
|
||||
let hdlr1 = [ctx['inc'], ctx];
|
||||
let txt2 = ctx['state'].val;
|
||||
return block1([hdlr1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -56,8 +56,8 @@ exports[`hooks can use onWillStart, onWillUpdateProps 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].value;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].value;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -83,8 +83,8 @@ exports[`hooks can use useEnv 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['env'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['env'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -97,8 +97,8 @@ exports[`hooks mounted callbacks should be called in reverse order from willUnmo
|
||||
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].value;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['state'].value;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -124,8 +124,8 @@ exports[`hooks parent and child env 2`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['env'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['env'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -138,8 +138,8 @@ exports[`hooks two different call to willPatch/patched should work 1`] = `
|
||||
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].value;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['state'].value;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -152,8 +152,8 @@ exports[`hooks use sub env does not pollute user env 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['env'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['env'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -177,9 +177,9 @@ exports[`hooks use sub env supports arbitrary descriptor 2`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/> <block-text-1/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['env'].someVal;
|
||||
let d2 = ctx['env'].someVal2;
|
||||
return block1([d1, d2]);
|
||||
let txt1 = ctx['env'].someVal;
|
||||
let txt2 = ctx['env'].someVal2;
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -237,8 +237,8 @@ exports[`hooks useEffect hook effect with empty dependency list never reruns 1`]
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].value;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['state'].value;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -266,8 +266,8 @@ exports[`hooks useExternalListener 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].value;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].value;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -282,8 +282,8 @@ exports[`hooks useRef hook: basic use 1`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const refs = ctx.__owl__.refs;
|
||||
let d1 = (el) => refs[\`button\`] = el;
|
||||
let d2 = ctx['value'];
|
||||
return block1([d1, d2]);
|
||||
let txt2 = ctx['value'];
|
||||
return block1([d1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -126,8 +126,8 @@ exports[`lifecycle hooks components are unmounted and destroyed if no longer in
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].n;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].n;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -490,9 +490,9 @@ exports[`lifecycle hooks onWillRender 2`] = `
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-text-1/></button>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['increment'], ctx];
|
||||
let d2 = ctx['state'].value;
|
||||
return block1([d1, d2]);
|
||||
let hdlr1 = [ctx['increment'], ctx];
|
||||
let txt2 = ctx['state'].value;
|
||||
return block1([hdlr1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -532,8 +532,8 @@ exports[`lifecycle hooks patched hook is called after updating State 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].a;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['state'].a;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -546,8 +546,8 @@ exports[`lifecycle hooks render in mounted 1`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['patched'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['patched'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -560,8 +560,8 @@ exports[`lifecycle hooks render in patched 1`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['patched'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['patched'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -574,8 +574,8 @@ exports[`lifecycle hooks render in willPatch 1`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['patched'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['patched'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -644,8 +644,8 @@ exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents,
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].n;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].n;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -752,8 +752,8 @@ exports[`lifecycle hooks willUpdateProps hook is called 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].n;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].n;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -22,8 +22,8 @@ exports[`basics accept ES6-like syntax for props (with getters) 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].greetings;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].greetings;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -57,8 +57,8 @@ exports[`basics arrow functions as prop correctly capture their scope 2`] = `
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['props'].onClick, ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [ctx['props'].onClick, ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -85,8 +85,8 @@ exports[`basics explicit object prop 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].someval;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['state'].someval;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -110,8 +110,8 @@ exports[`basics prop names can contain - 2`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props']['prop-name'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props']['prop-name'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -135,8 +135,8 @@ exports[`basics support prop names that aren't valid bare object property names
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['props'].onClick, ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [ctx['props'].onClick, ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -170,9 +170,9 @@ exports[`basics t-set with a body expression can be passed in props, and then t-
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-child-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
let txt1 = ctx['props'].val;
|
||||
let b2 = safeOutput(ctx['props'].val);
|
||||
return block1([d1], [b2]);
|
||||
return block1([txt1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -203,8 +203,8 @@ exports[`basics t-set with a body expression can be used as textual prop 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -235,8 +235,8 @@ exports[`basics t-set works 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -60,8 +60,8 @@ exports[`default props can set default values 2`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].p;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].p;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -90,8 +90,8 @@ exports[`default props default values are also set whenever component is updated
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].p;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].p;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -664,8 +664,8 @@ exports[`props validation default values are applied before validating props at
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].p;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].p;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -726,8 +726,8 @@ exports[`props validation props are validated in dev mode (code snapshot) 2`] =
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].message;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].message;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -756,8 +756,8 @@ exports[`props validation props are validated whenever component is updated 2`]
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].p;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].p;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -8,8 +8,8 @@ exports[`reactivity in lifecycle can use a state hook 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['counter'].value;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['counter'].value;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -22,8 +22,8 @@ exports[`reactivity in lifecycle can use a state hook 2 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].a;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['state'].a;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -36,8 +36,8 @@ exports[`reactivity in lifecycle change state while mounting component 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['state'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -67,9 +67,9 @@ exports[`reactivity in lifecycle state changes in willUnmount do not trigger rer
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
let d2 = ctx['state'].n;
|
||||
return block1([d1, d2]);
|
||||
let txt1 = ctx['props'].val;
|
||||
let txt2 = ctx['state'].n;
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -26,16 +26,16 @@ exports[`refs refs are properly bound in slots 1`] = `
|
||||
|
||||
function slot2(ctx, node, key = \\"\\") {
|
||||
const refs = ctx.__owl__.refs;
|
||||
let d2 = [ctx['doSomething'], ctx];
|
||||
let hdlr2 = [ctx['doSomething'], ctx];
|
||||
let d3 = (el) => refs[\`myButton\`] = el;
|
||||
return block2([d2, d3]);
|
||||
return block2([hdlr2, d3]);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].val;
|
||||
let txt1 = ctx['state'].val;
|
||||
const ctx1 = capture(ctx);
|
||||
let b3 = component(\`Dialog\`, {slots: {'footer': {__render: slot2, __ctx: ctx1}}}, key + \`__3\`, node, ctx);
|
||||
return block1([d1], [b3]);
|
||||
return block1([txt1], [b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -110,11 +110,11 @@ exports[`slots can define and call slots with params 2`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/><div><block-child-0/></div><block-text-1/><div><block-child-1/></div></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].slots['header'].param;
|
||||
let txt1 = ctx['props'].slots['header'].param;
|
||||
let b2 = callSlot(ctx, node, key, 'header', false, {});
|
||||
let d2 = ctx['props'].slots['footer'].param;
|
||||
let txt2 = ctx['props'].slots['footer'].param;
|
||||
let b3 = callSlot(ctx, node, key, 'footer', false, {});
|
||||
return block1([d1, d2], [b2, b3]);
|
||||
return block1([txt1, txt2], [b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -522,10 +522,10 @@ exports[`slots dynamic t-slot call 2`] = `
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-child-0/></button>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['toggle'], ctx];
|
||||
let hdlr1 = [ctx['toggle'], ctx];
|
||||
const slot1 = (ctx['current'].slot);
|
||||
let b2 = toggler(slot1, callSlot(ctx, node, key, slot1), true, {});
|
||||
return block1([d1], [b2]);
|
||||
return block1([hdlr1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -572,9 +572,9 @@ exports[`slots dynamic t-slot call with default 2`] = `
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['toggle'], ctx];
|
||||
let hdlr1 = [ctx['toggle'], ctx];
|
||||
let b3 = callSlot(ctx, node, key, (ctx['current'].slot), true, {}, defaultContent1);
|
||||
return block1([d1], [b3]);
|
||||
return block1([hdlr1], [b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -759,8 +759,8 @@ exports[`slots multiple slots containing components 3`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -776,8 +776,8 @@ exports[`slots named slot inside slot 1`] = `
|
||||
let block3 = createBlock(\`<p>B<block-text-0/></p>\`);
|
||||
|
||||
function slot2(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['value'];
|
||||
return block2([d1]);
|
||||
let txt1 = ctx['value'];
|
||||
return block2([txt1]);
|
||||
}
|
||||
|
||||
function slot3(ctx, node, key = \\"\\") {
|
||||
@@ -786,8 +786,8 @@ exports[`slots named slot inside slot 1`] = `
|
||||
}
|
||||
|
||||
function slot5(ctx, node, key = \\"\\") {
|
||||
let d2 = ctx['value'];
|
||||
return block3([d2]);
|
||||
let txt2 = ctx['value'];
|
||||
return block3([txt2]);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -825,8 +825,8 @@ exports[`slots named slot inside slot, part 3 1`] = `
|
||||
let block3 = createBlock(\`<p>B<block-text-0/></p>\`);
|
||||
|
||||
function slot2(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['value'];
|
||||
return block2([d1]);
|
||||
let txt1 = ctx['value'];
|
||||
return block2([txt1]);
|
||||
}
|
||||
|
||||
function slot3(ctx, node, key = \\"\\") {
|
||||
@@ -835,8 +835,8 @@ exports[`slots named slot inside slot, part 3 1`] = `
|
||||
}
|
||||
|
||||
function slot5(ctx, node, key = \\"\\") {
|
||||
let d2 = ctx['value'];
|
||||
return block3([d2]);
|
||||
let txt2 = ctx['value'];
|
||||
return block3([txt2]);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -907,8 +907,8 @@ exports[`slots named slots inside slot, again 1`] = `
|
||||
let block3 = createBlock(\`<p>B<block-text-0/></p>\`);
|
||||
|
||||
function slot2(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['value'];
|
||||
return block2([d1]);
|
||||
let txt1 = ctx['value'];
|
||||
return block2([txt1]);
|
||||
}
|
||||
|
||||
function slot3(ctx, node, key = \\"\\") {
|
||||
@@ -917,8 +917,8 @@ exports[`slots named slots inside slot, again 1`] = `
|
||||
}
|
||||
|
||||
function slot5(ctx, node, key = \\"\\") {
|
||||
let d2 = ctx['value'];
|
||||
return block3([d2]);
|
||||
let txt2 = ctx['value'];
|
||||
return block3([txt2]);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -1073,8 +1073,8 @@ exports[`slots nested slots: evaluation context and parented relationship 4`] =
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1379,10 +1379,10 @@ exports[`slots slot are properly rendered if inner props are changed 1`] = `
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['inc'], ctx];
|
||||
let d2 = ctx['state'].val;
|
||||
let hdlr1 = [ctx['inc'], ctx];
|
||||
let txt2 = ctx['state'].val;
|
||||
let b3 = component(\`GenericComponent\`, {slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__3\`, node, ctx);
|
||||
return block1([d1, d2], [b3]);
|
||||
return block1([hdlr1, txt2], [b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1410,8 +1410,8 @@ exports[`slots slot are properly rendered if inner props are changed 3`] = `
|
||||
let block1 = createBlock(\`<div> SC:<block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1428,8 +1428,8 @@ exports[`slots slot content is bound to caller (variation) 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"var\\", 1);
|
||||
let d1 = [()=>this.inc(), ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [()=>this.inc(), ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -1462,8 +1462,8 @@ exports[`slots slot content is bound to caller 1`] = `
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">some text</button>\`);
|
||||
|
||||
function slot1(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['inc'], ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [ctx['inc'], ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -1636,9 +1636,9 @@ exports[`slots slots are properly bound to correct component 2`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"var\\", 1);
|
||||
let d1 = [()=>this.increment(), ctx];
|
||||
let d2 = ctx['state'].value;
|
||||
return block1([d1, d2]);
|
||||
let hdlr1 = [()=>this.increment(), ctx];
|
||||
let txt2 = ctx['state'].value;
|
||||
return block1([hdlr1, txt2]);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -1657,15 +1657,15 @@ exports[`slots slots are rendered with proper context 1`] = `
|
||||
let block2 = createBlock(\`<button block-handler-0=\\"click\\">do something</button>\`);
|
||||
|
||||
function slot2(ctx, node, key = \\"\\") {
|
||||
let d2 = [ctx['doSomething'], ctx];
|
||||
return block2([d2]);
|
||||
let hdlr2 = [ctx['doSomething'], ctx];
|
||||
return block2([hdlr2]);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].val;
|
||||
let txt1 = ctx['state'].val;
|
||||
const ctx1 = capture(ctx);
|
||||
let b3 = component(\`Dialog\`, {slots: {'footer': {__render: slot2, __ctx: ctx1}}}, key + \`__3\`, node, ctx);
|
||||
return block1([d1], [b3]);
|
||||
return block1([txt1], [b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1725,9 +1725,9 @@ exports[`slots slots are rendered with proper context, part 2 2`] = `
|
||||
let block1 = createBlock(\`<a block-attribute-0=\\"href\\"><block-child-0/></a>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].to;
|
||||
let attr1 = ctx['props'].to;
|
||||
let b2 = callSlot(ctx, node, key, 'default', false, {});
|
||||
return block1([d1], [b2]);
|
||||
return block1([attr1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1773,9 +1773,9 @@ exports[`slots slots are rendered with proper context, part 3 2`] = `
|
||||
let block1 = createBlock(\`<a block-attribute-0=\\"href\\"><block-child-0/></a>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].to;
|
||||
let attr1 = ctx['props'].to;
|
||||
let b2 = callSlot(ctx, node, key, 'default', false, {});
|
||||
return block1([d1], [b2]);
|
||||
return block1([attr1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1812,9 +1812,9 @@ exports[`slots slots are rendered with proper context, part 4 2`] = `
|
||||
let block1 = createBlock(\`<a block-attribute-0=\\"href\\"><block-child-0/></a>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].to;
|
||||
let attr1 = ctx['props'].to;
|
||||
let b2 = callSlot(ctx, node, key, 'default', false, {});
|
||||
return block1([d1], [b2]);
|
||||
return block1([attr1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1829,8 +1829,8 @@ exports[`slots slots in slots, with vars 1`] = `
|
||||
let block2 = createBlock(\`<p>hey<block-text-0/></p>\`);
|
||||
|
||||
function slot2(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['test'];
|
||||
return block2([d1]);
|
||||
let txt1 = ctx['test'];
|
||||
return block2([txt1]);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -1915,9 +1915,9 @@ exports[`slots slots in t-foreach and re-rendering 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-child-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].val;
|
||||
let txt1 = ctx['state'].val;
|
||||
let b2 = callSlot(ctx, node, key, 'default', false, {});
|
||||
return block1([d1], [b2]);
|
||||
return block1([txt1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1934,8 +1934,8 @@ exports[`slots slots in t-foreach in t-foreach 1`] = `
|
||||
let block7 = createBlock(\`<li><block-text-0/></li>\`);
|
||||
|
||||
function slot2(ctx, node, key = \\"\\") {
|
||||
let d2 = ctx['node1'].value;
|
||||
return block7([d2]);
|
||||
let txt2 = ctx['node1'].value;
|
||||
return block7([txt2]);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -1944,8 +1944,8 @@ exports[`slots slots in t-foreach in t-foreach 1`] = `
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`node1\`] = v_block2[i1];
|
||||
let key1 = ctx['node1'].key;
|
||||
let d1 = ctx['node1'].value;
|
||||
let b4 = block4([d1]);
|
||||
let txt1 = ctx['node1'].value;
|
||||
let b4 = block4([txt1]);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block6, v_block6, l_block6, c_block6] = prepareList(ctx['node1'].nodes);
|
||||
for (let i2 = 0; i2 < l_block6; i2++) {
|
||||
@@ -2020,9 +2020,9 @@ exports[`slots slots in t-foreach with t-set and re-rendering 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-child-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].val;
|
||||
let txt1 = ctx['state'].val;
|
||||
let b2 = callSlot(ctx, node, key, 'default', false, {});
|
||||
return block1([d1], [b2]);
|
||||
return block1([txt1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -2271,9 +2271,9 @@ exports[`slots t-slot scope context 2`] = `
|
||||
let block1 = createBlock(\`<div block-handler-0=\\"click\\"><block-child-0/></div>\`);
|
||||
|
||||
function slot1(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['onClick'], ctx];
|
||||
let hdlr1 = [ctx['onClick'], ctx];
|
||||
let b2 = callSlot(ctx, node, key, 'default', false, {});
|
||||
return block1([d1], [b2]);
|
||||
return block1([hdlr1], [b2]);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -2395,8 +2395,8 @@ exports[`slots template can just return a slot 3`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].value;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].value;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -21,8 +21,8 @@ exports[`style and class handling can set class on multi root component 2`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2 = block2();
|
||||
let d1 = ctx['props'].class;
|
||||
let b3 = block3([d1]);
|
||||
let attr1 = ctx['props'].class;
|
||||
let b3 = block3([attr1]);
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
}"
|
||||
@@ -47,8 +47,8 @@ exports[`style and class handling can set class on sub component, as prop 2`] =
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">child</div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].class;
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['props'].class;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -83,8 +83,8 @@ exports[`style and class handling can set class on sub sub component 3`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">childchild</div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].class;
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['props'].class;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -108,8 +108,8 @@ exports[`style and class handling can set more than one class on sub component 2
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">child</div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].class;
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['props'].class;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -135,8 +135,8 @@ exports[`style and class handling class on components do not interfere with user
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = {c:ctx['state'].c};
|
||||
return block1([d1]);
|
||||
let attr1 = {c:ctx['state'].c};
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -177,8 +177,8 @@ exports[`style and class handling class on sub component, which is switched to a
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">a</div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].class;
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['props'].class;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -191,8 +191,8 @@ exports[`style and class handling class on sub component, which is switched to a
|
||||
let block1 = createBlock(\`<span block-attribute-0=\\"class\\">b</span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].class;
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['props'].class;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -219,8 +219,8 @@ exports[`style and class handling class with extra whitespaces (variation) 2`] =
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].class;
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['props'].class;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -244,8 +244,8 @@ exports[`style and class handling class with extra whitespaces 2`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].class;
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['props'].class;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -269,8 +269,8 @@ exports[`style and class handling component class and parent class combine toget
|
||||
let block1 = createBlock(\`<div class=\\"child\\" block-attribute-0=\\"class\\">child</div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].class;
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['props'].class;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -324,8 +324,8 @@ exports[`style and class handling empty class attribute is not added on widget r
|
||||
let block1 = createBlock(\`<span block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].class;
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['props'].class;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -349,9 +349,9 @@ exports[`style and class handling error in subcomponent with class 2`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"><block-text-1/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].class;
|
||||
let d2 = this.will.crash;
|
||||
return block1([d1, d2]);
|
||||
let attr1 = ctx['props'].class;
|
||||
let txt2 = this.will.crash;
|
||||
return block1([attr1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -399,8 +399,8 @@ exports[`style and class handling no class is set is parent does not give it as
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">child</div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].class;
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['props'].class;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -424,8 +424,8 @@ exports[`style and class handling style is properly added on widget root el 2`]
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"style\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].style;
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['props'].style;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -452,8 +452,8 @@ exports[`style and class handling t-att-class is properly added/removed on widge
|
||||
let block1 = createBlock(\`<span class=\\"c\\" block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = {d:ctx['state'].d,...ctx['props'].class};
|
||||
return block1([d1]);
|
||||
let attr1 = {d:ctx['state'].d,...ctx['props'].class};
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -477,8 +477,8 @@ exports[`style and class handling t-att-class is properly added/removed on widge
|
||||
let block1 = createBlock(\`<span class=\\"c\\" block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = {d:ctx['state'].d,...ctx['props'].class};
|
||||
return block1([d1]);
|
||||
let attr1 = {d:ctx['state'].d,...ctx['props'].class};
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -52,8 +52,8 @@ exports[`t-call handlers are properly bound through a dynamic t-call 1`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const template2 = ('__template__999');
|
||||
let b2 = call(this, template2, ctx, node, key + \`__1\`);
|
||||
let d1 = ctx['counter'];
|
||||
return block1([d1], [b2]);
|
||||
let txt1 = ctx['counter'];
|
||||
return block1([txt1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -66,8 +66,8 @@ exports[`t-call handlers are properly bound through a dynamic t-call 2`] = `
|
||||
let block1 = createBlock(\`<p block-handler-0=\\"click\\">lucas</p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [()=>this.update(), ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [()=>this.update(), ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -83,8 +83,8 @@ exports[`t-call handlers are properly bound through a t-call 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let d1 = ctx['counter'];
|
||||
return block1([d1], [b2]);
|
||||
let txt1 = ctx['counter'];
|
||||
return block1([txt1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -97,8 +97,8 @@ exports[`t-call handlers are properly bound through a t-call 2`] = `
|
||||
let block1 = createBlock(\`<p block-handler-0=\\"click\\">lucas</p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['update'], ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [ctx['update'], ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -128,8 +128,8 @@ exports[`t-call handlers with arguments are properly bound through a t-call 2`]
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const v1 = ctx['a'];
|
||||
let d1 = [()=>this.update(v1), ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [()=>this.update(v1), ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -253,8 +253,8 @@ exports[`t-call sub components in two t-calls 3`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -305,8 +305,8 @@ exports[`t-call t-call in t-foreach and children component 3`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].val;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].val;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -142,10 +142,10 @@ exports[`t-component modifying a sub widget 2`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/><button block-handler-1=\\"click\\">Inc</button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].counter;
|
||||
let txt1 = ctx['state'].counter;
|
||||
const v1 = ctx['state'];
|
||||
let d2 = [()=>v1.counter++, ctx];
|
||||
return block1([d1, d2]);
|
||||
let hdlr2 = [()=>v1.counter++, ctx];
|
||||
return block1([txt1, hdlr2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -32,8 +32,8 @@ exports[`list of components components in a node in a t-foreach 2`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].item;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].item;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -150,8 +150,8 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].blip;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].blip;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -198,8 +198,8 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach,
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].row+'_'+ctx['props'].col;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].row+'_'+ctx['props'].col;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -231,8 +231,8 @@ exports[`list of components simple list 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].value;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].value;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -267,8 +267,8 @@ exports[`list of components sub components rendered in a loop 2`] = `
|
||||
let block1 = createBlock(\`<p><block-text-0/></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].n;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].n;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -303,8 +303,8 @@ exports[`list of components sub components with some state rendered in a loop 2`
|
||||
let block1 = createBlock(\`<p><block-text-0/></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].n;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['state'].n;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -339,8 +339,8 @@ exports[`list of components switch component position 2`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].key;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].key;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -376,9 +376,9 @@ exports[`list of components t-foreach with t-component, and update 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['state'].val;
|
||||
let d2 = ctx['props'].val;
|
||||
return block1([d1, d2]);
|
||||
let txt1 = ctx['state'].val;
|
||||
let txt2 = ctx['props'].val;
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -31,8 +31,8 @@ exports[`t-key t-foreach with t-key switch component position 2`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].key;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].key;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -57,8 +57,8 @@ exports[`t-key t-key on Component 2`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].key;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].key;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -86,8 +86,8 @@ exports[`t-key t-key on Component as a function 2`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].key;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].key;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -117,8 +117,8 @@ exports[`t-key t-key on multiple Components 2`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].key;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].key;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -170,8 +170,8 @@ exports[`t-key t-key on multiple Components with t-call 1 3`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].key;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].key;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -215,8 +215,8 @@ exports[`t-key t-key on multiple Components with t-call 2 3`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].key;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].key;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -10,10 +10,10 @@ exports[`t-model directive .lazy modifier 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const bExpr1 = ctx['state'];
|
||||
let d1 = ctx['state']['text'];
|
||||
let d2 = [(ev) => { bExpr1['text'] = ev.target.value; }];
|
||||
let d3 = ctx['state'].text;
|
||||
return block1([d1, d2, d3]);
|
||||
let attr1 = ctx['state']['text'];
|
||||
let hdlr2 = [(ev) => { bExpr1['text'] = ev.target.value; }];
|
||||
let txt3 = ctx['state'].text;
|
||||
return block1([attr1, hdlr2, txt3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -28,10 +28,10 @@ exports[`t-model directive .number modifier 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const bExpr1 = ctx['state'];
|
||||
let d1 = ctx['state']['number'];
|
||||
let d2 = [(ev) => { bExpr1['number'] = toNumber(ev.target.value); }];
|
||||
let d3 = ctx['state'].number;
|
||||
return block1([d1, d2, d3]);
|
||||
let attr1 = ctx['state']['number'];
|
||||
let hdlr2 = [(ev) => { bExpr1['number'] = toNumber(ev.target.value); }];
|
||||
let txt3 = ctx['state'].number;
|
||||
return block1([attr1, hdlr2, txt3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -46,10 +46,10 @@ exports[`t-model directive .trim modifier 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const bExpr1 = ctx['state'];
|
||||
let d1 = ctx['state']['text'];
|
||||
let d2 = [(ev) => { bExpr1['text'] = ev.target.value.trim(); }];
|
||||
let d3 = ctx['state'].text;
|
||||
return block1([d1, d2, d3]);
|
||||
let attr1 = ctx['state']['text'];
|
||||
let hdlr2 = [(ev) => { bExpr1['text'] = ev.target.value.trim(); }];
|
||||
let txt3 = ctx['state'].text;
|
||||
return block1([attr1, hdlr2, txt3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -64,10 +64,10 @@ exports[`t-model directive basic use, on an input 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const bExpr1 = ctx['state'];
|
||||
let d1 = ctx['state']['text'];
|
||||
let d2 = [(ev) => { bExpr1['text'] = ev.target.value; }];
|
||||
let d3 = ctx['state'].text;
|
||||
return block1([d1, d2, d3]);
|
||||
let attr1 = ctx['state']['text'];
|
||||
let hdlr2 = [(ev) => { bExpr1['text'] = ev.target.value; }];
|
||||
let txt3 = ctx['state'].text;
|
||||
return block1([attr1, hdlr2, txt3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -82,10 +82,10 @@ exports[`t-model directive basic use, on an input with bracket expression 1`] =
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const bExpr1 = ctx['state'];
|
||||
let d1 = ctx['state']['text'];
|
||||
let d2 = [(ev) => { bExpr1['text'] = ev.target.value; }];
|
||||
let d3 = ctx['state'].text;
|
||||
return block1([d1, d2, d3]);
|
||||
let attr1 = ctx['state']['text'];
|
||||
let hdlr2 = [(ev) => { bExpr1['text'] = ev.target.value; }];
|
||||
let txt3 = ctx['state'].text;
|
||||
return block1([attr1, hdlr2, txt3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -100,10 +100,10 @@ exports[`t-model directive basic use, on another key in component 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const bExpr1 = ctx['some'];
|
||||
let d1 = ctx['some']['text'];
|
||||
let d2 = [(ev) => { bExpr1['text'] = ev.target.value; }];
|
||||
let d3 = ctx['some'].text;
|
||||
return block1([d1, d2, d3]);
|
||||
let attr1 = ctx['some']['text'];
|
||||
let hdlr2 = [(ev) => { bExpr1['text'] = ev.target.value; }];
|
||||
let txt3 = ctx['some'].text;
|
||||
return block1([attr1, hdlr2, txt3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -117,11 +117,11 @@ exports[`t-model directive can also define t-on directive on same event, part 1
|
||||
let block1 = createBlock(\`<div><input block-handler-0=\\"input\\" block-attribute-1=\\"value\\" block-handler-2=\\"input\\"/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['onInput'], ctx];
|
||||
let hdlr1 = [ctx['onInput'], ctx];
|
||||
const bExpr1 = ctx['state'];
|
||||
let d2 = ctx['state']['text'];
|
||||
let d3 = [(ev) => { bExpr1['text'] = ev.target.value; }];
|
||||
return block1([d1, d2, d3]);
|
||||
let attr2 = ctx['state']['text'];
|
||||
let hdlr3 = [(ev) => { bExpr1['text'] = ev.target.value; }];
|
||||
return block1([hdlr1, attr2, hdlr3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -135,19 +135,19 @@ exports[`t-model directive can also define t-on directive on same event, part 2
|
||||
let block1 = createBlock(\`<div><input type=\\"radio\\" id=\\"one\\" value=\\"One\\" block-handler-0=\\"click\\" block-attribute-1=\\"checked\\" block-handler-2=\\"click\\"/><input type=\\"radio\\" id=\\"two\\" value=\\"Two\\" block-handler-3=\\"click\\" block-attribute-4=\\"checked\\" block-handler-5=\\"click\\"/><input type=\\"radio\\" id=\\"three\\" value=\\"Three\\" block-handler-6=\\"click\\" block-attribute-7=\\"checked\\" block-handler-8=\\"click\\"/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['onClick'], ctx];
|
||||
let hdlr1 = [ctx['onClick'], ctx];
|
||||
const bExpr1 = ctx['state'];
|
||||
let d2 = ctx['state']['choice'] === 'One';
|
||||
let d3 = [(ev) => { bExpr1['choice'] = ev.target.value; }];
|
||||
let d4 = [ctx['onClick'], ctx];
|
||||
let attr2 = ctx['state']['choice'] === 'One';
|
||||
let hdlr3 = [(ev) => { bExpr1['choice'] = ev.target.value; }];
|
||||
let hdlr4 = [ctx['onClick'], ctx];
|
||||
const bExpr2 = ctx['state'];
|
||||
let d5 = ctx['state']['choice'] === 'Two';
|
||||
let d6 = [(ev) => { bExpr2['choice'] = ev.target.value; }];
|
||||
let d7 = [ctx['onClick'], ctx];
|
||||
let attr5 = ctx['state']['choice'] === 'Two';
|
||||
let hdlr6 = [(ev) => { bExpr2['choice'] = ev.target.value; }];
|
||||
let hdlr7 = [ctx['onClick'], ctx];
|
||||
const bExpr3 = ctx['state'];
|
||||
let d8 = ctx['state']['choice'] === 'Three';
|
||||
let d9 = [(ev) => { bExpr3['choice'] = ev.target.value; }];
|
||||
return block1([d1, d2, d3, d4, d5, d6, d7, d8, d9]);
|
||||
let attr8 = ctx['state']['choice'] === 'Three';
|
||||
let hdlr9 = [(ev) => { bExpr3['choice'] = ev.target.value; }];
|
||||
return block1([hdlr1, attr2, hdlr3, hdlr4, attr5, hdlr6, hdlr7, attr8, hdlr9]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -165,9 +165,9 @@ exports[`t-model directive following a scope protecting directive (e.g. t-set) 1
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"admiral\\", 'Bruno');
|
||||
const bExpr1 = ctx['state'];
|
||||
let d1 = ctx['state']['text'];
|
||||
let d2 = [(ev) => { bExpr1['text'] = ev.target.value; }];
|
||||
return block1([d1, d2]);
|
||||
let attr1 = ctx['state']['text'];
|
||||
let hdlr2 = [(ev) => { bExpr1['text'] = ev.target.value; }];
|
||||
return block1([attr1, hdlr2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -188,9 +188,9 @@ exports[`t-model directive in a t-foreach 1`] = `
|
||||
ctx[\`thing\`] = v_block2[i1];
|
||||
let key1 = ctx['thing'].id;
|
||||
const bExpr1 = ctx['thing'];
|
||||
let d1 = ctx['thing']['f'];
|
||||
let d2 = [(ev) => { bExpr1['f'] = ev.target.checked; }];
|
||||
c_block2[i1] = withKey(block3([d1, d2]), key1);
|
||||
let attr1 = ctx['thing']['f'];
|
||||
let hdlr2 = [(ev) => { bExpr1['f'] = ev.target.checked; }];
|
||||
c_block2[i1] = withKey(block3([attr1, hdlr2]), key1);
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
@@ -215,9 +215,9 @@ exports[`t-model directive in a t-foreach, part 2 1`] = `
|
||||
ctx[\`thing_index\`] = i1;
|
||||
let key1 = ctx['thing_index'];
|
||||
const bExpr1 = ctx['state'];
|
||||
let d1 = ctx['state'][ctx['thing_index']];
|
||||
let d2 = [(ev) => { bExpr1[ctx['thing_index']] = ev.target.value; }];
|
||||
c_block2[i1] = withKey(block3([d1, d2]), key1);
|
||||
let attr1 = ctx['state'][ctx['thing_index']];
|
||||
let hdlr2 = [(ev) => { bExpr1[ctx['thing_index']] = ev.target.value; }];
|
||||
c_block2[i1] = withKey(block3([attr1, hdlr2]), key1);
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
@@ -235,10 +235,10 @@ exports[`t-model directive on a select 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const bExpr1 = ctx['state'];
|
||||
let d1 = ctx['state']['color'];
|
||||
let d2 = [(ev) => { bExpr1['color'] = ev.target.value; }];
|
||||
let d3 = ctx['state'].color;
|
||||
return block1([d1, d2, d3]);
|
||||
let attr1 = ctx['state']['color'];
|
||||
let hdlr2 = [(ev) => { bExpr1['color'] = ev.target.value; }];
|
||||
let txt3 = ctx['state'].color;
|
||||
return block1([attr1, hdlr2, txt3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -253,9 +253,9 @@ exports[`t-model directive on a select, initial state 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const bExpr1 = ctx['state'];
|
||||
let d1 = ctx['state']['color'];
|
||||
let d2 = [(ev) => { bExpr1['color'] = ev.target.value; }];
|
||||
return block1([d1, d2]);
|
||||
let attr1 = ctx['state']['color'];
|
||||
let hdlr2 = [(ev) => { bExpr1['color'] = ev.target.value; }];
|
||||
return block1([attr1, hdlr2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -270,10 +270,10 @@ exports[`t-model directive on a sub state key 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const bExpr1 = ctx['state'].something;
|
||||
let d1 = ctx['state'].something['text'];
|
||||
let d2 = [(ev) => { bExpr1['text'] = ev.target.value; }];
|
||||
let d3 = ctx['state'].something.text;
|
||||
return block1([d1, d2, d3]);
|
||||
let attr1 = ctx['state'].something['text'];
|
||||
let hdlr2 = [(ev) => { bExpr1['text'] = ev.target.value; }];
|
||||
let txt3 = ctx['state'].something.text;
|
||||
return block1([attr1, hdlr2, txt3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -288,13 +288,13 @@ exports[`t-model directive on an input type=radio 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const bExpr1 = ctx['state'];
|
||||
let d1 = ctx['state']['choice'] === 'One';
|
||||
let d2 = [(ev) => { bExpr1['choice'] = ev.target.value; }];
|
||||
let attr1 = ctx['state']['choice'] === 'One';
|
||||
let hdlr2 = [(ev) => { bExpr1['choice'] = ev.target.value; }];
|
||||
const bExpr2 = ctx['state'];
|
||||
let d3 = ctx['state']['choice'] === 'Two';
|
||||
let d4 = [(ev) => { bExpr2['choice'] = ev.target.value; }];
|
||||
let d5 = ctx['state'].choice;
|
||||
return block1([d1, d2, d3, d4, d5]);
|
||||
let attr3 = ctx['state']['choice'] === 'Two';
|
||||
let hdlr4 = [(ev) => { bExpr2['choice'] = ev.target.value; }];
|
||||
let txt5 = ctx['state'].choice;
|
||||
return block1([attr1, hdlr2, attr3, hdlr4, txt5]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -309,12 +309,12 @@ exports[`t-model directive on an input type=radio, with initial value 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const bExpr1 = ctx['state'];
|
||||
let d1 = ctx['state']['choice'] === 'One';
|
||||
let d2 = [(ev) => { bExpr1['choice'] = ev.target.value; }];
|
||||
let attr1 = ctx['state']['choice'] === 'One';
|
||||
let hdlr2 = [(ev) => { bExpr1['choice'] = ev.target.value; }];
|
||||
const bExpr2 = ctx['state'];
|
||||
let d3 = ctx['state']['choice'] === 'Two';
|
||||
let d4 = [(ev) => { bExpr2['choice'] = ev.target.value; }];
|
||||
return block1([d1, d2, d3, d4]);
|
||||
let attr3 = ctx['state']['choice'] === 'Two';
|
||||
let hdlr4 = [(ev) => { bExpr2['choice'] = ev.target.value; }];
|
||||
return block1([attr1, hdlr2, attr3, hdlr4]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -330,14 +330,14 @@ exports[`t-model directive on an input, type=checkbox 1`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2,b3;
|
||||
const bExpr1 = ctx['state'];
|
||||
let d1 = ctx['state']['flag'];
|
||||
let d2 = [(ev) => { bExpr1['flag'] = ev.target.checked; }];
|
||||
let attr1 = ctx['state']['flag'];
|
||||
let hdlr2 = [(ev) => { bExpr1['flag'] = ev.target.checked; }];
|
||||
if (ctx['state'].flag) {
|
||||
b2 = text(\`yes\`);
|
||||
} else {
|
||||
b3 = text(\`no\`);
|
||||
}
|
||||
return block1([d1, d2], [b2, b3]);
|
||||
return block1([attr1, hdlr2], [b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -352,10 +352,10 @@ exports[`t-model directive on an textarea 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const bExpr1 = ctx['state'];
|
||||
let d1 = ctx['state']['text'];
|
||||
let d2 = [(ev) => { bExpr1['text'] = ev.target.value; }];
|
||||
let d3 = ctx['state'].text;
|
||||
return block1([d1, d2, d3]);
|
||||
let attr1 = ctx['state']['text'];
|
||||
let hdlr2 = [(ev) => { bExpr1['text'] = ev.target.value; }];
|
||||
let txt3 = ctx['state'].text;
|
||||
return block1([attr1, hdlr2, txt3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -374,15 +374,15 @@ exports[`t-model directive two inputs in a div alternating with a t-if 1`] = `
|
||||
let b2,b3;
|
||||
if (ctx['state'].flag) {
|
||||
const bExpr1 = ctx['state'];
|
||||
let d1 = ctx['state']['text1'];
|
||||
let d2 = [(ev) => { bExpr1['text1'] = ev.target.value; }];
|
||||
b2 = block2([d1, d2]);
|
||||
let attr1 = ctx['state']['text1'];
|
||||
let hdlr2 = [(ev) => { bExpr1['text1'] = ev.target.value; }];
|
||||
b2 = block2([attr1, hdlr2]);
|
||||
}
|
||||
if (!ctx['state'].flag) {
|
||||
const bExpr2 = ctx['state'];
|
||||
let d3 = ctx['state']['text2'];
|
||||
let d4 = [(ev) => { bExpr2['text2'] = ev.target.value; }];
|
||||
b3 = block3([d3, d4]);
|
||||
let attr3 = ctx['state']['text2'];
|
||||
let hdlr4 = [(ev) => { bExpr2['text2'] = ev.target.value; }];
|
||||
b3 = block3([attr3, hdlr4]);
|
||||
}
|
||||
return block1([], [b2, b3]);
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ exports[`t-on t-on expression captured in t-foreach 1`] = `
|
||||
let key1 = ctx['val'];
|
||||
const v1 = ctx['otherState'];
|
||||
const v2 = ctx['iter'];
|
||||
let d1 = [()=>v1.vals.push(v2+'_'+v2), ctx];
|
||||
let hdlr1 = [()=>v1.vals.push(v2+'_'+v2), ctx];
|
||||
setContextValue(ctx, \\"iter\\", ctx['iter']+1);
|
||||
c_block2[i1] = withKey(block3([d1]), key1);
|
||||
c_block2[i1] = withKey(block3([hdlr1]), key1);
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
@@ -46,12 +46,12 @@ exports[`t-on t-on expression in t-foreach 1`] = `
|
||||
ctx[\`val\`] = v_block2[i1];
|
||||
ctx[\`val_index\`] = i1;
|
||||
let key1 = ctx['val'];
|
||||
let d1 = ctx['val_index'];
|
||||
let d2 = ctx['val']+'';
|
||||
let txt1 = ctx['val_index'];
|
||||
let txt2 = ctx['val']+'';
|
||||
const v1 = ctx['otherState'];
|
||||
const v2 = ctx['val'];
|
||||
let d3 = [()=>v1.vals.push(v2), ctx];
|
||||
c_block2[i1] = withKey(block3([d1, d2, d3]), key1);
|
||||
let hdlr3 = [()=>v1.vals.push(v2), ctx];
|
||||
c_block2[i1] = withKey(block3([txt1, txt2, hdlr3]), key1);
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
@@ -79,13 +79,13 @@ exports[`t-on t-on expression in t-foreach with t-set 1`] = `
|
||||
ctx[\`val_index\`] = i1;
|
||||
let key1 = ctx['val'];
|
||||
setContextValue(ctx, \\"bossa\\", ctx['bossa']+'_'+ctx['val_index']);
|
||||
let d1 = ctx['val_index'];
|
||||
let d2 = ctx['val']+'';
|
||||
let txt1 = ctx['val_index'];
|
||||
let txt2 = ctx['val']+'';
|
||||
const v1 = ctx['otherState'];
|
||||
const v2 = ctx['val'];
|
||||
const v3 = ctx['bossa'];
|
||||
let d3 = [()=>v1.vals.push(v2+'_'+v3), ctx];
|
||||
c_block2[i1] = withKey(block3([d1, d2, d3]), key1);
|
||||
let hdlr3 = [()=>v1.vals.push(v2+'_'+v3), ctx];
|
||||
c_block2[i1] = withKey(block3([txt1, txt2, hdlr3]), key1);
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
@@ -109,11 +109,11 @@ exports[`t-on t-on method call in t-foreach 1`] = `
|
||||
ctx[\`val\`] = v_block2[i1];
|
||||
ctx[\`val_index\`] = i1;
|
||||
let key1 = ctx['val'];
|
||||
let d1 = ctx['val_index'];
|
||||
let d2 = ctx['val']+'';
|
||||
let txt1 = ctx['val_index'];
|
||||
let txt2 = ctx['val']+'';
|
||||
const v1 = ctx['val'];
|
||||
let d3 = [()=>this.addVal(v1), ctx];
|
||||
c_block2[i1] = withKey(block3([d1, d2, d3]), key1);
|
||||
let hdlr3 = [()=>this.addVal(v1), ctx];
|
||||
c_block2[i1] = withKey(block3([txt1, txt2, hdlr3]), key1);
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
@@ -146,8 +146,8 @@ exports[`t-on t-on on destroyed components 2`] = `
|
||||
let block1 = createBlock(\`<div block-handler-0=\\"click\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['onClick'], ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [ctx['onClick'], ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -22,8 +22,8 @@ exports[`t-props basic use 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].a+ctx['props'].b;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].a+ctx['props'].b;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -50,9 +50,9 @@ exports[`t-props t-props and other props 2`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/><block-text-1/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].a;
|
||||
let d2 = ctx['props'].b;
|
||||
return block1([d1, d2]);
|
||||
let txt1 = ctx['props'].a;
|
||||
let txt2 = ctx['props'].b;
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -79,8 +79,8 @@ exports[`t-props t-props only 2`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].a;
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['props'].a;
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -19,11 +19,11 @@ exports[`t-set slot setted value (with t-set) not accessible with t-esc 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"iter\\", 'source');
|
||||
let d1 = ctx['iter'];
|
||||
let txt1 = ctx['iter'];
|
||||
const ctx1 = capture(ctx);
|
||||
let b2 = component(\`Childcomp\`, {slots: {'default': {__render: slot2, __ctx: ctx1}}}, key + \`__3\`, node, ctx);
|
||||
let d2 = ctx['iter'];
|
||||
return block1([d1, d2], [b2]);
|
||||
let txt2 = ctx['iter'];
|
||||
return block1([txt1, txt2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -39,10 +39,10 @@ exports[`t-set slot setted value (with t-set) not accessible with t-esc 2`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
let d1 = ctx['iter'];
|
||||
let txt1 = ctx['iter'];
|
||||
setContextValue(ctx, \\"iter\\", 'called');
|
||||
let d2 = ctx['iter'];
|
||||
return block1([d1, d2]);
|
||||
let txt2 = ctx['iter'];
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -58,10 +58,10 @@ exports[`t-set t-set can't alter component even if key in component 1`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
let d1 = ctx['iter'];
|
||||
let txt1 = ctx['iter'];
|
||||
setContextValue(ctx, \\"iter\\", 5);
|
||||
let d2 = ctx['iter'];
|
||||
return block1([d1, d2]);
|
||||
let txt2 = ctx['iter'];
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -77,10 +77,10 @@ exports[`t-set t-set can't alter component if key not in component 1`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
let d1 = ctx['iter'];
|
||||
let txt1 = ctx['iter'];
|
||||
setContextValue(ctx, \\"iter\\", 5);
|
||||
let d2 = ctx['iter'];
|
||||
return block1([d1, d2]);
|
||||
let txt2 = ctx['iter'];
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -104,8 +104,8 @@ exports[`t-set t-set in t-if 1`] = `
|
||||
} else {
|
||||
setContextValue(ctx, \\"iter\\", 4);
|
||||
}
|
||||
let d1 = ctx['iter'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['iter'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -122,10 +122,10 @@ exports[`t-set t-set not altered by child comp 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"iter\\", 'source');
|
||||
let d1 = ctx['iter'];
|
||||
let txt1 = ctx['iter'];
|
||||
let b2 = component(\`Childcomp\`, {}, key + \`__1\`, node, ctx);
|
||||
let d2 = ctx['iter'];
|
||||
return block1([d1, d2], [b2]);
|
||||
let txt2 = ctx['iter'];
|
||||
return block1([txt1, txt2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -141,10 +141,10 @@ exports[`t-set t-set not altered by child comp 2`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
let d1 = ctx['iter'];
|
||||
let txt1 = ctx['iter'];
|
||||
setContextValue(ctx, \\"iter\\", 'called');
|
||||
let d2 = ctx['iter'];
|
||||
return block1([d1, d2]);
|
||||
let txt2 = ctx['iter'];
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -169,8 +169,8 @@ exports[`t-set t-set outside modified in t-if 1`] = `
|
||||
} else {
|
||||
setContextValue(ctx, \\"iter\\", 4);
|
||||
}
|
||||
let d1 = ctx['iter'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['iter'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user