mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2068196377 |
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@odoo/owl",
|
||||
"version": "2.0.0-beta-12",
|
||||
"version": "2.0.0-beta-10",
|
||||
"description": "Odoo Web Library (OWL)",
|
||||
"main": "dist/owl.cjs.js",
|
||||
"browser": "dist/owl.iife.js",
|
||||
|
||||
@@ -143,7 +143,7 @@ interface Context {
|
||||
ctxVar?: string;
|
||||
}
|
||||
|
||||
function createContext(parentCtx: Context, params?: Partial<Context>): Context {
|
||||
function createContext(parentCtx: Context, params?: Partial<Context>) {
|
||||
return Object.assign(
|
||||
{
|
||||
block: null,
|
||||
@@ -265,7 +265,10 @@ export class CodeGenerator {
|
||||
tKeyExpr: null,
|
||||
});
|
||||
// define blocks and utility functions
|
||||
let mainCode = [` let { text, createBlock, list, multi, html, toggler, comment } = bdom;`];
|
||||
let mainCode = [
|
||||
` "use strict";`,
|
||||
`let { text, createBlock, list, multi, html, toggler, comment } = bdom;`,
|
||||
];
|
||||
if (this.helpers.size) {
|
||||
mainCode.push(`let { ${[...this.helpers].join(", ")} } = helpers;`);
|
||||
}
|
||||
@@ -334,8 +337,8 @@ export class CodeGenerator {
|
||||
this.addLine(`const ${varName} = ${expr};`);
|
||||
}
|
||||
|
||||
insertAnchor(block: BlockDescription, index: number = block.children.length) {
|
||||
const tag = `block-child-${index}`;
|
||||
insertAnchor(block: BlockDescription) {
|
||||
const tag = `block-child-${block.children.length}`;
|
||||
const anchor = xmlDoc.createElement(tag);
|
||||
block.insert(anchor);
|
||||
}
|
||||
@@ -692,7 +695,7 @@ export class CodeGenerator {
|
||||
const children = ast.content;
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
const child = ast.content[i];
|
||||
const subCtx = createContext(ctx, {
|
||||
const subCtx: Context = createContext(ctx, {
|
||||
block,
|
||||
index: block!.childNumber,
|
||||
forceNewBlock: false,
|
||||
@@ -754,37 +757,21 @@ export class CodeGenerator {
|
||||
this.insertAnchor(block);
|
||||
}
|
||||
block = this.createBlock(block, "html", ctx);
|
||||
let blockStr;
|
||||
if (ast.expr === "0") {
|
||||
this.helpers.add("zero");
|
||||
blockStr = `ctx[zero]`;
|
||||
} else if (ast.body) {
|
||||
let bodyValue = null;
|
||||
bodyValue = BlockDescription.nextBlockId;
|
||||
const subCtx = createContext(ctx);
|
||||
this.helpers.add(ast.expr === "0" ? "zero" : "safeOutput");
|
||||
let expr = ast.expr === "0" ? "ctx[zero]" : `safeOutput(${compileExpr(ast.expr)})`;
|
||||
if (ast.body) {
|
||||
const nextId = BlockDescription.nextBlockId;
|
||||
const subCtx: Context = createContext(ctx);
|
||||
this.compileAST({ type: ASTType.Multi, content: ast.body }, subCtx);
|
||||
this.helpers.add("safeOutput");
|
||||
blockStr = `safeOutput(${compileExpr(ast.expr)}, b${bodyValue})`;
|
||||
} else {
|
||||
this.helpers.add("safeOutput");
|
||||
blockStr = `safeOutput(${compileExpr(ast.expr)})`;
|
||||
this.helpers.add("withDefault");
|
||||
expr = `withDefault(${expr}, b${nextId})`;
|
||||
}
|
||||
this.insertBlock(blockStr, block, ctx);
|
||||
}
|
||||
|
||||
compileTIfBranch(content: AST, block: BlockDescription, ctx: Context) {
|
||||
this.target.indentLevel++;
|
||||
let childN = block.children.length;
|
||||
this.compileAST(content, createContext(ctx, { block, index: ctx.index }));
|
||||
if (block.children.length > childN) {
|
||||
// we have some content => need to insert an anchor at correct index
|
||||
this.insertAnchor(block!, childN);
|
||||
}
|
||||
this.target.indentLevel--;
|
||||
this.insertBlock(`${expr}`, block, ctx);
|
||||
}
|
||||
|
||||
compileTIf(ast: ASTTif, ctx: Context, nextNode?: ASTDomNode) {
|
||||
let { block, forceNewBlock } = ctx;
|
||||
let { block, forceNewBlock, index } = ctx;
|
||||
let currentIndex = index;
|
||||
const codeIdx = this.target.code.length;
|
||||
const isNewBlock = !block || (block.type !== "multi" && forceNewBlock);
|
||||
if (block) {
|
||||
@@ -794,16 +781,28 @@ export class CodeGenerator {
|
||||
block = this.createBlock(block, "multi", ctx);
|
||||
}
|
||||
this.addLine(`if (${compileExpr(ast.condition)}) {`);
|
||||
this.compileTIfBranch(ast.content, block, ctx);
|
||||
this.target.indentLevel++;
|
||||
this.insertAnchor(block!);
|
||||
const subCtx: Context = createContext(ctx, { block, index: currentIndex });
|
||||
this.compileAST(ast.content, subCtx);
|
||||
this.target.indentLevel--;
|
||||
if (ast.tElif) {
|
||||
for (let clause of ast.tElif) {
|
||||
this.addLine(`} else if (${compileExpr(clause.condition)}) {`);
|
||||
this.compileTIfBranch(clause.content, block, ctx);
|
||||
this.target.indentLevel++;
|
||||
this.insertAnchor(block);
|
||||
const subCtx: Context = createContext(ctx, { block, index: currentIndex });
|
||||
this.compileAST(clause.content, subCtx);
|
||||
this.target.indentLevel--;
|
||||
}
|
||||
}
|
||||
if (ast.tElse) {
|
||||
this.addLine(`} else {`);
|
||||
this.compileTIfBranch(ast.tElse, block, ctx);
|
||||
this.target.indentLevel++;
|
||||
this.insertAnchor(block);
|
||||
const subCtx: Context = createContext(ctx, { block, index: currentIndex });
|
||||
this.compileAST(ast.tElse, subCtx);
|
||||
this.target.indentLevel--;
|
||||
}
|
||||
this.addLine("}");
|
||||
if (isNewBlock) {
|
||||
@@ -889,7 +888,7 @@ export class CodeGenerator {
|
||||
this.addLine("}");
|
||||
}
|
||||
|
||||
const subCtx = createContext(ctx, { block, index: loopVar });
|
||||
const subCtx: Context = createContext(ctx, { block, index: loopVar });
|
||||
this.compileAST(ast.body, subCtx);
|
||||
if (ast.memo) {
|
||||
this.addLine(
|
||||
@@ -936,7 +935,7 @@ export class CodeGenerator {
|
||||
for (let i = 0, l = ast.content.length; i < l; i++) {
|
||||
const child = ast.content[i];
|
||||
const isTSet = child.type === ASTType.TSet;
|
||||
const subCtx = createContext(ctx, {
|
||||
const subCtx: Context = createContext(ctx, {
|
||||
block,
|
||||
index,
|
||||
forceNewBlock: !isTSet,
|
||||
@@ -982,7 +981,7 @@ export class CodeGenerator {
|
||||
this.addLine(`${ctxVar}[isBoundary] = 1;`);
|
||||
this.helpers.add("isBoundary");
|
||||
const nextId = BlockDescription.nextBlockId;
|
||||
const subCtx = createContext(ctx, { preventRoot: true, ctxVar });
|
||||
const subCtx: Context = createContext(ctx, { preventRoot: true, ctxVar });
|
||||
this.compileAST({ type: ASTType.Multi, content: ast.body }, subCtx);
|
||||
if (nextId !== BlockDescription.nextBlockId) {
|
||||
this.helpers.add("zero");
|
||||
|
||||
@@ -258,12 +258,16 @@ function parseTNode(node: Element, ctx: ParsingContext): AST | null {
|
||||
// -----------------------------------------------------------------------------
|
||||
// Text and Comment Nodes
|
||||
// -----------------------------------------------------------------------------
|
||||
const whitespaceRE = /[^\S\r\n]+/g;
|
||||
const lineBreakRE = /[\r\n]/;
|
||||
const whitespaceRE = /\s+/g;
|
||||
|
||||
function parseTextCommentNode(node: Node, ctx: ParsingContext): AST | null {
|
||||
if (node.nodeType === Node.TEXT_NODE) {
|
||||
let value = node.textContent || "";
|
||||
if (!ctx.inPreTag) {
|
||||
if (lineBreakRE.test(value) && !value.trim()) {
|
||||
return null;
|
||||
}
|
||||
value = value.replace(whitespaceRE, " ");
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -3,6 +3,7 @@ import { ComponentNode } from "./component_node";
|
||||
import { nodeErrorHandlers } from "./error_handling";
|
||||
import { Fiber, MountOptions } from "./fibers";
|
||||
import { Scheduler } from "./scheduler";
|
||||
import { STATUS } from "./status";
|
||||
import { validateProps } from "./template_helpers";
|
||||
import { TemplateSet, TemplateSetConfig } from "./template_set";
|
||||
import { validateTarget } from "./utils";
|
||||
@@ -140,7 +141,10 @@ export class App<
|
||||
return (props: P, key: string, ctx: ComponentNode, parent: any, C: any) => {
|
||||
let children = ctx.children;
|
||||
let node: any = children[key];
|
||||
if (isDynamic && node && node.component.constructor !== C) {
|
||||
if (
|
||||
node &&
|
||||
(node.status === STATUS.DESTROYED || (isDynamic && node.component.constructor !== C))
|
||||
) {
|
||||
node = undefined;
|
||||
}
|
||||
const parentFiber = ctx.fiber!;
|
||||
|
||||
@@ -56,7 +56,6 @@ function cancelFibers(fibers: Fiber[]): number {
|
||||
fiber.render = throwOnRender;
|
||||
if (node.status === STATUS.NEW) {
|
||||
node.destroy();
|
||||
delete node.parent!.children[node.parentKey!];
|
||||
}
|
||||
node.fiber = null;
|
||||
if (fiber.bdom) {
|
||||
|
||||
@@ -129,9 +129,9 @@ class LazyValue {
|
||||
/*
|
||||
* Safely outputs `value` as a block depending on the nature of `value`
|
||||
*/
|
||||
export function safeOutput(value: any, defaultValue?: any): ReturnType<typeof toggler> {
|
||||
if (value === undefined) {
|
||||
return defaultValue ? toggler("default", defaultValue) : toggler("undefined", text(""));
|
||||
export function safeOutput(value: any): ReturnType<typeof toggler> {
|
||||
if (!value) {
|
||||
return value;
|
||||
}
|
||||
let safeKey;
|
||||
let block;
|
||||
|
||||
@@ -49,6 +49,7 @@ exports[`Reactivity: useState concurrent renderings 3`] = `
|
||||
exports[`Reactivity: useState destroyed component before being mounted is inactive 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -67,6 +68,7 @@ exports[`Reactivity: useState destroyed component before being mounted is inacti
|
||||
exports[`Reactivity: useState destroyed component before being mounted is inactive 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -81,6 +83,7 @@ exports[`Reactivity: useState destroyed component before being mounted is inacti
|
||||
exports[`Reactivity: useState destroyed component is inactive 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -99,6 +102,7 @@ exports[`Reactivity: useState destroyed component is inactive 1`] = `
|
||||
exports[`Reactivity: useState destroyed component is inactive 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -113,6 +117,7 @@ exports[`Reactivity: useState destroyed component is inactive 2`] = `
|
||||
exports[`Reactivity: useState one components can subscribe twice to same context 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/><block-text-1/></div>\`);
|
||||
@@ -128,6 +133,7 @@ exports[`Reactivity: useState one components can subscribe twice to same context
|
||||
exports[`Reactivity: useState parent and children subscribed to same context 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -144,6 +150,7 @@ exports[`Reactivity: useState parent and children subscribed to same context 1`]
|
||||
exports[`Reactivity: useState parent and children subscribed to same context 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -221,6 +228,7 @@ exports[`Reactivity: useState several nodes on different level use same context
|
||||
exports[`Reactivity: useState two components are updated in parallel 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
@@ -238,6 +246,7 @@ exports[`Reactivity: useState two components are updated in parallel 1`] = `
|
||||
exports[`Reactivity: useState two components are updated in parallel 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -252,6 +261,7 @@ exports[`Reactivity: useState two components are updated in parallel 2`] = `
|
||||
exports[`Reactivity: useState two components can subscribe to same context 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
@@ -269,6 +279,7 @@ exports[`Reactivity: useState two components can subscribe to same context 1`] =
|
||||
exports[`Reactivity: useState two components can subscribe to same context 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -283,6 +294,7 @@ exports[`Reactivity: useState two components can subscribe to same context 2`] =
|
||||
exports[`Reactivity: useState two independent components on different levels are updated in parallel 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`Parent\`, true, false, false, true);
|
||||
@@ -300,6 +312,7 @@ exports[`Reactivity: useState two independent components on different levels are
|
||||
exports[`Reactivity: useState two independent components on different levels are updated in parallel 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -314,6 +327,7 @@ exports[`Reactivity: useState two independent components on different levels are
|
||||
exports[`Reactivity: useState two independent components on different levels are updated in parallel 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -329,6 +343,7 @@ exports[`Reactivity: useState two independent components on different levels are
|
||||
exports[`Reactivity: useState useContext=useState hook is reactive, for one component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -343,37 +358,26 @@ exports[`Reactivity: useState useContext=useState hook is reactive, for one comp
|
||||
exports[`Reactivity: useState useless atoms should be deleted 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Quantity\`, true, false, false, false);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
Total: <block-text-0/>
|
||||
Count: <block-text-1/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/> Total: <block-text-0/> Count: <block-text-1/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(Object.keys(ctx['state']));;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`id\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(Object.keys(ctx['state']));;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`id\`] = v_block2[i1];
|
||||
const key1 = ctx['id'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const b7 = comp1({id: ctx['id']}, key + \`__1__\${key1}\`, node, this, null);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8]), key1);
|
||||
c_block2[i1] = withKey(comp1({id: ctx['id']}, key + \`__1__\${key1}\`, node, this, null), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b2 = list(c_block2);
|
||||
let txt1 = ctx['total'];
|
||||
let txt2 = Object.keys(ctx['state']).length;
|
||||
const b3 = block3([txt1, txt2], [b4]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt1, txt2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -381,6 +385,7 @@ exports[`Reactivity: useState useless atoms should be deleted 1`] = `
|
||||
exports[`Reactivity: useState useless atoms should be deleted 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -395,6 +400,7 @@ exports[`Reactivity: useState useless atoms should be deleted 2`] = `
|
||||
exports[`Reactivity: useState very simple use, with initial value 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`app App supports env with getters/setters 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/> <block-text-1/></div>\`);
|
||||
@@ -18,6 +19,7 @@ exports[`app App supports env with getters/setters 1`] = `
|
||||
exports[`app can configure an app with props 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -32,6 +34,7 @@ exports[`app can configure an app with props 1`] = `
|
||||
exports[`app destroy remove the widget from the DOM 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -45,6 +48,7 @@ exports[`app destroy remove the widget from the DOM 1`] = `
|
||||
exports[`app warnIfNoStaticProps works as expected 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`attributes changing a class with t-att-class (preexisting class 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"hoy\\" block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -17,6 +18,7 @@ exports[`attributes changing a class with t-att-class (preexisting class 1`] = `
|
||||
exports[`attributes changing a class with t-att-class 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -31,6 +33,7 @@ exports[`attributes changing a class with t-att-class 1`] = `
|
||||
exports[`attributes changing an attribute with t-att- 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"value\\"/>\`);
|
||||
@@ -45,6 +48,7 @@ exports[`attributes changing an attribute with t-att- 1`] = `
|
||||
exports[`attributes class and t-att-class should combine together 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\" class=\\"hello\\"/>\`);
|
||||
@@ -59,6 +63,7 @@ exports[`attributes class and t-att-class should combine together 1`] = `
|
||||
exports[`attributes class and t-attf-class with ternary operation 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"hello\\" block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -73,6 +78,7 @@ exports[`attributes class and t-attf-class with ternary operation 1`] = `
|
||||
exports[`attributes dynamic attribute evaluating to 0 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -87,6 +93,7 @@ exports[`attributes dynamic attribute evaluating to 0 1`] = `
|
||||
exports[`attributes dynamic attribute falsy variable 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -101,6 +108,7 @@ exports[`attributes dynamic attribute falsy variable 1`] = `
|
||||
exports[`attributes dynamic attribute with a dash 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"data-action-id\\"/>\`);
|
||||
@@ -115,6 +123,7 @@ exports[`attributes dynamic attribute with a dash 1`] = `
|
||||
exports[`attributes dynamic attributes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -129,6 +138,7 @@ exports[`attributes dynamic attributes 1`] = `
|
||||
exports[`attributes dynamic attributes with backticks 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -143,6 +153,7 @@ exports[`attributes dynamic attributes with backticks 1`] = `
|
||||
exports[`attributes dynamic class attribute 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -157,6 +168,7 @@ exports[`attributes dynamic class attribute 1`] = `
|
||||
exports[`attributes dynamic class attribute evaluating to 0 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -171,6 +183,7 @@ exports[`attributes dynamic class attribute evaluating to 0 1`] = `
|
||||
exports[`attributes dynamic class attribute that starts and ends with a space 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -185,6 +198,7 @@ exports[`attributes dynamic class attribute that starts and ends with a space 1`
|
||||
exports[`attributes dynamic class attribute which is only a space 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -199,6 +213,7 @@ exports[`attributes dynamic class attribute which is only a space 1`] = `
|
||||
exports[`attributes dynamic class attribute with multiple consecutive spaces 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -213,6 +228,7 @@ exports[`attributes dynamic class attribute with multiple consecutive spaces 1`]
|
||||
exports[`attributes dynamic empty class attribute 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -227,6 +243,7 @@ exports[`attributes dynamic empty class attribute 1`] = `
|
||||
exports[`attributes dynamic formatted attributes with a dash 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"aria-label\\"/>\`);
|
||||
@@ -241,6 +258,7 @@ exports[`attributes dynamic formatted attributes with a dash 1`] = `
|
||||
exports[`attributes dynamic undefined class attribute 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -255,6 +273,7 @@ exports[`attributes dynamic undefined class attribute 1`] = `
|
||||
exports[`attributes dynamic undefined generic attribute 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"thing\\"/>\`);
|
||||
@@ -269,6 +288,7 @@ exports[`attributes dynamic undefined generic attribute 1`] = `
|
||||
exports[`attributes fixed variable 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -283,6 +303,7 @@ exports[`attributes fixed variable 1`] = `
|
||||
exports[`attributes format expression 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -297,6 +318,7 @@ exports[`attributes format expression 1`] = `
|
||||
exports[`attributes format literal 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -311,6 +333,7 @@ exports[`attributes format literal 1`] = `
|
||||
exports[`attributes format multiple 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -325,6 +348,7 @@ exports[`attributes format multiple 1`] = `
|
||||
exports[`attributes format value 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -339,23 +363,18 @@ exports[`attributes format value 1`] = `
|
||||
exports[`attributes from object variables set previously 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<span block-attribute-0=\\"class\\"/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><span block-attribute-0=\\"class\\"/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"o\\", {a:'b'});
|
||||
let attr1 = ctx['o'].a;
|
||||
const b3 = block3([attr1]);
|
||||
return multi([b2, b3]);
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -363,22 +382,18 @@ exports[`attributes from object variables set previously 1`] = `
|
||||
exports[`attributes from variables set previously (no external node) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block4 = createBlock(\`<span block-attribute-0=\\"class\\"/>\`);
|
||||
let block1 = createBlock(\`<span block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"abc\\", 'def');
|
||||
const b3 = text(\`
|
||||
\`);
|
||||
let attr1 = ctx['abc'];
|
||||
const b4 = block4([attr1]);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -386,6 +401,7 @@ exports[`attributes from variables set previously (no external node) 1`] = `
|
||||
exports[`attributes from variables set previously 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -404,6 +420,7 @@ exports[`attributes from variables set previously 1`] = `
|
||||
exports[`attributes object 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attributes=\\"0\\"/>\`);
|
||||
@@ -418,6 +435,7 @@ exports[`attributes object 1`] = `
|
||||
exports[`attributes static attributes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div foo=\\"a\\" bar=\\"b\\" baz=\\"c\\"/>\`);
|
||||
@@ -431,6 +449,7 @@ exports[`attributes static attributes 1`] = `
|
||||
exports[`attributes static attributes on void elements 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<img src=\\"/test.skip.jpg\\" alt=\\"Test\\"/>\`);
|
||||
@@ -444,6 +463,7 @@ exports[`attributes static attributes on void elements 1`] = `
|
||||
exports[`attributes static attributes with backticks 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div foo=\\"\\\\\`bar\\\\\`\\"/>\`);
|
||||
@@ -457,6 +477,7 @@ exports[`attributes static attributes with backticks 1`] = `
|
||||
exports[`attributes static attributes with dashes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div aria-label=\\"Close\\"/>\`);
|
||||
@@ -470,6 +491,7 @@ exports[`attributes static attributes with dashes 1`] = `
|
||||
exports[`attributes string interpolation, alternate syntax 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -484,6 +506,7 @@ exports[`attributes string interpolation, alternate syntax 1`] = `
|
||||
exports[`attributes t-att-class and class should combine together 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"hello\\" block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -498,6 +521,7 @@ exports[`attributes t-att-class and class should combine together 1`] = `
|
||||
exports[`attributes t-att-class with multiple classes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -512,6 +536,7 @@ exports[`attributes t-att-class with multiple classes 1`] = `
|
||||
exports[`attributes t-att-class with multiple classes 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -526,6 +551,7 @@ exports[`attributes t-att-class with multiple classes 2`] = `
|
||||
exports[`attributes t-att-class with multiple classes 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -540,6 +566,7 @@ exports[`attributes t-att-class with multiple classes 3`] = `
|
||||
exports[`attributes t-att-class with multiple classes, some of which are duplicate 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -554,6 +581,7 @@ exports[`attributes t-att-class with multiple classes, some of which are duplica
|
||||
exports[`attributes t-att-class with object 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"static\\" block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -568,6 +596,7 @@ exports[`attributes t-att-class with object 1`] = `
|
||||
exports[`attributes t-att-class with object 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -582,6 +611,7 @@ exports[`attributes t-att-class with object 2`] = `
|
||||
exports[`attributes t-att-class with object 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -596,6 +626,7 @@ exports[`attributes t-att-class with object 3`] = `
|
||||
exports[`attributes t-attf-class 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -610,6 +641,7 @@ exports[`attributes t-attf-class 1`] = `
|
||||
exports[`attributes t-attf-class should combine with class 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"hello\\" block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -624,6 +656,7 @@ exports[`attributes t-attf-class should combine with class 1`] = `
|
||||
exports[`attributes t-attf-class with multiple classes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -638,6 +671,7 @@ exports[`attributes t-attf-class with multiple classes 1`] = `
|
||||
exports[`attributes t-attf-class with multiple classes separated by multiple spaces 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -652,6 +686,7 @@ exports[`attributes t-attf-class with multiple classes separated by multiple spa
|
||||
exports[`attributes tuple literal 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attributes=\\"0\\"/>\`);
|
||||
@@ -666,6 +701,7 @@ exports[`attributes tuple literal 1`] = `
|
||||
exports[`attributes tuple variable 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attributes=\\"0\\"/>\`);
|
||||
@@ -680,6 +716,7 @@ exports[`attributes tuple variable 1`] = `
|
||||
exports[`attributes two classes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"a b\\"/>\`);
|
||||
@@ -693,6 +730,7 @@ exports[`attributes two classes 1`] = `
|
||||
exports[`attributes two dynamic attributes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\" block-attribute-1=\\"bar\\"/>\`);
|
||||
@@ -708,6 +746,7 @@ exports[`attributes two dynamic attributes 1`] = `
|
||||
exports[`attributes updating classes (with obj notation) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"hoy\\" block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -722,18 +761,16 @@ exports[`attributes updating classes (with obj notation) 1`] = `
|
||||
exports[`attributes various escapes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div foo=\\"<foo\\" block-attribute-0=\\"bar\\" block-attribute-1=\\"baz\\" block-attributes=\\"2\\"/>\`);
|
||||
let block1 = createBlock(\`<div foo=\\"<foo\\" block-attribute-0=\\"bar\\" block-attribute-1=\\"baz\\" block-attributes=\\"2\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let attr1 = ctx['bar'];
|
||||
let attr2 = \`<\${ctx['baz']}>\`;
|
||||
let attr3 = ctx['qux'];
|
||||
const b3 = block3([attr1, attr2, attr3]);
|
||||
return multi([b2, b3]);
|
||||
return block1([attr1, attr2, attr3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -741,6 +778,7 @@ exports[`attributes various escapes 1`] = `
|
||||
exports[`attributes various escapes 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div> < </div>\`);
|
||||
@@ -754,6 +792,7 @@ exports[`attributes various escapes 2 1`] = `
|
||||
exports[`special cases for some specific html attributes/properties input of type checkbox with t-att-indeterminate 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<input type=\\"checkbox\\" block-attribute-0=\\"indeterminate\\"/>\`);
|
||||
@@ -768,6 +807,7 @@ exports[`special cases for some specific html attributes/properties input of typ
|
||||
exports[`special cases for some specific html attributes/properties input type= checkbox, with t-att-checked 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<input type=\\"checkbox\\" block-attribute-0=\\"checked\\"/>\`);
|
||||
@@ -782,6 +822,7 @@ exports[`special cases for some specific html attributes/properties input type=
|
||||
exports[`special cases for some specific html attributes/properties input with t-att-value 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<input block-attribute-0=\\"value\\"/>\`);
|
||||
@@ -796,20 +837,14 @@ exports[`special cases for some specific html attributes/properties input with t
|
||||
exports[`special cases for some specific html attributes/properties select with t-att-value 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<select block-attribute-0=\\"value\\">
|
||||
<option value=\\"potato\\">Potato</option>
|
||||
<option value=\\"tomato\\">Tomato</option>
|
||||
<option value=\\"onion\\">Onion</option>
|
||||
</select>\`);
|
||||
let block1 = createBlock(\`<select block-attribute-0=\\"value\\"><option value=\\"potato\\">Potato</option><option value=\\"tomato\\">Tomato</option><option value=\\"onion\\">Onion</option></select>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let attr1 = ctx['value'];
|
||||
const b3 = block3([attr1]);
|
||||
return multi([b2, b3]);
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -817,6 +852,7 @@ exports[`special cases for some specific html attributes/properties select with
|
||||
exports[`special cases for some specific html attributes/properties textarea with t-att-value 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<textarea block-attribute-0=\\"value\\"/>\`);
|
||||
@@ -831,25 +867,13 @@ exports[`special cases for some specific html attributes/properties textarea wit
|
||||
exports[`special cases for some specific html attributes/properties various boolean html attributes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<input type=\\"checkbox\\" checked=\\"checked\\"/>
|
||||
<input checked=\\"checked\\"/>
|
||||
<div checked=\\"checked\\"/>
|
||||
<div selected=\\"selected\\"/>
|
||||
<option selected=\\"selected\\" other=\\"1\\"/>
|
||||
<input readonly=\\"readonly\\"/>
|
||||
<button disabled=\\"disabled\\"/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><input type=\\"checkbox\\" checked=\\"checked\\"/><input checked=\\"checked\\"/><div checked=\\"checked\\"/><div selected=\\"selected\\"/><option selected=\\"selected\\" other=\\"1\\"/><input readonly=\\"readonly\\"/><button disabled=\\"disabled\\"/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = block3();
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1();
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`comments only a comment 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -14,6 +15,7 @@ exports[`comments only a comment 1`] = `
|
||||
exports[`comments properly handle comments 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hello <!-- comment-->owl</div>\`);
|
||||
@@ -27,25 +29,21 @@ exports[`comments properly handle comments 1`] = `
|
||||
exports[`comments properly handle comments between t-if/t-else 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/><block-child-1/>
|
||||
</div>\`);
|
||||
let block4 = createBlock(\`<span>true</span>\`);
|
||||
let block5 = createBlock(\`<span>owl</span>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
let block2 = createBlock(\`<span>true</span>\`);
|
||||
let block3 = createBlock(\`<span>owl</span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4,b5;
|
||||
let b2,b3;
|
||||
if (true) {
|
||||
b4 = block4();
|
||||
b2 = block2();
|
||||
} else {
|
||||
b5 = block5();
|
||||
b3 = block3();
|
||||
}
|
||||
const b3 = block3([], [b4, b5]);
|
||||
return multi([b2, b3]);
|
||||
return block1([], [b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-on can bind event handler 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -17,6 +18,7 @@ exports[`t-on can bind event handler 1`] = `
|
||||
exports[`t-on can bind handlers with arguments 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -32,6 +34,7 @@ exports[`t-on can bind handlers with arguments 1`] = `
|
||||
exports[`t-on can bind handlers with empty object 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -47,6 +50,7 @@ exports[`t-on can bind handlers with empty object 1`] = `
|
||||
exports[`t-on can bind handlers with empty object (with non empty inner string) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -62,34 +66,27 @@ exports[`t-on can bind handlers with empty object (with non empty inner string)
|
||||
exports[`t-on can bind handlers with empty object (with non empty inner string) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<ul>
|
||||
<block-child-0/>
|
||||
</ul>\`);
|
||||
let block5 = createBlock(\`<li>
|
||||
<a block-handler-0=\\"click\\">link</a>
|
||||
</li>\`);
|
||||
let block1 = createBlock(\`<ul><block-child-0/></ul>\`);
|
||||
let block3 = createBlock(\`<li><a block-handler-0=\\"click\\">link</a></li>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(['someval']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`action\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(['someval']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`action\`] = v_block2[i1];
|
||||
ctx[\`action_index\`] = i1;
|
||||
const key1 = ctx['action_index'];
|
||||
const v1 = ctx['activate'];
|
||||
const v2 = ctx['action'];
|
||||
let hdlr1 = [()=>v1(v2), ctx];
|
||||
c_block4[i1] = withKey(block5([hdlr1]), key1);
|
||||
c_block2[i1] = withKey(block3([hdlr1]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -97,6 +94,7 @@ exports[`t-on can bind handlers with empty object (with non empty inner string)
|
||||
exports[`t-on can bind handlers with object arguments 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -112,17 +110,15 @@ exports[`t-on can bind handlers with object arguments 1`] = `
|
||||
exports[`t-on can bind two event handlers 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<button block-handler-0=\\"click\\" block-handler-1=\\"dblclick\\">Click</button>\`);
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\" block-handler-1=\\"dblclick\\">Click</button>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let hdlr1 = [ctx['handleClick'], ctx];
|
||||
let hdlr2 = [ctx['handleDblClick'], ctx];
|
||||
const b3 = block3([hdlr1, hdlr2]);
|
||||
return multi([b2, b3]);
|
||||
return block1([hdlr1, hdlr2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -130,6 +126,7 @@ exports[`t-on can bind two event handlers 1`] = `
|
||||
exports[`t-on handler is bound to proper owner 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -144,29 +141,22 @@ exports[`t-on handler is bound to proper owner 1`] = `
|
||||
exports[`t-on handler is bound to proper owner, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block6 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
let block2 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block3, v_block3, l_block3, c_block3] = prepareList([1]);;
|
||||
for (let i1 = 0; i1 < l_block3; i1++) {
|
||||
ctx[\`value\`] = v_block3[i1];
|
||||
const [k_block1, v_block1, l_block1, c_block1] = prepareList([1]);;
|
||||
for (let i1 = 0; i1 < l_block1; i1++) {
|
||||
ctx[\`value\`] = v_block1[i1];
|
||||
const key1 = ctx['value'];
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
let hdlr1 = [ctx['add'], ctx];
|
||||
const b6 = block6([hdlr1]);
|
||||
const b7 = text(\`
|
||||
\`);
|
||||
c_block3[i1] = withKey(multi([b5, b6, b7]), key1);
|
||||
c_block1[i1] = withKey(block2([hdlr1]), key1);
|
||||
}
|
||||
const b3 = list(c_block3);
|
||||
return multi([b2, b3]);
|
||||
return list(c_block1);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -174,6 +164,7 @@ exports[`t-on handler is bound to proper owner, part 2 1`] = `
|
||||
exports[`t-on handler is bound to proper owner, part 3 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
@@ -186,6 +177,7 @@ exports[`t-on handler is bound to proper owner, part 3 1`] = `
|
||||
exports[`t-on handler is bound to proper owner, part 3 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -200,31 +192,24 @@ exports[`t-on handler is bound to proper owner, part 3 2`] = `
|
||||
exports[`t-on handler is bound to proper owner, part 4 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block3, v_block3, l_block3, c_block3] = prepareList([1]);;
|
||||
for (let i1 = 0; i1 < l_block3; i1++) {
|
||||
ctx[\`value\`] = v_block3[i1];
|
||||
const [k_block1, v_block1, l_block1, c_block1] = prepareList([1]);;
|
||||
for (let i1 = 0; i1 < l_block1; i1++) {
|
||||
ctx[\`value\`] = v_block1[i1];
|
||||
ctx[\`value_first\`] = i1 === 0;
|
||||
ctx[\`value_last\`] = i1 === v_block3.length - 1;
|
||||
ctx[\`value_last\`] = i1 === v_block1.length - 1;
|
||||
ctx[\`value_index\`] = i1;
|
||||
ctx[\`value_value\`] = k_block3[i1];
|
||||
ctx[\`value_value\`] = k_block1[i1];
|
||||
const key1 = ctx['value'];
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
const b6 = callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}\`);
|
||||
const b7 = text(\`
|
||||
\`);
|
||||
c_block3[i1] = withKey(multi([b5, b6, b7]), key1);
|
||||
c_block1[i1] = withKey(callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}\`), key1);
|
||||
}
|
||||
const b3 = list(c_block3);
|
||||
return multi([b2, b3]);
|
||||
return list(c_block1);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -232,6 +217,7 @@ exports[`t-on handler is bound to proper owner, part 4 1`] = `
|
||||
exports[`t-on handler is bound to proper owner, part 4 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -246,6 +232,7 @@ exports[`t-on handler is bound to proper owner, part 4 2`] = `
|
||||
exports[`t-on receive event in first argument 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -260,11 +247,10 @@ exports[`t-on receive event in first argument 1`] = `
|
||||
exports[`t-on t-on modifiers (native listener) basic support for native listener 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"myClass\\" block-handler-0=\\"click\\">
|
||||
<button block-handler-1=\\"click\\">Button</button>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div class=\\"myClass\\" block-handler-0=\\"click\\"><button block-handler-1=\\"click\\">Button</button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let hdlr1 = [ctx['divClicked'], ctx];
|
||||
@@ -277,6 +263,7 @@ exports[`t-on t-on modifiers (native listener) basic support for native listener
|
||||
exports[`t-on t-on modifiers (native listener) t-on combined with t-esc 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><button block-handler-0=\\"click\\"><block-text-1/></button></div>\`);
|
||||
@@ -292,6 +279,7 @@ exports[`t-on t-on modifiers (native listener) t-on combined with t-esc 1`] = `
|
||||
exports[`t-on t-on modifiers (native listener) t-on combined with t-out 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -308,11 +296,10 @@ exports[`t-on t-on modifiers (native listener) t-on combined with t-out 1`] = `
|
||||
exports[`t-on t-on modifiers (native listener) t-on with .capture modifier 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-handler-0=\\"click.capture\\">
|
||||
<button block-handler-1=\\"click\\">Button</button>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div block-handler-0=\\"click.capture\\"><button block-handler-1=\\"click\\">Button</button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let hdlr1 = [\\"capture\\", ctx['onCapture'], ctx];
|
||||
@@ -325,11 +312,10 @@ exports[`t-on t-on modifiers (native listener) t-on with .capture modifier 1`] =
|
||||
exports[`t-on t-on modifiers (native listener) t-on with empty handler (only modifiers) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>
|
||||
<button block-handler-0=\\"click.prevent\\">Button</button>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><button block-handler-0=\\"click.prevent\\">Button</button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let hdlr1 = [\\"prevent\\", , ctx];
|
||||
@@ -341,11 +327,10 @@ exports[`t-on t-on modifiers (native listener) t-on with empty handler (only mod
|
||||
exports[`t-on t-on modifiers (native listener) t-on with prevent and self modifiers (order matters) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>
|
||||
<button block-handler-0=\\"click.prevent.self\\"><span>Button</span></button>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><button block-handler-0=\\"click.prevent.self\\"><span>Button</span></button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let hdlr1 = [\\"prevent\\",\\"self\\", ctx['onClick'], ctx];
|
||||
@@ -357,13 +342,10 @@ exports[`t-on t-on modifiers (native listener) t-on with prevent and self modifi
|
||||
exports[`t-on t-on modifiers (native listener) t-on with prevent and/or stop modifiers 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>
|
||||
<button block-handler-0=\\"click.prevent\\">Button 1</button>
|
||||
<button block-handler-1=\\"click.stop\\">Button 2</button>
|
||||
<button block-handler-2=\\"click.prevent.stop\\">Button 3</button>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><button block-handler-0=\\"click.prevent\\">Button 1</button><button block-handler-1=\\"click.stop\\">Button 2</button><button block-handler-2=\\"click.prevent.stop\\">Button 3</button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let hdlr1 = [\\"prevent\\", ctx['onClickPrevented'], ctx];
|
||||
@@ -377,15 +359,12 @@ exports[`t-on t-on modifiers (native listener) t-on with prevent and/or stop mod
|
||||
exports[`t-on t-on modifiers (native listener) t-on with prevent modifier in t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block5 = createBlock(\`<a href=\\"#\\" block-handler-0=\\"click.prevent\\">
|
||||
Edit <block-text-1/>
|
||||
</a>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<a href=\\"#\\" block-handler-0=\\"click.prevent\\"> Edit <block-text-1/></a>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
@@ -393,18 +372,12 @@ exports[`t-on t-on modifiers (native listener) t-on with prevent modifier in t-f
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`project\`] = v_block2[i1];
|
||||
const key1 = ctx['project'];
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
const v1 = ctx['onEdit'];
|
||||
const v2 = ctx['project'];
|
||||
let hdlr1 = [\\"prevent\\", _ev=>v1(v2.id,_ev), ctx];
|
||||
let txt1 = ctx['project'].name;
|
||||
const b5 = block5([hdlr1, txt1]);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
c_block2[i1] = withKey(multi([b4, b5, b6]), key1);
|
||||
c_block2[i1] = withKey(block3([hdlr1, txt1]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
@@ -414,11 +387,10 @@ exports[`t-on t-on modifiers (native listener) t-on with prevent modifier in t-f
|
||||
exports[`t-on t-on modifiers (native listener) t-on with self and prevent modifiers (order matters) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>
|
||||
<button block-handler-0=\\"click.self.prevent\\"><span>Button</span></button>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><button block-handler-0=\\"click.self.prevent\\"><span>Button</span></button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let hdlr1 = [\\"self\\",\\"prevent\\", ctx['onClick'], ctx];
|
||||
@@ -430,12 +402,10 @@ exports[`t-on t-on modifiers (native listener) t-on with self and prevent modifi
|
||||
exports[`t-on t-on modifiers (native listener) t-on with self modifier 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>
|
||||
<button block-handler-0=\\"click\\"><span>Button</span></button>
|
||||
<button block-handler-1=\\"click.self\\"><span>Button</span></button>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><button block-handler-0=\\"click\\"><span>Button</span></button><button block-handler-1=\\"click.self\\"><span>Button</span></button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let hdlr1 = [ctx['onClick'], ctx];
|
||||
@@ -448,11 +418,10 @@ exports[`t-on t-on modifiers (native listener) t-on with self modifier 1`] = `
|
||||
exports[`t-on t-on modifiers (synthetic listener) basic support for synthetic 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-handler-0=\\"click.synthetic\\">
|
||||
<button block-handler-1=\\"click.synthetic\\">Button</button>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div block-handler-0=\\"click.synthetic\\"><button block-handler-1=\\"click.synthetic\\">Button</button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let hdlr1 = [\\"synthetic\\", ctx['divClicked'], ctx];
|
||||
@@ -465,6 +434,7 @@ exports[`t-on t-on modifiers (synthetic listener) basic support for synthetic 1`
|
||||
exports[`t-on t-on with inline statement (function call) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -480,6 +450,7 @@ exports[`t-on t-on with inline statement (function call) 1`] = `
|
||||
exports[`t-on t-on with inline statement 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -495,6 +466,7 @@ exports[`t-on t-on with inline statement 1`] = `
|
||||
exports[`t-on t-on with inline statement, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Toggle</button>\`);
|
||||
@@ -510,6 +482,7 @@ exports[`t-on t-on with inline statement, part 2 1`] = `
|
||||
exports[`t-on t-on with inline statement, part 3 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Toggle</button>\`);
|
||||
@@ -526,6 +499,7 @@ exports[`t-on t-on with inline statement, part 3 1`] = `
|
||||
exports[`t-on t-on with t-call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
@@ -541,6 +515,7 @@ exports[`t-on t-on with t-call 1`] = `
|
||||
exports[`t-on t-on with t-call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p block-handler-0=\\"click\\">lucas</p>\`);
|
||||
@@ -555,6 +530,7 @@ exports[`t-on t-on with t-call 2`] = `
|
||||
exports[`t-on t-on, with arguments and t-call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
@@ -570,6 +546,7 @@ exports[`t-on t-on, with arguments and t-call 1`] = `
|
||||
exports[`t-on t-on, with arguments and t-call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p block-handler-0=\\"click\\">lucas</p>\`);
|
||||
|
||||
@@ -3,120 +3,79 @@
|
||||
exports[`misc complex template 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`SlotButton\`, true, false, false, false);
|
||||
|
||||
let block3 = createBlock(\`<div block-attribute-0=\\"class\\">
|
||||
<div block-attribute-1=\\"class\\">
|
||||
<div class=\\"batch_header\\">
|
||||
<a block-attribute-2=\\"href\\" block-attribute-3=\\"class\\" title=\\"View Batch\\">
|
||||
<block-text-4/>
|
||||
<block-child-0/>
|
||||
<i class=\\"arrow fa fa-window-maximize\\"/>
|
||||
</a>
|
||||
</div>
|
||||
<block-child-1/>
|
||||
<div class=\\"batch_slots\\">
|
||||
<block-child-2/>
|
||||
<block-child-3/>
|
||||
</div>
|
||||
<div class=\\"batch_commits\\">
|
||||
<block-child-4/>
|
||||
</div>
|
||||
</div>
|
||||
</div>\`);
|
||||
let block4 = createBlock(\`<i class=\\"fa fa-exclamation-triangle\\"/>\`);
|
||||
let block7 = createBlock(\`<span><i class=\\"fa fa-cog fa-spin fa-fw\\"/> preparing</span>\`);
|
||||
let block15 = createBlock(\`<div class=\\"slot_filler\\"/>\`);
|
||||
let block17 = createBlock(\`<div class=\\"one_line\\">
|
||||
<a block-attribute-0=\\"href\\" block-attribute-1=\\"class\\">
|
||||
<block-child-0/>
|
||||
<block-child-1/>
|
||||
<block-child-2/>
|
||||
<block-child-3/>
|
||||
<block-text-2/>
|
||||
</a>
|
||||
<a block-attribute-3=\\"href\\" class=\\"badge badge-light\\" title=\\"View Commit on Github\\"><i class=\\"fa fa-github\\"/></a>
|
||||
<span><block-text-4/></span>
|
||||
</div>\`);
|
||||
let block18 = createBlock(\`<i class=\\"fa fa-fw fa-hashtag\\" title=\\"This commit is a new head\\"/>\`);
|
||||
let block19 = createBlock(\`<i class=\\"fa fa-fw fa-link\\" title=\\"This commit is an existing head from bundle branches\\"/>\`);
|
||||
let block20 = createBlock(\`<i class=\\"fa fa-fw fa-code-fork\\" title=\\"This commit is matched from a base batch with matching merge_base\\"/>\`);
|
||||
let block21 = createBlock(\`<i class=\\"fa fa-fw fa-clock-o\\" title=\\"This commit is the head of a base branch\\"/>\`);
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"><div block-attribute-1=\\"class\\"><div class=\\"batch_header\\"><a block-attribute-2=\\"href\\" block-attribute-3=\\"class\\" title=\\"View Batch\\"><block-text-4/><block-child-0/><i class=\\"arrow fa fa-window-maximize\\"/></a></div><block-child-1/><div class=\\"batch_slots\\"><block-child-2/><block-child-3/></div><div class=\\"batch_commits\\"><block-child-4/></div></div></div>\`);
|
||||
let block2 = createBlock(\`<i class=\\"fa fa-exclamation-triangle\\"/>\`);
|
||||
let block3 = createBlock(\`<span><i class=\\"fa fa-cog fa-spin fa-fw\\"/> preparing</span>\`);
|
||||
let block7 = createBlock(\`<div class=\\"slot_filler\\"/>\`);
|
||||
let block9 = createBlock(\`<div class=\\"one_line\\"><a block-attribute-0=\\"href\\" block-attribute-1=\\"class\\"><block-child-0/><block-child-1/><block-child-2/><block-child-3/><block-text-2/></a><a block-attribute-3=\\"href\\" class=\\"badge badge-light\\" title=\\"View Commit on Github\\"><i class=\\"fa fa-github\\"/></a><span><block-text-4/></span></div>\`);
|
||||
let block10 = createBlock(\`<i class=\\"fa fa-fw fa-hashtag\\" title=\\"This commit is a new head\\"/>\`);
|
||||
let block11 = createBlock(\`<i class=\\"fa fa-fw fa-link\\" title=\\"This commit is an existing head from bundle branches\\"/>\`);
|
||||
let block12 = createBlock(\`<i class=\\"fa fa-fw fa-code-fork\\" title=\\"This commit is matched from a base batch with matching merge_base\\"/>\`);
|
||||
let block13 = createBlock(\`<i class=\\"fa fa-fw fa-clock-o\\" title=\\"This commit is the head of a base branch\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4,b5,b9,b14,b16;
|
||||
let b2,b3,b4,b6,b8;
|
||||
let attr1 = \`batch_tile \${ctx['options'].more?'more':'nomore'}\`;
|
||||
let attr2 = \`card bg-\${ctx['klass']}-light\`;
|
||||
let attr3 = \`/runbot/batch/\${ctx['batch'].id}\`;
|
||||
let attr4 = \`badge badge-\${ctx['batch'].has_warning?'warning':'light'}\`;
|
||||
let txt1 = ctx['batch'].formated_age;
|
||||
if (ctx['batch'].has_warning) {
|
||||
b4 = block4();
|
||||
b2 = block2();
|
||||
}
|
||||
if (ctx['batch'].state=='preparing') {
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const b7 = block7();
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
b5 = multi([b6, b7, b8]);
|
||||
b3 = block3();
|
||||
}
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block9, v_block9, l_block9, c_block9] = prepareList(ctx['batch'].slot_ids.filter(_slot=>_slot.build_id.id&&!_slot.trigger_id.manual&&(ctx['options'].trigger_display[_slot.trigger_id.id])));;
|
||||
for (let i1 = 0; i1 < l_block9; i1++) {
|
||||
ctx[\`slot\`] = v_block9[i1];
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['batch'].slot_ids.filter(_slot=>_slot.build_id.id&&!_slot.trigger_id.manual&&(ctx['options'].trigger_display[_slot.trigger_id.id])));;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`slot\`] = v_block4[i1];
|
||||
const key1 = ctx['slot'].id;
|
||||
const b11 = text(\`
|
||||
\`);
|
||||
const b12 = comp1({class: ctx['slot_container'],slot: ctx['slot']}, key + \`__1__\${key1}\`, node, this, null);
|
||||
const b13 = text(\`
|
||||
\`);
|
||||
c_block9[i1] = withKey(multi([b11, b12, b13]), key1);
|
||||
c_block4[i1] = withKey(comp1({class: ctx['slot_container'],slot: ctx['slot']}, key + \`__1__\${key1}\`, node, this, null), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
b9 = list(c_block9);
|
||||
b4 = list(c_block4);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block14, v_block14, l_block14, c_block14] = prepareList([1,2,3,4]);;
|
||||
for (let i1 = 0; i1 < l_block14; i1++) {
|
||||
ctx[\`x\`] = v_block14[i1];
|
||||
const [k_block6, v_block6, l_block6, c_block6] = prepareList([1,2,3,4]);;
|
||||
for (let i1 = 0; i1 < l_block6; i1++) {
|
||||
ctx[\`x\`] = v_block6[i1];
|
||||
const key1 = ctx['x'];
|
||||
c_block14[i1] = withKey(block15(), key1);
|
||||
c_block6[i1] = withKey(block7(), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
b14 = list(c_block14);
|
||||
b6 = list(c_block6);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block16, v_block16, l_block16, c_block16] = prepareList(ctx['commit_links']);;
|
||||
for (let i1 = 0; i1 < l_block16; i1++) {
|
||||
ctx[\`commit_link\`] = v_block16[i1];
|
||||
const [k_block8, v_block8, l_block8, c_block8] = prepareList(ctx['commit_links']);;
|
||||
for (let i1 = 0; i1 < l_block8; i1++) {
|
||||
ctx[\`commit_link\`] = v_block8[i1];
|
||||
const key1 = ctx['commit_link'].id;
|
||||
let b18,b19,b20,b21;
|
||||
let b10,b11,b12,b13;
|
||||
let attr5 = \`/runbot/commit/\${ctx['commit_link'].commit_id}\`;
|
||||
let attr6 = \`badge badge-light batch_commit match_type_\${ctx['commit_link'].match_type}\`;
|
||||
if (ctx['commit_link'].match_type=='new') {
|
||||
b18 = block18();
|
||||
b10 = block10();
|
||||
}
|
||||
if (ctx['commit_link'].match_type=='head') {
|
||||
b19 = block19();
|
||||
b11 = block11();
|
||||
}
|
||||
if (ctx['commit_link'].match_type=='base_match') {
|
||||
b20 = block20();
|
||||
b12 = block12();
|
||||
}
|
||||
if (ctx['commit_link'].match_type=='base_head') {
|
||||
b21 = block21();
|
||||
b13 = block13();
|
||||
}
|
||||
let txt2 = ctx['commit_link'].commit_dname;
|
||||
let attr7 = 'https://%s/commit/%s'%(ctx['commit_link'].commit_remote_url,ctx['commit_link'].commit_name);
|
||||
let txt3 = ctx['commit_link'].commit_subject;
|
||||
c_block16[i1] = withKey(block17([attr5, attr6, txt2, attr7, txt3], [b18, b19, b20, b21]), key1);
|
||||
c_block8[i1] = withKey(block9([attr5, attr6, txt2, attr7, txt3], [b10, b11, b12, b13]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
b16 = list(c_block16);
|
||||
const b3 = block3([attr1, attr2, attr3, attr4, txt1], [b4, b5, b9, b14, b16]);
|
||||
return multi([b2, b3]);
|
||||
b8 = list(c_block8);
|
||||
return block1([attr1, attr2, attr3, attr4, txt1], [b2, b3, b4, b6, b8]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -124,6 +83,7 @@ exports[`misc complex template 1`] = `
|
||||
exports[`misc global 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, isBoundary, withDefault, setContextValue, zero, withKey } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`_callee-uses-foo\`);
|
||||
@@ -132,71 +92,43 @@ exports[`misc global 1`] = `
|
||||
const callTemplate_4 = app.getTemplate(\`_callee-asc\`);
|
||||
const callTemplate_5 = app.getTemplate(\`_callee-asc-toto\`);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
<block-child-1/>
|
||||
</div>\`);
|
||||
let block7 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
let block4 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList([4,5,6]);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`value\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList([4,5,6]);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`value\`] = v_block2[i1];
|
||||
ctx[\`value_first\`] = i1 === 0;
|
||||
ctx[\`value_last\`] = i1 === v_block4.length - 1;
|
||||
ctx[\`value_last\`] = i1 === v_block2.length - 1;
|
||||
ctx[\`value_index\`] = i1;
|
||||
ctx[\`value_value\`] = k_block4[i1];
|
||||
ctx[\`value_value\`] = k_block2[i1];
|
||||
const key1 = ctx['value'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['value'];
|
||||
const b7 = block7([txt1]);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
const b4 = block4([txt1]);
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
const b10 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
const b12 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"foo\\", 'aaa');
|
||||
const b13 = text(\`
|
||||
\`);
|
||||
const b11 = multi([b12, b13]);
|
||||
ctx[zero] = b11;
|
||||
const b14 = callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}\`);
|
||||
const b6 = callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}\`);
|
||||
ctx = ctx.__proto__;
|
||||
const b15 = text(\`
|
||||
\`);
|
||||
const b16 = callTemplate_2.call(this, ctx, node, key + \`__2__\${key1}\`);
|
||||
const b17 = text(\`
|
||||
\`);
|
||||
const b7 = callTemplate_2.call(this, ctx, node, key + \`__2__\${key1}\`);
|
||||
setContextValue(ctx, \\"foo\\", 'bbb');
|
||||
const b18 = text(\`
|
||||
\`);
|
||||
const b19 = callTemplate_3.call(this, ctx, node, key + \`__3__\${key1}\`);
|
||||
const b20 = text(\`
|
||||
\`);
|
||||
const b9 = multi([b10, b14, b15, b16, b17, b18, b19, b20]);
|
||||
ctx[zero] = b9;
|
||||
const b21 = callTemplate_4.call(this, ctx, node, key + \`__4__\${key1}\`);
|
||||
const b8 = callTemplate_3.call(this, ctx, node, key + \`__3__\${key1}\`);
|
||||
const b5 = multi([b6, b7, b8]);
|
||||
ctx[zero] = b5;
|
||||
const b9 = callTemplate_4.call(this, ctx, node, key + \`__4__\${key1}\`);
|
||||
ctx = ctx.__proto__;
|
||||
const b22 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8, b21, b22]), key1);
|
||||
c_block2[i1] = withKey(multi([b4, b9]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b23 = callTemplate_5.call(this, ctx, node, key + \`__5\`);
|
||||
const b3 = block3([], [b4, b23]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
const b10 = callTemplate_5.call(this, ctx, node, key + \`__5\`);
|
||||
return block1([], [b2, b10]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -204,6 +136,7 @@ exports[`misc global 1`] = `
|
||||
exports[`misc global 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { withDefault } = helpers;
|
||||
|
||||
@@ -219,6 +152,7 @@ exports[`misc global 2`] = `
|
||||
exports[`misc global 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { zero } = helpers;
|
||||
|
||||
@@ -235,14 +169,15 @@ exports[`misc global 3`] = `
|
||||
exports[`misc global 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
let { safeOutput, withDefault } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b3 = text(\`toto default\`);
|
||||
const b2 = safeOutput(ctx['toto'], b3);
|
||||
const b2 = withDefault(safeOutput(ctx['toto']), b3);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
@@ -251,54 +186,14 @@ exports[`misc global 4`] = `
|
||||
exports[`misc other complex template 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`LOAD_INFOS_TEMPLATE\`);
|
||||
const comp1 = app.createComponent(\`BundlesList\`, true, false, false, false);
|
||||
const comp2 = app.createComponent(\`BundlesList\`, true, false, false, false);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<header>
|
||||
<nav class=\\"navbar navbar-expand-md navbar-light bg-light\\">
|
||||
<a block-attribute-0=\\"href\\">
|
||||
<b style=\\"color:#777;\\">
|
||||
<block-text-1/>
|
||||
</b>
|
||||
</a>
|
||||
<button type=\\"button\\" class=\\"navbar-toggler\\" data-toggle=\\"collapse\\" data-target=\\"#top_menu_collapse\\">
|
||||
<span class=\\"navbar-toggler-icon\\"/>
|
||||
</button>
|
||||
<div class=\\"collapse navbar-collapse\\" id=\\"top_menu_collapse\\" aria-expanded=\\"false\\">
|
||||
<ul class=\\"nav navbar-nav ml-auto text-right\\" id=\\"top_menu\\">
|
||||
<block-child-0/>
|
||||
|
||||
<li class=\\"nav-item divider\\"/>
|
||||
<block-child-1/>
|
||||
</ul>
|
||||
|
||||
<div>
|
||||
<div class=\\"input-group input-group-sm\\">
|
||||
<div class=\\"input-group-prepend input-group-sm\\">
|
||||
<button class=\\"btn btn-default fa fa-cog\\" title=\\"Settings\\" block-handler-2=\\"click\\"/>
|
||||
<button class=\\"btn btn-default\\" block-handler-3=\\"click\\">
|
||||
More
|
||||
</button>
|
||||
<block-child-2/>
|
||||
</div>
|
||||
|
||||
<input class=\\"form-control\\" type=\\"text\\" placeholder=\\"Search\\" aria-label=\\"Search\\" name=\\"search\\" block-attribute-4=\\"value\\" block-handler-5=\\"keyup\\" block-handler-6=\\"change\\" block-ref=\\"7\\"/>
|
||||
<div class=\\"input-group-append\\">
|
||||
<button class=\\"btn btn-default fa fa-eraser\\" block-handler-8=\\"click\\"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div class=\\"container-fluid\\" block-ref=\\"9\\">
|
||||
<div class=\\"row\\">
|
||||
<!--div class=\\"form-group col-md-6\\">
|
||||
let block1 = createBlock(\`<div><header><nav class=\\"navbar navbar-expand-md navbar-light bg-light\\"><a block-attribute-0=\\"href\\"><b style=\\"color:#777;\\"><block-text-1/></b></a><button type=\\"button\\" class=\\"navbar-toggler\\" data-toggle=\\"collapse\\" data-target=\\"#top_menu_collapse\\"><span class=\\"navbar-toggler-icon\\"/></button><div class=\\"collapse navbar-collapse\\" id=\\"top_menu_collapse\\" aria-expanded=\\"false\\"><ul class=\\"nav navbar-nav ml-auto text-right\\" id=\\"top_menu\\"><block-child-0/><li class=\\"nav-item divider\\"/><block-child-1/></ul><div><div class=\\"input-group input-group-sm\\"><div class=\\"input-group-prepend input-group-sm\\"><button class=\\"btn btn-default fa fa-cog\\" title=\\"Settings\\" block-handler-2=\\"click\\"/><button class=\\"btn btn-default\\" block-handler-3=\\"click\\"> More </button><block-child-2/></div><input class=\\"form-control\\" type=\\"text\\" placeholder=\\"Search\\" aria-label=\\"Search\\" name=\\"search\\" block-attribute-4=\\"value\\" block-handler-5=\\"keyup\\" block-handler-6=\\"change\\" block-ref=\\"7\\"/><div class=\\"input-group-append\\"><button class=\\"btn btn-default fa fa-eraser\\" block-handler-8=\\"click\\"/></div></div></div></div></nav></header><div class=\\"container-fluid\\" block-ref=\\"9\\"><div class=\\"row\\"><!--div class=\\"form-group col-md-6\\">
|
||||
<h5>Search options</h5>
|
||||
<input class=\\"form-control\\" type=\\"text\\" name=\\"default_search\\" id=\\"default_search\\" t-att-checked=\\"default_search\\" placeholder=\\"Default search\\"/>
|
||||
|
||||
@@ -311,187 +206,94 @@ exports[`misc other complex template 1`] = `
|
||||
<input class=\\"form-check-input\\" type=\\"checkbox\\" name=\\"display_dev\\"/>
|
||||
<label class=\\"form-check-label\\" for=\\"display_dev\\">Display dev</label>
|
||||
</div>
|
||||
</div-->
|
||||
<div class=\\"form-group col-md-6\\">
|
||||
<h5>Triggers</h5>
|
||||
<block-child-3/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=\\"container-fluid frontend\\">
|
||||
<div class=\\"row\\">
|
||||
<div class=\\"col-md-12\\">
|
||||
<block-child-4/>
|
||||
</div>
|
||||
<div class=\\"col-md-12\\">
|
||||
<block-child-5/>
|
||||
<block-child-6/><block-child-7/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>\`);
|
||||
let block5 = createBlock(\`<li class=\\"nav-item\\">
|
||||
<a class=\\"nav-link\\" href=\\"#\\" block-handler-0=\\"click\\">
|
||||
<block-text-1/>
|
||||
</a>
|
||||
</li>\`);
|
||||
let block10 = createBlock(\`<li class=\\"nav-item dropdown\\">
|
||||
<b>
|
||||
<a class=\\"nav-link\\" block-attribute-0=\\"href\\">Login</a>
|
||||
</b>
|
||||
</li>\`);
|
||||
let block16 = createBlock(\`<li class=\\"nav-item\\">
|
||||
<a href=\\"/runbot/errors\\" class=\\"nav-link text-danger\\" block-attribute-0=\\"title\\">
|
||||
<i class=\\"fa fa-bug\\"/><block-text-1/>
|
||||
</a>
|
||||
</li>\`);
|
||||
let block18 = createBlock(\`<li class=\\"nav-item divider\\"/>\`);
|
||||
let block22 = createBlock(\`<li class=\\"nav-item\\">
|
||||
<a href=\\"/runbot/errors\\" class=\\"nav-link\\" title=\\"Random Bugs\\"><i class=\\"fa fa-bug\\"/></a>
|
||||
</li>\`);
|
||||
let block24 = createBlock(\`<li class=\\"nav-item divider\\"/>\`);
|
||||
let block27 = createBlock(\`<li class=\\"nav-item dropdown\\">
|
||||
<a href=\\"#\\" class=\\"nav-link dropdown-toggle\\" data-toggle=\\"dropdown\\">
|
||||
<b>
|
||||
<span><block-text-0/></span>
|
||||
</b>
|
||||
</a>
|
||||
<div class=\\"dropdown-menu js_usermenu\\" role=\\"menu\\">
|
||||
<a class=\\"dropdown-item\\" id=\\"o_logout\\" role=\\"menuitem\\" block-attribute-1=\\"href\\">Logout</a>
|
||||
<a class=\\"dropdown-item\\" role=\\"menuitem\\" block-attribute-2=\\"href\\">Web</a>
|
||||
</div>
|
||||
</li>\`);
|
||||
let block30 = createBlock(\`<select class=\\"custom-select\\" name=\\"category\\" id=\\"category\\">
|
||||
<block-child-0/>
|
||||
</select>\`);
|
||||
let block32 = createBlock(\`<option block-attribute-0=\\"value\\" block-attribute-1=\\"selected\\"><block-text-2/></option>\`);
|
||||
let block38 = createBlock(\`<div class=\\"form-check\\">
|
||||
<input class=\\"form-check-input\\" type=\\"checkbox\\" block-attribute-0=\\"name\\" block-attribute-1=\\"id\\" block-attribute-2=\\"checked\\" block-attribute-3=\\"data-trigger_id\\" block-handler-4=\\"change\\"/>
|
||||
<label class=\\"form-check-label\\" block-attribute-5=\\"for\\"><block-text-6/></label>
|
||||
</div>\`);
|
||||
let block41 = createBlock(\`<div>
|
||||
<button class=\\"btn btn-sm btn-default\\" block-handler-0=\\"click\\">All</button>
|
||||
<button class=\\"btn btn-sm btn-default\\" block-handler-1=\\"click\\">None</button>
|
||||
<button class=\\"btn btn-sm btn-info\\" block-handler-2=\\"click\\">Default</button>
|
||||
<button class=\\"btn btn-sm btn-default\\" block-handler-3=\\"click\\">Close</button>
|
||||
</div>\`);
|
||||
let block44 = createBlock(\`<div class=\\"alert alert-warning\\" role=\\"alert\\">
|
||||
<block-text-0/> <!-- todo fixme-->
|
||||
</div>\`);
|
||||
let block45 = createBlock(\`<div class=\\"mb32\\">
|
||||
<h1>No project</h1>
|
||||
</div>\`);
|
||||
let block46 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
<block-child-1/>
|
||||
</div>\`);
|
||||
</div--><div class=\\"form-group col-md-6\\"><h5>Triggers</h5><block-child-3/></div></div></div><div class=\\"container-fluid frontend\\"><div class=\\"row\\"><div class=\\"col-md-12\\"><block-child-4/></div><div class=\\"col-md-12\\"><block-child-5/><block-child-6/><block-child-7/></div></div></div></div>\`);
|
||||
let block3 = createBlock(\`<li class=\\"nav-item\\"><a class=\\"nav-link\\" href=\\"#\\" block-handler-0=\\"click\\"><block-text-1/></a></li>\`);
|
||||
let block5 = createBlock(\`<li class=\\"nav-item dropdown\\"><b><a class=\\"nav-link\\" block-attribute-0=\\"href\\">Login</a></b></li>\`);
|
||||
let block8 = createBlock(\`<li class=\\"nav-item\\"><a href=\\"/runbot/errors\\" class=\\"nav-link text-danger\\" block-attribute-0=\\"title\\"><i class=\\"fa fa-bug\\"/><block-text-1/></a></li>\`);
|
||||
let block9 = createBlock(\`<li class=\\"nav-item divider\\"/>\`);
|
||||
let block11 = createBlock(\`<li class=\\"nav-item\\"><a href=\\"/runbot/errors\\" class=\\"nav-link\\" title=\\"Random Bugs\\"><i class=\\"fa fa-bug\\"/></a></li>\`);
|
||||
let block12 = createBlock(\`<li class=\\"nav-item divider\\"/>\`);
|
||||
let block13 = createBlock(\`<li class=\\"nav-item dropdown\\"><a href=\\"#\\" class=\\"nav-link dropdown-toggle\\" data-toggle=\\"dropdown\\"><b><span><block-text-0/></span></b></a><div class=\\"dropdown-menu js_usermenu\\" role=\\"menu\\"><a class=\\"dropdown-item\\" id=\\"o_logout\\" role=\\"menuitem\\" block-attribute-1=\\"href\\">Logout</a><a class=\\"dropdown-item\\" role=\\"menuitem\\" block-attribute-2=\\"href\\">Web</a></div></li>\`);
|
||||
let block14 = createBlock(\`<select class=\\"custom-select\\" name=\\"category\\" id=\\"category\\"><block-child-0/></select>\`);
|
||||
let block16 = createBlock(\`<option block-attribute-0=\\"value\\" block-attribute-1=\\"selected\\"><block-text-2/></option>\`);
|
||||
let block20 = createBlock(\`<div class=\\"form-check\\"><input class=\\"form-check-input\\" type=\\"checkbox\\" block-attribute-0=\\"name\\" block-attribute-1=\\"id\\" block-attribute-2=\\"checked\\" block-attribute-3=\\"data-trigger_id\\" block-handler-4=\\"change\\"/><label class=\\"form-check-label\\" block-attribute-5=\\"for\\"><block-text-6/></label></div>\`);
|
||||
let block21 = createBlock(\`<div><button class=\\"btn btn-sm btn-default\\" block-handler-0=\\"click\\">All</button><button class=\\"btn btn-sm btn-default\\" block-handler-1=\\"click\\">None</button><button class=\\"btn btn-sm btn-info\\" block-handler-2=\\"click\\">Default</button><button class=\\"btn btn-sm btn-default\\" block-handler-3=\\"click\\">Close</button></div>\`);
|
||||
let block23 = createBlock(\`<div class=\\"alert alert-warning\\" role=\\"alert\\"><block-text-0/> <!-- todo fixme--></div>\`);
|
||||
let block24 = createBlock(\`<div class=\\"mb32\\"><h1>No project</h1></div>\`);
|
||||
let block25 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const refs = ctx.__owl__.refs;
|
||||
const ref1 = (el) => refs[\`search_input\`] = el;
|
||||
const ref2 = (el) => refs[\`settings_menu\`] = el;
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4,b6,b30,b33,b43,b44,b45,b46;
|
||||
let b2,b4,b14,b17,b22,b23,b24,b25;
|
||||
let attr1 = \`/runbot/\${ctx['project'].slug}\`;
|
||||
let txt1 = ctx['project'].name;
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['projects']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`project\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['projects']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`project\`] = v_block2[i1];
|
||||
const key1 = ctx['project'].id;
|
||||
let hdlr1 = [ctx['selectProject'](ctx['project']), ctx];
|
||||
let txt2 = ctx['project'].name;
|
||||
c_block4[i1] = withKey(block5([hdlr1, txt2]), key1);
|
||||
c_block2[i1] = withKey(block3([hdlr1, txt2]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
b4 = list(c_block4);
|
||||
b2 = list(c_block2);
|
||||
if (ctx['user']) {
|
||||
let b7,b8,b12,b29;
|
||||
b7 = text(\`
|
||||
\`);
|
||||
let b5,b6;
|
||||
if (ctx['user'].public) {
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
let attr2 = \`/web/login?redirect=/\`;
|
||||
const b10 = block10([attr2]);
|
||||
const b11 = text(\`
|
||||
\`);
|
||||
b8 = multi([b9, b10, b11]);
|
||||
b5 = block5([attr2]);
|
||||
} else {
|
||||
let b13,b14,b20,b26,b27,b28;
|
||||
b13 = text(\`
|
||||
\`);
|
||||
let b7,b10,b13;
|
||||
if (ctx['nb_assigned_errors']&&ctx['nb_assigned_errors']>0) {
|
||||
const b15 = text(\`
|
||||
\`);
|
||||
let attr3 = \`You have \${ctx['nb_assigned_errors']} random bug assigned\`;
|
||||
let txt3 = ctx['nb_assigned_errors'];
|
||||
const b16 = block16([attr3, txt3]);
|
||||
const b17 = text(\`
|
||||
\`);
|
||||
const b18 = block18();
|
||||
const b19 = text(\`
|
||||
\`);
|
||||
b14 = multi([b15, b16, b17, b18, b19]);
|
||||
const b8 = block8([attr3, txt3]);
|
||||
const b9 = block9();
|
||||
b7 = multi([b8, b9]);
|
||||
} else if (ctx['nb_build_errors']&&ctx['nb_build_errors']>0) {
|
||||
const b21 = text(\`
|
||||
\`);
|
||||
const b22 = block22();
|
||||
const b23 = text(\`
|
||||
\`);
|
||||
const b24 = block24();
|
||||
const b25 = text(\`
|
||||
\`);
|
||||
b20 = multi([b21, b22, b23, b24, b25]);
|
||||
const b11 = block11();
|
||||
const b12 = block12();
|
||||
b10 = multi([b11, b12]);
|
||||
}
|
||||
b26 = text(\`
|
||||
\`);
|
||||
let txt4 = ctx['user'].name.length>25?ctx['user'].namesubstring(0,23)+'...':ctx['user'].name;
|
||||
let attr4 = \`/web/session/logout?redirect=/\`;
|
||||
let attr5 = \`/web\`;
|
||||
b27 = block27([txt4, attr4, attr5]);
|
||||
b28 = text(\`
|
||||
\`);
|
||||
b12 = multi([b13, b14, b20, b26, b27, b28]);
|
||||
b13 = block13([txt4, attr4, attr5]);
|
||||
b6 = multi([b7, b10, b13]);
|
||||
}
|
||||
b29 = text(\`
|
||||
\`);
|
||||
b6 = multi([b7, b8, b12, b29]);
|
||||
b4 = multi([b5, b6]);
|
||||
}
|
||||
let hdlr2 = [ctx['toggleSettingsMenu'], ctx];
|
||||
let hdlr3 = [ctx['toggleMore'], ctx];
|
||||
if (ctx['categories']&&ctx['categories'].length>1) {
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block31, v_block31, l_block31, c_block31] = prepareList(ctx['categories']);;
|
||||
for (let i1 = 0; i1 < l_block31; i1++) {
|
||||
ctx[\`category\`] = v_block31[i1];
|
||||
const [k_block15, v_block15, l_block15, c_block15] = prepareList(ctx['categories']);;
|
||||
for (let i1 = 0; i1 < l_block15; i1++) {
|
||||
ctx[\`category\`] = v_block15[i1];
|
||||
const key1 = ctx['category'].id;
|
||||
let attr6 = ctx['category'].id;
|
||||
let attr7 = ctx['category'].id==ctx['options'].active_category_id;
|
||||
let txt5 = ctx['category'].name;
|
||||
c_block31[i1] = withKey(block32([attr6, attr7, txt5]), key1);
|
||||
c_block15[i1] = withKey(block16([attr6, attr7, txt5]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b31 = list(c_block31);
|
||||
b30 = block30([], [b31]);
|
||||
const b15 = list(c_block15);
|
||||
b14 = block14([], [b15]);
|
||||
}
|
||||
let attr8 = ctx['search'].value;
|
||||
let hdlr4 = [ctx['updateFilter'], ctx];
|
||||
let hdlr5 = [ctx['updateFilter'], ctx];
|
||||
let hdlr6 = [ctx['clearSearch'], ctx];
|
||||
if (ctx['triggers']) {
|
||||
const b34 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block35, v_block35, l_block35, c_block35] = prepareList(ctx['triggers']);;
|
||||
for (let i1 = 0; i1 < l_block35; i1++) {
|
||||
ctx[\`trigger\`] = v_block35[i1];
|
||||
const [k_block18, v_block18, l_block18, c_block18] = prepareList(ctx['triggers']);;
|
||||
for (let i1 = 0; i1 < l_block18; i1++) {
|
||||
ctx[\`trigger\`] = v_block18[i1];
|
||||
const key1 = ctx['trigger'].id;
|
||||
let b37,b38,b39;
|
||||
b37 = text(\`
|
||||
\`);
|
||||
let b20;
|
||||
if (!ctx['trigger'].manual&&ctx['trigger'].project_id===ctx['project'].id&&ctx['trigger'].category_id===ctx['options'].active_category_id) {
|
||||
let attr9 = \`trigger_\${ctx['trigger'].id}\`;
|
||||
let attr10 = \`trigger_\${ctx['trigger'].id}\`;
|
||||
@@ -500,41 +302,34 @@ exports[`misc other complex template 1`] = `
|
||||
let hdlr7 = [ctx['updateTriggerDisplay'], ctx];
|
||||
let attr13 = \`trigger_\${ctx['trigger'].id}\`;
|
||||
let txt6 = ctx['trigger'].name;
|
||||
b38 = block38([attr9, attr10, attr11, attr12, hdlr7, attr13, txt6]);
|
||||
b20 = block20([attr9, attr10, attr11, attr12, hdlr7, attr13, txt6]);
|
||||
}
|
||||
b39 = text(\`
|
||||
\`);
|
||||
c_block35[i1] = withKey(multi([b37, b38, b39]), key1);
|
||||
c_block18[i1] = withKey(multi([b20]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b35 = list(c_block35);
|
||||
const b40 = text(\`
|
||||
\`);
|
||||
const b18 = list(c_block18);
|
||||
let hdlr8 = [ctx['triggerAll'], ctx];
|
||||
let hdlr9 = [ctx['triggerNone'], ctx];
|
||||
let hdlr10 = [ctx['triggerDefault'], ctx];
|
||||
let hdlr11 = [ctx['toggleSettingsMenu'], ctx];
|
||||
const b41 = block41([hdlr8, hdlr9, hdlr10, hdlr11]);
|
||||
const b42 = text(\`
|
||||
\`);
|
||||
b33 = multi([b34, b35, b40, b41, b42]);
|
||||
const b21 = block21([hdlr8, hdlr9, hdlr10, hdlr11]);
|
||||
b17 = multi([b18, b21]);
|
||||
}
|
||||
if (ctx['load_infos']) {
|
||||
b43 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
b22 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
}
|
||||
if (ctx['message']) {
|
||||
let txt7 = ctx['message'];
|
||||
b44 = block44([txt7]);
|
||||
b23 = block23([txt7]);
|
||||
}
|
||||
if (!ctx['project']) {
|
||||
b45 = block45();
|
||||
b24 = block24();
|
||||
} else {
|
||||
const b47 = comp1({bundles: ctx['bundles'].sticky,category_custom_views: ctx['category_custom_views'],search: ctx['search']}, key + \`__2\`, node, this, null);
|
||||
const b48 = comp2({bundles: ctx['bundles'].dev,search: ctx['search']}, key + \`__3\`, node, this, null);
|
||||
b46 = block46([], [b47, b48]);
|
||||
const b26 = comp1({bundles: ctx['bundles'].sticky,category_custom_views: ctx['category_custom_views'],search: ctx['search']}, key + \`__2\`, node, this, null);
|
||||
const b27 = comp2({bundles: ctx['bundles'].dev,search: ctx['search']}, key + \`__3\`, node, this, null);
|
||||
b25 = block25([], [b26, b27]);
|
||||
}
|
||||
const b3 = block3([attr1, txt1, hdlr2, hdlr3, attr8, hdlr4, hdlr5, ref1, hdlr6, ref2], [b4, b6, b30, b33, b43, b44, b45, b46]);
|
||||
return multi([b2, b3]);
|
||||
return block1([attr1, txt1, hdlr2, hdlr3, attr8, hdlr4, hdlr5, ref1, hdlr6, ref2], [b2, b4, b14, b17, b22, b23, b24, b25]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`memory t-foreach does not leak stuff in global scope 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`simple templates, mostly static can render a table row 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<tr><td>cell</td></tr>\`);
|
||||
@@ -16,6 +17,7 @@ exports[`simple templates, mostly static can render a table row 1`] = `
|
||||
exports[`simple templates, mostly static div with a class attribute 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"abc\\">foo</div>\`);
|
||||
@@ -29,6 +31,7 @@ exports[`simple templates, mostly static div with a class attribute 1`] = `
|
||||
exports[`simple templates, mostly static div with a class attribute with a quote 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"a'bc\\">word</div>\`);
|
||||
@@ -42,6 +45,7 @@ exports[`simple templates, mostly static div with a class attribute with a quote
|
||||
exports[`simple templates, mostly static div with a span child node 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><span>word</span></div>\`);
|
||||
@@ -55,6 +59,7 @@ exports[`simple templates, mostly static div with a span child node 1`] = `
|
||||
exports[`simple templates, mostly static div with an arbitrary attribute with a quote 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div abc=\\"a'bc\\">word</div>\`);
|
||||
@@ -68,6 +73,7 @@ exports[`simple templates, mostly static div with an arbitrary attribute with a
|
||||
exports[`simple templates, mostly static div with an empty class attribute 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>word</div>\`);
|
||||
@@ -81,6 +87,7 @@ exports[`simple templates, mostly static div with an empty class attribute 1`] =
|
||||
exports[`simple templates, mostly static div with content 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>foo</div>\`);
|
||||
@@ -94,6 +101,7 @@ exports[`simple templates, mostly static div with content 1`] = `
|
||||
exports[`simple templates, mostly static dom node with t-esc 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -108,6 +116,7 @@ exports[`simple templates, mostly static dom node with t-esc 1`] = `
|
||||
exports[`simple templates, mostly static dom node with t-esc 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -122,6 +131,7 @@ exports[`simple templates, mostly static dom node with t-esc 2`] = `
|
||||
exports[`simple templates, mostly static dynamic text value 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -133,6 +143,7 @@ exports[`simple templates, mostly static dynamic text value 1`] = `
|
||||
exports[`simple templates, mostly static empty div 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -146,6 +157,7 @@ exports[`simple templates, mostly static empty div 1`] = `
|
||||
exports[`simple templates, mostly static empty string 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -157,6 +169,7 @@ exports[`simple templates, mostly static empty string 1`] = `
|
||||
exports[`simple templates, mostly static empty string in a template set 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -168,6 +181,7 @@ exports[`simple templates, mostly static empty string in a template set 1`] = `
|
||||
exports[`simple templates, mostly static inline template string in t-esc 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -179,6 +193,7 @@ exports[`simple templates, mostly static inline template string in t-esc 1`] = `
|
||||
exports[`simple templates, mostly static inline template string with content in t-esc 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -194,6 +209,7 @@ exports[`simple templates, mostly static inline template string with content in
|
||||
exports[`simple templates, mostly static inline template string with variable in context 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -205,6 +221,7 @@ exports[`simple templates, mostly static inline template string with variable in
|
||||
exports[`simple templates, mostly static multiple root nodes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block2 = createBlock(\`<div>foo</div>\`);
|
||||
@@ -221,6 +238,7 @@ exports[`simple templates, mostly static multiple root nodes 1`] = `
|
||||
exports[`simple templates, mostly static simple string 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -232,6 +250,7 @@ exports[`simple templates, mostly static simple string 1`] = `
|
||||
exports[`simple templates, mostly static simple string in t tag 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -243,6 +262,7 @@ exports[`simple templates, mostly static simple string in t tag 1`] = `
|
||||
exports[`simple templates, mostly static static text and dynamic text (no t tag) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -256,6 +276,7 @@ exports[`simple templates, mostly static static text and dynamic text (no t tag)
|
||||
exports[`simple templates, mostly static static text and dynamic text 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -269,6 +290,7 @@ exports[`simple templates, mostly static static text and dynamic text 1`] = `
|
||||
exports[`simple templates, mostly static t-esc in dom node 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -283,6 +305,7 @@ exports[`simple templates, mostly static t-esc in dom node 1`] = `
|
||||
exports[`simple templates, mostly static t-esc in dom node, variations 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hello <block-text-0/></div>\`);
|
||||
@@ -297,6 +320,7 @@ exports[`simple templates, mostly static t-esc in dom node, variations 1`] = `
|
||||
exports[`simple templates, mostly static t-esc in dom node, variations 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hello <block-text-0/> world</div>\`);
|
||||
@@ -311,24 +335,16 @@ exports[`simple templates, mostly static t-esc in dom node, variations 2`] = `
|
||||
exports[`simple templates, mostly static template with multiple t tag with multiple content 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-text-0/>
|
||||
|
||||
<block-text-1/>
|
||||
Loading<block-text-2/>
|
||||
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-text-0/><block-text-1/>Loading<block-text-2/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['a'];
|
||||
let txt2 = ctx['b'];
|
||||
let txt3 = ctx['c'];
|
||||
const b3 = block3([txt1, txt2, txt3]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt1, txt2, txt3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -336,6 +352,7 @@ exports[`simple templates, mostly static template with multiple t tag with multi
|
||||
exports[`simple templates, mostly static template with t tag with multiple content 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>Loading<block-child-0/></div>\`);
|
||||
@@ -353,6 +370,7 @@ exports[`simple templates, mostly static template with t tag with multiple conte
|
||||
exports[`simple templates, mostly static two t-escs next to each other 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -366,6 +384,7 @@ exports[`simple templates, mostly static two t-escs next to each other 1`] = `
|
||||
exports[`simple templates, mostly static two t-escs next to each other 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -379,6 +398,7 @@ exports[`simple templates, mostly static two t-escs next to each other 2`] = `
|
||||
exports[`simple templates, mostly static two t-escs next to each other, in a div 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/><block-text-1/></div>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`properly support svg add proper namespace to g tags 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<g block-ns=\\"http://www.w3.org/2000/svg\\"><circle cx=\\"50\\" cy=\\"50\\" r=\\"4\\" stroke=\\"green\\" stroke-width=\\"1\\" fill=\\"yellow\\"/> </g>\`);
|
||||
@@ -16,6 +17,7 @@ exports[`properly support svg add proper namespace to g tags 1`] = `
|
||||
exports[`properly support svg add proper namespace to svg 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<svg block-ns=\\"http://www.w3.org/2000/svg\\" width=\\"100px\\" height=\\"90px\\"><circle cx=\\"50\\" cy=\\"50\\" r=\\"4\\" stroke=\\"green\\" stroke-width=\\"1\\" fill=\\"yellow\\"/> </svg>\`);
|
||||
@@ -29,6 +31,7 @@ exports[`properly support svg add proper namespace to svg 1`] = `
|
||||
exports[`properly support svg namespace to g tags not added if already in svg namespace 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<svg block-ns=\\"http://www.w3.org/2000/svg\\"><g/></svg>\`);
|
||||
@@ -42,6 +45,7 @@ exports[`properly support svg namespace to g tags not added if already in svg na
|
||||
exports[`properly support svg namespace to svg tags added even if already in svg namespace 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<svg block-ns=\\"http://www.w3.org/2000/svg\\"><svg/></svg>\`);
|
||||
@@ -55,29 +59,20 @@ exports[`properly support svg namespace to svg tags added even if already in svg
|
||||
exports[`properly support svg svg creates new block if it is within html -- 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block4 = createBlock(\`<svg block-ns=\\"http://www.w3.org/2000/svg\\">
|
||||
<polygon fill=\\"#000000\\" points=\\"0 0 4 4 8 0\\" transform=\\"translate(5 7)\\"/>
|
||||
<block-child-0/>
|
||||
</svg>\`);
|
||||
let block5 = createBlock(\`<path block-ns=\\"http://www.w3.org/2000/svg\\"/>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block2 = createBlock(\`<svg block-ns=\\"http://www.w3.org/2000/svg\\"><polygon fill=\\"#000000\\" points=\\"0 0 4 4 8 0\\" transform=\\"translate(5 7)\\"/><block-child-0/></svg>\`);
|
||||
let block3 = createBlock(\`<path block-ns=\\"http://www.w3.org/2000/svg\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b5;
|
||||
let b3;
|
||||
if (ctx['hasPath']) {
|
||||
b5 = block5();
|
||||
b3 = block3();
|
||||
}
|
||||
const b4 = block4([], [b5]);
|
||||
const b3 = block3([], [b4]);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b6]);
|
||||
const b2 = block2([], [b3]);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -85,23 +80,15 @@ exports[`properly support svg svg creates new block if it is within html -- 2 1`
|
||||
exports[`properly support svg svg creates new block if it is within html 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block4 = createBlock(\`<svg block-ns=\\"http://www.w3.org/2000/svg\\">
|
||||
<polygon fill=\\"#000000\\" points=\\"0 0 4 4 8 0\\" transform=\\"translate(5 7)\\"/>
|
||||
</svg>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block2 = createBlock(\`<svg block-ns=\\"http://www.w3.org/2000/svg\\"><polygon fill=\\"#000000\\" points=\\"0 0 4 4 8 0\\" transform=\\"translate(5 7)\\"/></svg>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b4 = block4();
|
||||
const b3 = block3([], [b4]);
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b5]);
|
||||
const b2 = block2();
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -109,6 +96,7 @@ exports[`properly support svg svg creates new block if it is within html 1`] = `
|
||||
exports[`properly support svg svg namespace added to sub templates if root tag is path 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`path\`);
|
||||
|
||||
@@ -124,6 +112,7 @@ exports[`properly support svg svg namespace added to sub templates if root tag i
|
||||
exports[`properly support svg svg namespace added to sub templates if root tag is path 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<path block-ns=\\"http://www.w3.org/2000/svg\\"/>\`);
|
||||
@@ -137,6 +126,7 @@ exports[`properly support svg svg namespace added to sub templates if root tag i
|
||||
exports[`properly support svg svg namespace added to sub-blocks 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<svg block-ns=\\"http://www.w3.org/2000/svg\\"><block-child-0/></svg>\`);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,7 @@
|
||||
exports[`debugging t-debug 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
@@ -23,6 +24,7 @@ exports[`debugging t-debug 1`] = `
|
||||
exports[`debugging t-debug on sub template 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p>coucou</p>\`);
|
||||
@@ -37,6 +39,7 @@ exports[`debugging t-debug on sub template 1`] = `
|
||||
exports[`debugging t-debug on sub template 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
@@ -52,13 +55,11 @@ exports[`debugging t-debug on sub template 2`] = `
|
||||
exports[`debugging t-log 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<div>
|
||||
|
||||
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
|
||||
@@ -3,26 +3,18 @@
|
||||
exports[`t-esc div with falsy values 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<p><block-text-0/></p>
|
||||
<p><block-text-1/></p>
|
||||
<p><block-text-2/></p>
|
||||
<p><block-text-3/></p>
|
||||
<p><block-text-4/></p>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><p><block-text-0/></p><p><block-text-1/></p><p><block-text-2/></p><p><block-text-3/></p><p><block-text-4/></p></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['v1'];
|
||||
let txt2 = ctx['v2'];
|
||||
let txt3 = ctx['v3'];
|
||||
let txt4 = ctx['v4'];
|
||||
let txt5 = ctx['v5'];
|
||||
const b3 = block3([txt1, txt2, txt3, txt4, txt5]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt1, txt2, txt3, txt4, txt5]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -30,6 +22,7 @@ exports[`t-esc div with falsy values 1`] = `
|
||||
exports[`t-esc escaping 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -44,6 +37,7 @@ exports[`t-esc escaping 1`] = `
|
||||
exports[`t-esc escaping on a node 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -58,6 +52,7 @@ exports[`t-esc escaping on a node 1`] = `
|
||||
exports[`t-esc escaping on a node with a body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { withDefault } = helpers;
|
||||
|
||||
@@ -73,6 +68,7 @@ exports[`t-esc escaping on a node with a body 1`] = `
|
||||
exports[`t-esc escaping on a node with a body, as a default 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { withDefault } = helpers;
|
||||
|
||||
@@ -88,21 +84,20 @@ exports[`t-esc escaping on a node with a body, as a default 1`] = `
|
||||
exports[`t-esc falsy values in text nodes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = text(ctx['v1']);
|
||||
const b4 = text(\`:\`);
|
||||
const b5 = text(ctx['v2']);
|
||||
const b6 = text(\`:\`);
|
||||
const b7 = text(ctx['v3']);
|
||||
const b8 = text(\`:\`);
|
||||
const b9 = text(ctx['v4']);
|
||||
const b10 = text(\`:\`);
|
||||
const b11 = text(ctx['v5']);
|
||||
return multi([b2, b3, b4, b5, b6, b7, b8, b9, b10, b11]);
|
||||
const b2 = text(ctx['v1']);
|
||||
const b3 = text(\`:\`);
|
||||
const b4 = text(ctx['v2']);
|
||||
const b5 = text(\`:\`);
|
||||
const b6 = text(ctx['v3']);
|
||||
const b7 = text(\`:\`);
|
||||
const b8 = text(ctx['v4']);
|
||||
const b9 = text(\`:\`);
|
||||
const b10 = text(ctx['v5']);
|
||||
return multi([b2, b3, b4, b5, b6, b7, b8, b9, b10]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -110,6 +105,7 @@ exports[`t-esc falsy values in text nodes 1`] = `
|
||||
exports[`t-esc literal 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -124,6 +120,7 @@ exports[`t-esc literal 1`] = `
|
||||
exports[`t-esc t-esc is escaped 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue } = helpers;
|
||||
|
||||
@@ -144,34 +141,10 @@ exports[`t-esc t-esc is escaped 1`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-esc t-esc with the 0 number 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return text(ctx['var']);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-esc t-esc with the 0 number, in a p 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p><block-text-0/></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let txt1 = ctx['var'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-esc t-esc work with spread operator 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -186,6 +159,7 @@ exports[`t-esc t-esc work with spread operator 1`] = `
|
||||
exports[`t-esc t-esc=0 is escaped 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, zero } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -207,6 +181,7 @@ exports[`t-esc t-esc=0 is escaped 1`] = `
|
||||
exports[`t-esc t-esc=0 is escaped 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { zero } = helpers;
|
||||
|
||||
@@ -219,20 +194,10 @@ exports[`t-esc t-esc=0 is escaped 2`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-esc top level t-esc with undefined 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return text(ctx['var']);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-esc variable 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
@@ -3,27 +3,22 @@
|
||||
exports[`t-foreach does not pollute the rendering context 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList([1]);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`item\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList([1]);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`item\`] = v_block2[i1];
|
||||
const key1 = ctx['item'];
|
||||
c_block4[i1] = withKey(text(ctx['item']), key1);
|
||||
c_block2[i1] = withKey(text(ctx['item']), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -31,29 +26,24 @@ exports[`t-foreach does not pollute the rendering context 1`] = `
|
||||
exports[`t-foreach iterate on items (on a element node) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block5 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList([1,2]);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`item\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList([1,2]);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`item\`] = v_block2[i1];
|
||||
const key1 = ctx['item'];
|
||||
let txt1 = ctx['item'];
|
||||
c_block4[i1] = withKey(block5([txt1]), key1);
|
||||
c_block2[i1] = withKey(block3([txt1]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -61,38 +51,31 @@ exports[`t-foreach iterate on items (on a element node) 1`] = `
|
||||
exports[`t-foreach iterate on items 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList([3,2,1]);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`item\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList([3,2,1]);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`item\`] = v_block2[i1];
|
||||
ctx[\`item_index\`] = i1;
|
||||
ctx[\`item_value\`] = k_block4[i1];
|
||||
ctx[\`item_value\`] = k_block2[i1];
|
||||
const key1 = ctx['item'];
|
||||
const b6 = text(\`
|
||||
[\`);
|
||||
const b7 = text(ctx['item_index']);
|
||||
const b8 = text(\`: \`);
|
||||
const b9 = text(ctx['item']);
|
||||
const b10 = text(\` \`);
|
||||
const b11 = text(ctx['item_value']);
|
||||
const b12 = text(\`]
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8, b9, b10, b11, b12]), key1);
|
||||
const b4 = text(\` [\`);
|
||||
const b5 = text(ctx['item_index']);
|
||||
const b6 = text(\`: \`);
|
||||
const b7 = text(ctx['item']);
|
||||
const b8 = text(\` \`);
|
||||
const b9 = text(ctx['item_value']);
|
||||
const b10 = text(\`] \`);
|
||||
c_block2[i1] = withKey(multi([b4, b5, b6, b7, b8, b9, b10]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -100,38 +83,31 @@ exports[`t-foreach iterate on items 1`] = `
|
||||
exports[`t-foreach iterate, dict param 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['value']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`item\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['value']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`item\`] = v_block2[i1];
|
||||
ctx[\`item_index\`] = i1;
|
||||
ctx[\`item_value\`] = k_block4[i1];
|
||||
ctx[\`item_value\`] = k_block2[i1];
|
||||
const key1 = ctx['item_index'];
|
||||
const b6 = text(\`
|
||||
[\`);
|
||||
const b7 = text(ctx['item_index']);
|
||||
const b8 = text(\`: \`);
|
||||
const b9 = text(ctx['item']);
|
||||
const b10 = text(\` \`);
|
||||
const b11 = text(ctx['item_value']);
|
||||
const b12 = text(\`]
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8, b9, b10, b11, b12]), key1);
|
||||
const b4 = text(\` [\`);
|
||||
const b5 = text(ctx['item_index']);
|
||||
const b6 = text(\`: \`);
|
||||
const b7 = text(ctx['item']);
|
||||
const b8 = text(\` \`);
|
||||
const b9 = text(ctx['item_value']);
|
||||
const b10 = text(\`] \`);
|
||||
c_block2[i1] = withKey(multi([b4, b5, b6, b7, b8, b9, b10]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -139,43 +115,36 @@ exports[`t-foreach iterate, dict param 1`] = `
|
||||
exports[`t-foreach iterate, position 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(Array(5));;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`elem\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(Array(5));;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`elem\`] = v_block2[i1];
|
||||
ctx[\`elem_first\`] = i1 === 0;
|
||||
ctx[\`elem_last\`] = i1 === v_block4.length - 1;
|
||||
ctx[\`elem_last\`] = i1 === v_block2.length - 1;
|
||||
ctx[\`elem_index\`] = i1;
|
||||
const key1 = ctx['elem'];
|
||||
let b6,b7,b8,b9,b10,b11;
|
||||
b6 = text(\`
|
||||
-\`);
|
||||
let b4,b5,b6,b7,b8,b9;
|
||||
b4 = text(\` -\`);
|
||||
if (ctx['elem_first']) {
|
||||
b7 = text(\` first\`);
|
||||
b5 = text(\` first\`);
|
||||
}
|
||||
if (ctx['elem_last']) {
|
||||
b8 = text(\` last\`);
|
||||
b6 = text(\` last\`);
|
||||
}
|
||||
b9 = text(\` (\`);
|
||||
b10 = text(ctx['elem_index']);
|
||||
b11 = text(\`)
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8, b9, b10, b11]), key1);
|
||||
b7 = text(\` (\`);
|
||||
b8 = text(ctx['elem_index']);
|
||||
b9 = text(\`) \`);
|
||||
c_block2[i1] = withKey(multi([b4, b5, b6, b7, b8, b9]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -183,27 +152,22 @@ exports[`t-foreach iterate, position 1`] = `
|
||||
exports[`t-foreach simple iteration (in a node) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList([3,2,1]);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`item\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList([3,2,1]);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`item\`] = v_block2[i1];
|
||||
const key1 = ctx['item'];
|
||||
c_block4[i1] = withKey(text(ctx['item']), key1);
|
||||
c_block2[i1] = withKey(text(ctx['item']), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -211,6 +175,7 @@ exports[`t-foreach simple iteration (in a node) 1`] = `
|
||||
exports[`t-foreach simple iteration 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -230,34 +195,26 @@ exports[`t-foreach simple iteration 1`] = `
|
||||
exports[`t-foreach simple iteration with two nodes inside 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block6 = createBlock(\`<span>a<block-text-0/></span>\`);
|
||||
let block8 = createBlock(\`<span>b<block-text-0/></span>\`);
|
||||
let block3 = createBlock(\`<span>a<block-text-0/></span>\`);
|
||||
let block4 = createBlock(\`<span>b<block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block3, v_block3, l_block3, c_block3] = prepareList([3,2,1]);;
|
||||
for (let i1 = 0; i1 < l_block3; i1++) {
|
||||
ctx[\`item\`] = v_block3[i1];
|
||||
const [k_block1, v_block1, l_block1, c_block1] = prepareList([3,2,1]);;
|
||||
for (let i1 = 0; i1 < l_block1; i1++) {
|
||||
ctx[\`item\`] = v_block1[i1];
|
||||
const key1 = ctx['item'];
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['item'];
|
||||
const b6 = block6([txt1]);
|
||||
const b7 = text(\`
|
||||
\`);
|
||||
const b3 = block3([txt1]);
|
||||
let txt2 = ctx['item'];
|
||||
const b8 = block8([txt2]);
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
c_block3[i1] = withKey(multi([b5, b6, b7, b8, b9]), key1);
|
||||
const b4 = block4([txt2]);
|
||||
c_block1[i1] = withKey(multi([b3, b4]), key1);
|
||||
}
|
||||
const b3 = list(c_block3);
|
||||
return multi([b2, b3]);
|
||||
return list(c_block1);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -265,75 +222,53 @@ exports[`t-foreach simple iteration with two nodes inside 1`] = `
|
||||
exports[`t-foreach t-call with body in t-foreach in t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, isBoundary, withDefault, setContextValue, zero, withKey } = helpers;
|
||||
let { prepareList, isBoundary, withDefault, setContextValue, withKey } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
<span>[<block-text-0/>][<block-text-1/>][<block-text-2/>]</span>
|
||||
</div>\`);
|
||||
let block16 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><span>[<block-text-0/>][<block-text-1/>][<block-text-2/>]</span></div>\`);
|
||||
let block6 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['numbers']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`a\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['numbers']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`a\`] = v_block2[i1];
|
||||
ctx[\`a_first\`] = i1 === 0;
|
||||
ctx[\`a_last\`] = i1 === v_block4.length - 1;
|
||||
ctx[\`a_last\`] = i1 === v_block2.length - 1;
|
||||
ctx[\`a_index\`] = i1;
|
||||
ctx[\`a_value\`] = k_block4[i1];
|
||||
ctx[\`a_value\`] = k_block2[i1];
|
||||
const key1 = ctx['a'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block7, v_block7, l_block7, c_block7] = prepareList(ctx['letters']);;
|
||||
for (let i2 = 0; i2 < l_block7; i2++) {
|
||||
ctx[\`b\`] = v_block7[i2];
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['letters']);;
|
||||
for (let i2 = 0; i2 < l_block4; i2++) {
|
||||
ctx[\`b\`] = v_block4[i2];
|
||||
ctx[\`b_first\`] = i2 === 0;
|
||||
ctx[\`b_last\`] = i2 === v_block7.length - 1;
|
||||
ctx[\`b_last\`] = i2 === v_block4.length - 1;
|
||||
ctx[\`b_index\`] = i2;
|
||||
ctx[\`b_value\`] = k_block7[i2];
|
||||
ctx[\`b_value\`] = k_block4[i2];
|
||||
const key2 = ctx['b'];
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
const b11 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"c\\", 'x'+'_'+ctx['a']+'_'+ctx['b']);
|
||||
const b12 = text(\`
|
||||
\`);
|
||||
const b10 = multi([b11, b12]);
|
||||
ctx[zero] = b10;
|
||||
const b13 = callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}__\${key2}\`);
|
||||
c_block4[i2] = withKey(callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}__\${key2}\`), key2);
|
||||
ctx = ctx.__proto__;
|
||||
const b14 = text(\`
|
||||
\`);
|
||||
c_block7[i2] = withKey(multi([b9, b13, b14]), key2);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b7 = list(c_block7);
|
||||
const b15 = text(\`
|
||||
\`);
|
||||
const b4 = list(c_block4);
|
||||
let txt1 = ctx['c'];
|
||||
const b16 = block16([txt1]);
|
||||
const b17 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b15, b16, b17]), key1);
|
||||
const b6 = block6([txt1]);
|
||||
c_block2[i1] = withKey(multi([b4, b6]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b2 = list(c_block2);
|
||||
let txt2 = ctx['a'];
|
||||
let txt3 = ctx['b'];
|
||||
let txt4 = ctx['c'];
|
||||
const b3 = block3([txt2, txt3, txt4], [b4]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt2, txt3, txt4], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -341,23 +276,18 @@ exports[`t-foreach t-call with body in t-foreach in t-foreach 1`] = `
|
||||
exports[`t-foreach t-call with body in t-foreach in t-foreach 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = text(\`
|
||||
[\`);
|
||||
const b4 = text(ctx['a']);
|
||||
const b5 = text(\`]
|
||||
[\`);
|
||||
const b6 = text(ctx['b']);
|
||||
const b7 = text(\`]
|
||||
[\`);
|
||||
const b8 = text(ctx['c']);
|
||||
const b9 = text(\`]
|
||||
\`);
|
||||
return multi([b2, b3, b4, b5, b6, b7, b8, b9]);
|
||||
const b2 = text(\` [\`);
|
||||
const b3 = text(ctx['a']);
|
||||
const b4 = text(\`] [\`);
|
||||
const b5 = text(ctx['b']);
|
||||
const b6 = text(\`] [\`);
|
||||
const b7 = text(ctx['c']);
|
||||
const b8 = text(\`] \`);
|
||||
return multi([b2, b3, b4, b5, b6, b7, b8]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -365,63 +295,47 @@ exports[`t-foreach t-call with body in t-foreach in t-foreach 2`] = `
|
||||
exports[`t-foreach t-call without body in t-foreach in t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
<span>[<block-text-0/>][<block-text-1/>][<block-text-2/>]</span>
|
||||
</div>\`);
|
||||
let block13 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><span>[<block-text-0/>][<block-text-1/>][<block-text-2/>]</span></div>\`);
|
||||
let block6 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['numbers']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`a\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['numbers']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`a\`] = v_block2[i1];
|
||||
ctx[\`a_first\`] = i1 === 0;
|
||||
ctx[\`a_last\`] = i1 === v_block4.length - 1;
|
||||
ctx[\`a_last\`] = i1 === v_block2.length - 1;
|
||||
ctx[\`a_index\`] = i1;
|
||||
ctx[\`a_value\`] = k_block4[i1];
|
||||
ctx[\`a_value\`] = k_block2[i1];
|
||||
const key1 = ctx['a'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block7, v_block7, l_block7, c_block7] = prepareList(ctx['letters']);;
|
||||
for (let i2 = 0; i2 < l_block7; i2++) {
|
||||
ctx[\`b\`] = v_block7[i2];
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['letters']);;
|
||||
for (let i2 = 0; i2 < l_block4; i2++) {
|
||||
ctx[\`b\`] = v_block4[i2];
|
||||
ctx[\`b_first\`] = i2 === 0;
|
||||
ctx[\`b_last\`] = i2 === v_block7.length - 1;
|
||||
ctx[\`b_last\`] = i2 === v_block4.length - 1;
|
||||
ctx[\`b_index\`] = i2;
|
||||
ctx[\`b_value\`] = k_block7[i2];
|
||||
ctx[\`b_value\`] = k_block4[i2];
|
||||
const key2 = ctx['b'];
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
const b10 = callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}__\${key2}\`);
|
||||
const b11 = text(\`
|
||||
\`);
|
||||
c_block7[i2] = withKey(multi([b9, b10, b11]), key2);
|
||||
c_block4[i2] = withKey(callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}__\${key2}\`), key2);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b7 = list(c_block7);
|
||||
const b12 = text(\`
|
||||
\`);
|
||||
const b4 = list(c_block4);
|
||||
let txt1 = ctx['c'];
|
||||
const b13 = block13([txt1]);
|
||||
const b14 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b12, b13, b14]), key1);
|
||||
const b6 = block6([txt1]);
|
||||
c_block2[i1] = withKey(multi([b4, b6]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b2 = list(c_block2);
|
||||
let txt2 = ctx['a'];
|
||||
let txt3 = ctx['b'];
|
||||
let txt4 = ctx['c'];
|
||||
const b3 = block3([txt2, txt3, txt4], [b4]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt2, txt3, txt4], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -429,29 +343,22 @@ exports[`t-foreach t-call without body in t-foreach in t-foreach 1`] = `
|
||||
exports[`t-foreach t-call without body in t-foreach in t-foreach 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"c\\", 'x'+'_'+ctx['a']+'_'+ctx['b']);
|
||||
const b4 = text(\`
|
||||
[\`);
|
||||
const b5 = text(ctx['a']);
|
||||
const b6 = text(\`]
|
||||
[\`);
|
||||
const b7 = text(ctx['b']);
|
||||
const b8 = text(\`]
|
||||
[\`);
|
||||
const b9 = text(ctx['c']);
|
||||
const b10 = text(\`]
|
||||
\`);
|
||||
return multi([b2, b3, b4, b5, b6, b7, b8, b9, b10]);
|
||||
const b2 = text(\` [\`);
|
||||
const b3 = text(ctx['a']);
|
||||
const b4 = text(\`] [\`);
|
||||
const b5 = text(ctx['b']);
|
||||
const b6 = text(\`] [\`);
|
||||
const b7 = text(ctx['c']);
|
||||
const b8 = text(\`] \`);
|
||||
return multi([b2, b3, b4, b5, b6, b7, b8]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -459,46 +366,34 @@ exports[`t-foreach t-call without body in t-foreach in t-foreach 2`] = `
|
||||
exports[`t-foreach t-foreach in t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['numbers']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`number\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['numbers']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`number\`] = v_block2[i1];
|
||||
const key1 = ctx['number'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block7, v_block7, l_block7, c_block7] = prepareList(ctx['letters']);;
|
||||
for (let i2 = 0; i2 < l_block7; i2++) {
|
||||
ctx[\`letter\`] = v_block7[i2];
|
||||
const [k_block3, v_block3, l_block3, c_block3] = prepareList(ctx['letters']);;
|
||||
for (let i2 = 0; i2 < l_block3; i2++) {
|
||||
ctx[\`letter\`] = v_block3[i2];
|
||||
const key2 = ctx['letter'];
|
||||
const b9 = text(\`
|
||||
[\`);
|
||||
const b10 = text(ctx['number']);
|
||||
const b11 = text(ctx['letter']);
|
||||
const b12 = text(\`]
|
||||
\`);
|
||||
c_block7[i2] = withKey(multi([b9, b10, b11, b12]), key2);
|
||||
const b5 = text(\` [\`);
|
||||
const b6 = text(ctx['number']);
|
||||
const b7 = text(ctx['letter']);
|
||||
const b8 = text(\`] \`);
|
||||
c_block3[i2] = withKey(multi([b5, b6, b7, b8]), key2);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b7 = list(c_block7);
|
||||
const b13 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b13]), key1);
|
||||
c_block2[i1] = withKey(list(c_block3), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -506,32 +401,26 @@ exports[`t-foreach t-foreach in t-foreach 1`] = `
|
||||
exports[`t-foreach t-foreach with t-if inside (no external node) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block6 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
let block3 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block3, v_block3, l_block3, c_block3] = prepareList(ctx['elems']);;
|
||||
for (let i1 = 0; i1 < l_block3; i1++) {
|
||||
ctx[\`elem\`] = v_block3[i1];
|
||||
const [k_block1, v_block1, l_block1, c_block1] = prepareList(ctx['elems']);;
|
||||
for (let i1 = 0; i1 < l_block1; i1++) {
|
||||
ctx[\`elem\`] = v_block1[i1];
|
||||
const key1 = ctx['elem'].id;
|
||||
let b5,b6,b7;
|
||||
b5 = text(\`
|
||||
\`);
|
||||
let b3;
|
||||
if (ctx['elem'].id<3) {
|
||||
let txt1 = ctx['elem'].text;
|
||||
b6 = block6([txt1]);
|
||||
b3 = block3([txt1]);
|
||||
}
|
||||
b7 = text(\`
|
||||
\`);
|
||||
c_block3[i1] = withKey(multi([b5, b6, b7]), key1);
|
||||
c_block1[i1] = withKey(multi([b3]), key1);
|
||||
}
|
||||
const b3 = list(c_block3);
|
||||
return multi([b2, b3]);
|
||||
return list(c_block1);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -539,37 +428,28 @@ exports[`t-foreach t-foreach with t-if inside (no external node) 1`] = `
|
||||
exports[`t-foreach t-foreach with t-if inside 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block7 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block4 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['elems']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`elem\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['elems']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`elem\`] = v_block2[i1];
|
||||
const key1 = ctx['elem'].id;
|
||||
let b6,b7,b8;
|
||||
b6 = text(\`
|
||||
\`);
|
||||
let b4;
|
||||
if (ctx['elem'].id<3) {
|
||||
let txt1 = ctx['elem'].text;
|
||||
b7 = block7([txt1]);
|
||||
b4 = block4([txt1]);
|
||||
}
|
||||
b8 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8]), key1);
|
||||
c_block2[i1] = withKey(multi([b4]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -577,33 +457,23 @@ exports[`t-foreach t-foreach with t-if inside 1`] = `
|
||||
exports[`t-foreach t-key on t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block7 = createBlock(\`<span/>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<span/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['things']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`thing\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['things']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`thing\`] = v_block2[i1];
|
||||
const key1 = ctx['thing'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const b7 = block7();
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8]), key1);
|
||||
c_block2[i1] = withKey(block3(), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -611,6 +481,7 @@ exports[`t-foreach t-key on t-foreach 1`] = `
|
||||
exports[`t-foreach throws error if invalid loop expression 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -636,45 +507,37 @@ exports[`t-foreach throws error if invalid loop expression 1`] = `
|
||||
exports[`t-foreach with t-memo 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block5 = createBlock(\`<p>
|
||||
<block-text-0/>
|
||||
<block-text-1/>
|
||||
</p>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<p><block-text-0/><block-text-1/></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let cache = ctx.cache || {};
|
||||
let nextCache = ctx.cache = {};
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['items']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`item\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['items']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`item\`] = v_block2[i1];
|
||||
const key1 = ctx['item'].id;
|
||||
const memo1 = [ctx['item'].x];
|
||||
const vnode1 = cache[key1];;
|
||||
if (vnode1) {
|
||||
if (shallowEqual(vnode1.memo, memo1)) {
|
||||
c_block4[i1] = vnode1;
|
||||
c_block2[i1] = vnode1;
|
||||
nextCache[key1] = vnode1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
let txt1 = ctx['item'].x;
|
||||
let txt2 = ctx['item'].y;
|
||||
c_block4[i1] = withKey(block5([txt1, txt2]), key1);
|
||||
nextCache[key1] = Object.assign(c_block4[i1], {memo: memo1});
|
||||
c_block2[i1] = withKey(block3([txt1, txt2]), key1);
|
||||
nextCache[key1] = Object.assign(c_block2[i1], {memo: memo1});
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-if a t-if next to a div 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block2 = createBlock(\`<div>foo</div>\`);
|
||||
@@ -21,6 +22,7 @@ exports[`t-if a t-if next to a div 1`] = `
|
||||
exports[`t-if a t-if with two inner nodes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<span>yip</span>\`);
|
||||
@@ -41,22 +43,21 @@ exports[`t-if a t-if with two inner nodes 1`] = `
|
||||
exports[`t-if boolean value condition elif (no outside node) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2,b3,b4,b5,b6;
|
||||
b2 = text(\`
|
||||
\`);
|
||||
let b2,b3,b4,b5;
|
||||
if (ctx['color']=='black') {
|
||||
b3 = text(\`black pearl\`);
|
||||
b2 = text(\`black pearl\`);
|
||||
} else if (ctx['color']=='yellow') {
|
||||
b4 = text(\`yellow submarine\`);
|
||||
b3 = text(\`yellow submarine\`);
|
||||
} else if (ctx['color']=='red') {
|
||||
b5 = text(\`red is dead\`);
|
||||
b4 = text(\`red is dead\`);
|
||||
} else {
|
||||
b6 = text(\`beer\`);
|
||||
b5 = text(\`beer\`);
|
||||
}
|
||||
return multi([b2, b3, b4, b5, b6]);
|
||||
return multi([b2, b3, b4, b5]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -64,27 +65,23 @@ exports[`t-if boolean value condition elif (no outside node) 1`] = `
|
||||
exports[`t-if boolean value condition elif 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/><block-child-1/><block-child-2/><block-child-3/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/><block-child-2/><block-child-3/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4,b5,b6,b7;
|
||||
let b2,b3,b4,b5;
|
||||
if (ctx['color']=='black') {
|
||||
b4 = text(\`black pearl\`);
|
||||
b2 = text(\`black pearl\`);
|
||||
} else if (ctx['color']=='yellow') {
|
||||
b5 = text(\`yellow submarine\`);
|
||||
b3 = text(\`yellow submarine\`);
|
||||
} else if (ctx['color']=='red') {
|
||||
b6 = text(\`red is dead\`);
|
||||
b4 = text(\`red is dead\`);
|
||||
} else {
|
||||
b7 = text(\`beer\`);
|
||||
b5 = text(\`beer\`);
|
||||
}
|
||||
const b3 = block3([], [b4, b5, b6, b7]);
|
||||
return multi([b2, b3]);
|
||||
return block1([], [b2, b3, b4, b5]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -92,25 +89,19 @@ exports[`t-if boolean value condition elif 1`] = `
|
||||
exports[`t-if boolean value condition else 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<span>begin</span>
|
||||
<block-child-0/><block-child-1/>
|
||||
<span>end</span>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><span>begin</span><block-child-0/><block-child-1/><span>end</span></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4,b5;
|
||||
let b2,b3;
|
||||
if (ctx['condition']) {
|
||||
b4 = text(\`ok\`);
|
||||
b2 = text(\`ok\`);
|
||||
} else {
|
||||
b5 = text(\`ok-else\`);
|
||||
b3 = text(\`ok-else\`);
|
||||
}
|
||||
const b3 = block3([], [b4, b5]);
|
||||
return multi([b2, b3]);
|
||||
return block1([], [b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -118,21 +109,19 @@ exports[`t-if boolean value condition else 1`] = `
|
||||
exports[`t-if boolean value condition false else 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div><span>begin</span><block-child-0/><block-child-1/><span>end</span></div>\`);
|
||||
let block1 = createBlock(\`<div><span>begin</span><block-child-0/><block-child-1/><span>end</span></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4,b5;
|
||||
let b2,b3;
|
||||
if (ctx['condition']) {
|
||||
b4 = text(\`fail\`);
|
||||
b2 = text(\`fail\`);
|
||||
} else {
|
||||
b5 = text(\`fail-else\`);
|
||||
b3 = text(\`fail-else\`);
|
||||
}
|
||||
const b3 = block3([], [b4, b5]);
|
||||
return multi([b2, b3]);
|
||||
return block1([], [b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -140,6 +129,7 @@ exports[`t-if boolean value condition false else 1`] = `
|
||||
exports[`t-if boolean value condition missing 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
||||
@@ -157,49 +147,38 @@ exports[`t-if boolean value condition missing 1`] = `
|
||||
exports[`t-if can use some boolean operators in expressions 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
<block-child-1/>
|
||||
<block-child-2/>
|
||||
<block-child-3/>
|
||||
<block-child-4/>
|
||||
<block-child-5/>
|
||||
<block-child-6/>
|
||||
<block-child-7/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/><block-child-2/><block-child-3/><block-child-4/><block-child-5/><block-child-6/><block-child-7/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4,b5,b6,b7,b8,b9,b10,b11;
|
||||
let b2,b3,b4,b5,b6,b7,b8,b9;
|
||||
if (ctx['cond1']&&ctx['cond2']) {
|
||||
b4 = text(\`and\`);
|
||||
b2 = text(\`and\`);
|
||||
}
|
||||
if (ctx['cond1']&&ctx['cond3']) {
|
||||
b5 = text(\`nope\`);
|
||||
b3 = text(\`nope\`);
|
||||
}
|
||||
if (ctx['cond1']||ctx['cond3']) {
|
||||
b6 = text(\`or\`);
|
||||
b4 = text(\`or\`);
|
||||
}
|
||||
if (ctx['cond3']||ctx['cond4']) {
|
||||
b7 = text(\`nope\`);
|
||||
b5 = text(\`nope\`);
|
||||
}
|
||||
if (ctx['m']>3) {
|
||||
b8 = text(\`mgt\`);
|
||||
b6 = text(\`mgt\`);
|
||||
}
|
||||
if (ctx['n']>3) {
|
||||
b9 = text(\`ngt\`);
|
||||
b7 = text(\`ngt\`);
|
||||
}
|
||||
if (ctx['m']<3) {
|
||||
b10 = text(\`mlt\`);
|
||||
b8 = text(\`mlt\`);
|
||||
}
|
||||
if (ctx['n']<3) {
|
||||
b11 = text(\`nlt\`);
|
||||
b9 = text(\`nlt\`);
|
||||
}
|
||||
const b3 = block3([], [b4, b5, b6, b7, b8, b9, b10, b11]);
|
||||
return multi([b2, b3]);
|
||||
return block1([], [b2, b3, b4, b5, b6, b7, b8, b9]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -207,6 +186,7 @@ exports[`t-if can use some boolean operators in expressions 1`] = `
|
||||
exports[`t-if div containing a t-if with two inner nodes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
@@ -228,6 +208,7 @@ exports[`t-if div containing a t-if with two inner nodes 1`] = `
|
||||
exports[`t-if dynamic content after t-if with two children nodes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-text-0/></div>\`);
|
||||
@@ -250,6 +231,7 @@ exports[`t-if dynamic content after t-if with two children nodes 1`] = `
|
||||
exports[`t-if just a t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -265,6 +247,7 @@ exports[`t-if just a t-if 1`] = `
|
||||
exports[`t-if simple t-if/t-else 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -282,6 +265,7 @@ exports[`t-if simple t-if/t-else 1`] = `
|
||||
exports[`t-if simple t-if/t-else in a div 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
@@ -301,6 +285,7 @@ exports[`t-if simple t-if/t-else in a div 1`] = `
|
||||
exports[`t-if t-esc with t-elif 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
@@ -320,6 +305,7 @@ exports[`t-if t-esc with t-elif 1`] = `
|
||||
exports[`t-if t-esc with t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
@@ -337,6 +323,7 @@ exports[`t-if t-esc with t-if 1`] = `
|
||||
exports[`t-if t-if and t-else with two nodes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block4 = createBlock(\`<span>a</span>\`);
|
||||
@@ -359,6 +346,7 @@ exports[`t-if t-if and t-else with two nodes 1`] = `
|
||||
exports[`t-if t-if in a div 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
@@ -376,6 +364,7 @@ exports[`t-if t-if in a div 1`] = `
|
||||
exports[`t-if t-if in a t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
@@ -398,6 +387,7 @@ exports[`t-if t-if in a t-if 1`] = `
|
||||
exports[`t-if t-if with empty content 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -414,6 +404,7 @@ exports[`t-if t-if with empty content 1`] = `
|
||||
exports[`t-if t-if/t-else with more content 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -433,26 +424,21 @@ exports[`t-if t-if/t-else with more content 1`] = `
|
||||
exports[`t-if t-set, then t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4;
|
||||
let b2;
|
||||
setContextValue(ctx, \\"title\\", 'test');
|
||||
if (ctx['title']) {
|
||||
b4 = text(ctx['title']);
|
||||
b2 = text(ctx['title']);
|
||||
}
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -460,29 +446,23 @@ exports[`t-if t-set, then t-if 1`] = `
|
||||
exports[`t-if t-set, then t-if, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block4 = createBlock(\`<span>COUCOU</span>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block2 = createBlock(\`<span>COUCOU</span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4;
|
||||
let b2;
|
||||
setContextValue(ctx, \\"y\\", true);
|
||||
setContextValue(ctx, \\"x\\", ctx['y']);
|
||||
if (ctx['x']) {
|
||||
b4 = block4();
|
||||
b2 = block2();
|
||||
}
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -490,32 +470,26 @@ exports[`t-if t-set, then t-if, part 2 1`] = `
|
||||
exports[`t-if t-set, then t-if, part 3 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
|
||||
<block-child-0/><block-child-1/>
|
||||
</div>\`);
|
||||
let block4 = createBlock(\`<span>AAA</span>\`);
|
||||
let block5 = createBlock(\`<span>BBB</span>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
let block2 = createBlock(\`<span>AAA</span>\`);
|
||||
let block3 = createBlock(\`<span>BBB</span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4,b5;
|
||||
let b2,b3;
|
||||
setContextValue(ctx, \\"y\\", false);
|
||||
setContextValue(ctx, \\"x\\", ctx['y']);
|
||||
if (ctx['x']) {
|
||||
b4 = block4();
|
||||
b2 = block2();
|
||||
} else if (!ctx['x']) {
|
||||
b5 = block5();
|
||||
b3 = block3();
|
||||
}
|
||||
const b3 = block3([], [b4, b5]);
|
||||
return multi([b2, b3]);
|
||||
return block1([], [b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -523,6 +497,7 @@ exports[`t-if t-set, then t-if, part 3 1`] = `
|
||||
exports[`t-if two consecutive t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -541,6 +516,7 @@ exports[`t-if two consecutive t-if 1`] = `
|
||||
exports[`t-if two consecutive t-if in a div 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
@@ -561,6 +537,7 @@ exports[`t-if two consecutive t-if in a div 1`] = `
|
||||
exports[`t-if two t-ifs next to each other 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-key can use t-key directive on a node 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -18,6 +19,7 @@ exports[`t-key can use t-key directive on a node 1`] = `
|
||||
exports[`t-key can use t-key directive on a node 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -33,6 +35,7 @@ exports[`t-key can use t-key directive on a node 2 1`] = `
|
||||
exports[`t-key can use t-key directive on a node as a function 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -48,12 +51,11 @@ exports[`t-key can use t-key directive on a node as a function 1`] = `
|
||||
exports[`t-key t-key directive in a list 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<ul>
|
||||
<block-child-0/>
|
||||
</ul>\`);
|
||||
let block1 = createBlock(\`<ul><block-child-0/></ul>\`);
|
||||
let block3 = createBlock(\`<li><block-text-0/></li>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -65,7 +67,6 @@ exports[`t-key t-key directive in a list 1`] = `
|
||||
let txt1 = ctx['beer'].name;
|
||||
c_block2[i1] = withKey(block3([txt1]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
@@ -75,28 +76,21 @@ exports[`t-key t-key directive in a list 1`] = `
|
||||
exports[`t-key t-key on sub dom node pushes a child block in its parent 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
<block-child-1/>
|
||||
</div>\`);
|
||||
let block4 = createBlock(\`<span/>\`);
|
||||
let block5 = createBlock(\`<div><h1/></div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
let block2 = createBlock(\`<span/>\`);
|
||||
let block3 = createBlock(\`<div><h1/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4,b5;
|
||||
let b2,b3;
|
||||
if (ctx['hasSpan']) {
|
||||
b4 = block4();
|
||||
b2 = block2();
|
||||
}
|
||||
const tKey_1 = ctx['key'];
|
||||
b5 = toggler(tKey_1, block5());
|
||||
const b3 = block3([], [b4, b5]);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b6]);
|
||||
b3 = toggler(tKey_1, block3());
|
||||
return block1([], [b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -104,6 +98,7 @@ exports[`t-key t-key on sub dom node pushes a child block in its parent 1`] = `
|
||||
exports[`t-key t-key on sub dom node pushes a child block in its parent 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><h1/></div>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-out literal 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -18,6 +19,7 @@ exports[`t-out literal 1`] = `
|
||||
exports[`t-out literal, no outside html element 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -30,31 +32,21 @@ exports[`t-out literal, no outside html element 1`] = `
|
||||
exports[`t-out multiple calls to t-out 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, zero } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block6 = createBlock(\`<span>coucou</span>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block2 = createBlock(\`<span>coucou</span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
const b6 = block6();
|
||||
const b7 = text(\`
|
||||
\`);
|
||||
const b4 = multi([b5, b6, b7]);
|
||||
ctx[zero] = b4;
|
||||
const b8 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
ctx = ctx.__proto__;
|
||||
const b3 = block3([], [b8]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = block2();
|
||||
ctx[zero] = b2;
|
||||
const b3 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -62,22 +54,16 @@ exports[`t-out multiple calls to t-out 1`] = `
|
||||
exports[`t-out multiple calls to t-out 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { zero } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
<div>Greeter</div>
|
||||
<block-child-1/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><div>Greeter</div><block-child-1/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b4 = ctx[zero];
|
||||
const b5 = ctx[zero];
|
||||
const b3 = block3([], [b4, b5]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = ctx[zero];
|
||||
const b3 = ctx[zero];
|
||||
return block1([], [b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -85,6 +71,7 @@ exports[`t-out multiple calls to t-out 2`] = `
|
||||
exports[`t-out not escaping 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -100,6 +87,7 @@ exports[`t-out not escaping 1`] = `
|
||||
exports[`t-out number literal 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -115,6 +103,7 @@ exports[`t-out number literal 1`] = `
|
||||
exports[`t-out t-out 0 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, zero } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`_basic-callee\`);
|
||||
@@ -136,6 +125,7 @@ exports[`t-out t-out 0 1`] = `
|
||||
exports[`t-out t-out 0 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { zero } = helpers;
|
||||
|
||||
@@ -151,6 +141,7 @@ exports[`t-out t-out 0 2`] = `
|
||||
exports[`t-out t-out and another sibling node 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -166,6 +157,7 @@ exports[`t-out t-out and another sibling node 1`] = `
|
||||
exports[`t-out t-out bdom 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue, safeOutput } = helpers;
|
||||
|
||||
@@ -189,6 +181,7 @@ exports[`t-out t-out bdom 1`] = `
|
||||
exports[`t-out t-out block 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -204,6 +197,7 @@ exports[`t-out t-out block 1`] = `
|
||||
exports[`t-out t-out escaped 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -219,6 +213,7 @@ exports[`t-out t-out escaped 1`] = `
|
||||
exports[`t-out t-out markedup 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -234,14 +229,15 @@ exports[`t-out t-out markedup 1`] = `
|
||||
exports[`t-out t-out on a node with a body, as a default 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
let { safeOutput, withDefault } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b3 = text(\`nope\`);
|
||||
const b2 = safeOutput(ctx['var'], b3);
|
||||
const b2 = withDefault(safeOutput(ctx['var']), b3);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
@@ -250,15 +246,16 @@ exports[`t-out t-out on a node with a body, as a default 1`] = `
|
||||
exports[`t-out t-out on a node with a dom node in body, as a default 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
let { safeOutput, withDefault } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
||||
let block3 = createBlock(\`<div>nope</div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b3 = block3();
|
||||
const b2 = safeOutput(ctx['var'], b3);
|
||||
const b2 = withDefault(safeOutput(ctx['var']), b3);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
@@ -267,6 +264,7 @@ exports[`t-out t-out on a node with a dom node in body, as a default 1`] = `
|
||||
exports[`t-out t-out switch escaped 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -282,6 +280,7 @@ exports[`t-out t-out switch escaped 1`] = `
|
||||
exports[`t-out t-out switch escaped on markup 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -297,6 +296,7 @@ exports[`t-out t-out switch escaped on markup 1`] = `
|
||||
exports[`t-out t-out switch markup 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -312,16 +312,14 @@ exports[`t-out t-out switch markup 1`] = `
|
||||
exports[`t-out t-out switch markup on bdom 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue, safeOutput } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<div>
|
||||
|
||||
<block-child-0/><block-child-1/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
let block2 = createBlock(\`<ol>set</ol>\`);
|
||||
let block3 = createBlock(\`<span><block-child-0/></span>\`);
|
||||
let block5 = createBlock(\`<span><block-child-0/></span>\`);
|
||||
let block10 = createBlock(\`<span><block-child-0/></span>\`);
|
||||
|
||||
function value1(ctx, node, key = \\"\\") {
|
||||
return block2();
|
||||
@@ -330,26 +328,16 @@ exports[`t-out t-out switch markup on bdom 1`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
let b3,b8;
|
||||
let b3,b5;
|
||||
ctx[\`bdom\`] = new LazyValue(value1, ctx, this, node);
|
||||
if (ctx['hasBdom']) {
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
const b6 = safeOutput(ctx['bdom']);
|
||||
const b5 = block5([], [b6]);
|
||||
const b7 = text(\`
|
||||
\`);
|
||||
b3 = multi([b4, b5, b7]);
|
||||
const b4 = safeOutput(ctx['bdom']);
|
||||
b3 = block3([], [b4]);
|
||||
} else {
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
const b11 = safeOutput(ctx['var']);
|
||||
const b10 = block10([], [b11]);
|
||||
const b12 = text(\`
|
||||
\`);
|
||||
b8 = multi([b9, b10, b12]);
|
||||
const b6 = safeOutput(ctx['var']);
|
||||
b5 = block5([], [b6]);
|
||||
}
|
||||
return block1([], [b3, b8]);
|
||||
return block1([], [b3, b5]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -357,6 +345,7 @@ exports[`t-out t-out switch markup on bdom 1`] = `
|
||||
exports[`t-out t-out switch markup on escaped 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -372,6 +361,7 @@ exports[`t-out t-out switch markup on escaped 1`] = `
|
||||
exports[`t-out t-out with a <t/> in body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -384,6 +374,7 @@ exports[`t-out t-out with a <t/> in body 1`] = `
|
||||
exports[`t-out t-out with arbitrary object 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -399,6 +390,7 @@ exports[`t-out t-out with arbitrary object 1`] = `
|
||||
exports[`t-out t-out with arbitrary object 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -414,6 +406,7 @@ exports[`t-out t-out with arbitrary object 2 1`] = `
|
||||
exports[`t-out t-out with comment 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -429,45 +422,7 @@ exports[`t-out t-out with comment 1`] = `
|
||||
exports[`t-out t-out with just a t-set t-value in body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return safeOutput(ctx['var']);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-out t-out with the 0 number 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return safeOutput(ctx['var']);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-out t-out with the 0 number, in a p 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<p><block-child-0/></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = safeOutput(ctx['var']);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-out top level t-out with undefined 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -480,6 +435,7 @@ exports[`t-out top level t-out with undefined 1`] = `
|
||||
exports[`t-out variable 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -495,6 +451,7 @@ exports[`t-out variable 1`] = `
|
||||
exports[`t-out with a String class 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -510,6 +467,7 @@ exports[`t-out with a String class 1`] = `
|
||||
exports[`t-out with an extended String class 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -525,6 +483,7 @@ exports[`t-out with an extended String class 1`] = `
|
||||
exports[`t-raw is deprecated should warn 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -540,6 +499,7 @@ exports[`t-raw is deprecated should warn 1`] = `
|
||||
exports[`t-raw is deprecated t-out is actually called in t-raw's place 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-ref can get a dynamic ref on a node 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><span block-ref=\\"0\\"/></div>\`);
|
||||
@@ -19,6 +20,7 @@ exports[`t-ref can get a dynamic ref on a node 1`] = `
|
||||
exports[`t-ref can get a dynamic ref on a node, alternate syntax 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><span block-ref=\\"0\\"/></div>\`);
|
||||
@@ -35,6 +37,7 @@ exports[`t-ref can get a dynamic ref on a node, alternate syntax 1`] = `
|
||||
exports[`t-ref can get a ref on a node 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><span block-ref=\\"0\\"/></div>\`);
|
||||
@@ -50,6 +53,7 @@ exports[`t-ref can get a ref on a node 1`] = `
|
||||
exports[`t-ref ref in a t-call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
@@ -65,6 +69,7 @@ exports[`t-ref ref in a t-call 1`] = `
|
||||
exports[`t-ref ref in a t-call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>1<span block-ref=\\"0\\"/>2</div>\`);
|
||||
@@ -80,29 +85,20 @@ exports[`t-ref ref in a t-call 2`] = `
|
||||
exports[`t-ref ref in a t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block6 = createBlock(\`<span block-ref=\\"0\\"/>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block2 = createBlock(\`<span block-ref=\\"0\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const refs = ctx.__owl__.refs;
|
||||
const ref1 = (el) => refs[\`name\`] = el;
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4;
|
||||
let b2;
|
||||
if (ctx['condition']) {
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
const b6 = block6([ref1]);
|
||||
const b7 = text(\`
|
||||
\`);
|
||||
b4 = multi([b5, b6, b7]);
|
||||
b2 = block2([ref1]);
|
||||
}
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -110,13 +106,12 @@ exports[`t-ref ref in a t-if 1`] = `
|
||||
exports[`t-ref refs in a loop 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block5 = createBlock(\`<div block-ref=\\"0\\"><block-text-1/></div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<div block-ref=\\"0\\"><block-text-1/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const refs = ctx.__owl__.refs;
|
||||
@@ -125,18 +120,12 @@ exports[`t-ref refs in a loop 1`] = `
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`item\`] = v_block2[i1];
|
||||
const key1 = ctx['item'];
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
const tKey_1 = ctx['item'];
|
||||
const v1 = ctx['item'];
|
||||
let ref1 = (el) => refs[(v1)] = el;
|
||||
let txt1 = ctx['item'];
|
||||
const b5 = toggler(tKey_1, block5([ref1, txt1]));
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
c_block2[i1] = withKey(multi([b4, b5, b6]), key1);
|
||||
c_block2[i1] = withKey(block3([ref1, txt1]), tKey_1 + key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
@@ -146,31 +135,21 @@ exports[`t-ref refs in a loop 1`] = `
|
||||
exports[`t-ref two refs, one in a t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
<p block-ref=\\"0\\"/>
|
||||
</div>\`);
|
||||
let block6 = createBlock(\`<span block-ref=\\"0\\"/>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><p block-ref=\\"0\\"/></div>\`);
|
||||
let block2 = createBlock(\`<span block-ref=\\"0\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const refs = ctx.__owl__.refs;
|
||||
const ref1 = (el) => refs[\`name\`] = el;
|
||||
const ref2 = (el) => refs[\`p\`] = el;
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4;
|
||||
let b2;
|
||||
if (ctx['condition']) {
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
const b6 = block6([ref1]);
|
||||
const b7 = text(\`
|
||||
\`);
|
||||
b4 = multi([b5, b6, b7]);
|
||||
b2 = block2([ref1]);
|
||||
}
|
||||
const b3 = block3([ref2], [b4]);
|
||||
return multi([b2, b3]);
|
||||
return block1([ref2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-set evaluate value expression 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -21,6 +22,7 @@ exports[`t-set evaluate value expression 1`] = `
|
||||
exports[`t-set evaluate value expression, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -39,6 +41,7 @@ exports[`t-set evaluate value expression, part 2 1`] = `
|
||||
exports[`t-set set from attribute literal (no outside div) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -54,6 +57,7 @@ exports[`t-set set from attribute literal (no outside div) 1`] = `
|
||||
exports[`t-set set from attribute literal 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -72,6 +76,7 @@ exports[`t-set set from attribute literal 1`] = `
|
||||
exports[`t-set set from attribute lookup 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -90,37 +95,25 @@ exports[`t-set set from attribute lookup 1`] = `
|
||||
exports[`t-set set from body literal (with t-if/t-else 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue } = helpers;
|
||||
|
||||
function value1(ctx, node, key = \\"\\") {
|
||||
let b5,b6,b7,b8;
|
||||
b5 = text(\`
|
||||
\`);
|
||||
let b2,b3;
|
||||
if (ctx['condition']) {
|
||||
b6 = text(\`true\`);
|
||||
b2 = text(\`true\`);
|
||||
} else {
|
||||
b7 = text(\`false\`);
|
||||
b3 = text(\`false\`);
|
||||
}
|
||||
b8 = text(\`
|
||||
\`);
|
||||
return multi([b5, b6, b7, b8]);
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = text(\`
|
||||
\`);
|
||||
ctx[\`value\`] = new LazyValue(value1, ctx, this, node);
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
const b10 = text(ctx['value']);
|
||||
const b11 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b9, b10, b11]);
|
||||
return text(ctx['value']);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -128,6 +121,7 @@ exports[`t-set set from body literal (with t-if/t-else 1`] = `
|
||||
exports[`t-set set from body literal 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -143,6 +137,7 @@ exports[`t-set set from body literal 1`] = `
|
||||
exports[`t-set set from body lookup 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue } = helpers;
|
||||
|
||||
@@ -165,6 +160,7 @@ exports[`t-set set from body lookup 1`] = `
|
||||
exports[`t-set set from empty body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -183,26 +179,21 @@ exports[`t-set set from empty body 1`] = `
|
||||
exports[`t-set t-set and t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4;
|
||||
let b2;
|
||||
setContextValue(ctx, \\"v\\", ctx['value']);
|
||||
if (ctx['v']==='ok') {
|
||||
b4 = text(\`grimbergen\`);
|
||||
b2 = text(\`grimbergen\`);
|
||||
}
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -210,38 +201,26 @@ exports[`t-set t-set and t-if 1`] = `
|
||||
exports[`t-set t-set body is evaluated immediately 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, LazyValue, safeOutput } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
|
||||
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block6 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block2 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
function value1(ctx, node, key = \\"\\") {
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['v1'];
|
||||
const b6 = block6([txt1]);
|
||||
const b7 = text(\`
|
||||
\`);
|
||||
return multi([b5, b6, b7]);
|
||||
return block2([txt1]);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"v1\\", 'before');
|
||||
ctx[\`v2\`] = new LazyValue(value1, ctx, this, node);
|
||||
setContextValue(ctx, \\"v1\\", 'after');
|
||||
const b8 = safeOutput(ctx['v2']);
|
||||
const b3 = block3([], [b8]);
|
||||
return multi([b2, b3]);
|
||||
const b3 = safeOutput(ctx['v2']);
|
||||
return block1([], [b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -249,30 +228,21 @@ exports[`t-set t-set body is evaluated immediately 1`] = `
|
||||
exports[`t-set t-set can't alter from within callee 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<p><block-text-0/></p>
|
||||
<block-child-0/>
|
||||
<p><block-text-1/></p>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><p><block-text-0/></p><block-child-0/><p><block-text-1/></p></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"iter\\", 'source');
|
||||
let txt1 = ctx['iter'];
|
||||
const b4 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
const b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
let txt2 = ctx['iter'];
|
||||
const b3 = block3([txt1, txt2], [b4]);
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b5]);
|
||||
return block1([txt1, txt2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -280,6 +250,7 @@ exports[`t-set t-set can't alter from within callee 1`] = `
|
||||
exports[`t-set t-set can't alter from within callee 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -299,40 +270,25 @@ exports[`t-set t-set can't alter from within callee 2`] = `
|
||||
exports[`t-set t-set can't alter in t-call body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, zero } = helpers;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<p><block-text-0/></p>
|
||||
<block-child-0/>
|
||||
<p><block-text-1/></p>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><p><block-text-0/></p><block-child-0/><p><block-text-1/></p></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"iter\\", 'source');
|
||||
let txt1 = ctx['iter'];
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"iter\\", 'inCall');
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const b4 = multi([b5, b6]);
|
||||
ctx[zero] = b4;
|
||||
const b7 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
const b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
ctx = ctx.__proto__;
|
||||
let txt2 = ctx['iter'];
|
||||
const b3 = block3([txt1, txt2], [b7]);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b8]);
|
||||
return block1([txt1, txt2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -340,6 +296,7 @@ exports[`t-set t-set can't alter in t-call body 1`] = `
|
||||
exports[`t-set t-set can't alter in t-call body 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -359,6 +316,7 @@ exports[`t-set t-set can't alter in t-call body 2`] = `
|
||||
exports[`t-set t-set does not modify render context existing key values 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -377,25 +335,19 @@ exports[`t-set t-set does not modify render context existing key values 1`] = `
|
||||
exports[`t-set t-set evaluates an expression only once 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<block-text-0/>
|
||||
<block-text-1/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-text-0/><block-text-1/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"v\\", ctx['value']+' artois');
|
||||
let txt1 = ctx['v'];
|
||||
let txt2 = ctx['v'];
|
||||
const b3 = block3([txt1, txt2]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -403,45 +355,30 @@ exports[`t-set t-set evaluates an expression only once 1`] = `
|
||||
exports[`t-set t-set outside modified in t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<block-child-0/>
|
||||
<p>EndLoop: <block-text-0/></p>
|
||||
</div>\`);
|
||||
let block7 = createBlock(\`<p>InLoop: <block-text-0/></p>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><p>EndLoop: <block-text-0/></p></div>\`);
|
||||
let block3 = createBlock(\`<p>InLoop: <block-text-0/></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"iter\\", 0);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(['a','b']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`val\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(['a','b']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`val\`] = v_block2[i1];
|
||||
const key1 = ctx['val'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['iter'];
|
||||
const b7 = block7([txt1]);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
c_block2[i1] = withKey(block3([txt1]), key1);
|
||||
setContextValue(ctx, \\"iter\\", ctx['iter']+1);
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8, b9]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b2 = list(c_block2);
|
||||
let txt2 = ctx['iter'];
|
||||
const b3 = block3([txt2], [b4]);
|
||||
const b10 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b10]);
|
||||
return block1([txt2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -449,45 +386,30 @@ exports[`t-set t-set outside modified in t-foreach 1`] = `
|
||||
exports[`t-set t-set outside modified in t-foreach increment-after operator 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<block-child-0/>
|
||||
<p>EndLoop: <block-text-0/></p>
|
||||
</div>\`);
|
||||
let block7 = createBlock(\`<p>InLoop: <block-text-0/></p>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><p>EndLoop: <block-text-0/></p></div>\`);
|
||||
let block3 = createBlock(\`<p>InLoop: <block-text-0/></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"iter\\", 0);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(['a','b']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`val\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(['a','b']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`val\`] = v_block2[i1];
|
||||
const key1 = ctx['val'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['iter'];
|
||||
const b7 = block7([txt1]);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
c_block2[i1] = withKey(block3([txt1]), key1);
|
||||
setContextValue(ctx, \\"iter\\", ctx['iter']++);
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8, b9]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b2 = list(c_block2);
|
||||
let txt2 = ctx['iter'];
|
||||
const b3 = block3([txt2], [b4]);
|
||||
const b10 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b10]);
|
||||
return block1([txt2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -495,45 +417,30 @@ exports[`t-set t-set outside modified in t-foreach increment-after operator 1`]
|
||||
exports[`t-set t-set outside modified in t-foreach increment-before operator 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<block-child-0/>
|
||||
<p>EndLoop: <block-text-0/></p>
|
||||
</div>\`);
|
||||
let block7 = createBlock(\`<p>InLoop: <block-text-0/></p>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><p>EndLoop: <block-text-0/></p></div>\`);
|
||||
let block3 = createBlock(\`<p>InLoop: <block-text-0/></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"iter\\", 0);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(['a','b']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`val\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(['a','b']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`val\`] = v_block2[i1];
|
||||
const key1 = ctx['val'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['iter'];
|
||||
const b7 = block7([txt1]);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
c_block2[i1] = withKey(block3([txt1]), key1);
|
||||
setContextValue(ctx, \\"iter\\", ++ctx['iter']);
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8, b9]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b2 = list(c_block2);
|
||||
let txt2 = ctx['iter'];
|
||||
const b3 = block3([txt2], [b4]);
|
||||
const b10 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b10]);
|
||||
return block1([txt2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -541,38 +448,29 @@ exports[`t-set t-set outside modified in t-foreach increment-before operator 1`]
|
||||
exports[`t-set t-set should reuse variable if possible 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block5 = createBlock(\`<div>
|
||||
<span>v<block-text-0/></span>
|
||||
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<div><span>v<block-text-0/></span></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"v\\", 1);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['list']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`elem\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['list']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`elem\`] = v_block2[i1];
|
||||
ctx[\`elem_index\`] = i1;
|
||||
const key1 = ctx['elem_index'];
|
||||
let txt1 = ctx['v'];
|
||||
setContextValue(ctx, \\"v\\", ctx['elem']);
|
||||
c_block4[i1] = withKey(block5([txt1]), key1);
|
||||
c_block2[i1] = withKey(block3([txt1]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -580,29 +478,24 @@ exports[`t-set t-set should reuse variable if possible 1`] = `
|
||||
exports[`t-set t-set with content and sub t-esc 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<block-text-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
function value1(ctx, node, key = \\"\\") {
|
||||
const b5 = text(ctx['beep']);
|
||||
const b6 = text(\` boop\`);
|
||||
return multi([b5, b6]);
|
||||
const b3 = text(ctx['beep']);
|
||||
const b4 = text(\` boop\`);
|
||||
return multi([b3, b4]);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx[\`setvar\`] = new LazyValue(value1, ctx, this, node);
|
||||
let txt1 = ctx['setvar'];
|
||||
const b3 = block3([txt1]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -610,42 +503,28 @@ exports[`t-set t-set with content and sub t-esc 1`] = `
|
||||
exports[`t-set t-set with t-value (falsy) and body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, LazyValue, safeOutput } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block6 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block2 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
function value1(ctx, node, key = \\"\\") {
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['v1'];
|
||||
const b6 = block6([txt1]);
|
||||
const b7 = text(\`
|
||||
\`);
|
||||
return multi([b5, b6, b7]);
|
||||
return block2([txt1]);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"v3\\", false);
|
||||
setContextValue(ctx, \\"v1\\", 'before');
|
||||
ctx[\`v2\`] = withDefault(ctx['v3'], new LazyValue(value1, ctx, this, node));
|
||||
setContextValue(ctx, \\"v1\\", 'after');
|
||||
setContextValue(ctx, \\"v3\\", true);
|
||||
const b8 = safeOutput(ctx['v2']);
|
||||
const b3 = block3([], [b8]);
|
||||
return multi([b2, b3]);
|
||||
const b3 = safeOutput(ctx['v2']);
|
||||
return block1([], [b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -653,76 +532,28 @@ exports[`t-set t-set with t-value (falsy) and body 1`] = `
|
||||
exports[`t-set t-set with t-value (truthy) and body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, LazyValue, safeOutput } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block6 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block2 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
function value1(ctx, node, key = \\"\\") {
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['v1'];
|
||||
const b6 = block6([txt1]);
|
||||
const b7 = text(\`
|
||||
\`);
|
||||
return multi([b5, b6, b7]);
|
||||
return block2([txt1]);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"v3\\", 'Truthy');
|
||||
setContextValue(ctx, \\"v1\\", 'before');
|
||||
ctx[\`v2\`] = withDefault(ctx['v3'], new LazyValue(value1, ctx, this, node));
|
||||
setContextValue(ctx, \\"v1\\", 'after');
|
||||
setContextValue(ctx, \\"v3\\", false);
|
||||
const b8 = safeOutput(ctx['v2']);
|
||||
const b3 = block3([], [b8]);
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-set t-set, multiple t-ifs, and a specific configuration 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<p>
|
||||
<div>
|
||||
|
||||
<span>First div</span>
|
||||
</div>
|
||||
<div>
|
||||
<block-child-0/>
|
||||
</div>
|
||||
</p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4;
|
||||
if (ctx['flag']) {
|
||||
setContextValue(ctx, \\"bouh\\", 2);
|
||||
}
|
||||
if (!ctx['flag']) {
|
||||
b4 = text(\`Second\`);
|
||||
}
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b3 = safeOutput(ctx['v2']);
|
||||
return block1([], [b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -730,27 +561,22 @@ exports[`t-set t-set, multiple t-ifs, and a specific configuration 1`] = `
|
||||
exports[`t-set t-set, t-if, and mix of expression/body lookup, 1 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<block-text-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-0/><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
if (ctx['flag']) {
|
||||
setContextValue(ctx, \\"ourvar\\", \`1\`);
|
||||
} else {
|
||||
setContextValue(ctx, \\"ourvar\\", 0);
|
||||
}
|
||||
let txt1 = ctx['ourvar'];
|
||||
const b3 = block3([txt1]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -758,27 +584,22 @@ exports[`t-set t-set, t-if, and mix of expression/body lookup, 1 1`] = `
|
||||
exports[`t-set t-set, t-if, and mix of expression/body lookup, 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<block-text-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-0/><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
if (ctx['flag']) {
|
||||
setContextValue(ctx, \\"ourvar\\", 1);
|
||||
} else {
|
||||
setContextValue(ctx, \\"ourvar\\", \`0\`);
|
||||
}
|
||||
let txt1 = ctx['ourvar'];
|
||||
const b3 = block3([txt1]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -786,24 +607,21 @@ exports[`t-set t-set, t-if, and mix of expression/body lookup, 2 1`] = `
|
||||
exports[`t-set t-set, t-if, and mix of expression/body lookup, 3 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
let b2,b3,b4;
|
||||
b2 = text(\`
|
||||
\`);
|
||||
let b2;
|
||||
if (ctx['flag']) {
|
||||
setContextValue(ctx, \\"ourvar\\", 1);
|
||||
} else {
|
||||
setContextValue(ctx, \\"ourvar\\", \`0\`);
|
||||
}
|
||||
b3 = text(\`
|
||||
\`);
|
||||
b4 = text(ctx['ourvar']);
|
||||
return multi([b2, b3, b4]);
|
||||
b2 = text(ctx['ourvar']);
|
||||
return multi([b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -811,6 +629,7 @@ exports[`t-set t-set, t-if, and mix of expression/body lookup, 3 1`] = `
|
||||
exports[`t-set value priority (with non text body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue } = helpers;
|
||||
|
||||
@@ -834,6 +653,7 @@ exports[`t-set value priority (with non text body 1`] = `
|
||||
exports[`t-set value priority 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`qweb t-tag can fallback if falsy tag 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = tag => createBlock(\`<\${tag || 'fallback'}/>\`);
|
||||
@@ -17,6 +18,7 @@ exports[`qweb t-tag can fallback if falsy tag 1`] = `
|
||||
exports[`qweb t-tag can update 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = tag => createBlock(\`<\${tag || 't'}/>\`);
|
||||
@@ -31,6 +33,7 @@ exports[`qweb t-tag can update 1`] = `
|
||||
exports[`qweb t-tag simple usecases 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = tag => createBlock(\`<\${tag || 't'}/>\`);
|
||||
@@ -45,6 +48,7 @@ exports[`qweb t-tag simple usecases 1`] = `
|
||||
exports[`qweb t-tag simple usecases 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = tag => createBlock(\`<\${tag || 't'}>text</\${tag || 't'}>\`);
|
||||
@@ -59,6 +63,7 @@ exports[`qweb t-tag simple usecases 2`] = `
|
||||
exports[`qweb t-tag with multiple attributes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = tag => createBlock(\`<\${tag || 't'} class=\\"blueberry\\" taste=\\"raspberry\\">gooseberry</\${tag || 't'}>\`);
|
||||
@@ -73,20 +78,14 @@ exports[`qweb t-tag with multiple attributes 1`] = `
|
||||
exports[`qweb t-tag with multiple child nodes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = tag => createBlock(\`<\${tag || 't'}>
|
||||
pear
|
||||
<span>apple</span>
|
||||
strawberry
|
||||
</\${tag || 't'}>\`);
|
||||
let block1 = tag => createBlock(\`<\${tag || 't'}> pear <span>apple</span> strawberry </\${tag || 't'}>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const tag1 = ctx['tag'];
|
||||
const b3 = toggler(tag1, block3(tag1)());
|
||||
return multi([b2, b3]);
|
||||
return toggler(tag1, block1(tag1)());
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -94,6 +93,7 @@ exports[`qweb t-tag with multiple child nodes 1`] = `
|
||||
exports[`qweb t-tag with multiple t-tag in same template 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = tag => createBlock(\`<\${tag || 't'}><block-child-0/></\${tag || 't'}>\`);
|
||||
@@ -111,6 +111,7 @@ exports[`qweb t-tag with multiple t-tag in same template 1`] = `
|
||||
exports[`qweb t-tag with multiple t-tag in same template, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block2 = tag => createBlock(\`<\${tag || 't'}>bar</\${tag || 't'}>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`loading templates addTemplates does not modify its xml document in place 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -17,6 +18,7 @@ exports[`loading templates addTemplates does not modify its xml document in plac
|
||||
exports[`loading templates can initialize qweb with a string 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>jupiler</div>\`);
|
||||
@@ -30,6 +32,7 @@ exports[`loading templates can initialize qweb with a string 1`] = `
|
||||
exports[`loading templates can initialize qweb with an XMLDocument 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>jupiler</div>\`);
|
||||
@@ -43,6 +46,7 @@ exports[`loading templates can initialize qweb with an XMLDocument 1`] = `
|
||||
exports[`loading templates can load a few templates from a xml string 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`items\`);
|
||||
|
||||
@@ -58,6 +62,7 @@ exports[`loading templates can load a few templates from a xml string 1`] = `
|
||||
exports[`loading templates can load a few templates from a xml string 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block2 = createBlock(\`<li>ok</li>\`);
|
||||
@@ -74,6 +79,7 @@ exports[`loading templates can load a few templates from a xml string 2`] = `
|
||||
exports[`loading templates can load a few templates from an XMLDocument 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`items\`);
|
||||
|
||||
@@ -89,6 +95,7 @@ exports[`loading templates can load a few templates from an XMLDocument 1`] = `
|
||||
exports[`loading templates can load a few templates from an XMLDocument 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block2 = createBlock(\`<li>ok</li>\`);
|
||||
|
||||
@@ -3,17 +3,13 @@
|
||||
exports[`translation support can set and remove translatable attributes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div tomato=\\"word\\" potato=\\"mot\\" title=\\"mot\\" label=\\"word\\">text</div>\`);
|
||||
let block1 = createBlock(\`<div tomato=\\"word\\" potato=\\"mot\\" title=\\"mot\\" label=\\"word\\">text</div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = block3();
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1();
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -21,6 +17,7 @@ exports[`translation support can set and remove translatable attributes 1`] = `
|
||||
exports[`translation support can translate node content 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>mot</div>\`);
|
||||
@@ -34,20 +31,13 @@ exports[`translation support can translate node content 1`] = `
|
||||
exports[`translation support does not translate node content if disabled 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<span>mot</span>
|
||||
<span>word</span>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><span>mot</span><span>word</span></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = block3();
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1();
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -55,23 +45,13 @@ exports[`translation support does not translate node content if disabled 1`] = `
|
||||
exports[`translation support some attributes are translated 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<p label=\\"mot\\">mot</p>
|
||||
<p title=\\"mot\\">mot</p>
|
||||
<p placeholder=\\"mot\\">mot</p>
|
||||
<p alt=\\"mot\\">mot</p>
|
||||
<p something=\\"word\\">mot</p>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><p label=\\"mot\\">mot</p><p title=\\"mot\\">mot</p><p placeholder=\\"mot\\">mot</p><p alt=\\"mot\\">mot</p><p something=\\"word\\">mot</p></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = block3();
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1();
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -79,17 +59,13 @@ exports[`translation support some attributes are translated 1`] = `
|
||||
exports[`translation support translation is done on the trimmed text, with extra spaces readded after 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div> mot </div>\`);
|
||||
let block1 = createBlock(\`<div> mot </div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = block3();
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1();
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`white space handling consecutives whitespaces are condensed into a single space 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div> abc </div>\`);
|
||||
@@ -16,6 +17,7 @@ exports[`white space handling consecutives whitespaces are condensed into a sing
|
||||
exports[`white space handling nothing is done in pre tags 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<pre> </pre>\`);
|
||||
@@ -29,6 +31,7 @@ exports[`white space handling nothing is done in pre tags 1`] = `
|
||||
exports[`white space handling nothing is done in pre tags 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<pre>
|
||||
@@ -44,6 +47,7 @@ exports[`white space handling nothing is done in pre tags 2`] = `
|
||||
exports[`white space handling nothing is done in pre tags 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<pre>
|
||||
@@ -59,10 +63,10 @@ exports[`white space handling nothing is done in pre tags 3`] = `
|
||||
exports[`white space handling pre inside a div with a new line 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><pre>SomeText</pre>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><pre>SomeText</pre></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return block1();
|
||||
@@ -73,6 +77,7 @@ exports[`white space handling pre inside a div with a new line 1`] = `
|
||||
exports[`white space handling white space only text nodes are condensed into a single space 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div> </div>\`);
|
||||
@@ -86,11 +91,10 @@ exports[`white space handling white space only text nodes are condensed into a s
|
||||
exports[`white space handling whitespace only text nodes with newlines are removed 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>
|
||||
<span>abc</span>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><span>abc</span></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return block1();
|
||||
|
||||
@@ -67,21 +67,6 @@ describe("t-esc", () => {
|
||||
);
|
||||
});
|
||||
|
||||
test("t-esc with the 0 number", () => {
|
||||
const template = `<t t-esc="var"/>`;
|
||||
expect(renderToString(template, { var: 0 })).toBe("0");
|
||||
});
|
||||
|
||||
test("t-esc with the 0 number, in a p", () => {
|
||||
const template = `<p><t t-esc="var"/></p>`;
|
||||
expect(renderToString(template, { var: 0 })).toBe("<p>0</p>");
|
||||
});
|
||||
|
||||
test("top level t-esc with undefined", () => {
|
||||
const template = `<t t-esc="var"/>`;
|
||||
expect(renderToString(template, { var: undefined })).toBe("");
|
||||
});
|
||||
|
||||
test("falsy values in text nodes", () => {
|
||||
const template = `
|
||||
<t t-esc="v1"/>:<t t-esc="v2"/>:<t t-esc="v3"/>:<t t-esc="v4"/>:<t t-esc="v5"/>`;
|
||||
|
||||
@@ -47,21 +47,6 @@ describe("t-out", () => {
|
||||
expect(renderToString(template, { var: new String("ok") })).toBe("<span>ok</span>");
|
||||
});
|
||||
|
||||
test("t-out with the 0 number", () => {
|
||||
const template = `<t t-out="var"/>`;
|
||||
expect(renderToString(template, { var: 0 })).toBe("0");
|
||||
});
|
||||
|
||||
test("t-out with the 0 number, in a p", () => {
|
||||
const template = `<p><t t-out="var"/></p>`;
|
||||
expect(renderToString(template, { var: 0 })).toBe("<p>0</p>");
|
||||
});
|
||||
|
||||
test("top level t-out with undefined", () => {
|
||||
const template = `<t t-out="var"/>`;
|
||||
expect(renderToString(template, { var: undefined })).toBe("");
|
||||
});
|
||||
|
||||
test("with an extended String class", () => {
|
||||
class LoveString extends String {
|
||||
valueOf(): string {
|
||||
|
||||
@@ -33,22 +33,6 @@ describe("t-set", () => {
|
||||
expect(renderToString(template, { value: "ok" })).toBe("<div>grimbergen</div>");
|
||||
});
|
||||
|
||||
test("t-set, multiple t-ifs, and a specific configuration", () => {
|
||||
const template = `
|
||||
<p>
|
||||
<div>
|
||||
<t t-if="flag" t-set="bouh" t-value="2"/>
|
||||
<span>First div</span>
|
||||
</div>
|
||||
<div>
|
||||
<t t-if="!flag">Second</t>
|
||||
</div>
|
||||
</p>`;
|
||||
expect(renderToString(template)).toBe(
|
||||
"<p><div><span>First div</span></div><div>Second</div></p>"
|
||||
);
|
||||
});
|
||||
|
||||
test("set from body literal", () => {
|
||||
const template = `<t><t t-set="value">ok</t><t t-esc="value"/></t>`;
|
||||
expect(renderToString(template)).toBe("ok");
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,7 @@
|
||||
exports[`event handling Invalid handler throws an error 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">click</button>\`);
|
||||
@@ -17,6 +18,7 @@ exports[`event handling Invalid handler throws an error 1`] = `
|
||||
exports[`event handling handler is not called if component is destroyed 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span block-handler-0=\\"click\\"/>\`);
|
||||
@@ -31,6 +33,7 @@ exports[`event handling handler is not called if component is destroyed 1`] = `
|
||||
exports[`event handling handler receive the event as argument 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -48,6 +51,7 @@ exports[`event handling handler receive the event as argument 1`] = `
|
||||
exports[`event handling handler receive the event as argument 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>simple vnode</div>\`);
|
||||
@@ -61,23 +65,18 @@ exports[`event handling handler receive the event as argument 2`] = `
|
||||
exports[`event handling input blur event is not called if component is destroyed 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
<textarea/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><textarea/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4;
|
||||
let b2;
|
||||
if (ctx['state'].cond) {
|
||||
b4 = comp1({}, key + \`__1\`, node, this, null);
|
||||
b2 = comp1({}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -85,6 +84,7 @@ exports[`event handling input blur event is not called if component is destroyed
|
||||
exports[`event handling input blur event is not called if component is destroyed 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<input block-handler-0=\\"blur\\"/>\`);
|
||||
@@ -99,36 +99,26 @@ exports[`event handling input blur event is not called if component is destroyed
|
||||
exports[`event handling objects from scope are properly captured by t-on 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block7 = createBlock(\`<div class=\\"item\\" block-handler-0=\\"click\\"/>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<div class=\\"item\\" block-handler-0=\\"click\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['items']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`item\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['items']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`item\`] = v_block2[i1];
|
||||
const key1 = ctx['item'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const v1 = ctx['onClick'];
|
||||
const v2 = ctx['item'];
|
||||
let hdlr1 = [_ev=>v1(v2.val,_ev), ctx];
|
||||
const b7 = block7([hdlr1]);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8]), key1);
|
||||
c_block2[i1] = withKey(block3([hdlr1]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -136,17 +126,15 @@ exports[`event handling objects from scope are properly captured by t-on 1`] = `
|
||||
exports[`event handling support for callable expression in event handler 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div><block-text-0/><input type=\\"text\\" block-handler-1=\\"input\\"/></div>\`);
|
||||
let block1 = createBlock(\`<div><block-text-0/><input type=\\"text\\" block-handler-1=\\"input\\"/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['state'].value;
|
||||
let hdlr1 = [ctx['obj'].onInput, ctx];
|
||||
const b3 = block3([txt1, hdlr1]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt1, hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -154,36 +142,26 @@ exports[`event handling support for callable expression in event handler 1`] = `
|
||||
exports[`event handling t-on with handler bound to dynamic argument on a t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block7 = createBlock(\`<div class=\\"item\\" block-handler-0=\\"click\\"/>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<div class=\\"item\\" block-handler-0=\\"click\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['items']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`item\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['items']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`item\`] = v_block2[i1];
|
||||
const key1 = ctx['item'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const v1 = ctx['onClick'];
|
||||
const v2 = ctx['item'];
|
||||
let hdlr1 = [_ev=>v1(v2,_ev), ctx];
|
||||
const b7 = block7([hdlr1]);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8]), key1);
|
||||
c_block2[i1] = withKey(block3([hdlr1]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`basics basic use 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -15,6 +16,7 @@ exports[`basics basic use 1`] = `
|
||||
exports[`basics basic use 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>child<block-text-0/></span>\`);
|
||||
@@ -29,29 +31,20 @@ exports[`basics basic use 2`] = `
|
||||
exports[`basics can select a sub widget 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`OtherChild\`, true, false, false, true);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2,b3,b4,b5,b6,b7,b8;
|
||||
b2 = text(\`
|
||||
\`);
|
||||
b3 = text(\`
|
||||
\`);
|
||||
let b2,b3;
|
||||
if (ctx['env'].options.flag) {
|
||||
b4 = comp1({}, key + \`__1\`, node, this, null);
|
||||
b2 = comp1({}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
b5 = text(\`
|
||||
\`);
|
||||
if (!ctx['env'].options.flag) {
|
||||
b6 = comp2({}, key + \`__2\`, node, this, null);
|
||||
b3 = comp2({}, key + \`__2\`, node, this, null);
|
||||
}
|
||||
b7 = text(\`
|
||||
\`);
|
||||
b8 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4, b5, b6, b7, b8]);
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -59,6 +52,7 @@ exports[`basics can select a sub widget 1`] = `
|
||||
exports[`basics can select a sub widget 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>CHILD 1</span>\`);
|
||||
@@ -72,6 +66,7 @@ exports[`basics can select a sub widget 2`] = `
|
||||
exports[`basics can select a sub widget 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>CHILD 2</div>\`);
|
||||
@@ -85,29 +80,20 @@ exports[`basics can select a sub widget 3`] = `
|
||||
exports[`basics can select a sub widget, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`OtherChild\`, true, false, false, true);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2,b3,b4,b5,b6,b7,b8;
|
||||
b2 = text(\`
|
||||
\`);
|
||||
b3 = text(\`
|
||||
\`);
|
||||
let b2,b3;
|
||||
if (ctx['state'].flag) {
|
||||
b4 = comp1({}, key + \`__1\`, node, this, null);
|
||||
b2 = comp1({}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
b5 = text(\`
|
||||
\`);
|
||||
if (!ctx['state'].flag) {
|
||||
b6 = comp2({}, key + \`__2\`, node, this, null);
|
||||
b3 = comp2({}, key + \`__2\`, node, this, null);
|
||||
}
|
||||
b7 = text(\`
|
||||
\`);
|
||||
b8 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4, b5, b6, b7, b8]);
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -115,6 +101,7 @@ exports[`basics can select a sub widget, part 2 1`] = `
|
||||
exports[`basics can select a sub widget, part 2 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>CHILD 1</span>\`);
|
||||
@@ -128,6 +115,7 @@ exports[`basics can select a sub widget, part 2 2`] = `
|
||||
exports[`basics can select a sub widget, part 2 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>CHILD 2</div>\`);
|
||||
@@ -141,6 +129,7 @@ exports[`basics can select a sub widget, part 2 3`] = `
|
||||
exports[`basics sub widget is interactive 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -153,19 +142,15 @@ exports[`basics sub widget is interactive 1`] = `
|
||||
exports[`basics sub widget is interactive 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<span>
|
||||
<button block-handler-0=\\"click\\">click</button>child<block-text-1/>
|
||||
</span>\`);
|
||||
let block1 = createBlock(\`<span><button block-handler-0=\\"click\\">click</button>child<block-text-1/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let hdlr1 = [ctx['inc'], ctx];
|
||||
let txt1 = ctx['state'].val;
|
||||
const b3 = block3([hdlr1, txt1]);
|
||||
return multi([b2, b3]);
|
||||
return block1([hdlr1, txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -173,6 +158,7 @@ exports[`basics sub widget is interactive 2`] = `
|
||||
exports[`basics top level sub widget with a parent 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, true);
|
||||
|
||||
@@ -188,6 +174,7 @@ exports[`basics top level sub widget with a parent 1`] = `
|
||||
exports[`basics top level sub widget with a parent 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentC\`, true, false, false, true);
|
||||
|
||||
@@ -200,6 +187,7 @@ exports[`basics top level sub widget with a parent 2`] = `
|
||||
exports[`basics top level sub widget with a parent 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>Hello</span>\`);
|
||||
|
||||
@@ -3,26 +3,21 @@
|
||||
exports[`hooks autofocus hook input in a t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<input block-ref=\\"0\\"/>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block4 = createBlock(\`<input block-ref=\\"0\\"/>\`);
|
||||
let block1 = createBlock(\`<div><input block-ref=\\"0\\"/><block-child-0/></div>\`);
|
||||
let block2 = createBlock(\`<input block-ref=\\"0\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const refs = ctx.__owl__.refs;
|
||||
const ref1 = (el) => refs[\`input1\`] = el;
|
||||
const ref2 = (el) => refs[\`input2\`] = el;
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4;
|
||||
let b2;
|
||||
if (ctx['state'].flag) {
|
||||
b4 = block4([ref2]);
|
||||
b2 = block2([ref2]);
|
||||
}
|
||||
const b3 = block3([ref1], [b4]);
|
||||
return multi([b2, b3]);
|
||||
return block1([ref1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -30,21 +25,16 @@ exports[`hooks autofocus hook input in a t-if 1`] = `
|
||||
exports[`hooks autofocus hook simple input 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<input block-ref=\\"0\\"/>
|
||||
<input block-ref=\\"1\\"/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><input block-ref=\\"0\\"/><input block-ref=\\"1\\"/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const refs = ctx.__owl__.refs;
|
||||
const ref1 = (el) => refs[\`input1\`] = el;
|
||||
const ref2 = (el) => refs[\`input2\`] = el;
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = block3([ref1, ref2]);
|
||||
return multi([b2, b3]);
|
||||
return block1([ref1, ref2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -52,6 +42,7 @@ exports[`hooks autofocus hook simple input 1`] = `
|
||||
exports[`hooks can use onWillStart, onWillUpdateProps 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`MyComponent\`, true, false, false, false);
|
||||
|
||||
@@ -64,6 +55,7 @@ exports[`hooks can use onWillStart, onWillUpdateProps 1`] = `
|
||||
exports[`hooks can use onWillStart, onWillUpdateProps 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -78,6 +70,7 @@ exports[`hooks can use onWillStart, onWillUpdateProps 2`] = `
|
||||
exports[`hooks can use useComponent 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -91,6 +84,7 @@ exports[`hooks can use useComponent 1`] = `
|
||||
exports[`hooks can use useEnv 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -105,6 +99,7 @@ exports[`hooks can use useEnv 1`] = `
|
||||
exports[`hooks mounted callbacks should be called in reverse order from willUnmount callbacks 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
||||
@@ -119,6 +114,7 @@ exports[`hooks mounted callbacks should be called in reverse order from willUnmo
|
||||
exports[`hooks parent and child env (with useChildSubEnv then useSubEnv) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -133,6 +129,7 @@ exports[`hooks parent and child env (with useChildSubEnv then useSubEnv) 1`] = `
|
||||
exports[`hooks parent and child env (with useChildSubEnv then useSubEnv) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block2 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -151,6 +148,7 @@ exports[`hooks parent and child env (with useChildSubEnv then useSubEnv) 2`] = `
|
||||
exports[`hooks parent and child env (with useChildSubEnv) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -165,6 +163,7 @@ exports[`hooks parent and child env (with useChildSubEnv) 1`] = `
|
||||
exports[`hooks parent and child env (with useChildSubEnv) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -179,6 +178,7 @@ exports[`hooks parent and child env (with useChildSubEnv) 2`] = `
|
||||
exports[`hooks parent and child env (with useSubEnv) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -193,6 +193,7 @@ exports[`hooks parent and child env (with useSubEnv) 1`] = `
|
||||
exports[`hooks parent and child env (with useSubEnv) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -207,6 +208,7 @@ exports[`hooks parent and child env (with useSubEnv) 2`] = `
|
||||
exports[`hooks two different call to willPatch/patched should work 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
||||
@@ -221,6 +223,7 @@ exports[`hooks two different call to willPatch/patched should work 1`] = `
|
||||
exports[`hooks useChildSubEnv does not pollute user env 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -235,6 +238,7 @@ exports[`hooks useChildSubEnv does not pollute user env 1`] = `
|
||||
exports[`hooks useChildSubEnv supports arbitrary descriptor 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -247,6 +251,7 @@ exports[`hooks useChildSubEnv supports arbitrary descriptor 1`] = `
|
||||
exports[`hooks useChildSubEnv supports arbitrary descriptor 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/> <block-text-1/></div>\`);
|
||||
@@ -262,6 +267,7 @@ exports[`hooks useChildSubEnv supports arbitrary descriptor 2`] = `
|
||||
exports[`hooks useEffect hook dependencies prevent effects from rerunning when unchanged 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -275,25 +281,19 @@ exports[`hooks useEffect hook dependencies prevent effects from rerunning when u
|
||||
exports[`hooks useEffect hook effect can depend on stuff in dom 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block5 = createBlock(\`<div block-ref=\\"0\\"/>\`);
|
||||
let block2 = createBlock(\`<div block-ref=\\"0\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const refs = ctx.__owl__.refs;
|
||||
const ref1 = (el) => refs[\`div\`] = el;
|
||||
let b2,b3;
|
||||
b2 = text(\`
|
||||
\`);
|
||||
let b2;
|
||||
if (ctx['state'].value) {
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
const b5 = block5([ref1]);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
b3 = multi([b4, b5, b6]);
|
||||
b2 = block2([ref1]);
|
||||
}
|
||||
return multi([b2, b3]);
|
||||
return multi([b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -301,6 +301,7 @@ exports[`hooks useEffect hook effect can depend on stuff in dom 1`] = `
|
||||
exports[`hooks useEffect hook effect runs on mount, is reapplied on patch, and is cleaned up on unmount and before reapplying 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -314,6 +315,7 @@ exports[`hooks useEffect hook effect runs on mount, is reapplied on patch, and i
|
||||
exports[`hooks useEffect hook effect with empty dependency list never reruns 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -328,6 +330,7 @@ exports[`hooks useEffect hook effect with empty dependency list never reruns 1`]
|
||||
exports[`hooks useEffect hook properly behaves when the effect function throws 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -341,6 +344,7 @@ exports[`hooks useEffect hook properly behaves when the effect function throws 1
|
||||
exports[`hooks useExternalListener 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`MyComponent\`, true, false, false, true);
|
||||
|
||||
@@ -357,6 +361,7 @@ exports[`hooks useExternalListener 1`] = `
|
||||
exports[`hooks useExternalListener 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -371,6 +376,7 @@ exports[`hooks useExternalListener 2`] = `
|
||||
exports[`hooks useRef hook: basic use 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><button block-ref=\\"0\\"><block-text-1/></button></div>\`);
|
||||
@@ -387,6 +393,7 @@ exports[`hooks useRef hook: basic use 1`] = `
|
||||
exports[`hooks useSubEnv modifies user env 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -401,6 +408,7 @@ exports[`hooks useSubEnv modifies user env 1`] = `
|
||||
exports[`hooks useSubEnv supports arbitrary descriptor 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -413,6 +421,7 @@ exports[`hooks useSubEnv supports arbitrary descriptor 1`] = `
|
||||
exports[`hooks useSubEnv supports arbitrary descriptor 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/> <block-text-1/></div>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`lifecycle hooks basic checks for a component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>test</span>\`);
|
||||
@@ -16,6 +17,7 @@ exports[`lifecycle hooks basic checks for a component 1`] = `
|
||||
exports[`lifecycle hooks component semantics 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`C\`, true, false, false, true);
|
||||
@@ -33,6 +35,7 @@ exports[`lifecycle hooks component semantics 1`] = `
|
||||
exports[`lifecycle hooks component semantics 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>B</div>\`);
|
||||
@@ -46,27 +49,23 @@ exports[`lifecycle hooks component semantics 2`] = `
|
||||
exports[`lifecycle hooks component semantics 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`D\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`E\`, true, false, false, true);
|
||||
const comp3 = app.createComponent(\`F\`, true, false, false, true);
|
||||
|
||||
let block3 = createBlock(\`<div>C<block-child-0/>
|
||||
<block-child-1/><block-child-2/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div>C<block-child-0/><block-child-1/><block-child-2/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4,b5,b6;
|
||||
b4 = comp1({}, key + \`__1\`, node, this, null);
|
||||
let b2,b3,b4;
|
||||
b2 = comp1({}, key + \`__1\`, node, this, null);
|
||||
if (ctx['state'].flag) {
|
||||
b5 = comp2({}, key + \`__2\`, node, this, null);
|
||||
b3 = comp2({}, key + \`__2\`, node, this, null);
|
||||
} else {
|
||||
b6 = comp3({}, key + \`__3\`, node, this, null);
|
||||
b4 = comp3({}, key + \`__3\`, node, this, null);
|
||||
}
|
||||
const b3 = block3([], [b4, b5, b6]);
|
||||
return multi([b2, b3]);
|
||||
return block1([], [b2, b3, b4]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -74,6 +73,7 @@ exports[`lifecycle hooks component semantics 3`] = `
|
||||
exports[`lifecycle hooks component semantics 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>D</div>\`);
|
||||
@@ -87,6 +87,7 @@ exports[`lifecycle hooks component semantics 4`] = `
|
||||
exports[`lifecycle hooks component semantics 5`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>E</div>\`);
|
||||
@@ -100,6 +101,7 @@ exports[`lifecycle hooks component semantics 5`] = `
|
||||
exports[`lifecycle hooks component semantics 6`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>F</div>\`);
|
||||
@@ -113,24 +115,19 @@ exports[`lifecycle hooks component semantics 6`] = `
|
||||
exports[`lifecycle hooks components are unmounted and destroyed if no longer in DOM, even after updateprops 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block2 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2,b3,b5;
|
||||
b2 = text(\`
|
||||
\`);
|
||||
let b2;
|
||||
if (ctx['state'].flag) {
|
||||
const b4 = comp1({n: ctx['state'].n}, key + \`__1\`, node, this, null);
|
||||
b3 = block3([], [b4]);
|
||||
const b3 = comp1({n: ctx['state'].n}, key + \`__1\`, node, this, null);
|
||||
b2 = block2([], [b3]);
|
||||
}
|
||||
b5 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b5]);
|
||||
return multi([b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -138,6 +135,7 @@ exports[`lifecycle hooks components are unmounted and destroyed if no longer in
|
||||
exports[`lifecycle hooks components are unmounted and destroyed if no longer in DOM, even after updateprops 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -152,6 +150,7 @@ exports[`lifecycle hooks components are unmounted and destroyed if no longer in
|
||||
exports[`lifecycle hooks components are unmounted destroyed if no longer in DOM 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -168,6 +167,7 @@ exports[`lifecycle hooks components are unmounted destroyed if no longer in DOM
|
||||
exports[`lifecycle hooks components are unmounted destroyed if no longer in DOM 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -181,6 +181,7 @@ exports[`lifecycle hooks components are unmounted destroyed if no longer in DOM
|
||||
exports[`lifecycle hooks destroy new children before being mountged 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -199,6 +200,7 @@ exports[`lifecycle hooks destroy new children before being mountged 1`] = `
|
||||
exports[`lifecycle hooks destroy new children before being mountged 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -210,6 +212,7 @@ exports[`lifecycle hooks destroy new children before being mountged 2`] = `
|
||||
exports[`lifecycle hooks hooks are called in proper order in widget creation/destruction 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -225,6 +228,7 @@ exports[`lifecycle hooks hooks are called in proper order in widget creation/des
|
||||
exports[`lifecycle hooks hooks are called in proper order in widget creation/destruction 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -238,6 +242,7 @@ exports[`lifecycle hooks hooks are called in proper order in widget creation/des
|
||||
exports[`lifecycle hooks lifecycle callbacks are bound to component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Test\`, true, false, false, false);
|
||||
|
||||
@@ -250,6 +255,7 @@ exports[`lifecycle hooks lifecycle callbacks are bound to component 1`] = `
|
||||
exports[`lifecycle hooks lifecycle callbacks are bound to component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -261,6 +267,7 @@ exports[`lifecycle hooks lifecycle callbacks are bound to component 2`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -276,6 +283,7 @@ exports[`lifecycle hooks lifecycle semantics 1`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -289,6 +297,7 @@ exports[`lifecycle hooks lifecycle semantics 2`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -305,6 +314,7 @@ exports[`lifecycle hooks lifecycle semantics, part 2 1`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 2 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`GrandChild\`, true, false, false, true);
|
||||
|
||||
@@ -317,6 +327,7 @@ exports[`lifecycle hooks lifecycle semantics, part 2 2`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 2 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -330,6 +341,7 @@ exports[`lifecycle hooks lifecycle semantics, part 2 3`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 3 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -346,6 +358,7 @@ exports[`lifecycle hooks lifecycle semantics, part 3 1`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 4 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -362,6 +375,7 @@ exports[`lifecycle hooks lifecycle semantics, part 4 1`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 4 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`GrandChild\`, true, false, false, true);
|
||||
|
||||
@@ -374,6 +388,7 @@ exports[`lifecycle hooks lifecycle semantics, part 4 2`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 4 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -387,6 +402,7 @@ exports[`lifecycle hooks lifecycle semantics, part 4 3`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 5 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -403,6 +419,7 @@ exports[`lifecycle hooks lifecycle semantics, part 5 1`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 5 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -416,6 +433,7 @@ exports[`lifecycle hooks lifecycle semantics, part 5 2`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 6 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -428,6 +446,7 @@ exports[`lifecycle hooks lifecycle semantics, part 6 1`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 6 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -441,6 +460,7 @@ exports[`lifecycle hooks lifecycle semantics, part 6 2`] = `
|
||||
exports[`lifecycle hooks mounted hook is called if mounted in DOM 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -454,6 +474,7 @@ exports[`lifecycle hooks mounted hook is called if mounted in DOM 1`] = `
|
||||
exports[`lifecycle hooks mounted hook is called on every mount, not just the first one 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -470,6 +491,7 @@ exports[`lifecycle hooks mounted hook is called on every mount, not just the fir
|
||||
exports[`lifecycle hooks mounted hook is called on every mount, not just the first one 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>child</div>\`);
|
||||
@@ -483,6 +505,7 @@ exports[`lifecycle hooks mounted hook is called on every mount, not just the fir
|
||||
exports[`lifecycle hooks mounted hook is called on subcomponents, in proper order 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -498,6 +521,7 @@ exports[`lifecycle hooks mounted hook is called on subcomponents, in proper orde
|
||||
exports[`lifecycle hooks mounted hook is called on subcomponents, in proper order 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -511,6 +535,7 @@ exports[`lifecycle hooks mounted hook is called on subcomponents, in proper orde
|
||||
exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper order 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -529,6 +554,7 @@ exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper o
|
||||
exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper order 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ChildChild\`, true, false, false, true);
|
||||
|
||||
@@ -544,6 +570,7 @@ exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper o
|
||||
exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper order 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -557,14 +584,12 @@ exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper o
|
||||
exports[`lifecycle hooks onWillRender 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = comp1({someValue: ctx['state'].value}, key + \`__1\`, node, this, null);
|
||||
return multi([b2, b3]);
|
||||
return comp1({someValue: ctx['state'].value}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -572,6 +597,7 @@ exports[`lifecycle hooks onWillRender 1`] = `
|
||||
exports[`lifecycle hooks onWillRender 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-text-1/></button>\`);
|
||||
@@ -587,6 +613,7 @@ exports[`lifecycle hooks onWillRender 2`] = `
|
||||
exports[`lifecycle hooks patched hook is called after updateProps 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -602,6 +629,7 @@ exports[`lifecycle hooks patched hook is called after updateProps 1`] = `
|
||||
exports[`lifecycle hooks patched hook is called after updateProps 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -615,6 +643,7 @@ exports[`lifecycle hooks patched hook is called after updateProps 2`] = `
|
||||
exports[`lifecycle hooks patched hook is called after updating State 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -629,6 +658,7 @@ exports[`lifecycle hooks patched hook is called after updating State 1`] = `
|
||||
exports[`lifecycle hooks render in mounted 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -643,6 +673,7 @@ exports[`lifecycle hooks render in mounted 1`] = `
|
||||
exports[`lifecycle hooks render in patched 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -657,6 +688,7 @@ exports[`lifecycle hooks render in patched 1`] = `
|
||||
exports[`lifecycle hooks render in willPatch 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -671,6 +703,7 @@ exports[`lifecycle hooks render in willPatch 1`] = `
|
||||
exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly called 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -687,6 +720,7 @@ exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly calle
|
||||
exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly called 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -700,6 +734,7 @@ exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly calle
|
||||
exports[`lifecycle hooks timeout in onWillStart emits a warning 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span/>\`);
|
||||
@@ -713,6 +748,7 @@ exports[`lifecycle hooks timeout in onWillStart emits a warning 1`] = `
|
||||
exports[`lifecycle hooks timeout in onWillUpdateProps emits a warning 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -727,6 +763,7 @@ exports[`lifecycle hooks timeout in onWillUpdateProps emits a warning 1`] = `
|
||||
exports[`lifecycle hooks timeout in onWillUpdateProps emits a warning 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -738,19 +775,15 @@ exports[`lifecycle hooks timeout in onWillUpdateProps emits a warning 2`] = `
|
||||
exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents, in proper order 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
let block3 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b4 = comp1({n: ctx['state'].n}, key + \`__1\`, node, this, null);
|
||||
const b3 = block3([], [b4]);
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b5]);
|
||||
const b2 = comp1({n: ctx['state'].n}, key + \`__1\`, node, this, null);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -758,19 +791,15 @@ exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents,
|
||||
exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents, in proper order 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ChildChild\`, true, false, false, false);
|
||||
|
||||
let block3 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b4 = comp1({n: ctx['props'].n}, key + \`__1\`, node, this, null);
|
||||
const b3 = block3([], [b4]);
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b5]);
|
||||
const b2 = comp1({n: ctx['props'].n}, key + \`__1\`, node, this, null);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -778,18 +807,14 @@ exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents,
|
||||
exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents, in proper order 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['props'].n;
|
||||
const b3 = block3([txt1]);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -797,6 +822,7 @@ exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents,
|
||||
exports[`lifecycle hooks willStart hook is called on sub component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -809,6 +835,7 @@ exports[`lifecycle hooks willStart hook is called on sub component 1`] = `
|
||||
exports[`lifecycle hooks willStart hook is called on sub component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -822,6 +849,7 @@ exports[`lifecycle hooks willStart hook is called on sub component 2`] = `
|
||||
exports[`lifecycle hooks willStart is called 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>simple vnode</span>\`);
|
||||
@@ -835,6 +863,7 @@ exports[`lifecycle hooks willStart is called 1`] = `
|
||||
exports[`lifecycle hooks willStart is called with component as this 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>simple vnode</span>\`);
|
||||
@@ -848,35 +877,21 @@ exports[`lifecycle hooks willStart is called with component as this 1`] = `
|
||||
exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is mounted in some other position 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/><block-child-1/>
|
||||
</div>\`);
|
||||
let block10 = createBlock(\`<div/>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
let block3 = createBlock(\`<div/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4,b8;
|
||||
let b2,b3;
|
||||
if (ctx['state'].ok) {
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
const b6 = comp1({}, key + \`__1\`, node, this, null);
|
||||
const b7 = text(\`
|
||||
\`);
|
||||
b4 = multi([b5, b6, b7]);
|
||||
b2 = comp1({}, key + \`__1\`, node, this, null);
|
||||
} else {
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
const b10 = block10();
|
||||
const b11 = text(\`
|
||||
\`);
|
||||
b8 = multi([b9, b10, b11]);
|
||||
b3 = block3();
|
||||
}
|
||||
const b3 = block3([], [b4, b8]);
|
||||
return multi([b2, b3]);
|
||||
return block1([], [b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -884,6 +899,7 @@ exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is
|
||||
exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is mounted in some other position 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -897,6 +913,7 @@ exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is
|
||||
exports[`lifecycle hooks willUpdateProps hook is called 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -909,6 +926,7 @@ exports[`lifecycle hooks willUpdateProps hook is called 1`] = `
|
||||
exports[`lifecycle hooks willUpdateProps hook is called 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`basics accept ES6-like syntax for props (with getters) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -18,6 +19,7 @@ exports[`basics accept ES6-like syntax for props (with getters) 1`] = `
|
||||
exports[`basics accept ES6-like syntax for props (with getters) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -32,32 +34,22 @@ exports[`basics accept ES6-like syntax for props (with getters) 2`] = `
|
||||
exports[`basics arrow functions as prop correctly capture their scope 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block3, v_block3, l_block3, c_block3] = prepareList(ctx['items']);;
|
||||
for (let i1 = 0; i1 < l_block3; i1++) {
|
||||
ctx[\`item\`] = v_block3[i1];
|
||||
const [k_block1, v_block1, l_block1, c_block1] = prepareList(ctx['items']);;
|
||||
for (let i1 = 0; i1 < l_block1; i1++) {
|
||||
ctx[\`item\`] = v_block1[i1];
|
||||
const key1 = ctx['item'].val;
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
const v1 = ctx['onClick'];
|
||||
const v2 = ctx['item'];
|
||||
const b6 = comp1({onClick: _ev=>v1(v2.val,_ev)}, key + \`__1__\${key1}\`, node, this, null);
|
||||
const b7 = text(\`
|
||||
\`);
|
||||
c_block3[i1] = withKey(multi([b5, b6, b7]), key1);
|
||||
c_block1[i1] = withKey(comp1({onClick: _ev=>v1(v2.val,_ev)}, key + \`__1__\${key1}\`, node, this, null), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b3 = list(c_block3);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b8]);
|
||||
return list(c_block1);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -65,6 +57,7 @@ exports[`basics arrow functions as prop correctly capture their scope 1`] = `
|
||||
exports[`basics arrow functions as prop correctly capture their scope 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\"/>\`);
|
||||
@@ -79,6 +72,7 @@ exports[`basics arrow functions as prop correctly capture their scope 2`] = `
|
||||
exports[`basics explicit object prop 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -94,6 +88,7 @@ exports[`basics explicit object prop 1`] = `
|
||||
exports[`basics explicit object prop 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -108,6 +103,7 @@ exports[`basics explicit object prop 2`] = `
|
||||
exports[`basics prop names can contain - 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -120,6 +116,7 @@ exports[`basics prop names can contain - 1`] = `
|
||||
exports[`basics prop names can contain - 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -134,6 +131,7 @@ exports[`basics prop names can contain - 2`] = `
|
||||
exports[`basics support prop names that aren't valid bare object property names 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -146,6 +144,7 @@ exports[`basics support prop names that aren't valid bare object property names
|
||||
exports[`basics support prop names that aren't valid bare object property names 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\"/>\`);
|
||||
@@ -160,29 +159,24 @@ exports[`basics support prop names that aren't valid bare object property names
|
||||
exports[`basics t-set with a body expression can be passed in props, and then t-out 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block4 = createBlock(\`<p>43</p>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block2 = createBlock(\`<p>43</p>\`);
|
||||
|
||||
function value1(ctx, node, key = \\"\\") {
|
||||
return block4();
|
||||
return block2();
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx[\`abc\`] = new LazyValue(value1, ctx, this, node);
|
||||
const b5 = comp1({val: ctx['abc']}, key + \`__1\`, node, this, null);
|
||||
const b3 = block3([], [b5]);
|
||||
return multi([b2, b3]);
|
||||
const b3 = comp1({val: ctx['abc']}, key + \`__1\`, node, this, null);
|
||||
return block1([], [b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -190,21 +184,16 @@ exports[`basics t-set with a body expression can be passed in props, and then t-
|
||||
exports[`basics t-set with a body expression can be passed in props, and then t-out 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<span>
|
||||
<block-text-0/>
|
||||
<block-child-0/>
|
||||
</span>\`);
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-child-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['props'].val;
|
||||
const b4 = safeOutput(ctx['props'].val);
|
||||
const b3 = block3([txt1], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = safeOutput(ctx['props'].val);
|
||||
return block1([txt1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -212,24 +201,19 @@ exports[`basics t-set with a body expression can be passed in props, and then t-
|
||||
exports[`basics t-set with a body expression can be used as textual prop 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"abc\\", \`42\`);
|
||||
const b4 = comp1({val: ctx['abc']}, key + \`__1\`, node, this, null);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = comp1({val: ctx['abc']}, key + \`__1\`, node, this, null);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -237,6 +221,7 @@ exports[`basics t-set with a body expression can be used as textual prop 1`] = `
|
||||
exports[`basics t-set with a body expression can be used as textual prop 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -251,24 +236,19 @@ exports[`basics t-set with a body expression can be used as textual prop 2`] = `
|
||||
exports[`basics t-set works 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"val\\", 42);
|
||||
const b4 = comp1({val: ctx['val']}, key + \`__1\`, node, this, null);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = comp1({val: ctx['val']}, key + \`__1\`, node, this, null);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -276,6 +256,7 @@ exports[`basics t-set works 1`] = `
|
||||
exports[`basics t-set works 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -290,6 +271,7 @@ exports[`basics t-set works 2`] = `
|
||||
exports[`basics template string in prop 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -302,6 +284,7 @@ exports[`basics template string in prop 1`] = `
|
||||
exports[`basics template string in prop 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -313,6 +296,7 @@ exports[`basics template string in prop 2`] = `
|
||||
exports[`bound functions is referentially equal after update 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { bind } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -326,6 +310,7 @@ exports[`bound functions is referentially equal after update 1`] = `
|
||||
exports[`bound functions is referentially equal after update 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -337,6 +322,7 @@ exports[`bound functions is referentially equal after update 2`] = `
|
||||
exports[`can bind function prop with bind suffix 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { bind } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -350,6 +336,7 @@ exports[`can bind function prop with bind suffix 1`] = `
|
||||
exports[`can bind function prop with bind suffix 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`default props a default prop cannot be defined on a mandatory prop 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -17,6 +18,7 @@ exports[`default props a default prop cannot be defined on a mandatory prop 1`]
|
||||
exports[`default props can set default boolean values 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, true);
|
||||
|
||||
@@ -34,6 +36,7 @@ exports[`default props can set default boolean values 1`] = `
|
||||
exports[`default props can set default boolean values 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-child-0/><block-child-1/></span>\`);
|
||||
@@ -54,6 +57,7 @@ exports[`default props can set default boolean values 2`] = `
|
||||
exports[`default props can set default values 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, true);
|
||||
|
||||
@@ -71,6 +75,7 @@ exports[`default props can set default values 1`] = `
|
||||
exports[`default props can set default values 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -85,6 +90,7 @@ exports[`default props can set default values 2`] = `
|
||||
exports[`default props default values are also set whenever component is updated 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -102,6 +108,7 @@ exports[`default props default values are also set whenever component is updated
|
||||
exports[`default props default values are also set whenever component is updated 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -116,6 +123,7 @@ exports[`default props default values are also set whenever component is updated
|
||||
exports[`props validation can specify that additional props are allowed (array) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -130,6 +138,7 @@ exports[`props validation can specify that additional props are allowed (array)
|
||||
exports[`props validation can specify that additional props are allowed (array) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -143,6 +152,7 @@ exports[`props validation can specify that additional props are allowed (array)
|
||||
exports[`props validation can specify that additional props are allowed (object) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -157,6 +167,7 @@ exports[`props validation can specify that additional props are allowed (object)
|
||||
exports[`props validation can specify that additional props are allowed (object) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -170,6 +181,7 @@ exports[`props validation can specify that additional props are allowed (object)
|
||||
exports[`props validation can validate a prop with multiple types 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -187,6 +199,7 @@ exports[`props validation can validate a prop with multiple types 1`] = `
|
||||
exports[`props validation can validate a prop with multiple types 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -200,6 +213,7 @@ exports[`props validation can validate a prop with multiple types 2`] = `
|
||||
exports[`props validation can validate a prop with multiple types 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -217,6 +231,7 @@ exports[`props validation can validate a prop with multiple types 3`] = `
|
||||
exports[`props validation can validate a prop with multiple types 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -230,6 +245,7 @@ exports[`props validation can validate a prop with multiple types 4`] = `
|
||||
exports[`props validation can validate a prop with multiple types 5`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -247,6 +263,7 @@ exports[`props validation can validate a prop with multiple types 5`] = `
|
||||
exports[`props validation can validate an array with given primitive type 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -264,6 +281,7 @@ exports[`props validation can validate an array with given primitive type 1`] =
|
||||
exports[`props validation can validate an array with given primitive type 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -277,6 +295,7 @@ exports[`props validation can validate an array with given primitive type 2`] =
|
||||
exports[`props validation can validate an array with given primitive type 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -294,6 +313,7 @@ exports[`props validation can validate an array with given primitive type 3`] =
|
||||
exports[`props validation can validate an array with given primitive type 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -307,6 +327,7 @@ exports[`props validation can validate an array with given primitive type 4`] =
|
||||
exports[`props validation can validate an array with given primitive type 5`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -324,6 +345,7 @@ exports[`props validation can validate an array with given primitive type 5`] =
|
||||
exports[`props validation can validate an array with given primitive type 6`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -341,6 +363,7 @@ exports[`props validation can validate an array with given primitive type 6`] =
|
||||
exports[`props validation can validate an array with multiple sub element types 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -358,6 +381,7 @@ exports[`props validation can validate an array with multiple sub element types
|
||||
exports[`props validation can validate an array with multiple sub element types 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -371,6 +395,7 @@ exports[`props validation can validate an array with multiple sub element types
|
||||
exports[`props validation can validate an array with multiple sub element types 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -388,6 +413,7 @@ exports[`props validation can validate an array with multiple sub element types
|
||||
exports[`props validation can validate an array with multiple sub element types 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -401,6 +427,7 @@ exports[`props validation can validate an array with multiple sub element types
|
||||
exports[`props validation can validate an array with multiple sub element types 5`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -418,6 +445,7 @@ exports[`props validation can validate an array with multiple sub element types
|
||||
exports[`props validation can validate an array with multiple sub element types 6`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -431,6 +459,7 @@ exports[`props validation can validate an array with multiple sub element types
|
||||
exports[`props validation can validate an array with multiple sub element types 7`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -448,6 +477,7 @@ exports[`props validation can validate an array with multiple sub element types
|
||||
exports[`props validation can validate an object with simple shape 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -465,6 +495,7 @@ exports[`props validation can validate an object with simple shape 1`] = `
|
||||
exports[`props validation can validate an object with simple shape 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -478,6 +509,7 @@ exports[`props validation can validate an object with simple shape 2`] = `
|
||||
exports[`props validation can validate an object with simple shape 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -495,6 +527,7 @@ exports[`props validation can validate an object with simple shape 3`] = `
|
||||
exports[`props validation can validate an object with simple shape 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -512,6 +545,7 @@ exports[`props validation can validate an object with simple shape 4`] = `
|
||||
exports[`props validation can validate an object with simple shape 5`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -529,6 +563,7 @@ exports[`props validation can validate an object with simple shape 5`] = `
|
||||
exports[`props validation can validate an optional props 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -546,6 +581,7 @@ exports[`props validation can validate an optional props 1`] = `
|
||||
exports[`props validation can validate an optional props 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -559,6 +595,7 @@ exports[`props validation can validate an optional props 2`] = `
|
||||
exports[`props validation can validate an optional props 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -576,6 +613,7 @@ exports[`props validation can validate an optional props 3`] = `
|
||||
exports[`props validation can validate an optional props 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -589,6 +627,7 @@ exports[`props validation can validate an optional props 4`] = `
|
||||
exports[`props validation can validate an optional props 5`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -606,6 +645,7 @@ exports[`props validation can validate an optional props 5`] = `
|
||||
exports[`props validation can validate recursively complicated prop def 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -623,6 +663,7 @@ exports[`props validation can validate recursively complicated prop def 1`] = `
|
||||
exports[`props validation can validate recursively complicated prop def 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -636,6 +677,7 @@ exports[`props validation can validate recursively complicated prop def 2`] = `
|
||||
exports[`props validation can validate recursively complicated prop def 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -653,6 +695,7 @@ exports[`props validation can validate recursively complicated prop def 3`] = `
|
||||
exports[`props validation can validate recursively complicated prop def 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -666,6 +709,7 @@ exports[`props validation can validate recursively complicated prop def 4`] = `
|
||||
exports[`props validation can validate recursively complicated prop def 5`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -683,6 +727,7 @@ exports[`props validation can validate recursively complicated prop def 5`] = `
|
||||
exports[`props validation default values are applied before validating props at update 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -700,6 +745,7 @@ exports[`props validation default values are applied before validating props at
|
||||
exports[`props validation default values are applied before validating props at update 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -714,6 +760,7 @@ exports[`props validation default values are applied before validating props at
|
||||
exports[`props validation missing required boolean prop causes an error 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, true);
|
||||
|
||||
@@ -731,6 +778,7 @@ exports[`props validation missing required boolean prop causes an error 1`] = `
|
||||
exports[`props validation mix of optional and mandatory 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -748,6 +796,7 @@ exports[`props validation mix of optional and mandatory 1`] = `
|
||||
exports[`props validation props are validated in dev mode (code snapshot) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -765,6 +814,7 @@ exports[`props validation props are validated in dev mode (code snapshot) 1`] =
|
||||
exports[`props validation props are validated in dev mode (code snapshot) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -779,6 +829,7 @@ exports[`props validation props are validated in dev mode (code snapshot) 2`] =
|
||||
exports[`props validation props are validated whenever component is updated 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -796,6 +847,7 @@ exports[`props validation props are validated whenever component is updated 1`]
|
||||
exports[`props validation props are validated whenever component is updated 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -810,6 +862,7 @@ exports[`props validation props are validated whenever component is updated 2`]
|
||||
exports[`props validation props: list of strings 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, true);
|
||||
|
||||
@@ -827,6 +880,7 @@ exports[`props validation props: list of strings 1`] = `
|
||||
exports[`props validation validate simple types 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -844,6 +898,7 @@ exports[`props validation validate simple types 1`] = `
|
||||
exports[`props validation validate simple types 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -861,6 +916,7 @@ exports[`props validation validate simple types 2`] = `
|
||||
exports[`props validation validate simple types 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -874,6 +930,7 @@ exports[`props validation validate simple types 3`] = `
|
||||
exports[`props validation validate simple types 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -891,6 +948,7 @@ exports[`props validation validate simple types 4`] = `
|
||||
exports[`props validation validate simple types 5`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -908,6 +966,7 @@ exports[`props validation validate simple types 5`] = `
|
||||
exports[`props validation validate simple types 6`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -925,6 +984,7 @@ exports[`props validation validate simple types 6`] = `
|
||||
exports[`props validation validate simple types 7`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -938,6 +998,7 @@ exports[`props validation validate simple types 7`] = `
|
||||
exports[`props validation validate simple types 8`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -955,6 +1016,7 @@ exports[`props validation validate simple types 8`] = `
|
||||
exports[`props validation validate simple types 9`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -972,6 +1034,7 @@ exports[`props validation validate simple types 9`] = `
|
||||
exports[`props validation validate simple types 10`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -989,6 +1052,7 @@ exports[`props validation validate simple types 10`] = `
|
||||
exports[`props validation validate simple types 11`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -1002,6 +1066,7 @@ exports[`props validation validate simple types 11`] = `
|
||||
exports[`props validation validate simple types 12`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1019,6 +1084,7 @@ exports[`props validation validate simple types 12`] = `
|
||||
exports[`props validation validate simple types 13`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1036,6 +1102,7 @@ exports[`props validation validate simple types 13`] = `
|
||||
exports[`props validation validate simple types 14`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1053,6 +1120,7 @@ exports[`props validation validate simple types 14`] = `
|
||||
exports[`props validation validate simple types 15`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -1066,6 +1134,7 @@ exports[`props validation validate simple types 15`] = `
|
||||
exports[`props validation validate simple types 16`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1083,6 +1152,7 @@ exports[`props validation validate simple types 16`] = `
|
||||
exports[`props validation validate simple types 17`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1100,6 +1170,7 @@ exports[`props validation validate simple types 17`] = `
|
||||
exports[`props validation validate simple types 18`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1117,6 +1188,7 @@ exports[`props validation validate simple types 18`] = `
|
||||
exports[`props validation validate simple types 19`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -1130,6 +1202,7 @@ exports[`props validation validate simple types 19`] = `
|
||||
exports[`props validation validate simple types 20`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1147,6 +1220,7 @@ exports[`props validation validate simple types 20`] = `
|
||||
exports[`props validation validate simple types 21`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1164,6 +1238,7 @@ exports[`props validation validate simple types 21`] = `
|
||||
exports[`props validation validate simple types 22`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1181,6 +1256,7 @@ exports[`props validation validate simple types 22`] = `
|
||||
exports[`props validation validate simple types 23`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -1194,6 +1270,7 @@ exports[`props validation validate simple types 23`] = `
|
||||
exports[`props validation validate simple types 24`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1211,6 +1288,7 @@ exports[`props validation validate simple types 24`] = `
|
||||
exports[`props validation validate simple types, alternate form 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1228,6 +1306,7 @@ exports[`props validation validate simple types, alternate form 1`] = `
|
||||
exports[`props validation validate simple types, alternate form 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1245,6 +1324,7 @@ exports[`props validation validate simple types, alternate form 2`] = `
|
||||
exports[`props validation validate simple types, alternate form 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -1258,6 +1338,7 @@ exports[`props validation validate simple types, alternate form 3`] = `
|
||||
exports[`props validation validate simple types, alternate form 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1275,6 +1356,7 @@ exports[`props validation validate simple types, alternate form 4`] = `
|
||||
exports[`props validation validate simple types, alternate form 5`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1292,6 +1374,7 @@ exports[`props validation validate simple types, alternate form 5`] = `
|
||||
exports[`props validation validate simple types, alternate form 6`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1309,6 +1392,7 @@ exports[`props validation validate simple types, alternate form 6`] = `
|
||||
exports[`props validation validate simple types, alternate form 7`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -1322,6 +1406,7 @@ exports[`props validation validate simple types, alternate form 7`] = `
|
||||
exports[`props validation validate simple types, alternate form 8`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1339,6 +1424,7 @@ exports[`props validation validate simple types, alternate form 8`] = `
|
||||
exports[`props validation validate simple types, alternate form 9`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1356,6 +1442,7 @@ exports[`props validation validate simple types, alternate form 9`] = `
|
||||
exports[`props validation validate simple types, alternate form 10`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1373,6 +1460,7 @@ exports[`props validation validate simple types, alternate form 10`] = `
|
||||
exports[`props validation validate simple types, alternate form 11`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -1386,6 +1474,7 @@ exports[`props validation validate simple types, alternate form 11`] = `
|
||||
exports[`props validation validate simple types, alternate form 12`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1403,6 +1492,7 @@ exports[`props validation validate simple types, alternate form 12`] = `
|
||||
exports[`props validation validate simple types, alternate form 13`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1420,6 +1510,7 @@ exports[`props validation validate simple types, alternate form 13`] = `
|
||||
exports[`props validation validate simple types, alternate form 14`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1437,6 +1528,7 @@ exports[`props validation validate simple types, alternate form 14`] = `
|
||||
exports[`props validation validate simple types, alternate form 15`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -1450,6 +1542,7 @@ exports[`props validation validate simple types, alternate form 15`] = `
|
||||
exports[`props validation validate simple types, alternate form 16`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1467,6 +1560,7 @@ exports[`props validation validate simple types, alternate form 16`] = `
|
||||
exports[`props validation validate simple types, alternate form 17`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1484,6 +1578,7 @@ exports[`props validation validate simple types, alternate form 17`] = `
|
||||
exports[`props validation validate simple types, alternate form 18`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1501,6 +1596,7 @@ exports[`props validation validate simple types, alternate form 18`] = `
|
||||
exports[`props validation validate simple types, alternate form 19`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -1514,6 +1610,7 @@ exports[`props validation validate simple types, alternate form 19`] = `
|
||||
exports[`props validation validate simple types, alternate form 20`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1531,6 +1628,7 @@ exports[`props validation validate simple types, alternate form 20`] = `
|
||||
exports[`props validation validate simple types, alternate form 21`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1548,6 +1646,7 @@ exports[`props validation validate simple types, alternate form 21`] = `
|
||||
exports[`props validation validate simple types, alternate form 22`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1565,6 +1664,7 @@ exports[`props validation validate simple types, alternate form 22`] = `
|
||||
exports[`props validation validate simple types, alternate form 23`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -1578,6 +1678,7 @@ exports[`props validation validate simple types, alternate form 23`] = `
|
||||
exports[`props validation validate simple types, alternate form 24`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, false);
|
||||
|
||||
@@ -1595,6 +1696,7 @@ exports[`props validation validate simple types, alternate form 24`] = `
|
||||
exports[`props validation validation is only done in dev mode 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, true);
|
||||
|
||||
@@ -1612,6 +1714,7 @@ exports[`props validation validation is only done in dev mode 1`] = `
|
||||
exports[`props validation validation is only done in dev mode 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubComp\`, true, false, false, true);
|
||||
|
||||
@@ -1627,6 +1730,7 @@ exports[`props validation validation is only done in dev mode 2`] = `
|
||||
exports[`props validation validation is only done in dev mode 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`reactivity in lifecycle Child component doesn't render when state they depend on changes but their parent is about to unmount them 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -19,6 +20,7 @@ exports[`reactivity in lifecycle Child component doesn't render when state they
|
||||
exports[`reactivity in lifecycle Child component doesn't render when state they depend on changes but their parent is about to unmount them 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -30,6 +32,7 @@ exports[`reactivity in lifecycle Child component doesn't render when state they
|
||||
exports[`reactivity in lifecycle Component is automatically subscribed to reactive object received as prop 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -42,6 +45,7 @@ exports[`reactivity in lifecycle Component is automatically subscribed to reacti
|
||||
exports[`reactivity in lifecycle Component is automatically subscribed to reactive object received as prop 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -55,6 +59,7 @@ exports[`reactivity in lifecycle Component is automatically subscribed to reacti
|
||||
exports[`reactivity in lifecycle can use a state hook 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -69,6 +74,7 @@ exports[`reactivity in lifecycle can use a state hook 1`] = `
|
||||
exports[`reactivity in lifecycle can use a state hook 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -83,6 +89,7 @@ exports[`reactivity in lifecycle can use a state hook 2 1`] = `
|
||||
exports[`reactivity in lifecycle can use a state hook on Map 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -97,18 +104,14 @@ exports[`reactivity in lifecycle can use a state hook on Map 1`] = `
|
||||
exports[`reactivity in lifecycle change state while mounting component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['state'].val;
|
||||
const b3 = block3([txt1]);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -116,24 +119,18 @@ exports[`reactivity in lifecycle change state while mounting component 1`] = `
|
||||
exports[`reactivity in lifecycle state changes in willUnmount do not trigger rerender 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4;
|
||||
let b2;
|
||||
if (ctx['state'].flag) {
|
||||
b4 = comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
|
||||
b2 = comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
const b3 = block3([], [b4]);
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b5]);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -141,19 +138,15 @@ exports[`reactivity in lifecycle state changes in willUnmount do not trigger rer
|
||||
exports[`reactivity in lifecycle state changes in willUnmount do not trigger rerender 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['props'].val;
|
||||
let txt2 = ctx['state'].n;
|
||||
const b3 = block3([txt1, txt2]);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`refs basic use 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-ref=\\"0\\"/>\`);
|
||||
@@ -18,34 +19,23 @@ exports[`refs basic use 1`] = `
|
||||
exports[`refs can use 2 refs with same name in a t-if/t-else situation 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { multiRefSetter } = helpers;
|
||||
|
||||
let block5 = createBlock(\`<div block-ref=\\"0\\"/>\`);
|
||||
let block9 = createBlock(\`<span block-ref=\\"0\\"/>\`);
|
||||
let block2 = createBlock(\`<div block-ref=\\"0\\"/>\`);
|
||||
let block3 = createBlock(\`<span block-ref=\\"0\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const refs = ctx.__owl__.refs;
|
||||
const ref1 = multiRefSetter(refs, \`coucou\`);
|
||||
let b2,b3,b7;
|
||||
b2 = text(\`
|
||||
\`);
|
||||
let b2,b3;
|
||||
if (ctx['state'].value) {
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
const b5 = block5([ref1]);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
b3 = multi([b4, b5, b6]);
|
||||
b2 = block2([ref1]);
|
||||
} else {
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
const b9 = block9([ref1]);
|
||||
const b10 = text(\`
|
||||
\`);
|
||||
b7 = multi([b8, b9, b10]);
|
||||
b3 = block3([ref1]);
|
||||
}
|
||||
return multi([b2, b3, b7]);
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -53,26 +43,21 @@ exports[`refs can use 2 refs with same name in a t-if/t-else situation 1`] = `
|
||||
exports[`refs refs and recursive templates 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Test\`, true, false, false, false);
|
||||
|
||||
let block3 = createBlock(\`<p block-ref=\\"0\\">
|
||||
<block-text-1/>
|
||||
<block-child-0/>
|
||||
</p>\`);
|
||||
let block1 = createBlock(\`<p block-ref=\\"0\\"><block-text-1/><block-child-0/></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const refs = ctx.__owl__.refs;
|
||||
const ref1 = (el) => refs[\`root\`] = el;
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4;
|
||||
let b2;
|
||||
let txt1 = ctx['props'].tree.value;
|
||||
if (ctx['props'].tree.child) {
|
||||
b4 = comp1({tree: ctx['props'].tree.child}, key + \`__1\`, node, this, null);
|
||||
b2 = comp1({tree: ctx['props'].tree.child}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
const b3 = block3([ref1, txt1], [b4]);
|
||||
return multi([b2, b3]);
|
||||
return block1([ref1, txt1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -80,41 +65,26 @@ exports[`refs refs and recursive templates 1`] = `
|
||||
exports[`refs refs are properly bound in slots 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { capture, markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<span class=\\"counter\\"><block-text-0/></span>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block4 = createBlock(\`<button block-handler-0=\\"click\\" block-ref=\\"1\\">do something</button>\`);
|
||||
let block1 = createBlock(\`<div><span class=\\"counter\\"><block-text-0/></span><block-child-0/></div>\`);
|
||||
let block2 = createBlock(\`<button block-handler-0=\\"click\\" block-ref=\\"1\\">do something</button>\`);
|
||||
|
||||
function slot1(ctx, node, key = \\"\\") {
|
||||
const refs = ctx.__owl__.refs;
|
||||
const ref1 = (el) => refs[\`myButton\`] = el;
|
||||
let hdlr1 = [ctx['doSomething'], ctx];
|
||||
return block4([hdlr1, ref1]);
|
||||
}
|
||||
|
||||
function slot2(ctx, node, key = \\"\\") {
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const b7 = text(\`
|
||||
\`);
|
||||
return multi([b6, b7]);
|
||||
return block2([hdlr1, ref1]);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['state'].val;
|
||||
const ctx1 = capture(ctx);
|
||||
const b8 = comp1({slots: markRaw({'footer': {__render: slot1, __ctx: ctx1}, 'default': {__render: slot2, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
||||
const b3 = block3([txt1], [b8]);
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b9]);
|
||||
const b3 = comp1({slots: markRaw({'footer': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
||||
return block1([txt1], [b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -122,6 +92,7 @@ exports[`refs refs are properly bound in slots 1`] = `
|
||||
exports[`refs refs are properly bound in slots 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -137,22 +108,19 @@ exports[`refs refs are properly bound in slots 2`] = `
|
||||
exports[`refs throws if there are 2 same refs at the same time 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { multiRefSetter } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div block-ref=\\"0\\"/>\`);
|
||||
let block5 = createBlock(\`<span block-ref=\\"0\\"/>\`);
|
||||
let block2 = createBlock(\`<div block-ref=\\"0\\"/>\`);
|
||||
let block3 = createBlock(\`<span block-ref=\\"0\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const refs = ctx.__owl__.refs;
|
||||
const ref1 = multiRefSetter(refs, \`coucou\`);
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b2 = block2([ref1]);
|
||||
const b3 = block3([ref1]);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
const b5 = block5([ref1]);
|
||||
return multi([b2, b3, b4, b5]);
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -3,19 +3,14 @@
|
||||
exports[`children, default props and renderings 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = text(ctx['state'].value);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
const b5 = comp1({}, key + \`__1\`, node, this, null);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4, b5, b6]);
|
||||
const b2 = text(ctx['state'].value);
|
||||
const b3 = comp1({}, key + \`__1\`, node, this, null);
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -23,6 +18,7 @@ exports[`children, default props and renderings 1`] = `
|
||||
exports[`children, default props and renderings 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -34,6 +30,7 @@ exports[`children, default props and renderings 2`] = `
|
||||
exports[`force render in case of existing render 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, false);
|
||||
|
||||
@@ -46,6 +43,7 @@ exports[`force render in case of existing render 1`] = `
|
||||
exports[`force render in case of existing render 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`C\`, true, false, false, true);
|
||||
|
||||
@@ -60,6 +58,7 @@ exports[`force render in case of existing render 2`] = `
|
||||
exports[`force render in case of existing render 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -71,19 +70,14 @@ exports[`force render in case of existing render 3`] = `
|
||||
exports[`rendering semantics can force a render to update sub tree 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = text(ctx['state'].value);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
const b5 = comp1({}, key + \`__1\`, node, this, null);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4, b5, b6]);
|
||||
const b2 = text(ctx['state'].value);
|
||||
const b3 = comp1({}, key + \`__1\`, node, this, null);
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -91,6 +85,7 @@ exports[`rendering semantics can force a render to update sub tree 1`] = `
|
||||
exports[`rendering semantics can force a render to update sub tree 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -102,19 +97,14 @@ exports[`rendering semantics can force a render to update sub tree 2`] = `
|
||||
exports[`rendering semantics can render a parent without rendering child 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = text(ctx['state'].value);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
const b5 = comp1({}, key + \`__1\`, node, this, null);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4, b5, b6]);
|
||||
const b2 = text(ctx['state'].value);
|
||||
const b3 = comp1({}, key + \`__1\`, node, this, null);
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -122,6 +112,7 @@ exports[`rendering semantics can render a parent without rendering child 1`] = `
|
||||
exports[`rendering semantics can render a parent without rendering child 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -133,16 +124,12 @@ exports[`rendering semantics can render a parent without rendering child 2`] = `
|
||||
exports[`rendering semantics props are reactive (nested prop) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = comp1({a: ctx['state']}, key + \`__1\`, node, this, null);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return comp1({a: ctx['state']}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -150,6 +137,7 @@ exports[`rendering semantics props are reactive (nested prop) 1`] = `
|
||||
exports[`rendering semantics props are reactive (nested prop) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -161,16 +149,12 @@ exports[`rendering semantics props are reactive (nested prop) 2`] = `
|
||||
exports[`rendering semantics props are reactive 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = comp1({a: ctx['state']}, key + \`__1\`, node, this, null);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return comp1({a: ctx['state']}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -178,6 +162,7 @@ exports[`rendering semantics props are reactive 1`] = `
|
||||
exports[`rendering semantics props are reactive 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -189,19 +174,14 @@ exports[`rendering semantics props are reactive 2`] = `
|
||||
exports[`rendering semantics render need a boolean = true to be 'deep' 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = text(ctx['state'].value);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
const b5 = comp1({}, key + \`__1\`, node, this, null);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4, b5, b6]);
|
||||
const b2 = text(ctx['state'].value);
|
||||
const b3 = comp1({}, key + \`__1\`, node, this, null);
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -209,6 +189,7 @@ exports[`rendering semantics render need a boolean = true to be 'deep' 1`] = `
|
||||
exports[`rendering semantics render need a boolean = true to be 'deep' 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -220,6 +201,7 @@ exports[`rendering semantics render need a boolean = true to be 'deep' 2`] = `
|
||||
exports[`rendering semantics render with deep=true followed by render with deep=false work as expected 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -235,6 +217,7 @@ exports[`rendering semantics render with deep=true followed by render with deep=
|
||||
exports[`rendering semantics render with deep=true followed by render with deep=false work as expected 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -248,6 +231,7 @@ exports[`rendering semantics render with deep=true followed by render with deep=
|
||||
exports[`rendering semantics rendering is atomic (for one subtree) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, false);
|
||||
|
||||
@@ -262,6 +246,7 @@ exports[`rendering semantics rendering is atomic (for one subtree) 1`] = `
|
||||
exports[`rendering semantics rendering is atomic (for one subtree) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`C\`, true, false, false, false);
|
||||
|
||||
@@ -274,6 +259,7 @@ exports[`rendering semantics rendering is atomic (for one subtree) 2`] = `
|
||||
exports[`rendering semantics rendering is atomic (for one subtree) 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -285,16 +271,12 @@ exports[`rendering semantics rendering is atomic (for one subtree) 3`] = `
|
||||
exports[`rendering semantics works as expected for dynamic number of props 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, true, false);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = comp1(Object.assign({}, ctx['state']), key + \`__1\`, node, this, null);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return comp1(Object.assign({}, ctx['state']), key + \`__1\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -302,6 +284,7 @@ exports[`rendering semantics works as expected for dynamic number of props 1`] =
|
||||
exports[`rendering semantics works as expected for dynamic number of props 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,7 @@
|
||||
exports[`style and class handling can set class on multi root component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -15,6 +16,7 @@ exports[`style and class handling can set class on multi root component 1`] = `
|
||||
exports[`style and class handling can set class on multi root component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block2 = createBlock(\`<div>a</div>\`);
|
||||
@@ -32,6 +34,7 @@ exports[`style and class handling can set class on multi root component 2`] = `
|
||||
exports[`style and class handling can set class on sub component, as prop 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -44,6 +47,7 @@ exports[`style and class handling can set class on sub component, as prop 1`] =
|
||||
exports[`style and class handling can set class on sub component, as prop 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">child</div>\`);
|
||||
@@ -58,6 +62,7 @@ exports[`style and class handling can set class on sub component, as prop 2`] =
|
||||
exports[`style and class handling can set class on sub sub component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -70,6 +75,7 @@ exports[`style and class handling can set class on sub sub component 1`] = `
|
||||
exports[`style and class handling can set class on sub sub component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ChildChild\`, true, false, false, false);
|
||||
|
||||
@@ -82,6 +88,7 @@ exports[`style and class handling can set class on sub sub component 2`] = `
|
||||
exports[`style and class handling can set class on sub sub component 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">childchild</div>\`);
|
||||
@@ -96,6 +103,7 @@ exports[`style and class handling can set class on sub sub component 3`] = `
|
||||
exports[`style and class handling can set more than one class on sub component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -108,6 +116,7 @@ exports[`style and class handling can set more than one class on sub component 1
|
||||
exports[`style and class handling can set more than one class on sub component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">child</div>\`);
|
||||
@@ -122,17 +131,13 @@ exports[`style and class handling can set more than one class on sub component 2
|
||||
exports[`style and class handling can set style and class inside component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div style=\\"font-weight:bold;\\" class=\\"some-class\\">world</div>\`);
|
||||
let block1 = createBlock(\`<div style=\\"font-weight:bold;\\" class=\\"some-class\\">world</div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = block3();
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1();
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -140,6 +145,7 @@ exports[`style and class handling can set style and class inside component 1`] =
|
||||
exports[`style and class handling class on components do not interfere with user defined classes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -154,6 +160,7 @@ exports[`style and class handling class on components do not interfere with user
|
||||
exports[`style and class handling class on sub component, which is switched to another 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -166,6 +173,7 @@ exports[`style and class handling class on sub component, which is switched to a
|
||||
exports[`style and class handling class on sub component, which is switched to another 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ChildA\`, true, false, false, false);
|
||||
const comp2 = app.createComponent(\`ChildB\`, true, false, false, false);
|
||||
@@ -185,6 +193,7 @@ exports[`style and class handling class on sub component, which is switched to a
|
||||
exports[`style and class handling class on sub component, which is switched to another 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">a</div>\`);
|
||||
@@ -199,6 +208,7 @@ exports[`style and class handling class on sub component, which is switched to a
|
||||
exports[`style and class handling class on sub component, which is switched to another 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span block-attribute-0=\\"class\\">b</span>\`);
|
||||
@@ -213,6 +223,7 @@ exports[`style and class handling class on sub component, which is switched to a
|
||||
exports[`style and class handling class with extra whitespaces (variation) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -228,6 +239,7 @@ exports[`style and class handling class with extra whitespaces (variation) 1`] =
|
||||
exports[`style and class handling class with extra whitespaces (variation) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -242,6 +254,7 @@ exports[`style and class handling class with extra whitespaces (variation) 2`] =
|
||||
exports[`style and class handling class with extra whitespaces 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -254,6 +267,7 @@ exports[`style and class handling class with extra whitespaces 1`] = `
|
||||
exports[`style and class handling class with extra whitespaces 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -268,6 +282,7 @@ exports[`style and class handling class with extra whitespaces 2`] = `
|
||||
exports[`style and class handling component class and parent class combine together 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -280,6 +295,7 @@ exports[`style and class handling component class and parent class combine toget
|
||||
exports[`style and class handling component class and parent class combine together 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"child\\" block-attribute-0=\\"class\\">child</div>\`);
|
||||
@@ -321,6 +337,7 @@ exports[`style and class handling dynamic t-att-style is properly added and upda
|
||||
exports[`style and class handling empty class attribute is not added on widget root el 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -336,6 +353,7 @@ exports[`style and class handling empty class attribute is not added on widget r
|
||||
exports[`style and class handling empty class attribute is not added on widget root el 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -350,6 +368,7 @@ exports[`style and class handling empty class attribute is not added on widget r
|
||||
exports[`style and class handling error in subcomponent with class 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -362,6 +381,7 @@ exports[`style and class handling error in subcomponent with class 1`] = `
|
||||
exports[`style and class handling error in subcomponent with class 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"><block-text-1/></div>\`);
|
||||
@@ -377,6 +397,7 @@ exports[`style and class handling error in subcomponent with class 2`] = `
|
||||
exports[`style and class handling no class is set is child ignores it 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -389,6 +410,7 @@ exports[`style and class handling no class is set is child ignores it 1`] = `
|
||||
exports[`style and class handling no class is set is child ignores it 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>child</div>\`);
|
||||
@@ -402,6 +424,7 @@ exports[`style and class handling no class is set is child ignores it 2`] = `
|
||||
exports[`style and class handling no class is set is parent does not give it as prop 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -414,6 +437,7 @@ exports[`style and class handling no class is set is parent does not give it as
|
||||
exports[`style and class handling no class is set is parent does not give it as prop 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">child</div>\`);
|
||||
@@ -428,6 +452,7 @@ exports[`style and class handling no class is set is parent does not give it as
|
||||
exports[`style and class handling style is properly added on widget root el 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -440,6 +465,7 @@ exports[`style and class handling style is properly added on widget root el 1`]
|
||||
exports[`style and class handling style is properly added on widget root el 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"style\\"/>\`);
|
||||
@@ -454,19 +480,15 @@ exports[`style and class handling style is properly added on widget root el 2`]
|
||||
exports[`style and class handling t-att-class is properly added/removed on widget root el (v2) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b4 = comp1({class: {b:ctx['state'].b}}, key + \`__1\`, node, this, null);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = comp1({class: {b:ctx['state'].b}}, key + \`__1\`, node, this, null);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -474,6 +496,7 @@ exports[`style and class handling t-att-class is properly added/removed on widge
|
||||
exports[`style and class handling t-att-class is properly added/removed on widget root el (v2) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span class=\\"c\\" block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -488,6 +511,7 @@ exports[`style and class handling t-att-class is properly added/removed on widge
|
||||
exports[`style and class handling t-att-class is properly added/removed on widget root el (v3) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -500,6 +524,7 @@ exports[`style and class handling t-att-class is properly added/removed on widge
|
||||
exports[`style and class handling t-att-class is properly added/removed on widget root el (v3) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span class=\\"c\\" block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
@@ -3,22 +3,18 @@
|
||||
exports[`t-call dynamic t-call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, zero } = helpers;
|
||||
const call = app.callTemplate.bind(app);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
const b3 = text(\`
|
||||
owl
|
||||
\`);
|
||||
ctx[zero] = b3;
|
||||
const b1 = text(\` owl \`);
|
||||
ctx[zero] = b1;
|
||||
const template1 = (ctx['current'].template);
|
||||
const b4 = call(this, template1, ctx, node, key + \`__1\`);
|
||||
return multi([b2, b4]);
|
||||
return call(this, template1, ctx, node, key + \`__1\`);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -26,6 +22,7 @@ exports[`t-call dynamic t-call 1`] = `
|
||||
exports[`t-call dynamic t-call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>foo</div>\`);
|
||||
@@ -39,6 +36,7 @@ exports[`t-call dynamic t-call 2`] = `
|
||||
exports[`t-call dynamic t-call 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -50,6 +48,7 @@ exports[`t-call dynamic t-call 3`] = `
|
||||
exports[`t-call dynamic t-call: key is propagated 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
const call = app.callTemplate.bind(app);
|
||||
@@ -66,6 +65,7 @@ exports[`t-call dynamic t-call: key is propagated 1`] = `
|
||||
exports[`t-call dynamic t-call: key is propagated 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"id\\"/>\`);
|
||||
@@ -80,6 +80,7 @@ exports[`t-call dynamic t-call: key is propagated 2`] = `
|
||||
exports[`t-call dynamic t-call: key is propagated 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -92,19 +93,17 @@ exports[`t-call dynamic t-call: key is propagated 3`] = `
|
||||
exports[`t-call handlers are properly bound through a dynamic t-call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const call = app.callTemplate.bind(app);
|
||||
|
||||
let block3 = createBlock(\`<div><block-child-0/><block-text-0/></div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const template1 = ('__template__999');
|
||||
const b4 = call(this, template1, ctx, node, key + \`__1\`);
|
||||
const b2 = call(this, template1, ctx, node, key + \`__1\`);
|
||||
let txt1 = ctx['counter'];
|
||||
const b3 = block3([txt1], [b4]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -112,6 +111,7 @@ exports[`t-call handlers are properly bound through a dynamic t-call 1`] = `
|
||||
exports[`t-call handlers are properly bound through a dynamic t-call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p block-handler-0=\\"click\\">lucas</p>\`);
|
||||
@@ -126,18 +126,16 @@ exports[`t-call handlers are properly bound through a dynamic t-call 2`] = `
|
||||
exports[`t-call handlers are properly bound through a t-call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`__template__999\`);
|
||||
|
||||
let block3 = createBlock(\`<div><block-child-0/><block-text-0/></div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b4 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
const b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
let txt1 = ctx['counter'];
|
||||
const b3 = block3([txt1], [b4]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -145,6 +143,7 @@ exports[`t-call handlers are properly bound through a t-call 1`] = `
|
||||
exports[`t-call handlers are properly bound through a t-call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p block-handler-0=\\"click\\">lucas</p>\`);
|
||||
@@ -159,6 +158,7 @@ exports[`t-call handlers are properly bound through a t-call 2`] = `
|
||||
exports[`t-call handlers with arguments are properly bound through a t-call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`__template__999\`);
|
||||
|
||||
@@ -174,6 +174,7 @@ exports[`t-call handlers with arguments are properly bound through a t-call 1`]
|
||||
exports[`t-call handlers with arguments are properly bound through a t-call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p block-handler-0=\\"click\\">lucas</p>\`);
|
||||
@@ -189,6 +190,7 @@ exports[`t-call handlers with arguments are properly bound through a t-call 2`]
|
||||
exports[`t-call parent is set within t-call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`__template__999\`);
|
||||
|
||||
@@ -204,6 +206,7 @@ exports[`t-call parent is set within t-call 1`] = `
|
||||
exports[`t-call parent is set within t-call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -216,6 +219,7 @@ exports[`t-call parent is set within t-call 2`] = `
|
||||
exports[`t-call parent is set within t-call 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>lucas</span>\`);
|
||||
@@ -229,6 +233,7 @@ exports[`t-call parent is set within t-call 3`] = `
|
||||
exports[`t-call parent is set within t-call with no parentNode 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`__template__999\`);
|
||||
|
||||
@@ -241,6 +246,7 @@ exports[`t-call parent is set within t-call with no parentNode 1`] = `
|
||||
exports[`t-call parent is set within t-call with no parentNode 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -253,6 +259,7 @@ exports[`t-call parent is set within t-call with no parentNode 2`] = `
|
||||
exports[`t-call parent is set within t-call with no parentNode 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>lucas</span>\`);
|
||||
@@ -266,26 +273,21 @@ exports[`t-call parent is set within t-call with no parentNode 3`] = `
|
||||
exports[`t-call recursive t-call binding this -- static t-call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`recursive\`);
|
||||
|
||||
let block3 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"level\\", 0);
|
||||
const b4 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
ctx = ctx.__proto__;
|
||||
const b3 = block3([], [b4]);
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b5]);
|
||||
const b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -293,44 +295,29 @@ exports[`t-call recursive t-call binding this -- static t-call 1`] = `
|
||||
exports[`t-call recursive t-call binding this -- static t-call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, zero } = helpers;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`recursive\`);
|
||||
|
||||
let block5 = createBlock(\`<div block-handler-0=\\"click.stop\\"><block-text-1/></div>\`);
|
||||
let block3 = createBlock(\`<div block-handler-0=\\"click.stop\\"><block-text-1/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
let b2,b3,b12;
|
||||
b2 = text(\`
|
||||
\`);
|
||||
let b2;
|
||||
if (ctx['level']<2) {
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
let hdlr1 = [\\"stop\\", ctx['onClicked'].bind(this), ctx];
|
||||
let txt1 = ctx['level'];
|
||||
const b5 = block5([hdlr1, txt1]);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const b3 = block3([hdlr1, txt1]);
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"level\\", ctx['level']+1);
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
const b7 = multi([b8, b9]);
|
||||
ctx[zero] = b7;
|
||||
const b10 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
const b4 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
ctx = ctx.__proto__;
|
||||
const b11 = text(\`
|
||||
\`);
|
||||
b3 = multi([b4, b5, b6, b10, b11]);
|
||||
b2 = multi([b3, b4]);
|
||||
}
|
||||
b12 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b12]);
|
||||
return multi([b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -338,28 +325,22 @@ exports[`t-call recursive t-call binding this -- static t-call 2`] = `
|
||||
exports[`t-call sub components in two t-calls 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
const callTemplate_2 = app.getTemplate(\`sub\`);
|
||||
|
||||
let block7 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2,b3,b7;
|
||||
b2 = text(\`
|
||||
\`);
|
||||
let b2,b3;
|
||||
if (ctx['state'].val===1) {
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
const b5 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
b3 = multi([b4, b5, b6]);
|
||||
b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
} else {
|
||||
const b8 = callTemplate_2.call(this, ctx, node, key + \`__2\`);
|
||||
b7 = block7([], [b8]);
|
||||
const b4 = callTemplate_2.call(this, ctx, node, key + \`__2\`);
|
||||
b3 = block3([], [b4]);
|
||||
}
|
||||
return multi([b2, b3, b7]);
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -367,6 +348,7 @@ exports[`t-call sub components in two t-calls 1`] = `
|
||||
exports[`t-call sub components in two t-calls 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -379,6 +361,7 @@ exports[`t-call sub components in two t-calls 2`] = `
|
||||
exports[`t-call sub components in two t-calls 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -393,37 +376,27 @@ exports[`t-call sub components in two t-calls 3`] = `
|
||||
exports[`t-call t-call in t-foreach and children component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`__template__999\`);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(['a','b','c']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`val\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(['a','b','c']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`val\`] = v_block2[i1];
|
||||
ctx[\`val_first\`] = i1 === 0;
|
||||
ctx[\`val_last\`] = i1 === v_block4.length - 1;
|
||||
ctx[\`val_last\`] = i1 === v_block2.length - 1;
|
||||
ctx[\`val_index\`] = i1;
|
||||
ctx[\`val_value\`] = k_block4[i1];
|
||||
ctx[\`val_value\`] = k_block2[i1];
|
||||
const key1 = ctx['val'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const b7 = callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}\`);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8]), key1);
|
||||
c_block2[i1] = withKey(callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}\`), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -431,6 +404,7 @@ exports[`t-call t-call in t-foreach and children component 1`] = `
|
||||
exports[`t-call t-call in t-foreach and children component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -443,6 +417,7 @@ exports[`t-call t-call in t-foreach and children component 2`] = `
|
||||
exports[`t-call t-call in t-foreach and children component 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -457,15 +432,13 @@ exports[`t-call t-call in t-foreach and children component 3`] = `
|
||||
exports[`t-call t-call with t-call-context and subcomponent 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`someTemplate\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let ctx1 = ctx['subctx'];
|
||||
const b3 = callTemplate_1.call(this, ctx1, node, key + \`__1\`);
|
||||
return multi([b2, b3]);
|
||||
return callTemplate_1.call(this, ctx1, node, key + \`__1\`);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -473,20 +446,15 @@ exports[`t-call t-call with t-call-context and subcomponent 1`] = `
|
||||
exports[`t-call t-call with t-call-context and subcomponent 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
const comp2 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b3 = comp1({name: ctx['aab']}, key + \`__1\`, node, this, null);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
const b5 = comp2({name: ctx['lpe']}, key + \`__2\`, node, this, null);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4, b5, b6]);
|
||||
const b2 = comp1({name: ctx['aab']}, key + \`__1\`, node, this, null);
|
||||
const b3 = comp2({name: ctx['lpe']}, key + \`__2\`, node, this, null);
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -494,6 +462,7 @@ exports[`t-call t-call with t-call-context and subcomponent 2`] = `
|
||||
exports[`t-call t-call with t-call-context and subcomponent 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -507,15 +476,13 @@ exports[`t-call t-call with t-call-context and subcomponent 3`] = `
|
||||
exports[`t-call t-call with t-call-context, simple use 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`someTemplate\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let ctx1 = ctx['subctx'];
|
||||
const b3 = callTemplate_1.call(this, ctx1, node, key + \`__1\`);
|
||||
return multi([b2, b3]);
|
||||
return callTemplate_1.call(this, ctx1, node, key + \`__1\`);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -523,6 +490,7 @@ exports[`t-call t-call with t-call-context, simple use 1`] = `
|
||||
exports[`t-call t-call with t-call-context, simple use 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-call-block simple t-call-block with static text 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
@@ -3,20 +3,16 @@
|
||||
exports[`t-component can switch between dynamic components without the need for a t-key 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(null, false, false, false, true);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const Comp1 = ctx['constructor'].components[ctx['state'].child];
|
||||
const b4 = toggler(Comp1, comp1({}, key + \`__1\`, node, this, Comp1));
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = toggler(Comp1, comp1({}, key + \`__1\`, node, this, Comp1));
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -24,6 +20,7 @@ exports[`t-component can switch between dynamic components without the need for
|
||||
exports[`t-component can switch between dynamic components without the need for a t-key 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>child a</span>\`);
|
||||
@@ -37,6 +34,7 @@ exports[`t-component can switch between dynamic components without the need for
|
||||
exports[`t-component can switch between dynamic components without the need for a t-key 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>child b</span>\`);
|
||||
@@ -50,6 +48,7 @@ exports[`t-component can switch between dynamic components without the need for
|
||||
exports[`t-component can use dynamic components (the class) if given (with different root tagname) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(null, false, false, false, true);
|
||||
|
||||
@@ -64,6 +63,7 @@ exports[`t-component can use dynamic components (the class) if given (with diffe
|
||||
exports[`t-component can use dynamic components (the class) if given (with different root tagname) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>child a</span>\`);
|
||||
@@ -77,6 +77,7 @@ exports[`t-component can use dynamic components (the class) if given (with diffe
|
||||
exports[`t-component can use dynamic components (the class) if given (with different root tagname) 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>child b</div>\`);
|
||||
@@ -90,6 +91,7 @@ exports[`t-component can use dynamic components (the class) if given (with diffe
|
||||
exports[`t-component can use dynamic components (the class) if given 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(null, false, false, false, true);
|
||||
|
||||
@@ -104,6 +106,7 @@ exports[`t-component can use dynamic components (the class) if given 1`] = `
|
||||
exports[`t-component can use dynamic components (the class) if given 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>child a</span>\`);
|
||||
@@ -117,6 +120,7 @@ exports[`t-component can use dynamic components (the class) if given 2`] = `
|
||||
exports[`t-component can use dynamic components (the class) if given 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>child b</span>\`);
|
||||
@@ -130,6 +134,7 @@ exports[`t-component can use dynamic components (the class) if given 3`] = `
|
||||
exports[`t-component modifying a sub widget 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(null, false, false, false, true);
|
||||
|
||||
@@ -146,18 +151,16 @@ exports[`t-component modifying a sub widget 1`] = `
|
||||
exports[`t-component modifying a sub widget 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<div><block-text-0/><button block-handler-1=\\"click\\">Inc</button></div>\`);
|
||||
let block1 = createBlock(\`<div><block-text-0/><button block-handler-1=\\"click\\">Inc</button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['state'].counter;
|
||||
const v1 = ctx['state'];
|
||||
let hdlr1 = [()=>v1.counter++, ctx];
|
||||
const b3 = block3([txt1, hdlr1]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt1, hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -165,6 +168,7 @@ exports[`t-component modifying a sub widget 2`] = `
|
||||
exports[`t-component switching dynamic component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(null, false, false, false, true);
|
||||
|
||||
@@ -178,6 +182,7 @@ exports[`t-component switching dynamic component 1`] = `
|
||||
exports[`t-component switching dynamic component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>child a</div>\`);
|
||||
@@ -191,6 +196,7 @@ exports[`t-component switching dynamic component 2`] = `
|
||||
exports[`t-component switching dynamic component 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -202,6 +208,7 @@ exports[`t-component switching dynamic component 3`] = `
|
||||
exports[`t-component t-component works in simple case 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(null, false, false, false, true);
|
||||
|
||||
@@ -215,6 +222,7 @@ exports[`t-component t-component works in simple case 1`] = `
|
||||
exports[`t-component t-component works in simple case 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>child</div>\`);
|
||||
|
||||
@@ -3,39 +3,25 @@
|
||||
exports[`list of components components in a node in a t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<ul>
|
||||
<block-child-0/>
|
||||
</ul>
|
||||
</div>\`);
|
||||
let block7 = createBlock(\`<li>
|
||||
<block-child-0/>
|
||||
</li>\`);
|
||||
let block1 = createBlock(\`<div><ul><block-child-0/></ul></div>\`);
|
||||
let block3 = createBlock(\`<li><block-child-0/></li>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['items']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`item\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['items']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`item\`] = v_block2[i1];
|
||||
const key1 = 'li_'+ctx['item'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const b8 = comp1({item: ctx['item']}, key + \`__1__\${key1}\`, node, this, null);
|
||||
const b7 = block7([], [b8]);
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b9]), key1);
|
||||
const b4 = comp1({item: ctx['item']}, key + \`__1__\${key1}\`, node, this, null);
|
||||
c_block2[i1] = withKey(block3([], [b4]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -43,6 +29,7 @@ exports[`list of components components in a node in a t-foreach 1`] = `
|
||||
exports[`list of components components in a node in a t-foreach 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -57,35 +44,25 @@ exports[`list of components components in a node in a t-foreach 2`] = `
|
||||
exports[`list of components crash on duplicate key in dev mode 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block3, v_block3, l_block3, c_block3] = prepareList([1,2]);;
|
||||
const keys3 = new Set();
|
||||
for (let i1 = 0; i1 < l_block3; i1++) {
|
||||
ctx[\`item\`] = v_block3[i1];
|
||||
const [k_block1, v_block1, l_block1, c_block1] = prepareList([1,2]);;
|
||||
const keys1 = new Set();
|
||||
for (let i1 = 0; i1 < l_block1; i1++) {
|
||||
ctx[\`item\`] = v_block1[i1];
|
||||
const key1 = 'child';
|
||||
if (keys3.has(key1)) { throw new Error(\`Got duplicate key in t-foreach: \${key1}\`)}
|
||||
keys3.add(key1);
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
if (keys1.has(key1)) { throw new Error(\`Got duplicate key in t-foreach: \${key1}\`)}
|
||||
keys1.add(key1);
|
||||
const props1 = {};
|
||||
helpers.validateProps(\`Child\`, props1, ctx);
|
||||
const b6 = comp1(props1, key + \`__1__\${key1}\`, node, this, null);
|
||||
const b7 = text(\`
|
||||
\`);
|
||||
c_block3[i1] = withKey(multi([b5, b6, b7]), key1);
|
||||
c_block1[i1] = withKey(comp1(props1, key + \`__1__\${key1}\`, node, this, null), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b3 = list(c_block3);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b8]);
|
||||
return list(c_block1);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -93,6 +70,7 @@ exports[`list of components crash on duplicate key in dev mode 1`] = `
|
||||
exports[`list of components crash on duplicate key in dev mode 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -104,32 +82,25 @@ exports[`list of components crash on duplicate key in dev mode 2`] = `
|
||||
exports[`list of components list of sub components inside other nodes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`SubComponent\`, true, false, false, true);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block5 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['state'].blips);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`blip\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state'].blips);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`blip\`] = v_block2[i1];
|
||||
const key1 = ctx['blip'].id;
|
||||
const b6 = comp1({}, key + \`__1__\${key1}\`, node, this, null);
|
||||
c_block4[i1] = withKey(block5([], [b6]), key1);
|
||||
const b4 = comp1({}, key + \`__1__\${key1}\`, node, this, null);
|
||||
c_block2[i1] = withKey(block3([], [b4]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -137,6 +108,7 @@ exports[`list of components list of sub components inside other nodes 1`] = `
|
||||
exports[`list of components list of sub components inside other nodes 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>asdf</span>\`);
|
||||
@@ -150,48 +122,33 @@ exports[`list of components list of sub components inside other nodes 2`] = `
|
||||
exports[`list of components reconciliation alg works for t-foreach in t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['state'].s);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`section\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state'].s);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`section\`] = v_block2[i1];
|
||||
ctx[\`section_index\`] = i1;
|
||||
const key1 = ctx['section_index'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block7, v_block7, l_block7, c_block7] = prepareList(ctx['section'].blips);;
|
||||
for (let i2 = 0; i2 < l_block7; i2++) {
|
||||
ctx[\`blip\`] = v_block7[i2];
|
||||
const [k_block3, v_block3, l_block3, c_block3] = prepareList(ctx['section'].blips);;
|
||||
for (let i2 = 0; i2 < l_block3; i2++) {
|
||||
ctx[\`blip\`] = v_block3[i2];
|
||||
ctx[\`blip_index\`] = i2;
|
||||
const key2 = ctx['blip_index'];
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
const b10 = comp1({blip: ctx['blip']}, key + \`__1__\${key1}__\${key2}\`, node, this, null);
|
||||
const b11 = text(\`
|
||||
\`);
|
||||
c_block7[i2] = withKey(multi([b9, b10, b11]), key2);
|
||||
c_block3[i2] = withKey(comp1({blip: ctx['blip']}, key + \`__1__\${key1}__\${key2}\`, node, this, null), key2);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b7 = list(c_block7);
|
||||
const b12 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b12]), key1);
|
||||
c_block2[i1] = withKey(list(c_block3), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -199,6 +156,7 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach
|
||||
exports[`list of components reconciliation alg works for t-foreach in t-foreach 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -213,44 +171,35 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach
|
||||
exports[`list of components reconciliation alg works for t-foreach in t-foreach, 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block5 = createBlock(\`<p>
|
||||
<block-child-0/>
|
||||
</p>\`);
|
||||
let block7 = createBlock(\`<p>
|
||||
<block-child-0/>
|
||||
</p>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<p><block-child-0/></p>\`);
|
||||
let block5 = createBlock(\`<p><block-child-0/></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['state'].rows);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`row\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state'].rows);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`row\`] = v_block2[i1];
|
||||
const key1 = ctx['row'];
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block6, v_block6, l_block6, c_block6] = prepareList(ctx['state'].cols);;
|
||||
for (let i2 = 0; i2 < l_block6; i2++) {
|
||||
ctx[\`col\`] = v_block6[i2];
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['state'].cols);;
|
||||
for (let i2 = 0; i2 < l_block4; i2++) {
|
||||
ctx[\`col\`] = v_block4[i2];
|
||||
const key2 = ctx['col'];
|
||||
const b8 = comp1({row: ctx['row'],col: ctx['col']}, key + \`__1__\${key1}__\${key2}\`, node, this, null);
|
||||
c_block6[i2] = withKey(block7([], [b8]), key2);
|
||||
const b6 = comp1({row: ctx['row'],col: ctx['col']}, key + \`__1__\${key1}__\${key2}\`, node, this, null);
|
||||
c_block4[i2] = withKey(block5([], [b6]), key2);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b6 = list(c_block6);
|
||||
c_block4[i1] = withKey(block5([], [b6]), key1);
|
||||
const b4 = list(c_block4);
|
||||
c_block2[i1] = withKey(block3([], [b4]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -258,6 +207,7 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach,
|
||||
exports[`list of components reconciliation alg works for t-foreach in t-foreach, 2 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -272,27 +222,20 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach,
|
||||
exports[`list of components simple list 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block3, v_block3, l_block3, c_block3] = prepareList(ctx['state'].elems);;
|
||||
for (let i1 = 0; i1 < l_block3; i1++) {
|
||||
ctx[\`elem\`] = v_block3[i1];
|
||||
const [k_block1, v_block1, l_block1, c_block1] = prepareList(ctx['state'].elems);;
|
||||
for (let i1 = 0; i1 < l_block1; i1++) {
|
||||
ctx[\`elem\`] = v_block1[i1];
|
||||
const key1 = ctx['elem'].id;
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
const b6 = comp1({value: ctx['elem'].value}, key + \`__1__\${key1}\`, node, this, null);
|
||||
const b7 = text(\`
|
||||
\`);
|
||||
c_block3[i1] = withKey(multi([b5, b6, b7]), key1);
|
||||
c_block1[i1] = withKey(comp1({value: ctx['elem'].value}, key + \`__1__\${key1}\`, node, this, null), key1);
|
||||
}
|
||||
const b3 = list(c_block3);
|
||||
return multi([b2, b3]);
|
||||
return list(c_block1);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -300,6 +243,7 @@ exports[`list of components simple list 1`] = `
|
||||
exports[`list of components simple list 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -314,33 +258,23 @@ exports[`list of components simple list 2`] = `
|
||||
exports[`list of components sub components rendered in a loop 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['state'].numbers);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`number\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state'].numbers);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`number\`] = v_block2[i1];
|
||||
const key1 = ctx['number'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const b7 = comp1({n: ctx['number']}, key + \`__1__\${key1}\`, node, this, null);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8]), key1);
|
||||
c_block2[i1] = withKey(comp1({n: ctx['number']}, key + \`__1__\${key1}\`, node, this, null), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -348,6 +282,7 @@ exports[`list of components sub components rendered in a loop 1`] = `
|
||||
exports[`list of components sub components rendered in a loop 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p><block-text-0/></p>\`);
|
||||
@@ -362,33 +297,23 @@ exports[`list of components sub components rendered in a loop 2`] = `
|
||||
exports[`list of components sub components with some state rendered in a loop 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['state'].numbers);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`number\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state'].numbers);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`number\`] = v_block2[i1];
|
||||
const key1 = ctx['number'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const b7 = comp1({}, key + \`__1__\${key1}\`, node, this, null);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8]), key1);
|
||||
c_block2[i1] = withKey(comp1({}, key + \`__1__\${key1}\`, node, this, null), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -396,6 +321,7 @@ exports[`list of components sub components with some state rendered in a loop 1`
|
||||
exports[`list of components sub components with some state rendered in a loop 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p><block-text-0/></p>\`);
|
||||
@@ -410,13 +336,12 @@ exports[`list of components sub components with some state rendered in a loop 2`
|
||||
exports[`list of components switch component position 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
let block1 = createBlock(\`<span>
|
||||
<block-child-0/>
|
||||
</span>\`);
|
||||
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
@@ -424,14 +349,8 @@ exports[`list of components switch component position 1`] = `
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`c\`] = v_block2[i1];
|
||||
const key1 = ctx['c'];
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
const b5 = comp1({key: ctx['c']}, key + \`__1__\${key1}\`, node, this, null);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
c_block2[i1] = withKey(multi([b4, b5, b6]), key1);
|
||||
c_block2[i1] = withKey(comp1({key: ctx['c']}, key + \`__1__\${key1}\`, node, this, null), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
@@ -441,6 +360,7 @@ exports[`list of components switch component position 1`] = `
|
||||
exports[`list of components switch component position 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -455,34 +375,24 @@ exports[`list of components switch component position 2`] = `
|
||||
exports[`list of components t-foreach with t-component, and update 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(Array(2));;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`n\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(Array(2));;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`n\`] = v_block2[i1];
|
||||
ctx[\`n_index\`] = i1;
|
||||
const key1 = ctx['n_index'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const b7 = comp1({val: ctx['n_index']}, key + \`__1__\${key1}\`, node, this, null);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8]), key1);
|
||||
c_block2[i1] = withKey(comp1({val: ctx['n_index']}, key + \`__1__\${key1}\`, node, this, null), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -490,20 +400,15 @@ exports[`list of components t-foreach with t-component, and update 1`] = `
|
||||
exports[`list of components t-foreach with t-component, and update 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<span>
|
||||
<block-text-0/>
|
||||
<block-text-1/>
|
||||
</span>\`);
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['state'].val;
|
||||
let txt2 = ctx['props'].val;
|
||||
const b3 = block3([txt1, txt2]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -3,13 +3,12 @@
|
||||
exports[`t-key t-foreach with t-key switch component position 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
let block1 = createBlock(\`<span>
|
||||
<block-child-0/>
|
||||
</span>\`);
|
||||
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
@@ -17,15 +16,9 @@ exports[`t-key t-foreach with t-key switch component position 1`] = `
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`c\`] = v_block2[i1];
|
||||
const key1 = ctx['c'];
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
const tKey_1 = ctx['key1'];
|
||||
const b5 = toggler(tKey_1, comp1({key: ctx['c']+ctx['key1']}, tKey_1 + key + \`__1__\${key1}\`, node, this, null));
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
c_block2[i1] = withKey(multi([b4, b5, b6]), key1);
|
||||
c_block2[i1] = withKey(comp1({key: ctx['c']+ctx['key1']}, tKey_1 + key + \`__1__\${key1}\`, node, this, null), tKey_1 + key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
@@ -35,6 +28,7 @@ exports[`t-key t-foreach with t-key switch component position 1`] = `
|
||||
exports[`t-key t-foreach with t-key switch component position 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -49,6 +43,7 @@ exports[`t-key t-foreach with t-key switch component position 2`] = `
|
||||
exports[`t-key t-key on Component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -62,6 +57,7 @@ exports[`t-key t-key on Component 1`] = `
|
||||
exports[`t-key t-key on Component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -76,6 +72,7 @@ exports[`t-key t-key on Component 2`] = `
|
||||
exports[`t-key t-key on Component as a function 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -92,6 +89,7 @@ exports[`t-key t-key on Component as a function 1`] = `
|
||||
exports[`t-key t-key on Component as a function 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -106,14 +104,12 @@ exports[`t-key t-key on Component as a function 2`] = `
|
||||
exports[`t-key t-key on multiple Components 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
const comp2 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
let block1 = createBlock(\`<span>
|
||||
<block-child-0/>
|
||||
<block-child-1/>
|
||||
</span>\`);
|
||||
let block1 = createBlock(\`<span><block-child-0/><block-child-1/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const tKey_1 = ctx['key1'];
|
||||
@@ -128,6 +124,7 @@ exports[`t-key t-key on multiple Components 1`] = `
|
||||
exports[`t-key t-key on multiple Components 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -142,15 +139,13 @@ exports[`t-key t-key on multiple Components 2`] = `
|
||||
exports[`t-key t-key on multiple Components with t-call 1 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`calledTemplate\`);
|
||||
const callTemplate_2 = app.getTemplate(\`calledTemplate\`);
|
||||
|
||||
let block1 = createBlock(\`<span>
|
||||
<block-child-0/>
|
||||
<block-child-1/>
|
||||
</span>\`);
|
||||
let block1 = createBlock(\`<span><block-child-0/><block-child-1/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
@@ -164,7 +159,6 @@ exports[`t-key t-key on multiple Components with t-call 1 1`] = `
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"key\\", ctx['key2']);
|
||||
const b3 = callTemplate_2.call(this, ctx, node, key + \`__2\`);
|
||||
ctx = ctx.__proto__;
|
||||
return block1([], [b2, b3]);
|
||||
}
|
||||
}"
|
||||
@@ -173,17 +167,13 @@ exports[`t-key t-key on multiple Components with t-call 1 1`] = `
|
||||
exports[`t-key t-key on multiple Components with t-call 1 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const tKey_1 = ctx['key'];
|
||||
const b3 = toggler(tKey_1, comp1({key: ctx['key']}, tKey_1 + key + \`__1\`, node, this, null));
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return toggler(tKey_1, comp1({key: ctx['key']}, tKey_1 + key + \`__1\`, node, this, null));
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -191,6 +181,7 @@ exports[`t-key t-key on multiple Components with t-call 1 2`] = `
|
||||
exports[`t-key t-key on multiple Components with t-call 1 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -205,12 +196,11 @@ exports[`t-key t-key on multiple Components with t-call 1 3`] = `
|
||||
exports[`t-key t-key on multiple Components with t-call 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`calledTemplate\`);
|
||||
|
||||
let block1 = createBlock(\`<span>
|
||||
<block-child-0/>
|
||||
</span>\`);
|
||||
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
@@ -222,20 +212,17 @@ exports[`t-key t-key on multiple Components with t-call 2 1`] = `
|
||||
exports[`t-key t-key on multiple Components with t-call 2 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
const comp2 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const tKey_1 = ctx['key1'];
|
||||
const b3 = toggler(tKey_1, comp1({key: ctx['key1']}, tKey_1 + key + \`__1\`, node, this, null));
|
||||
const b2 = toggler(tKey_1, comp1({key: ctx['key1']}, tKey_1 + key + \`__1\`, node, this, null));
|
||||
const tKey_2 = ctx['key2'];
|
||||
const b4 = toggler(tKey_2, comp2({key: ctx['key2']}, tKey_2 + key + \`__2\`, node, this, null));
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4, b5]);
|
||||
const b3 = toggler(tKey_2, comp2({key: ctx['key2']}, tKey_2 + key + \`__2\`, node, this, null));
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -243,6 +230,7 @@ exports[`t-key t-key on multiple Components with t-call 2 2`] = `
|
||||
exports[`t-key t-key on multiple Components with t-call 2 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
@@ -3,26 +3,19 @@
|
||||
exports[`t-model directive .lazy modifier 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<input block-attribute-0=\\"value\\" block-handler-1=\\"change\\"/>
|
||||
<span><block-text-2/></span>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><input block-attribute-0=\\"value\\" block-handler-1=\\"change\\"/><span><block-text-2/></span></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const bExpr1 = ctx['state'];
|
||||
const expr1 = 'text';
|
||||
let attr1 = bExpr1[expr1];
|
||||
let hdlr1 = [(ev) => { bExpr1[expr1] = ev.target.value; }];
|
||||
let txt1 = ctx['state'].text;
|
||||
const b3 = block3([attr1, hdlr1, txt1]);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1([attr1, hdlr1, txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -30,26 +23,19 @@ exports[`t-model directive .lazy modifier 1`] = `
|
||||
exports[`t-model directive .number modifier 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/>
|
||||
<span><block-text-2/></span>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/><span><block-text-2/></span></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const bExpr1 = ctx['state'];
|
||||
const expr1 = 'number';
|
||||
let attr1 = bExpr1[expr1];
|
||||
let hdlr1 = [(ev) => { bExpr1[expr1] = toNumber(ev.target.value); }];
|
||||
let txt1 = ctx['state'].number;
|
||||
const b3 = block3([attr1, hdlr1, txt1]);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1([attr1, hdlr1, txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -57,26 +43,19 @@ exports[`t-model directive .number modifier 1`] = `
|
||||
exports[`t-model directive .trim modifier 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/>
|
||||
<span><block-text-2/></span>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/><span><block-text-2/></span></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const bExpr1 = ctx['state'];
|
||||
const expr1 = 'text';
|
||||
let attr1 = bExpr1[expr1];
|
||||
let hdlr1 = [(ev) => { bExpr1[expr1] = ev.target.value.trim(); }];
|
||||
let txt1 = ctx['state'].text;
|
||||
const b3 = block3([attr1, hdlr1, txt1]);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1([attr1, hdlr1, txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -84,24 +63,19 @@ exports[`t-model directive .trim modifier 1`] = `
|
||||
exports[`t-model directive basic use, on an input 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/>
|
||||
<span><block-text-2/></span>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/><span><block-text-2/></span></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const bExpr1 = ctx['state'];
|
||||
const expr1 = 'text';
|
||||
let attr1 = bExpr1[expr1];
|
||||
let hdlr1 = [(ev) => { bExpr1[expr1] = ev.target.value; }];
|
||||
let txt1 = ctx['state'].text;
|
||||
const b3 = block3([attr1, hdlr1, txt1]);
|
||||
return multi([b2, b3]);
|
||||
return block1([attr1, hdlr1, txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -109,24 +83,19 @@ exports[`t-model directive basic use, on an input 1`] = `
|
||||
exports[`t-model directive basic use, on an input with bracket expression 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/>
|
||||
<span><block-text-2/></span>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/><span><block-text-2/></span></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const bExpr1 = ctx['state'];
|
||||
const expr1 = 'text';
|
||||
let attr1 = bExpr1[expr1];
|
||||
let hdlr1 = [(ev) => { bExpr1[expr1] = ev.target.value; }];
|
||||
let txt1 = ctx['state'].text;
|
||||
const b3 = block3([attr1, hdlr1, txt1]);
|
||||
return multi([b2, b3]);
|
||||
return block1([attr1, hdlr1, txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -134,13 +103,11 @@ exports[`t-model directive basic use, on an input with bracket expression 1`] =
|
||||
exports[`t-model directive basic use, on another key in component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<div>
|
||||
<input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/>
|
||||
<span><block-text-2/></span>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/><span><block-text-2/></span></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const bExpr1 = ctx['some'];
|
||||
@@ -156,25 +123,19 @@ exports[`t-model directive basic use, on another key in component 1`] = `
|
||||
exports[`t-model directive can also define t-on directive on same event, part 1 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<input block-handler-0=\\"input\\" block-attribute-1=\\"value\\" block-handler-2=\\"input\\"/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><input block-handler-0=\\"input\\" block-attribute-1=\\"value\\" block-handler-2=\\"input\\"/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let hdlr1 = [ctx['onInput'], ctx];
|
||||
const bExpr1 = ctx['state'];
|
||||
const expr1 = 'text';
|
||||
let attr1 = bExpr1[expr1];
|
||||
let hdlr2 = [(ev) => { bExpr1[expr1] = ev.target.value; }];
|
||||
const b3 = block3([hdlr1, attr1, hdlr2]);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1([hdlr1, attr1, hdlr2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -182,18 +143,13 @@ exports[`t-model directive can also define t-on directive on same event, part 1
|
||||
exports[`t-model directive can also define t-on directive on same event, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block3 = 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>\`);
|
||||
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 = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let hdlr1 = [ctx['onClick'], ctx];
|
||||
const bExpr1 = ctx['state'];
|
||||
const expr1 = 'choice';
|
||||
@@ -209,10 +165,7 @@ exports[`t-model directive can also define t-on directive on same event, part 2
|
||||
const expr3 = 'choice';
|
||||
let attr3 = bExpr3[expr3] === 'Three';
|
||||
let hdlr6 = [(ev) => { bExpr3[expr3] = ev.target.value; }];
|
||||
const b3 = block3([hdlr1, attr1, hdlr2, hdlr3, attr2, hdlr4, hdlr5, attr3, hdlr6]);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1([hdlr1, attr1, hdlr2, hdlr3, attr2, hdlr4, hdlr5, attr3, hdlr6]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -220,28 +173,21 @@ exports[`t-model directive can also define t-on directive on same event, part 2
|
||||
exports[`t-model directive following a scope protecting directive (e.g. t-set) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, toNumber } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"admiral\\", 'Bruno');
|
||||
const bExpr1 = ctx['state'];
|
||||
const expr1 = 'text';
|
||||
let attr1 = bExpr1[expr1];
|
||||
let hdlr1 = [(ev) => { bExpr1[expr1] = ev.target.value; }];
|
||||
const b3 = block3([attr1, hdlr1]);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1([attr1, hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -249,39 +195,27 @@ exports[`t-model directive following a scope protecting directive (e.g. t-set) 1
|
||||
exports[`t-model directive in a t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, toNumber, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block7 = createBlock(\`<input type=\\"checkbox\\" block-attribute-0=\\"checked\\" block-handler-1=\\"input\\"/>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<input type=\\"checkbox\\" block-attribute-0=\\"checked\\" block-handler-1=\\"input\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['state']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`thing\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`thing\`] = v_block2[i1];
|
||||
const key1 = ctx['thing'].id;
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const bExpr1 = ctx['thing'];
|
||||
const expr1 = 'f';
|
||||
let attr1 = bExpr1[expr1];
|
||||
let hdlr1 = [(ev) => { bExpr1[expr1] = ev.target.checked; }];
|
||||
const b7 = block7([attr1, hdlr1]);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8]), key1);
|
||||
c_block2[i1] = withKey(block3([attr1, hdlr1]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b9]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -289,40 +223,28 @@ exports[`t-model directive in a t-foreach 1`] = `
|
||||
exports[`t-model directive in a t-foreach, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, toNumber, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block7 = createBlock(\`<input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['state']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`thing\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`thing\`] = v_block2[i1];
|
||||
ctx[\`thing_index\`] = i1;
|
||||
const key1 = ctx['thing_index'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const bExpr1 = ctx['state'];
|
||||
const expr1 = ctx['thing_index'];
|
||||
let attr1 = bExpr1[expr1];
|
||||
let hdlr1 = [(ev) => { bExpr1[expr1] = ev.target.value; }];
|
||||
const b7 = block7([attr1, hdlr1]);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8]), key1);
|
||||
c_block2[i1] = withKey(block3([attr1, hdlr1]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b9]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -330,40 +252,28 @@ exports[`t-model directive in a t-foreach, part 2 1`] = `
|
||||
exports[`t-model directive in a t-foreach, part 3 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, toNumber, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block7 = createBlock(\`<input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['names']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`name\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['names']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`name\`] = v_block2[i1];
|
||||
ctx[\`name_index\`] = i1;
|
||||
const key1 = ctx['name_index'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const bExpr1 = ctx['state'].values;
|
||||
const expr1 = ctx['name'];
|
||||
let attr1 = bExpr1[expr1];
|
||||
let hdlr1 = [(ev) => { bExpr1[expr1] = ev.target.value; }];
|
||||
const b7 = block7([attr1, hdlr1]);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8]), key1);
|
||||
c_block2[i1] = withKey(block3([attr1, hdlr1]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b9]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -371,17 +281,11 @@ exports[`t-model directive in a t-foreach, part 3 1`] = `
|
||||
exports[`t-model directive on a select 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<div>
|
||||
<select block-attribute-0=\\"value\\" block-handler-1=\\"change\\">
|
||||
<option value=\\"\\">Please select one</option>
|
||||
<option value=\\"red\\">Red</option>
|
||||
<option value=\\"blue\\">Blue</option>
|
||||
</select>
|
||||
<span>Choice: <block-text-2/></span>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><select block-attribute-0=\\"value\\" block-handler-1=\\"change\\"><option value=\\"\\">Please select one</option><option value=\\"red\\">Red</option><option value=\\"blue\\">Blue</option></select><span>Choice: <block-text-2/></span></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const bExpr1 = ctx['state'];
|
||||
@@ -397,28 +301,18 @@ exports[`t-model directive on a select 1`] = `
|
||||
exports[`t-model directive on a select, initial state 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<select block-attribute-0=\\"value\\" block-handler-1=\\"change\\">
|
||||
<option value=\\"\\">Please select one</option>
|
||||
<option value=\\"red\\">Red</option>
|
||||
<option value=\\"blue\\">Blue</option>
|
||||
</select>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><select block-attribute-0=\\"value\\" block-handler-1=\\"change\\"><option value=\\"\\">Please select one</option><option value=\\"red\\">Red</option><option value=\\"blue\\">Blue</option></select></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const bExpr1 = ctx['state'];
|
||||
const expr1 = 'color';
|
||||
let attr1 = bExpr1[expr1];
|
||||
let hdlr1 = [(ev) => { bExpr1[expr1] = ev.target.value; }];
|
||||
const b3 = block3([attr1, hdlr1]);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1([attr1, hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -426,26 +320,19 @@ exports[`t-model directive on a select, initial state 1`] = `
|
||||
exports[`t-model directive on a sub state key 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/>
|
||||
<span><block-text-2/></span>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/><span><block-text-2/></span></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const bExpr1 = ctx['state'].something;
|
||||
const expr1 = 'text';
|
||||
let attr1 = bExpr1[expr1];
|
||||
let hdlr1 = [(ev) => { bExpr1[expr1] = ev.target.value; }];
|
||||
let txt1 = ctx['state'].something.text;
|
||||
const b3 = block3([attr1, hdlr1, txt1]);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1([attr1, hdlr1, txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -453,14 +340,11 @@ exports[`t-model directive on a sub state key 1`] = `
|
||||
exports[`t-model directive on an input type=radio 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<div>
|
||||
<input type=\\"radio\\" id=\\"one\\" value=\\"One\\" block-attribute-0=\\"checked\\" block-handler-1=\\"click\\"/>
|
||||
<input type=\\"radio\\" id=\\"two\\" value=\\"Two\\" block-attribute-2=\\"checked\\" block-handler-3=\\"click\\"/>
|
||||
<span>Choice: <block-text-4/></span>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><input type=\\"radio\\" id=\\"one\\" value=\\"One\\" block-attribute-0=\\"checked\\" block-handler-1=\\"click\\"/><input type=\\"radio\\" id=\\"two\\" value=\\"Two\\" block-attribute-2=\\"checked\\" block-handler-3=\\"click\\"/><span>Choice: <block-text-4/></span></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const bExpr1 = ctx['state'];
|
||||
@@ -480,13 +364,11 @@ exports[`t-model directive on an input type=radio 1`] = `
|
||||
exports[`t-model directive on an input type=radio, with initial value 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<div>
|
||||
<input type=\\"radio\\" id=\\"one\\" value=\\"One\\" block-attribute-0=\\"checked\\" block-handler-1=\\"click\\"/>
|
||||
<input type=\\"radio\\" id=\\"two\\" value=\\"Two\\" block-attribute-2=\\"checked\\" block-handler-3=\\"click\\"/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><input type=\\"radio\\" id=\\"one\\" value=\\"One\\" block-attribute-0=\\"checked\\" block-handler-1=\\"click\\"/><input type=\\"radio\\" id=\\"two\\" value=\\"Two\\" block-attribute-2=\\"checked\\" block-handler-3=\\"click\\"/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const bExpr1 = ctx['state'];
|
||||
@@ -505,15 +387,11 @@ exports[`t-model directive on an input type=radio, with initial value 1`] = `
|
||||
exports[`t-model directive on an input, type=checkbox 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<div>
|
||||
<input type=\\"checkbox\\" block-attribute-0=\\"checked\\" block-handler-1=\\"input\\"/>
|
||||
<span>
|
||||
<block-child-0/><block-child-1/>
|
||||
</span>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><input type=\\"checkbox\\" block-attribute-0=\\"checked\\" block-handler-1=\\"input\\"/><span><block-child-0/><block-child-1/></span></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2,b3;
|
||||
@@ -534,13 +412,11 @@ exports[`t-model directive on an input, type=checkbox 1`] = `
|
||||
exports[`t-model directive on an textarea 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<div>
|
||||
<textarea block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/>
|
||||
<span><block-text-2/></span>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><textarea block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/><span><block-text-2/></span></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const bExpr1 = ctx['state'];
|
||||
@@ -556,6 +432,7 @@ exports[`t-model directive on an textarea 1`] = `
|
||||
exports[`t-model directive t-model on an input with an undefined value 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -574,20 +451,13 @@ exports[`t-model directive t-model on an input with an undefined value 1`] = `
|
||||
exports[`t-model directive t-model on select with static options 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<select block-attribute-0=\\"value\\" block-handler-1=\\"change\\">
|
||||
<option value=\\"a\\"><block-text-2/></option>
|
||||
<option value=\\"b\\"><block-text-3/></option>
|
||||
<option value=\\"c\\"><block-text-4/></option>
|
||||
</select>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><select block-attribute-0=\\"value\\" block-handler-1=\\"change\\"><option value=\\"a\\"><block-text-2/></option><option value=\\"b\\"><block-text-3/></option><option value=\\"c\\"><block-text-4/></option></select></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const bExpr1 = ctx['state'];
|
||||
const expr1 = 'model';
|
||||
let attr1 = bExpr1[expr1];
|
||||
@@ -595,10 +465,7 @@ exports[`t-model directive t-model on select with static options 1`] = `
|
||||
let txt1 = 'a';
|
||||
let txt2 = 'b';
|
||||
let txt3 = 'c';
|
||||
const b3 = block3([attr1, hdlr1, txt1, txt2, txt3]);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1([attr1, hdlr1, txt1, txt2, txt3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -606,19 +473,13 @@ exports[`t-model directive t-model on select with static options 1`] = `
|
||||
exports[`t-model directive t-model with dynamic values on select options -- 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<select block-handler-0=\\"change\\">
|
||||
<option block-attribute-1=\\"value\\" block-attribute-2=\\"selected\\"><block-text-3/></option>
|
||||
<option block-attribute-4=\\"value\\" block-attribute-5=\\"selected\\"><block-text-6/></option>
|
||||
</select>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><select block-handler-0=\\"change\\"><option block-attribute-1=\\"value\\" block-attribute-2=\\"selected\\"><block-text-3/></option><option block-attribute-4=\\"value\\" block-attribute-5=\\"selected\\"><block-text-6/></option></select></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const bExpr1 = ctx['state'];
|
||||
const expr1 = 'model';
|
||||
const bValue1 = bExpr1[expr1];
|
||||
@@ -629,10 +490,7 @@ exports[`t-model directive t-model with dynamic values on select options -- 2 1`
|
||||
let attr3 = (ctx['options'][1]);
|
||||
let attr4 = bValue1 === (ctx['options'][1]);
|
||||
let txt2 = ctx['options'][1];
|
||||
const b3 = block3([hdlr1, attr1, attr2, txt1, attr3, attr4, txt2]);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1([hdlr1, attr1, attr2, txt1, attr3, attr4, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -640,19 +498,13 @@ exports[`t-model directive t-model with dynamic values on select options -- 2 1`
|
||||
exports[`t-model directive t-model with dynamic values on select options -- 3 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<select block-handler-0=\\"change\\">
|
||||
<option block-attribute-1=\\"value\\" block-attribute-2=\\"selected\\"><block-text-3/></option>
|
||||
<option value=\\"b\\" block-attribute-4=\\"selected\\"><block-text-5/></option>
|
||||
</select>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><select block-handler-0=\\"change\\"><option block-attribute-1=\\"value\\" block-attribute-2=\\"selected\\"><block-text-3/></option><option value=\\"b\\" block-attribute-4=\\"selected\\"><block-text-5/></option></select></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const bExpr1 = ctx['state'];
|
||||
const expr1 = 'model';
|
||||
const bValue1 = bExpr1[expr1];
|
||||
@@ -662,10 +514,7 @@ exports[`t-model directive t-model with dynamic values on select options -- 3 1`
|
||||
let txt1 = ctx['options'][0];
|
||||
let attr3 = bValue1 === \\"b\\";
|
||||
let txt2 = ctx['options'][1];
|
||||
const b3 = block3([hdlr1, attr1, attr2, txt1, attr3, txt2]);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1([hdlr1, attr1, attr2, txt1, attr3, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -673,19 +522,13 @@ exports[`t-model directive t-model with dynamic values on select options -- 3 1`
|
||||
exports[`t-model directive t-model with dynamic values on select options 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<select block-handler-0=\\"change\\">
|
||||
<option block-attribute-1=\\"value\\" block-attribute-2=\\"selected\\"><block-text-3/></option>
|
||||
<option block-attribute-4=\\"value\\" block-attribute-5=\\"selected\\"><block-text-6/></option>
|
||||
</select>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><select block-handler-0=\\"change\\"><option block-attribute-1=\\"value\\" block-attribute-2=\\"selected\\"><block-text-3/></option><option block-attribute-4=\\"value\\" block-attribute-5=\\"selected\\"><block-text-6/></option></select></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const bExpr1 = ctx['state'];
|
||||
const expr1 = 'model';
|
||||
const bValue1 = bExpr1[expr1];
|
||||
@@ -696,10 +539,7 @@ exports[`t-model directive t-model with dynamic values on select options 1`] = `
|
||||
let attr3 = ctx['options'][1];
|
||||
let attr4 = bValue1 === ctx['options'][1];
|
||||
let txt2 = ctx['options'][1];
|
||||
const b3 = block3([hdlr1, attr1, attr2, txt1, attr3, attr4, txt2]);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1([hdlr1, attr1, attr2, txt1, attr3, attr4, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -707,44 +547,30 @@ exports[`t-model directive t-model with dynamic values on select options 1`] = `
|
||||
exports[`t-model directive t-model with dynamic values on select options in foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber, prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<select block-handler-0=\\"change\\">
|
||||
<block-child-0/>
|
||||
</select>
|
||||
</div>\`);
|
||||
let block7 = createBlock(\`<option block-attribute-0=\\"value\\" block-attribute-1=\\"selected\\"><block-text-2/></option>\`);
|
||||
let block1 = createBlock(\`<div><select block-handler-0=\\"change\\"><block-child-0/></select></div>\`);
|
||||
let block3 = createBlock(\`<option block-attribute-0=\\"value\\" block-attribute-1=\\"selected\\"><block-text-2/></option>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const bExpr1 = ctx['state'];
|
||||
const expr1 = 'model';
|
||||
const bValue1 = bExpr1[expr1];
|
||||
let hdlr1 = [(ev) => { bExpr1[expr1] = ev.target.value; }];
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['options']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`v\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['options']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`v\`] = v_block2[i1];
|
||||
const key1 = ctx['v'];
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
let attr1 = ctx['v'];
|
||||
let attr2 = bValue1 === ctx['v'];
|
||||
let txt1 = ctx['v'];
|
||||
const b7 = block7([attr1, attr2, txt1]);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
c_block4[i1] = withKey(multi([b6, b7, b8]), key1);
|
||||
c_block2[i1] = withKey(block3([attr1, attr2, txt1]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([hdlr1], [b4]);
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b9]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([hdlr1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -752,38 +578,31 @@ exports[`t-model directive t-model with dynamic values on select options in fore
|
||||
exports[`t-model directive two inputs in a div alternating with a t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
<block-child-1/>
|
||||
</div>\`);
|
||||
let block4 = createBlock(\`<input class=\\"a\\" block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/>\`);
|
||||
let block5 = createBlock(\`<input class=\\"b\\" block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
let block2 = createBlock(\`<input class=\\"a\\" block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/>\`);
|
||||
let block3 = createBlock(\`<input class=\\"b\\" block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4,b5;
|
||||
let b2,b3;
|
||||
if (ctx['state'].flag) {
|
||||
const bExpr1 = ctx['state'];
|
||||
const expr1 = 'text1';
|
||||
let attr1 = bExpr1[expr1];
|
||||
let hdlr1 = [(ev) => { bExpr1[expr1] = ev.target.value; }];
|
||||
b4 = block4([attr1, hdlr1]);
|
||||
b2 = block2([attr1, hdlr1]);
|
||||
}
|
||||
if (!ctx['state'].flag) {
|
||||
const bExpr2 = ctx['state'];
|
||||
const expr2 = 'text2';
|
||||
let attr2 = bExpr2[expr2];
|
||||
let hdlr2 = [(ev) => { bExpr2[expr2] = ev.target.value; }];
|
||||
b5 = block5([attr2, hdlr2]);
|
||||
b3 = block3([attr2, hdlr2]);
|
||||
}
|
||||
const b3 = block3([], [b4, b5]);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b6]);
|
||||
return block1([], [b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -791,26 +610,19 @@ exports[`t-model directive two inputs in a div alternating with a t-if 1`] = `
|
||||
exports[`t-model directive with expression having a changing key 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/>
|
||||
<span><block-text-2/></span>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/><span><block-text-2/></span></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const bExpr1 = ctx['state'].something;
|
||||
const expr1 = ctx['text'].key;
|
||||
let attr1 = bExpr1[expr1];
|
||||
let hdlr1 = [(ev) => { bExpr1[expr1] = ev.target.value; }];
|
||||
let txt1 = ctx['state'].something[ctx['text'].key];
|
||||
const b3 = block3([attr1, hdlr1, txt1]);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1([attr1, hdlr1, txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -3,41 +3,30 @@
|
||||
exports[`t-on t-on expression captured in t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block5 = createBlock(\`<div>
|
||||
<button block-handler-0=\\"click\\">expr</button>
|
||||
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<div><button block-handler-0=\\"click\\">expr</button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"iter\\", 0);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['arr']);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`val\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['arr']);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`val\`] = v_block2[i1];
|
||||
const key1 = ctx['val'];
|
||||
const v1 = ctx['otherState'];
|
||||
const v2 = ctx['iter'];
|
||||
let hdlr1 = [()=>v1.vals.push(v2+'_'+v2), ctx];
|
||||
setContextValue(ctx, \\"iter\\", ctx['iter']+1);
|
||||
c_block4[i1] = withKey(block5([hdlr1]), key1);
|
||||
c_block2[i1] = withKey(block3([hdlr1]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b6]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -45,24 +34,18 @@ exports[`t-on t-on expression captured in t-foreach 1`] = `
|
||||
exports[`t-on t-on expression in t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block5 = createBlock(\`<div>
|
||||
<block-text-0/>: <block-text-1/>
|
||||
<button block-handler-2=\\"click\\">Expr</button>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<div><block-text-0/>: <block-text-1/><button block-handler-2=\\"click\\">Expr</button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['state'].values);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`val\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state'].values);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`val\`] = v_block2[i1];
|
||||
ctx[\`val_index\`] = i1;
|
||||
const key1 = ctx['val'];
|
||||
let txt1 = ctx['val_index'];
|
||||
@@ -70,14 +53,10 @@ exports[`t-on t-on expression in t-foreach 1`] = `
|
||||
const v1 = ctx['otherState'];
|
||||
const v2 = ctx['val'];
|
||||
let hdlr1 = [()=>v1.vals.push(v2), ctx];
|
||||
c_block4[i1] = withKey(block5([txt1, txt2, hdlr1]), key1);
|
||||
c_block2[i1] = withKey(block3([txt1, txt2, hdlr1]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b6]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -85,29 +64,21 @@ exports[`t-on t-on expression in t-foreach 1`] = `
|
||||
exports[`t-on t-on expression in t-foreach with t-set 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block5 = createBlock(\`<div>
|
||||
|
||||
<block-text-0/>: <block-text-1/>
|
||||
<button block-handler-2=\\"click\\">Expr</button>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<div><block-text-0/>: <block-text-1/><button block-handler-2=\\"click\\">Expr</button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"bossa\\", 'nova');
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['state'].values);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`val\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state'].values);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`val\`] = v_block2[i1];
|
||||
ctx[\`val_index\`] = i1;
|
||||
const key1 = ctx['val'];
|
||||
setContextValue(ctx, \\"bossa\\", ctx['bossa']+'_'+ctx['val_index']);
|
||||
@@ -117,14 +88,10 @@ exports[`t-on t-on expression in t-foreach with t-set 1`] = `
|
||||
const v2 = ctx['val'];
|
||||
const v3 = ctx['bossa'];
|
||||
let hdlr1 = [()=>v1.vals.push(v2+'_'+v3), ctx];
|
||||
c_block4[i1] = withKey(block5([txt1, txt2, hdlr1]), key1);
|
||||
c_block2[i1] = withKey(block3([txt1, txt2, hdlr1]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b6]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -132,38 +99,28 @@ exports[`t-on t-on expression in t-foreach with t-set 1`] = `
|
||||
exports[`t-on t-on method call in t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block5 = createBlock(\`<div>
|
||||
<block-text-0/>: <block-text-1/>
|
||||
<button block-handler-2=\\"click\\">meth call</button>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<div><block-text-0/>: <block-text-1/><button block-handler-2=\\"click\\">meth call</button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['state'].values);;
|
||||
for (let i1 = 0; i1 < l_block4; i1++) {
|
||||
ctx[\`val\`] = v_block4[i1];
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state'].values);;
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`val\`] = v_block2[i1];
|
||||
ctx[\`val_index\`] = i1;
|
||||
const key1 = ctx['val'];
|
||||
let txt1 = ctx['val_index'];
|
||||
let txt2 = ctx['val']+'';
|
||||
const v1 = ctx['val'];
|
||||
let hdlr1 = [()=>this.addVal(v1), ctx];
|
||||
c_block4[i1] = withKey(block5([txt1, txt2, hdlr1]), key1);
|
||||
c_block2[i1] = withKey(block3([txt1, txt2, hdlr1]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
const b4 = list(c_block4);
|
||||
const b3 = block3([], [b4]);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b6]);
|
||||
const b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -171,24 +128,19 @@ exports[`t-on t-on method call in t-foreach 1`] = `
|
||||
exports[`t-on t-on on component next to t-on on div 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { createCatcher } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
const catcher1 = createCatcher({\\"click\\":0});
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
<p block-handler-0=\\"click\\">dec</p>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><p block-handler-0=\\"click\\">dec</p></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const hdlr1 = [ctx['increment'], ctx];
|
||||
const b4 = catcher1(comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null), [hdlr1]);
|
||||
const b2 = catcher1(comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null), [hdlr1]);
|
||||
let hdlr2 = [ctx['decrement'], ctx];
|
||||
const b3 = block3([hdlr2], [b4]);
|
||||
return multi([b2, b3]);
|
||||
return block1([hdlr2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -196,6 +148,7 @@ exports[`t-on t-on on component next to t-on on div 1`] = `
|
||||
exports[`t-on t-on on component next to t-on on div 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button><block-text-0/></button>\`);
|
||||
@@ -210,6 +163,7 @@ exports[`t-on t-on on component next to t-on on div 2`] = `
|
||||
exports[`t-on t-on on components 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { createCatcher } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -225,6 +179,7 @@ exports[`t-on t-on on components 1`] = `
|
||||
exports[`t-on t-on on components 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button><block-text-0/></button>\`);
|
||||
@@ -239,30 +194,23 @@ exports[`t-on t-on on components 2`] = `
|
||||
exports[`t-on t-on on components and t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, createCatcher, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
const catcher1 = createCatcher({\\"click\\":0});
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block3, v_block3, l_block3, c_block3] = prepareList(['John','Raoul','Gérald']);;
|
||||
for (let i1 = 0; i1 < l_block3; i1++) {
|
||||
ctx[\`name\`] = v_block3[i1];
|
||||
const [k_block1, v_block1, l_block1, c_block1] = prepareList(['John','Raoul','Gérald']);;
|
||||
for (let i1 = 0; i1 < l_block1; i1++) {
|
||||
ctx[\`name\`] = v_block1[i1];
|
||||
const key1 = ctx['name'];
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
const v1 = ctx['name'];
|
||||
const hdlr1 = [()=>this.log(v1), ctx];
|
||||
const b6 = catcher1(comp1({value: ctx['name']}, key + \`__1__\${key1}\`, node, this, null), [hdlr1]);
|
||||
const b7 = text(\`
|
||||
\`);
|
||||
c_block3[i1] = withKey(multi([b5, b6, b7]), key1);
|
||||
c_block1[i1] = withKey(catcher1(comp1({value: ctx['name']}, key + \`__1__\${key1}\`, node, this, null), [hdlr1]), key1);
|
||||
}
|
||||
const b3 = list(c_block3);
|
||||
return multi([b2, b3]);
|
||||
return list(c_block1);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -270,6 +218,7 @@ exports[`t-on t-on on components and t-foreach 1`] = `
|
||||
exports[`t-on t-on on components and t-foreach 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -284,24 +233,18 @@ exports[`t-on t-on on components and t-foreach 2`] = `
|
||||
exports[`t-on t-on on components, variation 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { createCatcher } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
const catcher1 = createCatcher({\\"click\\":0});
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<span/>
|
||||
<block-child-0/>
|
||||
<p/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><span/><block-child-0/><p/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const hdlr1 = [ctx['increment'], ctx];
|
||||
const b4 = catcher1(comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null), [hdlr1]);
|
||||
const b3 = block3([], [b4]);
|
||||
return multi([b2, b3]);
|
||||
const b2 = catcher1(comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null), [hdlr1]);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -309,6 +252,7 @@ exports[`t-on t-on on components, variation 1`] = `
|
||||
exports[`t-on t-on on components, variation 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button><block-text-0/></button>\`);
|
||||
@@ -323,6 +267,7 @@ exports[`t-on t-on on components, variation 2`] = `
|
||||
exports[`t-on t-on on components, with 'prevent' modifier 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { createCatcher } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -338,6 +283,7 @@ exports[`t-on t-on on components, with 'prevent' modifier 1`] = `
|
||||
exports[`t-on t-on on components, with 'prevent' modifier 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button><block-text-0/></button>\`);
|
||||
@@ -352,6 +298,7 @@ exports[`t-on t-on on components, with 'prevent' modifier 2`] = `
|
||||
exports[`t-on t-on on components, with a handler update 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, createCatcher } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -360,15 +307,10 @@ exports[`t-on t-on on components, with a handler update 1`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"name\\", ctx['state'].name);
|
||||
const b3 = text(\`
|
||||
\`);
|
||||
const v1 = ctx['name'];
|
||||
const hdlr1 = [()=>this.log(v1), ctx];
|
||||
const b4 = catcher1(comp1({value: ctx['name']}, key + \`__1\`, node, this, null), [hdlr1]);
|
||||
return multi([b2, b3, b4]);
|
||||
return catcher1(comp1({value: ctx['name']}, key + \`__1\`, node, this, null), [hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -376,6 +318,7 @@ exports[`t-on t-on on components, with a handler update 1`] = `
|
||||
exports[`t-on t-on on components, with a handler update 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -390,6 +333,7 @@ exports[`t-on t-on on components, with a handler update 2`] = `
|
||||
exports[`t-on t-on on destroyed components 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -408,6 +352,7 @@ exports[`t-on t-on on destroyed components 1`] = `
|
||||
exports[`t-on t-on on destroyed components 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-handler-0=\\"click\\"/>\`);
|
||||
@@ -422,26 +367,19 @@ exports[`t-on t-on on destroyed components 2`] = `
|
||||
exports[`t-on t-on on slot, with 'prevent' modifier 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
||||
|
||||
let block5 = createBlock(\`<button>button</button>\`);
|
||||
let block1 = createBlock(\`<button>button</button>\`);
|
||||
|
||||
function slot1(ctx, node, key = \\"\\") {
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
const b5 = block5();
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
return multi([b4, b5, b6]);
|
||||
return block1();
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b7 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
||||
return multi([b2, b7]);
|
||||
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -449,6 +387,7 @@ exports[`t-on t-on on slot, with 'prevent' modifier 1`] = `
|
||||
exports[`t-on t-on on slot, with 'prevent' modifier 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot, createCatcher } = helpers;
|
||||
const catcher1 = createCatcher({\\"click.prevent\\":0});
|
||||
@@ -463,44 +402,29 @@ exports[`t-on t-on on slot, with 'prevent' modifier 2`] = `
|
||||
exports[`t-on t-on on t-set-slots 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { capture, createCatcher, markRaw } = helpers;
|
||||
const catcher1 = createCatcher({\\"click\\":0});
|
||||
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
||||
|
||||
let block7 = createBlock(\`<p>something</p>\`);
|
||||
let block9 = createBlock(\`<p>paragraph</p>\`);
|
||||
let block6 = createBlock(\`<p>something</p>\`);
|
||||
let block7 = createBlock(\`<p>paragraph</p>\`);
|
||||
|
||||
function slot1(ctx, node, key = \\"\\") {
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const b6 = block6();
|
||||
const b7 = block7();
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
const b9 = block9();
|
||||
const b10 = text(\`
|
||||
\`);
|
||||
const hdlr1 = [()=>this.state.count++, ctx];
|
||||
return catcher1(multi([b6, b7, b8, b9, b10]), [hdlr1]);
|
||||
}
|
||||
|
||||
function slot2(ctx, node, key = \\"\\") {
|
||||
const b12 = text(\`
|
||||
\`);
|
||||
const b13 = text(\`
|
||||
\`);
|
||||
return multi([b12, b13]);
|
||||
return catcher1(multi([b6, b7]), [hdlr1]);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
[\`);
|
||||
const b2 = text(\` [\`);
|
||||
const b3 = text(ctx['state'].count);
|
||||
const b4 = text(\`]
|
||||
\`);
|
||||
const b4 = text(\`] \`);
|
||||
const ctx1 = capture(ctx);
|
||||
const b14 = comp1({slots: markRaw({'myslot': {__render: slot1, __ctx: ctx1}, 'default': {__render: slot2, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
||||
return multi([b2, b3, b4, b14]);
|
||||
const b8 = comp1({slots: markRaw({'myslot': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
||||
return multi([b2, b3, b4, b8]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -508,6 +432,7 @@ exports[`t-on t-on on t-set-slots 1`] = `
|
||||
exports[`t-on t-on on t-set-slots 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -520,26 +445,19 @@ exports[`t-on t-on on t-set-slots 2`] = `
|
||||
exports[`t-on t-on on t-slots 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
||||
|
||||
let block5 = createBlock(\`<p>something</p>\`);
|
||||
let block1 = createBlock(\`<p>something</p>\`);
|
||||
|
||||
function slot1(ctx, node, key = \\"\\") {
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
const b5 = block5();
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
return multi([b4, b5, b6]);
|
||||
return block1();
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b7 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
||||
return multi([b2, b7]);
|
||||
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -547,16 +465,15 @@ exports[`t-on t-on on t-slots 1`] = `
|
||||
exports[`t-on t-on on t-slots 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot, createCatcher } = helpers;
|
||||
const catcher1 = createCatcher({\\"click\\":0});
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
[\`);
|
||||
const b2 = text(\` [\`);
|
||||
const b3 = text(ctx['state'].count);
|
||||
const b4 = text(\`]
|
||||
\`);
|
||||
const b4 = text(\`] \`);
|
||||
const hdlr1 = [()=>this.state.count++, ctx];
|
||||
const b5 = catcher1(callSlot(ctx, node, key, 'default', false, {}), [hdlr1]);
|
||||
return multi([b2, b3, b4, b5]);
|
||||
|
||||
@@ -3,21 +3,15 @@
|
||||
exports[`t-props basic use 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, true, false);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b4 = comp1(Object.assign({}, ctx['some'].obj), key + \`__1\`, node, this, null);
|
||||
const b3 = block3([], [b4]);
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b5]);
|
||||
const b2 = comp1(Object.assign({}, ctx['some'].obj), key + \`__1\`, node, this, null);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -25,20 +19,14 @@ exports[`t-props basic use 1`] = `
|
||||
exports[`t-props basic use 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<span>
|
||||
<block-text-0/>
|
||||
</span>\`);
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['props'].a+ctx['props'].b;
|
||||
const b3 = block3([txt1]);
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b4]);
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -46,6 +34,7 @@ exports[`t-props basic use 2`] = `
|
||||
exports[`t-props child receives a copy of the t-props object, not the original 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, true, false);
|
||||
|
||||
@@ -58,6 +47,7 @@ exports[`t-props child receives a copy of the t-props object, not the original 1
|
||||
exports[`t-props child receives a copy of the t-props object, not the original 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -71,6 +61,7 @@ exports[`t-props child receives a copy of the t-props object, not the original 2
|
||||
exports[`t-props t-props and other props 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Comp\`, true, false, true, false);
|
||||
|
||||
@@ -86,6 +77,7 @@ exports[`t-props t-props and other props 1`] = `
|
||||
exports[`t-props t-props and other props 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/><block-text-1/></div>\`);
|
||||
@@ -101,6 +93,7 @@ exports[`t-props t-props and other props 2`] = `
|
||||
exports[`t-props t-props only 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Comp\`, true, false, true, false);
|
||||
|
||||
@@ -116,6 +109,7 @@ exports[`t-props t-props only 1`] = `
|
||||
exports[`t-props t-props only 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -130,21 +124,15 @@ exports[`t-props t-props only 2`] = `
|
||||
exports[`t-props t-props with props 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, true, false);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<block-child-0/>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const b4 = comp1(Object.assign({}, ctx['childProps'], {a: 1,b: 2}), key + \`__1\`, node, this, null);
|
||||
const b3 = block3([], [b4]);
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
return multi([b2, b3, b5]);
|
||||
const b2 = comp1(Object.assign({}, ctx['childProps'], {a: 1,b: 2}), key + \`__1\`, node, this, null);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -152,6 +140,7 @@ exports[`t-props t-props with props 1`] = `
|
||||
exports[`t-props t-props with props 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
|
||||
@@ -3,40 +3,29 @@
|
||||
exports[`t-set slot setted value (with t-set) not accessible with t-esc 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, capture, markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`Childcomp\`, true, true, false, true);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<p><block-text-0/></p>
|
||||
<block-child-0/>
|
||||
<p><block-text-1/></p>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><p><block-text-0/></p><block-child-0/><p><block-text-1/></p></div>\`);
|
||||
|
||||
function slot1(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"iter\\", 'inCall');
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
return multi([b5, b6]);
|
||||
return text('');
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"iter\\", 'source');
|
||||
let txt1 = ctx['iter'];
|
||||
const ctx1 = capture(ctx);
|
||||
const b7 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
||||
const b2 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
||||
let txt2 = ctx['iter'];
|
||||
const b3 = block3([txt1, txt2], [b7]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt1, txt2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -44,6 +33,7 @@ exports[`t-set slot setted value (with t-set) not accessible with t-esc 1`] = `
|
||||
exports[`t-set slot setted value (with t-set) not accessible with t-esc 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -63,6 +53,7 @@ exports[`t-set slot setted value (with t-set) not accessible with t-esc 2`] = `
|
||||
exports[`t-set slots with a t-set with a component in body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { capture, isBoundary, withDefault, LazyValue, safeOutput, markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`C\`, true, false, false, true);
|
||||
@@ -71,33 +62,19 @@ exports[`t-set slots with a t-set with a component in body 1`] = `
|
||||
function slot1(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
ctx[\`v\`] = new LazyValue(value1, ctx, this, node);
|
||||
const b9 = text(\`
|
||||
in slot
|
||||
\`);
|
||||
const b10 = safeOutput(ctx['v']);
|
||||
const b11 = text(\`
|
||||
\`);
|
||||
return multi([b4, b9, b10, b11]);
|
||||
const b3 = text(\` in slot \`);
|
||||
const b4 = safeOutput(ctx['v']);
|
||||
return multi([b3, b4]);
|
||||
}
|
||||
|
||||
function value1(ctx, node, key = \\"\\") {
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const b7 = comp1({}, key + \`__1\`, node, this, null);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
return multi([b6, b7, b8]);
|
||||
return comp1({}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const ctx1 = capture(ctx);
|
||||
const b12 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
|
||||
return multi([b2, b12]);
|
||||
return comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -105,6 +82,7 @@ exports[`t-set slots with a t-set with a component in body 1`] = `
|
||||
exports[`t-set slots with a t-set with a component in body 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -119,6 +97,7 @@ exports[`t-set slots with a t-set with a component in body 2`] = `
|
||||
exports[`t-set slots with a t-set with a component in body 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -130,46 +109,32 @@ exports[`t-set slots with a t-set with a component in body 3`] = `
|
||||
exports[`t-set slots with an t-set with a component in body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { capture, isBoundary, withDefault, LazyValue, safeOutput, markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`Blorg\`, true, true, false, true);
|
||||
|
||||
let block9 = createBlock(\`<div>coffee</div>\`);
|
||||
let block4 = createBlock(\`<div>coffee</div>\`);
|
||||
|
||||
function slot1(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
ctx[\`v\`] = new LazyValue(value1, ctx, this, node);
|
||||
const b11 = text(\`
|
||||
tea
|
||||
\`);
|
||||
const b12 = safeOutput(ctx['v']);
|
||||
const b13 = text(\`
|
||||
\`);
|
||||
return multi([b4, b11, b12, b13]);
|
||||
const b5 = text(\` tea \`);
|
||||
const b6 = safeOutput(ctx['v']);
|
||||
return multi([b5, b6]);
|
||||
}
|
||||
|
||||
function value1(ctx, node, key = \\"\\") {
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const b7 = comp1({}, key + \`__1\`, node, this, null);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
const b9 = block9();
|
||||
const b10 = text(\`
|
||||
\`);
|
||||
return multi([b6, b7, b8, b9, b10]);
|
||||
const b3 = comp1({}, key + \`__1\`, node, this, null);
|
||||
const b4 = block4();
|
||||
return multi([b3, b4]);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const ctx1 = capture(ctx);
|
||||
const b14 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
|
||||
return multi([b2, b14]);
|
||||
return comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -177,6 +142,7 @@ exports[`t-set slots with an t-set with a component in body 1`] = `
|
||||
exports[`t-set slots with an t-set with a component in body 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -191,6 +157,7 @@ exports[`t-set slots with an t-set with a component in body 2`] = `
|
||||
exports[`t-set slots with an t-set with a component in body 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -202,6 +169,7 @@ exports[`t-set slots with an t-set with a component in body 3`] = `
|
||||
exports[`t-set slots with an unused t-set with a component in body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { capture, isBoundary, withDefault, LazyValue, markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
@@ -210,30 +178,17 @@ exports[`t-set slots with an unused t-set with a component in body 1`] = `
|
||||
function slot1(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b4 = text(\`
|
||||
\`);
|
||||
ctx[\`v\`] = new LazyValue(value1, ctx, this, node);
|
||||
const b9 = text(\`
|
||||
in slot
|
||||
\`);
|
||||
return multi([b4, b9]);
|
||||
return text(\` in slot \`);
|
||||
}
|
||||
|
||||
function value1(ctx, node, key = \\"\\") {
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
const b7 = comp1({}, key + \`__1\`, node, this, null);
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
return multi([b6, b7, b8]);
|
||||
return comp1({}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
const ctx1 = capture(ctx);
|
||||
const b10 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
|
||||
return multi([b2, b10]);
|
||||
return comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -241,6 +196,7 @@ exports[`t-set slots with an unused t-set with a component in body 1`] = `
|
||||
exports[`t-set slots with an unused t-set with a component in body 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -255,25 +211,19 @@ exports[`t-set slots with an unused t-set with a component in body 2`] = `
|
||||
exports[`t-set t-set can't alter component even if key in component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<p><block-text-0/></p>
|
||||
|
||||
<p><block-text-1/></p>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><p><block-text-0/></p><p><block-text-1/></p></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['iter'];
|
||||
setContextValue(ctx, \\"iter\\", 5);
|
||||
let txt2 = ctx['iter'];
|
||||
const b3 = block3([txt1, txt2]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -281,25 +231,19 @@ exports[`t-set t-set can't alter component even if key in component 1`] = `
|
||||
exports[`t-set t-set can't alter component if key not in component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
<p><block-text-0/></p>
|
||||
|
||||
<p><block-text-1/></p>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><p><block-text-0/></p><p><block-text-1/></p></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let txt1 = ctx['iter'];
|
||||
setContextValue(ctx, \\"iter\\", 5);
|
||||
let txt2 = ctx['iter'];
|
||||
const b3 = block3([txt1, txt2]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -307,47 +251,25 @@ exports[`t-set t-set can't alter component if key not in component 1`] = `
|
||||
exports[`t-set t-set in t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<block-child-0/><block-child-1/><block-child-2/>
|
||||
<p><block-text-0/></p>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-0/><block-child-0/><p><block-text-0/></p></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4,b7,b10;
|
||||
setContextValue(ctx, \\"flag\\", ctx['state'].flag);
|
||||
if (ctx['flag']==='if') {
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"iter\\", 2);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
b4 = multi([b5, b6]);
|
||||
} else if (ctx['flag']==='elif') {
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"iter\\", 3);
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
b7 = multi([b8, b9]);
|
||||
} else {
|
||||
const b11 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"iter\\", 4);
|
||||
const b12 = text(\`
|
||||
\`);
|
||||
b10 = multi([b11, b12]);
|
||||
}
|
||||
let txt1 = ctx['iter'];
|
||||
const b3 = block3([txt1], [b4, b7, b10]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -355,28 +277,21 @@ exports[`t-set t-set in t-if 1`] = `
|
||||
exports[`t-set t-set not altered by child comp 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const comp1 = app.createComponent(\`Childcomp\`, true, false, false, true);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<p><block-text-0/></p>
|
||||
<block-child-0/>
|
||||
<p><block-text-1/></p>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><p><block-text-0/></p><block-child-0/><p><block-text-1/></p></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"iter\\", 'source');
|
||||
let txt1 = ctx['iter'];
|
||||
const b4 = comp1({}, key + \`__1\`, node, this, null);
|
||||
const b2 = comp1({}, key + \`__1\`, node, this, null);
|
||||
let txt2 = ctx['iter'];
|
||||
const b3 = block3([txt1, txt2], [b4]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt1, txt2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -384,6 +299,7 @@ exports[`t-set t-set not altered by child comp 1`] = `
|
||||
exports[`t-set t-set not altered by child comp 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -403,49 +319,26 @@ exports[`t-set t-set not altered by child comp 2`] = `
|
||||
exports[`t-set t-set outside modified in t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
|
||||
<block-child-0/><block-child-1/><block-child-2/>
|
||||
<p><block-text-0/></p>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-0/><block-child-0/><p><block-text-0/></p></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
let b4,b7,b10;
|
||||
setContextValue(ctx, \\"iter\\", 0);
|
||||
setContextValue(ctx, \\"flag\\", ctx['state'].flag);
|
||||
if (ctx['flag']==='if') {
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"iter\\", 2);
|
||||
const b6 = text(\`
|
||||
\`);
|
||||
b4 = multi([b5, b6]);
|
||||
} else if (ctx['flag']==='elif') {
|
||||
const b8 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"iter\\", 3);
|
||||
const b9 = text(\`
|
||||
\`);
|
||||
b7 = multi([b8, b9]);
|
||||
} else {
|
||||
const b11 = text(\`
|
||||
\`);
|
||||
setContextValue(ctx, \\"iter\\", 4);
|
||||
const b12 = text(\`
|
||||
\`);
|
||||
b10 = multi([b11, b12]);
|
||||
}
|
||||
let txt1 = ctx['iter'];
|
||||
const b3 = block3([txt1], [b4, b7, b10]);
|
||||
return multi([b2, b3]);
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -453,33 +346,23 @@ exports[`t-set t-set outside modified in t-if 1`] = `
|
||||
exports[`t-set t-set with a component in body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue, safeOutput } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<div><block-child-0/></div>
|
||||
</div>\`);
|
||||
let block1 = createBlock(\`<div><div><block-child-0/></div></div>\`);
|
||||
|
||||
function value1(ctx, node, key = \\"\\") {
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
const b6 = comp1({}, key + \`__1\`, node, this, null);
|
||||
const b7 = text(\`
|
||||
\`);
|
||||
return multi([b5, b6, b7]);
|
||||
return comp1({}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx[\`v\`] = new LazyValue(value1, ctx, this, node);
|
||||
const b8 = safeOutput(ctx['v']);
|
||||
const b3 = block3([], [b8]);
|
||||
return multi([b2, b3]);
|
||||
const b3 = safeOutput(ctx['v']);
|
||||
return block1([], [b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -487,6 +370,7 @@ exports[`t-set t-set with a component in body 1`] = `
|
||||
exports[`t-set t-set with a component in body 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -498,33 +382,23 @@ exports[`t-set t-set with a component in body 2`] = `
|
||||
exports[`t-set t-set with something in body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue, safeOutput } = helpers;
|
||||
|
||||
let block3 = createBlock(\`<div>
|
||||
|
||||
<div><block-child-0/></div>
|
||||
</div>\`);
|
||||
let block6 = createBlock(\`<p>coucou</p>\`);
|
||||
let block1 = createBlock(\`<div><div><block-child-0/></div></div>\`);
|
||||
let block2 = createBlock(\`<p>coucou</p>\`);
|
||||
|
||||
function value1(ctx, node, key = \\"\\") {
|
||||
const b5 = text(\`
|
||||
\`);
|
||||
const b6 = block6();
|
||||
const b7 = text(\`
|
||||
\`);
|
||||
return multi([b5, b6, b7]);
|
||||
return block2();
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
const b2 = text(\`
|
||||
\`);
|
||||
ctx[\`v\`] = new LazyValue(value1, ctx, this, node);
|
||||
const b8 = safeOutput(ctx['v']);
|
||||
const b3 = block3([], [b8]);
|
||||
return multi([b2, b3]);
|
||||
const b3 = safeOutput(ctx['v']);
|
||||
return block1([], [b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -1084,25 +1084,4 @@ describe("t-out in components", () => {
|
||||
await nextTick();
|
||||
expect(fixture.innerHTML).toBe("<div>1</div><div>2</div>");
|
||||
});
|
||||
|
||||
test("t-out and updating falsy values, ", async () => {
|
||||
class Test extends Component {
|
||||
static template = xml`<t t-out="state.a"/>`;
|
||||
state: any = useState({ a: 0 });
|
||||
}
|
||||
|
||||
const comp = await mount(Test, fixture);
|
||||
expect(fixture.innerHTML).toBe("0");
|
||||
comp.state.a = undefined;
|
||||
await nextTick();
|
||||
expect(fixture.innerHTML).toBe("");
|
||||
|
||||
comp.state.a = "hello";
|
||||
await nextTick();
|
||||
expect(fixture.innerHTML).toBe("hello");
|
||||
|
||||
comp.state.a = false;
|
||||
await nextTick();
|
||||
expect(fixture.innerHTML).toBe("false");
|
||||
});
|
||||
});
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user