Files
owl/tests/components/__snapshots__/slots.test.ts.snap
T
2022-07-06 12:07:20 +02:00

3768 lines
107 KiB
Plaintext

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`slots can define a default content 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Dialog\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({}, key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
`;
exports[`slots can define a default content 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<span>
<block-child-0/>
</span>\`);
function defaultContent1(ctx, node, key = \\"\\") {
return text(\`default content\`);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b5 = callSlot(ctx, node, key, 'default', false, {}, defaultContent1);
const b3 = block3([], [b5]);
return multi([b2, b3]);
}
}"
`;
exports[`slots can define and call slots 1`] = `
"function anonymous(app, bdom, helpers
) {
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>
<block-child-0/>
</div>\`);
let block4 = createBlock(\`<span>header</span>\`);
let block5 = createBlock(\`<span>footer</span>\`);
function slot1(ctx, node, key = \\"\\") {
return block4();
}
function slot2(ctx, node, key = \\"\\") {
return block5();
}
function slot3(ctx, node, key = \\"\\") {
const b7 = text(\`
\`);
const b8 = text(\`
\`);
const b9 = text(\`
\`);
return multi([b7, b8, b9]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const ctx1 = capture(ctx);
const b10 = comp1({slots: markRaw({'header': {__render: slot1, __ctx: ctx1}, 'footer': {__render: slot2, __ctx: ctx1}, 'default': {__render: slot3, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
const b3 = block3([], [b10]);
return multi([b2, b3]);
}
}"
`;
exports[`slots can define and call slots 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<div>
<div><block-child-0/></div>
<div><block-child-1/></div>
</div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b4 = callSlot(ctx, node, key, 'header', false, {});
const b5 = callSlot(ctx, node, key, 'footer', false, {});
const b3 = block3([], [b4, b5]);
return multi([b2, b3]);
}
}"
`;
exports[`slots can define and call slots with bound params 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, bind, markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
return text(\`abc\`);
}
function slot2(ctx, node, key = \\"\\") {
const b5 = text(\`
\`);
const b6 = text(\`
\`);
return multi([b5, b6]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const ctx1 = capture(ctx);
const b7 = comp1({slots: markRaw({'abc': {__render: slot1, __ctx: ctx1, getValue: bind(ctx, ctx['getValue'])}, 'default': {__render: slot2, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
return multi([b2, b7]);
}
}"
`;
exports[`slots can define and call slots with bound params 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b3 = callSlot(ctx, node, key, 'abc', false, {});
const b4 = text(\`
\`);
const b5 = text(ctx['props'].slots['abc'].getValue());
return multi([b2, b3, b4, b5]);
}
}"
`;
exports[`slots can define and call slots with params 1`] = `
"function anonymous(app, bdom, helpers
) {
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>
<block-child-0/>
</div>\`);
let block4 = createBlock(\`<span>header</span>\`);
let block5 = createBlock(\`<span>footer</span>\`);
function slot1(ctx, node, key = \\"\\") {
return block4();
}
function slot2(ctx, node, key = \\"\\") {
return block5();
}
function slot3(ctx, node, key = \\"\\") {
const b7 = text(\`
\`);
const b8 = text(\`
\`);
const b9 = text(\`
\`);
return multi([b7, b8, b9]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const ctx1 = capture(ctx);
const b10 = comp1({slots: markRaw({'header': {__render: slot1, __ctx: ctx1, param: ctx['var']}, 'footer': {__render: slot2, __ctx: ctx1, param: '5'}, 'default': {__render: slot3, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
const b3 = block3([], [b10]);
return multi([b2, b3]);
}
}"
`;
exports[`slots can define and call slots with params 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<div>
<block-text-0/>
<div><block-child-0/></div>
<block-text-1/>
<div><block-child-1/></div>
</div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
let txt1 = ctx['props'].slots['header'].param;
const b4 = callSlot(ctx, node, key, 'header', false, {});
let txt2 = ctx['props'].slots['footer'].param;
const b5 = callSlot(ctx, node, key, 'footer', false, {});
const b3 = block3([txt1, txt2], [b4, b5]);
return multi([b2, b3]);
}
}"
`;
exports[`slots can render node with t-ref and Component in same slot 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
const comp2 = app.createComponent(\`Child\`, true, true, false, true);
let block2 = createBlock(\`<div block-ref=\\"0\\"/>\`);
function slot1(ctx, node, key = \\"\\") {
const refs = ctx.__owl__.refs;
const ref1 = (el) => refs[\`div\`] = el;
const b2 = block2([ref1]);
const b3 = comp1({}, key + \`__1\`, node, this, null);
return multi([b2, b3]);
}
return function template(ctx, node, key = \\"\\") {
return comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
}
}"
`;
exports[`slots can render node with t-ref and Component in same slot 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
return function template(ctx, node, key = \\"\\") {
return callSlot(ctx, node, key, 'default', false, {});
}
}"
`;
exports[`slots can render only empty slot 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
return function template(ctx, node, key = \\"\\") {
return callSlot(ctx, node, key, 'default', false, {});
}
}"
`;
exports[`slots can use component in default-content of t-slot 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
return comp1({}, key + \`__1\`, node, this, null);
}
}"
`;
exports[`slots can use component in default-content of t-slot 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
const comp1 = app.createComponent(\`GrandChild\`, true, false, false, true);
function defaultContent1(ctx, node, key = \\"\\") {
return comp1({}, key + \`__1\`, node, this, null);
}
return function template(ctx, node, key = \\"\\") {
return callSlot(ctx, node, key, 'default', false, {}, defaultContent1);
}
}"
`;
exports[`slots can use component in default-content of t-slot 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`\`);
}
}"
`;
exports[`slots can use t-call in default-content of t-slot 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
return comp1({}, key + \`__1\`, node, this, null);
}
}"
`;
exports[`slots can use t-call in default-content of t-slot 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
const callTemplate_1 = app.getTemplate(\`__template__999\`);
function defaultContent1(ctx, node, key = \\"\\") {
return callTemplate_1.call(this, ctx, node, key + \`__1\`);
}
return function template(ctx, node, key = \\"\\") {
return callSlot(ctx, node, key, 'default', false, {}, defaultContent1);
}
}"
`;
exports[`slots can use t-call in default-content of t-slot 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`\`);
}
}"
`;
exports[`slots content is the default slot (variation) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
let block5 = createBlock(\`<span>sts rocks</span>\`);
function slot1(ctx, node, key = \\"\\") {
const b4 = text(\`
\`);
const b5 = block5();
const b6 = text(\`
\`);
return multi([b4, b5, b6]);
}
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]);
}
}"
`;
exports[`slots content is the default slot (variation) 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
return function template(ctx, node, key = \\"\\") {
return callSlot(ctx, node, key, 'default', false, {});
}
}"
`;
exports[`slots content is the default slot 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
let block3 = createBlock(\`<div>
<block-child-0/>
</div>\`);
let block6 = createBlock(\`<span>sts rocks</span>\`);
function slot1(ctx, node, key = \\"\\") {
const b5 = text(\`
\`);
const b6 = block6();
const b7 = text(\`
\`);
return multi([b5, b6, b7]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b8 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
const b3 = block3([], [b8]);
return multi([b2, b3]);
}
}"
`;
exports[`slots content is the default slot 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'default', false, {});
return block1([], [b2]);
}
}"
`;
exports[`slots default content is not rendered if named slot is provided 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, markRaw } = helpers;
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
function slot1(ctx, node, key = \\"\\") {
return text(\`hey\`);
}
return function template(ctx, node, key = \\"\\") {
const ctx1 = capture(ctx);
const b3 = comp1({slots: markRaw({'header': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
return block1([], [b3]);
}
}"
`;
exports[`slots default content is not rendered if named slot is provided 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<span>
<block-child-0/>
</span>\`);
function defaultContent1(ctx, node, key = \\"\\") {
return text(\`default content\`);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b5 = callSlot(ctx, node, key, 'header', false, {}, defaultContent1);
const b3 = block3([], [b5]);
return multi([b2, b3]);
}
}"
`;
exports[`slots default content is not rendered if slot is provided 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
function slot1(ctx, node, key = \\"\\") {
return text(\`hey\`);
}
return function template(ctx, node, key = \\"\\") {
const b3 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
return block1([], [b3]);
}
}"
`;
exports[`slots default content is not rendered if slot is provided 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<span>
<block-child-0/>
</span>\`);
function defaultContent1(ctx, node, key = \\"\\") {
return text(\`default content\`);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b5 = callSlot(ctx, node, key, 'default', false, {}, defaultContent1);
const b3 = block3([], [b5]);
return multi([b2, b3]);
}
}"
`;
exports[`slots default slot next to named slot, with default content 1`] = `
"function anonymous(app, bdom, helpers
) {
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>
<block-child-0/>
</div>\`);
function slot1(ctx, node, key = \\"\\") {
return text(\`
Overridden footer
\`);
}
function slot2(ctx, node, key = \\"\\") {
const b6 = text(\`
\`);
const b7 = text(\`
\`);
return multi([b6, b7]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
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([], [b8]);
const b9 = text(\`
\`);
return multi([b2, b3, b9]);
}
}"
`;
exports[`slots default slot next to named slot, with default content 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<div class=\\"Dialog\\">
<div class=\\"content\\">
<block-child-0/>
</div>
<div class=\\"footer\\">
<block-child-1/>
</div>
</div>\`);
function defaultContent1(ctx, node, key = \\"\\") {
return text(\`
Default content
\`);
}
function defaultContent2(ctx, node, key = \\"\\") {
return text(\`
Default footer
\`);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b5 = callSlot(ctx, node, key, 'default', false, {}, defaultContent1);
const b7 = callSlot(ctx, node, key, 'footer', false, {}, defaultContent2);
const b3 = block3([], [b5, b7]);
const b8 = text(\`
\`);
return multi([b2, b3, b8]);
}
}"
`;
exports[`slots default slot with params with - in it 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
return text(ctx['slotScope']['some-value']);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b4 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx, __scope: \\"slotScope\\"}})}, key + \`__1\`, node, this, null);
return multi([b2, b4]);
}
}"
`;
exports[`slots default slot with params with - in it 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
return function template(ctx, node, key = \\"\\") {
return callSlot(ctx, node, key, 'default', false, {'some-value': ctx['state'].value});
}
}"
`;
exports[`slots default slot with slot scope: shorthand syntax 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
let b4,b5,b6,b7;
b4 = text(\`
\`);
if (ctx['slotScope'].bool) {
b5 = text(\`some text\`);
} else {
b6 = text(\`other text\`);
}
b7 = text(\`
\`);
return multi([b4, b5, b6, b7]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b8 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx, __scope: \\"slotScope\\"}})}, key + \`__1\`, node, this, null);
return multi([b2, b8]);
}
}"
`;
exports[`slots default slot with slot scope: shorthand syntax 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'default', false, {bool: ctx['state'].bool});
return block1([], [b2]);
}
}"
`;
exports[`slots default slot work with text nodes (variation) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
return text(\`sts rocks\`);
}
return function template(ctx, node, key = \\"\\") {
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
}
}"
`;
exports[`slots default slot work with text nodes (variation) 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
return function template(ctx, node, key = \\"\\") {
return callSlot(ctx, node, key, 'default', false, {});
}
}"
`;
exports[`slots default slot work with text nodes 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
let block3 = createBlock(\`<div>
<block-child-0/>
</div>\`);
function slot1(ctx, node, key = \\"\\") {
return text(\`sts rocks\`);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b5 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
const b3 = block3([], [b5]);
return multi([b2, b3]);
}
}"
`;
exports[`slots default slot work with text nodes 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'default', false, {});
return block1([], [b2]);
}
}"
`;
exports[`slots dynamic t-slot call 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, markRaw } = helpers;
const comp1 = app.createComponent(\`Toggler\`, true, true, false, true);
let block3 = createBlock(\`<div>
<block-child-0/>
</div>\`);
let block5 = createBlock(\`<p>slot1</p>\`);
let block6 = createBlock(\`<span>content</span>\`);
let block7 = createBlock(\`<h1>slot2</h1>\`);
function slot1(ctx, node, key = \\"\\") {
const b5 = block5();
const b6 = block6();
return multi([b5, b6]);
}
function slot2(ctx, node, key = \\"\\") {
return block7();
}
function slot3(ctx, node, key = \\"\\") {
const b9 = text(\`
\`);
const b10 = text(\`
\`);
const b11 = text(\`
\`);
return multi([b9, b10, b11]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const ctx1 = capture(ctx);
const b12 = comp1({slots: markRaw({'slot1': {__render: slot1, __ctx: ctx1}, 'slot2': {__render: slot2, __ctx: ctx1}, 'default': {__render: slot3, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
const b3 = block3([], [b12]);
return multi([b2, b3]);
}
}"
`;
exports[`slots dynamic t-slot call 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-child-0/></button>\`);
return function template(ctx, node, key = \\"\\") {
let hdlr1 = [ctx['toggle'], ctx];
const slot1 = (ctx['current'].slot);
const b2 = toggler(slot1, callSlot(ctx, node, key, slot1, true, {}));
return block1([hdlr1], [b2]);
}
}"
`;
exports[`slots dynamic t-slot call with default 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, markRaw } = helpers;
const comp1 = app.createComponent(\`Toggler\`, true, true, false, true);
let block3 = createBlock(\`<div>
<block-child-0/>
</div>\`);
let block5 = createBlock(\`<p>slot1</p>\`);
let block6 = createBlock(\`<span>content</span>\`);
let block7 = createBlock(\`<h1>slot2</h1>\`);
function slot1(ctx, node, key = \\"\\") {
const b5 = block5();
const b6 = block6();
return multi([b5, b6]);
}
function slot2(ctx, node, key = \\"\\") {
return block7();
}
function slot3(ctx, node, key = \\"\\") {
const b9 = text(\`
\`);
const b10 = text(\`
\`);
const b11 = text(\`
\`);
return multi([b9, b10, b11]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const ctx1 = capture(ctx);
const b12 = comp1({slots: markRaw({'slot1': {__render: slot1, __ctx: ctx1}, 'slot2': {__render: slot2, __ctx: ctx1}, 'default': {__render: slot3, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
const b3 = block3([], [b12]);
return multi([b2, b3]);
}
}"
`;
exports[`slots dynamic t-slot call with default 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<button block-handler-0=\\"click\\">
<block-child-0/>
</button>\`);
function defaultContent1(ctx, node, key = \\"\\") {
return text(\`
owl
\`);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
let hdlr1 = [ctx['toggle'], ctx];
const b5 = callSlot(ctx, node, key, (ctx['current'].slot), true, {}, defaultContent1);
const b3 = block3([hdlr1], [b5]);
return multi([b2, b3]);
}
}"
`;
exports[`slots fun: two calls to the same slot 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
return text(\`some text\`);
}
return function template(ctx, node, key = \\"\\") {
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
}
}"
`;
exports[`slots fun: two calls to the same slot 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'default', false, {});
const b3 = callSlot(ctx, node, key, 'default', false, {});
return multi([b2, b3]);
}
}"
`;
exports[`slots missing slots are ignored 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Dialog\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({}, key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
`;
exports[`slots missing slots are ignored 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<span>
<block-child-0/>
<span>some content</span>
<block-child-1/>
</span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b4 = callSlot(ctx, node, key, 'default', false, {});
const b5 = callSlot(ctx, node, key, 'footer', false, {});
const b3 = block3([], [b4, b5]);
return multi([b2, b3]);
}
}"
`;
exports[`slots mix of slots, t-call, t-call with body, and giving own props child 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`P\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
return comp1({}, key + \`__1\`, node, this, null);
}
}"
`;
exports[`slots mix of slots, t-call, t-call with body, and giving own props child 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`A\`, true, false, false, false);
let block2 = createBlock(\`<button block-handler-0=\\"click\\">inc</button>\`);
return function template(ctx, node, key = \\"\\") {
let hdlr1 = [ctx['inc'], ctx];
const b2 = block2([hdlr1]);
const b3 = comp1({number: ctx['state'].number}, key + \`__1\`, node, this, null);
return multi([b2, b3]);
}
}"
`;
exports[`slots mix of slots, t-call, t-call with body, and giving own props child 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, markRaw } = helpers;
const callTemplate_1 = app.getTemplate(\`__template__1002\`);
const comp1 = app.createComponent(\`B\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
const b2 = text(\`[A]\`);
const b3 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
return multi([b2, b3]);
}
return function template(ctx, node, key = \\"\\") {
const ctx1 = capture(ctx);
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
}
}"
`;
exports[`slots mix of slots, t-call, t-call with body, and giving own props child 4`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, zero } = helpers;
const callTemplate_1 = app.getTemplate(\`__template__1001\`);
return function template(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
const b2 = text(\`[sub1]
\`);
setContextValue(ctx, \\"dummy\\", ctx['validate']);
const b3 = text(\`
\`);
ctx = Object.create(ctx);
ctx[isBoundary] = 1;
const b5 = text(\`
\`);
setContextValue(ctx, \\"v\\", ctx['props'].number);
const b6 = text(\`
\`);
const b4 = multi([b5, b6]);
ctx[zero] = b4;
const b7 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
return multi([b2, b3, b7]);
}
}"
`;
exports[`slots mix of slots, t-call, t-call with body, and giving own props child 5`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`[sub2\`);
const b3 = text(ctx['v']);
const b4 = text(\`]\`);
return multi([b2, b3, b4]);
}
}"
`;
exports[`slots mix of slots, t-call, t-call with body, and giving own props child 6`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`C\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`[B]\`);
const b3 = comp1({slots: ctx['props'].slots}, key + \`__1\`, node, this, null);
return multi([b2, b3]);
}
}"
`;
exports[`slots mix of slots, t-call, t-call with body, and giving own props child 7`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`[C]\`);
const b3 = callSlot(ctx, node, key, 'default', false, {});
return multi([b2, b3]);
}
}"
`;
exports[`slots multiple roots are allowed in a default slot 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
let block3 = createBlock(\`<div>
<block-child-0/>
</div>\`);
let block6 = createBlock(\`<span>sts</span>\`);
let block8 = createBlock(\`<span>rocks</span>\`);
function slot1(ctx, node, key = \\"\\") {
const b5 = text(\`
\`);
const b6 = block6();
const b7 = text(\`
\`);
const b8 = block8();
const b9 = text(\`
\`);
return multi([b5, b6, b7, b8, b9]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b10 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
const b3 = block3([], [b10]);
return multi([b2, b3]);
}
}"
`;
exports[`slots multiple roots are allowed in a default slot 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'default', false, {});
return block1([], [b2]);
}
}"
`;
exports[`slots multiple roots are allowed in a named slot 1`] = `
"function anonymous(app, bdom, helpers
) {
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>
<block-child-0/>
</div>\`);
let block6 = createBlock(\`<span>sts</span>\`);
let block8 = createBlock(\`<span>rocks</span>\`);
function slot1(ctx, node, key = \\"\\") {
const b5 = text(\`
\`);
const b6 = block6();
const b7 = text(\`
\`);
const b8 = block8();
const b9 = text(\`
\`);
return multi([b5, b6, b7, b8, b9]);
}
function slot2(ctx, node, key = \\"\\") {
const b11 = text(\`
\`);
const b12 = text(\`
\`);
return multi([b11, b12]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const ctx1 = capture(ctx);
const b13 = comp1({slots: markRaw({'content': {__render: slot1, __ctx: ctx1}, 'default': {__render: slot2, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
const b3 = block3([], [b13]);
return multi([b2, b3]);
}
}"
`;
exports[`slots multiple roots are allowed in a named slot 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'content', false, {});
return block1([], [b2]);
}
}"
`;
exports[`slots multiple slots containing components 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, markRaw } = helpers;
const comp1 = app.createComponent(\`C\`, true, false, false, false);
const comp2 = app.createComponent(\`C\`, true, false, false, false);
const comp3 = app.createComponent(\`B\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
return comp1({val: 1}, key + \`__1\`, node, this, null);
}
function slot2(ctx, node, key = \\"\\") {
return comp2({val: 2}, key + \`__2\`, node, this, null);
}
function slot3(ctx, node, key = \\"\\") {
const b6 = text(\`
\`);
const b7 = text(\`
\`);
const b8 = text(\`
\`);
return multi([b6, b7, b8]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const ctx1 = capture(ctx);
const b9 = comp3({slots: markRaw({'s1': {__render: slot1, __ctx: ctx1}, 's2': {__render: slot2, __ctx: ctx1}, 'default': {__render: slot3, __ctx: ctx1}})}, key + \`__3\`, node, this, null);
return multi([b2, b9]);
}
}"
`;
exports[`slots multiple slots containing components 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 's1', false, {});
const b3 = callSlot(ctx, node, key, 's2', false, {});
return block1([], [b2, b3]);
}
}"
`;
exports[`slots multiple slots containing components 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].val;
return block1([txt1]);
}
}"
`;
exports[`slots named slot inside slot 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
const comp2 = app.createComponent(\`Child\`, true, true, false, true);
let block3 = createBlock(\`<div>
<block-child-0/>
</div>\`);
let block6 = createBlock(\`<p>A<block-text-0/></p>\`);
let block13 = createBlock(\`<p>B<block-text-0/></p>\`);
function slot1(ctx, node, key = \\"\\") {
const b5 = text(\`
\`);
let txt1 = ctx['value'];
const b6 = block6([txt1]);
const b7 = text(\`
\`);
return multi([b5, b6, b7]);
}
function slot2(ctx, node, key = \\"\\") {
const b9 = text(\`
\`);
const b10 = text(\`
\`);
const ctx2 = capture(ctx);
const b18 = comp1({slots: markRaw({'brol': {__render: slot3, __ctx: ctx2}, 'default': {__render: slot4, __ctx: ctx2}})}, key + \`__1\`, node, this, null);
const b19 = text(\`
\`);
return multi([b9, b10, b18, b19]);
}
function slot3(ctx, node, key = \\"\\") {
const b12 = text(\`
\`);
let txt2 = ctx['value'];
const b13 = block13([txt2]);
const b14 = text(\`
\`);
return multi([b12, b13, b14]);
}
function slot4(ctx, node, key = \\"\\") {
const b16 = text(\`
\`);
const b17 = text(\`
\`);
return multi([b16, b17]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const ctx1 = capture(ctx);
const b20 = comp2({slots: markRaw({'brol': {__render: slot1, __ctx: ctx1}, 'default': {__render: slot2, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
const b3 = block3([], [b20]);
return multi([b2, b3]);
}
}"
`;
exports[`slots named slot inside slot 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<div>
<block-child-0/>
<block-child-1/>
</div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b4 = callSlot(ctx, node, key, 'brol', false, {});
const b5 = callSlot(ctx, node, key, 'default', false, {});
const b3 = block3([], [b4, b5]);
return multi([b2, b3]);
}
}"
`;
exports[`slots named slot inside slot, part 3 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
const comp2 = app.createComponent(\`Child\`, true, true, false, true);
let block3 = createBlock(\`<div>
<block-child-0/>
</div>\`);
let block6 = createBlock(\`<p>A<block-text-0/></p>\`);
let block13 = createBlock(\`<p>B<block-text-0/></p>\`);
function slot1(ctx, node, key = \\"\\") {
const b5 = text(\`
\`);
let txt1 = ctx['value'];
const b6 = block6([txt1]);
const b7 = text(\`
\`);
return multi([b5, b6, b7]);
}
function slot2(ctx, node, key = \\"\\") {
const b9 = text(\`
\`);
const b10 = text(\`
\`);
const ctx2 = capture(ctx);
const b20 = comp1({slots: markRaw({'brol': {__render: slot3, __ctx: ctx2}, 'default': {__render: slot4, __ctx: ctx2}})}, key + \`__1\`, node, this, null);
const b21 = text(\`
\`);
return multi([b9, b10, b20, b21]);
}
function slot3(ctx, node, key = \\"\\") {
const b12 = text(\`
\`);
let txt2 = ctx['value'];
const b13 = block13([txt2]);
const b14 = text(\`
\`);
return multi([b12, b13, b14]);
}
function slot4(ctx, node, key = \\"\\") {
const b16 = text(\`
\`);
const b17 = text(\`
\`);
const b18 = text(\`
\`);
const b19 = text(\`
\`);
return multi([b16, b17, b18, b19]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const ctx1 = capture(ctx);
const b22 = comp2({slots: markRaw({'brol': {__render: slot1, __ctx: ctx1}, 'default': {__render: slot2, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
const b3 = block3([], [b22]);
return multi([b2, b3]);
}
}"
`;
exports[`slots named slot inside slot, part 3 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<div>
<block-child-0/>
<block-child-1/>
</div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b4 = callSlot(ctx, node, key, 'brol', false, {});
const b5 = callSlot(ctx, node, key, 'default', false, {});
const b3 = block3([], [b4, b5]);
return multi([b2, b3]);
}
}"
`;
exports[`slots named slots can define a default content 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Dialog\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({}, key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
`;
exports[`slots named slots can define a default content 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<span>
<block-child-0/>
</span>\`);
function defaultContent1(ctx, node, key = \\"\\") {
return text(\`default content\`);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b5 = callSlot(ctx, node, key, 'header', false, {}, defaultContent1);
const b3 = block3([], [b5]);
return multi([b2, b3]);
}
}"
`;
exports[`slots named slots inside slot, again 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
const comp2 = app.createComponent(\`Child\`, true, true, false, true);
let block3 = createBlock(\`<div>
<block-child-0/>
</div>\`);
let block6 = createBlock(\`<p>A<block-text-0/></p>\`);
let block13 = createBlock(\`<p>B<block-text-0/></p>\`);
function slot1(ctx, node, key = \\"\\") {
const b5 = text(\`
\`);
let txt1 = ctx['value'];
const b6 = block6([txt1]);
const b7 = text(\`
\`);
return multi([b5, b6, b7]);
}
function slot2(ctx, node, key = \\"\\") {
const b9 = text(\`
\`);
const b10 = text(\`
\`);
const ctx2 = capture(ctx);
const b18 = comp1({slots: markRaw({'brol2': {__render: slot3, __ctx: ctx2}, 'default': {__render: slot4, __ctx: ctx2}})}, key + \`__1\`, node, this, null);
const b19 = text(\`
\`);
return multi([b9, b10, b18, b19]);
}
function slot3(ctx, node, key = \\"\\") {
const b12 = text(\`
\`);
let txt2 = ctx['value'];
const b13 = block13([txt2]);
const b14 = text(\`
\`);
return multi([b12, b13, b14]);
}
function slot4(ctx, node, key = \\"\\") {
const b16 = text(\`
\`);
const b17 = text(\`
\`);
return multi([b16, b17]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const ctx1 = capture(ctx);
const b20 = comp2({slots: markRaw({'brol1': {__render: slot1, __ctx: ctx1}, 'default': {__render: slot2, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
const b3 = block3([], [b20]);
return multi([b2, b3]);
}
}"
`;
exports[`slots named slots inside slot, again 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<child>
<block-child-0/>
<block-child-1/>
<block-child-2/>
</child>\`);
function defaultContent1(ctx, node, key = \\"\\") {
return text(\`default1\`);
}
function defaultContent2(ctx, node, key = \\"\\") {
return text(\`default2\`);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b5 = callSlot(ctx, node, key, 'brol1', false, {}, defaultContent1);
const b7 = callSlot(ctx, node, key, 'brol2', false, {}, defaultContent2);
const b8 = callSlot(ctx, node, key, 'default', false, {});
const b3 = block3([], [b5, b7, b8]);
return multi([b2, b3]);
}
}"
`;
exports[`slots nested slots in same template 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Child3\`, true, false, false, true);
const comp2 = app.createComponent(\`Child2\`, true, true, false, true);
const comp3 = app.createComponent(\`Child\`, true, true, false, true);
let block3 = createBlock(\`<span id=\\"parent\\">
<block-child-0/>
</span>\`);
function slot1(ctx, node, key = \\"\\") {
const b5 = text(\`
\`);
const b10 = comp2({slots: markRaw({'default': {__render: slot2, __ctx: ctx}})}, key + \`__2\`, node, this, null);
const b11 = text(\`
\`);
return multi([b5, b10, b11]);
}
function slot2(ctx, node, key = \\"\\") {
const b7 = text(\`
\`);
const b8 = comp1({}, key + \`__1\`, node, this, null);
const b9 = text(\`
\`);
return multi([b7, b8, b9]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b12 = comp3({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__3\`, node, this, null);
const b3 = block3([], [b12]);
return multi([b2, b3]);
}
}"
`;
exports[`slots nested slots in same template 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<span id=\\"c1\\">
<div>
<block-child-0/>
</div>
</span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b4 = callSlot(ctx, node, key, 'default', false, {});
const b3 = block3([], [b4]);
return multi([b2, b3]);
}
}"
`;
exports[`slots nested slots in same template 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<span id=\\"c2\\">
<block-child-0/>
</span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b4 = callSlot(ctx, node, key, 'default', false, {});
const b3 = block3([], [b4]);
return multi([b2, b3]);
}
}"
`;
exports[`slots nested slots in same template 4`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block3 = createBlock(\`<span>Child 3</span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b3 = block3();
return multi([b2, b3]);
}
}"
`;
exports[`slots nested slots: evaluation context and parented relationship 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Slot\`, true, false, false, false);
const comp2 = app.createComponent(\`Child\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
return comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
}
return function template(ctx, node, key = \\"\\") {
return comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
}
}"
`;
exports[`slots nested slots: evaluation context and parented relationship 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot, markRaw } = helpers;
const comp1 = app.createComponent(\`GrandChild\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
const b4 = text(\`
\`);
const b5 = callSlot(ctx, node, key, 'default', false, {});
const b6 = text(\`
\`);
return multi([b4, b5, b6]);
}
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]);
}
}"
`;
exports[`slots nested slots: evaluation context and parented relationship 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'default', false, {});
return block1([], [b2]);
}
}"
`;
exports[`slots nested slots: evaluation context and parented relationship 4`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].val;
return block1([txt1]);
}
}"
`;
exports[`slots no named slot content => just no children 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Dialog\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
return comp1({}, key + \`__1\`, node, this, null);
}
}"
`;
exports[`slots no named slot content => just no children 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'header', false, {});
return block1([], [b2]);
}
}"
`;
exports[`slots simple default slot 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
return text(\`some text\`);
}
return function template(ctx, node, key = \\"\\") {
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
}
}"
`;
exports[`slots simple default slot 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'default', false, {});
return block1([], [b2]);
}
}"
`;
exports[`slots simple default slot with params 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
let b4,b5,b6,b7;
b4 = text(\`
\`);
if (ctx['slotScope'].bool) {
b5 = text(\`some text\`);
} else {
b6 = text(\`other text\`);
}
b7 = text(\`
\`);
return multi([b4, b5, b6, b7]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b8 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
return multi([b2, b8]);
}
}"
`;
exports[`slots simple default slot with params 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'default', false, {bool: ctx['state'].bool});
return block1([], [b2]);
}
}"
`;
exports[`slots simple default slot with params and bound function 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
return text(ctx['slotScope'].fn());
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b4 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx, __scope: \\"slotScope\\"}})}, key + \`__1\`, node, this, null);
return multi([b2, b4]);
}
}"
`;
exports[`slots simple default slot with params and bound function 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot, bind } = helpers;
return function template(ctx, node, key = \\"\\") {
return callSlot(ctx, node, key, 'default', false, {fn: bind(ctx, ctx['getValue'])});
}
}"
`;
exports[`slots simple default slot, variation 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
return text(\`some text\`);
}
return function template(ctx, node, key = \\"\\") {
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
}
}"
`;
exports[`slots simple default slot, variation 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
return function template(ctx, node, key = \\"\\") {
return callSlot(ctx, node, key, 'default', false, {});
}
}"
`;
exports[`slots simple dynamic slot with slot scope 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
let b4,b5,b6,b7;
b4 = text(\`
\`);
if (ctx['slotScope'].bool) {
b5 = text(\`some text\`);
} else {
b6 = text(\`other text\`);
}
b7 = text(\`
\`);
return multi([b4, b5, b6, b7]);
}
function slot2(ctx, node, key = \\"\\") {
const b9 = text(\`
\`);
const b10 = text(\`
\`);
return multi([b9, b10]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const ctx1 = capture(ctx);
const b11 = comp1({slots: markRaw({'slotName': {__render: slot1, __ctx: ctx1, __scope: \\"slotScope\\"}, 'default': {__render: slot2, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
return multi([b2, b11]);
}
}"
`;
exports[`slots simple dynamic slot with slot scope 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
const slot1 = ('slotName');
const b2 = toggler(slot1, callSlot(ctx, node, key, slot1, true, {bool: ctx['state'].bool}));
return block1([], [b2]);
}
}"
`;
exports[`slots simple named and empty slot -- 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
return function template(ctx, node, key = \\"\\") {
const ctx1 = capture(ctx);
return comp1({slots: markRaw({'myEmptySlot': {myProp: 'myProp text'}})}, key + \`__1\`, node, this, null);
}
}"
`;
exports[`slots simple named and empty slot -- 2 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
function defaultContent1(ctx, node, key = \\"\\") {
return text(\`default empty\`);
}
return function template(ctx, node, key = \\"\\") {
const b3 = callSlot(ctx, node, key, 'myEmptySlot', false, {}, defaultContent1);
return block1([], [b3]);
}
}"
`;
exports[`slots simple named and empty slot 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
return text(\`some text\`);
}
return function template(ctx, node, key = \\"\\") {
const ctx1 = capture(ctx);
return comp1({slots: markRaw({'myEmptySlot': {}, 'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
}
}"
`;
exports[`slots simple named and empty slot 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span><block-child-0/><block-child-1/></span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'default', false, {});
const b3 = callSlot(ctx, node, key, 'myEmptySlot', false, {});
return block1([], [b2, b3]);
}
}"
`;
exports[`slots simple slot with slot scope 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
let b4,b5,b6,b7;
b4 = text(\`
\`);
if (ctx['slotScope'].bool) {
b5 = text(\`some text\`);
} else {
b6 = text(\`other text\`);
}
b7 = text(\`
\`);
return multi([b4, b5, b6, b7]);
}
function slot2(ctx, node, key = \\"\\") {
const b9 = text(\`
\`);
const b10 = text(\`
\`);
return multi([b9, b10]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const ctx1 = capture(ctx);
const b11 = comp1({slots: markRaw({'slotName': {__render: slot1, __ctx: ctx1, __scope: \\"slotScope\\"}, 'default': {__render: slot2, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
return multi([b2, b11]);
}
}"
`;
exports[`slots simple slot with slot scope 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'slotName', false, {bool: ctx['state'].bool});
return block1([], [b2]);
}
}"
`;
exports[`slots slot and (inline) t-call 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, markRaw } = helpers;
const callTemplate_1 = app.getTemplate(\`__template__999\`);
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
function slot1(ctx, node, key = \\"\\") {
return callTemplate_1.call(this, ctx, node, key + \`__1\`);
}
return function template(ctx, node, key = \\"\\") {
const ctx1 = capture(ctx);
const b3 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
return block1([], [b3]);
}
}"
`;
exports[`slots slot and (inline) t-call 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<p>sokka</p>\`);
return function template(ctx, node, key = \\"\\") {
return block1();
}
}"
`;
exports[`slots slot and (inline) t-call 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'default', false, {});
return block1([], [b2]);
}
}"
`;
exports[`slots slot and t-call 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, markRaw } = helpers;
const callTemplate_1 = app.getTemplate(\`__template__999\`);
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
function slot1(ctx, node, key = \\"\\") {
return callTemplate_1.call(this, ctx, node, key + \`__1\`);
}
return function template(ctx, node, key = \\"\\") {
const ctx1 = capture(ctx);
const b3 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
return block1([], [b3]);
}
}"
`;
exports[`slots slot and t-call 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<p>sokka</p>\`);
return function template(ctx, node, key = \\"\\") {
return block1();
}
}"
`;
exports[`slots slot and t-call 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'default', false, {});
return block1([], [b2]);
}
}"
`;
exports[`slots slot and t-esc 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
function slot1(ctx, node, key = \\"\\") {
return text('toph');
}
return function template(ctx, node, key = \\"\\") {
const b3 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
return block1([], [b3]);
}
}"
`;
exports[`slots slot and t-esc 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'default', false, {});
return block1([], [b2]);
}
}"
`;
exports[`slots slot are properly rendered if inner props are changed 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`SomeComponent\`, true, false, false, false);
const comp2 = app.createComponent(\`GenericComponent\`, true, true, false, true);
let block3 = createBlock(\`<div>
<button block-handler-0=\\"click\\">Inc[<block-text-1/>]</button>
<block-child-0/>
</div>\`);
function slot1(ctx, node, key = \\"\\") {
const b5 = text(\`
\`);
const b6 = comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
const b7 = text(\`
\`);
return multi([b5, b6, b7]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
let hdlr1 = [ctx['inc'], ctx];
let txt1 = ctx['state'].val;
const b8 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
const b3 = block3([hdlr1, txt1], [b8]);
return multi([b2, b3]);
}
}"
`;
exports[`slots slot are properly rendered if inner props are changed 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'default', false, {});
return block1([], [b2]);
}
}"
`;
exports[`slots slot are properly rendered if inner props are changed 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block3 = createBlock(\`<div>
SC:<block-text-0/>
</div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
let txt1 = ctx['props'].val;
const b3 = block3([txt1]);
return multi([b2, b3]);
}
}"
`;
exports[`slots slot content has different key from other content -- dynamic slot 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
const comp2 = app.createComponent(\`SlotDisplay\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
const b4 = text(\`
\`);
const b5 = comp1({parent: 'Parent'}, key + \`__1\`, node, this, null);
const b6 = text(\`
\`);
return multi([b4, b5, b6]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b7 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
return multi([b2, b7]);
}
}"
`;
exports[`slots slot content has different key from other content -- dynamic slot 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({parent: 'SlotDisplay'}, key + \`__1\`, node, this, null);
const slot1 = (ctx['slotName']);
const b3 = toggler(slot1, callSlot(ctx, node, key, slot1, true, {}));
return multi([b2, b3]);
}
}"
`;
exports[`slots slot content has different key from other content -- dynamic slot 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].parent;
return block1([txt1]);
}
}"
`;
exports[`slots slot content has different key from other content -- static slot 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
const comp2 = app.createComponent(\`SlotDisplay\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
const b4 = text(\`
\`);
const b5 = comp1({parent: 'Parent'}, key + \`__1\`, node, this, null);
const b6 = text(\`
\`);
return multi([b4, b5, b6]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b7 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
return multi([b2, b7]);
}
}"
`;
exports[`slots slot content has different key from other content -- static slot 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({parent: 'SlotDisplay'}, key + \`__1\`, node, this, null);
const b3 = callSlot(ctx, node, key, 'default', false, {});
return multi([b2, b3]);
}
}"
`;
exports[`slots slot content has different key from other content -- static slot 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].parent;
return block1([txt1]);
}
}"
`;
exports[`slots slot content is bound to caller (variation) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, isBoundary, withDefault, setContextValue, markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
let block6 = createBlock(\`<button block-handler-0=\\"click\\">some text</button>\`);
function slot1(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
const b4 = text(\`
\`);
setContextValue(ctx, \\"var\\", 1);
const b5 = text(\`
\`);
let hdlr1 = [()=>this.inc(), ctx];
const b6 = block6([hdlr1]);
const b7 = text(\`
\`);
return multi([b4, b5, b6, b7]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const ctx1 = capture(ctx);
const b8 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
return multi([b2, b8]);
}
}"
`;
exports[`slots slot content is bound to caller (variation) 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'default', false, {});
return block1([], [b2]);
}
}"
`;
exports[`slots slot content is bound to caller 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
let block1 = createBlock(\`<button block-handler-0=\\"click\\">some text</button>\`);
function slot1(ctx, node, key = \\"\\") {
let hdlr1 = [ctx['inc'], ctx];
return block1([hdlr1]);
}
return function template(ctx, node, key = \\"\\") {
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
}
}"
`;
exports[`slots slot content is bound to caller 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'default', false, {});
return block1([], [b2]);
}
}"
`;
exports[`slots slot preserves properly parented relationship 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`GrandChild\`, true, false, false, true);
const comp2 = app.createComponent(\`Child\`, true, true, false, true);
let block3 = createBlock(\`<div>
<block-child-0/>
</div>\`);
function slot1(ctx, node, key = \\"\\") {
const b5 = text(\`
\`);
const b6 = comp1({}, key + \`__1\`, node, this, null);
const b7 = text(\`
\`);
return multi([b5, b6, b7]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b8 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
const b3 = block3([], [b8]);
return multi([b2, b3]);
}
}"
`;
exports[`slots slot preserves properly parented relationship 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
return function template(ctx, node, key = \\"\\") {
return callSlot(ctx, node, key, 'default', false, {});
}
}"
`;
exports[`slots slot preserves properly parented relationship 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`Grand Child\`);
}
}"
`;
exports[`slots slot preserves properly parented relationship, even through t-call 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, markRaw } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
let block3 = createBlock(\`<div>
<block-child-0/>
</div>\`);
function slot1(ctx, node, key = \\"\\") {
const b5 = text(\`
\`);
const b6 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
const b7 = text(\`
\`);
return multi([b5, b6, b7]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const ctx1 = capture(ctx);
const b8 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
const b3 = block3([], [b8]);
return multi([b2, b3]);
}
}"
`;
exports[`slots slot preserves properly parented relationship, even through t-call 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`GrandChild\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
return comp1({}, key + \`__1\`, node, this, null);
}
}"
`;
exports[`slots slot preserves properly parented relationship, even through t-call 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
return function template(ctx, node, key = \\"\\") {
return callSlot(ctx, node, key, 'default', false, {});
}
}"
`;
exports[`slots slot preserves properly parented relationship, even through t-call 4`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`Grand Child\`);
}
}"
`;
exports[`slots slot with slot scope and t-props 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
let block5 = createBlock(\`<p><block-text-0/></p>\`);
let block7 = createBlock(\`<p><block-text-0/></p>\`);
function slot1(ctx, node, key = \\"\\") {
const b4 = text(\`
\`);
let txt1 = ctx['info'].a;
const b5 = block5([txt1]);
const b6 = text(\`
\`);
let txt2 = ctx['info'].b;
const b7 = block7([txt2]);
const b8 = text(\`
\`);
return multi([b4, b5, b6, b7, b8]);
}
function slot2(ctx, node, key = \\"\\") {
const b10 = text(\`
\`);
const b11 = text(\`
\`);
return multi([b10, b11]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const ctx1 = capture(ctx);
const b12 = comp1({slots: markRaw({'slotName': {__render: slot1, __ctx: ctx1, __scope: \\"info\\"}, 'default': {__render: slot2, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
return multi([b2, b12]);
}
}"
`;
exports[`slots slot with slot scope and t-props 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b3 = callSlot(ctx, node, key, 'slotName', false, Object.assign({}, ctx['info']));
return multi([b2, b3]);
}
}"
`;
exports[`slots slots and wrapper components 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Link\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
return text(\`hey\`);
}
return function template(ctx, node, key = \\"\\") {
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
}
}"
`;
exports[`slots slots and wrapper components 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<a href=\\"abc\\">
<block-child-0/>
</a>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b4 = callSlot(ctx, node, key, 'default', false, {});
const b3 = block3([], [b4]);
return multi([b2, b3]);
}
}"
`;
exports[`slots slots are properly bound to correct component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
return comp1({}, key + \`__1\`, node, this, null);
}
}"
`;
exports[`slots slots are properly bound to correct component 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot, isBoundary, withDefault, setContextValue } = helpers;
let block6 = createBlock(\`<button block-handler-0=\\"click\\">
<block-text-1/>
</button>\`);
function defaultContent1(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
const b4 = text(\`
\`);
setContextValue(ctx, \\"var\\", 1);
const b5 = text(\`
\`);
let hdlr1 = [()=>this.increment(), ctx];
let txt1 = ctx['state'].value;
const b6 = block6([hdlr1, txt1]);
const b7 = text(\`
\`);
return multi([b4, b5, b6, b7]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b8 = callSlot(ctx, node, key, 'default', false, {}, defaultContent1);
return multi([b2, b8]);
}
}"
`;
exports[`slots slots are rendered with proper context 1`] = `
"function anonymous(app, bdom, helpers
) {
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 block6 = createBlock(\`<button block-handler-0=\\"click\\">do something</button>\`);
function slot1(ctx, node, key = \\"\\") {
const b5 = text(\`
\`);
let hdlr1 = [ctx['doSomething'], ctx];
const b6 = block6([hdlr1]);
const b7 = text(\`
\`);
return multi([b5, b6, b7]);
}
function slot2(ctx, node, key = \\"\\") {
const b9 = text(\`
\`);
const b10 = text(\`
\`);
return multi([b9, b10]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
let txt1 = ctx['state'].val;
const ctx1 = capture(ctx);
const b11 = comp1({slots: markRaw({'footer': {__render: slot1, __ctx: ctx1}, 'default': {__render: slot2, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
const b3 = block3([txt1], [b11]);
return multi([b2, b3]);
}
}"
`;
exports[`slots slots are rendered with proper context 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'footer', false, {});
return block1([], [b2]);
}
}"
`;
exports[`slots slots are rendered with proper context, part 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, capture, markRaw, withKey } = helpers;
const comp1 = app.createComponent(\`Link\`, true, true, false, false);
let block3 = createBlock(\`<div>
<u><block-child-0/></u>
</div>\`);
let block5 = createBlock(\`<li>
<block-child-0/>
</li>\`);
function slot1(ctx, node, key = \\"\\") {
const b7 = text(\`User \`);
const b8 = text(ctx['user'].name);
return multi([b7, b8]);
}
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'].users);;
for (let i1 = 0; i1 < l_block4; i1++) {
ctx[\`user\`] = v_block4[i1];
const key1 = ctx['user'].id;
const ctx1 = capture(ctx);
const b9 = comp1({to: '/user/'+ctx['user'].id,slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1__\${key1}\`, node, this, null);
c_block4[i1] = withKey(block5([], [b9]), key1);
}
ctx = ctx.__proto__;
const b4 = list(c_block4);
const b3 = block3([], [b4]);
return multi([b2, b3]);
}
}"
`;
exports[`slots slots are rendered with proper context, part 2 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<a block-attribute-0=\\"href\\">
<block-child-0/>
</a>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
let attr1 = ctx['props'].to;
const b4 = callSlot(ctx, node, key, 'default', false, {});
const b3 = block3([attr1], [b4]);
return multi([b2, b3]);
}
}"
`;
exports[`slots slots are rendered with proper context, part 3 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, isBoundary, withDefault, setContextValue, capture, markRaw, withKey } = helpers;
const comp1 = app.createComponent(\`Link\`, true, true, false, false);
let block3 = createBlock(\`<div>
<u><block-child-0/></u>
</div>\`);
let block5 = createBlock(\`<li>
<block-child-0/>
</li>\`);
function slot1(ctx, node, key = \\"\\") {
return text(ctx['userdescr']);
}
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['state'].users);;
for (let i1 = 0; i1 < l_block4; i1++) {
ctx[\`user\`] = v_block4[i1];
const key1 = ctx['user'].id;
setContextValue(ctx, \\"userdescr\\", 'User '+ctx['user'].name);
const ctx1 = capture(ctx);
const b7 = comp1({to: '/user/'+ctx['user'].id,slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1__\${key1}\`, node, this, null);
c_block4[i1] = withKey(block5([], [b7]), key1);
}
ctx = ctx.__proto__;
const b4 = list(c_block4);
const b3 = block3([], [b4]);
return multi([b2, b3]);
}
}"
`;
exports[`slots slots are rendered with proper context, part 3 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<a block-attribute-0=\\"href\\">
<block-child-0/>
</a>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
let attr1 = ctx['props'].to;
const b4 = callSlot(ctx, node, key, 'default', false, {});
const b3 = block3([attr1], [b4]);
return multi([b2, b3]);
}
}"
`;
exports[`slots slots are rendered with proper context, part 4 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, capture, markRaw } = helpers;
const comp1 = app.createComponent(\`Link\`, true, true, false, false);
let block3 = createBlock(\`<div>
<block-child-0/>
</div>\`);
function slot1(ctx, node, key = \\"\\") {
return text(ctx['userdescr']);
}
return function template(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
const b2 = text(\`
\`);
setContextValue(ctx, \\"userdescr\\", 'User '+ctx['state'].user.name);
const ctx1 = capture(ctx);
const b5 = comp1({to: '/user/'+ctx['state'].user.id,slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
const b3 = block3([], [b5]);
return multi([b2, b3]);
}
}"
`;
exports[`slots slots are rendered with proper context, part 4 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<a block-attribute-0=\\"href\\">
<block-child-0/>
</a>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
let attr1 = ctx['props'].to;
const b4 = callSlot(ctx, node, key, 'default', false, {});
const b3 = block3([attr1], [b4]);
return multi([b2, b3]);
}
}"
`;
exports[`slots slots in slots, with vars 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, capture, markRaw } = helpers;
const comp1 = app.createComponent(\`A\`, true, true, false, true);
let block3 = createBlock(\`<div>
<block-child-0/>
</div>\`);
let block6 = createBlock(\`<p>hey<block-text-0/></p>\`);
function slot1(ctx, node, key = \\"\\") {
const b5 = text(\`
\`);
let txt1 = ctx['test'];
const b6 = block6([txt1]);
const b7 = text(\`
\`);
return multi([b5, b6, b7]);
}
return function template(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
const b2 = text(\`
\`);
setContextValue(ctx, \\"test\\", ctx['state'].name);
const ctx1 = capture(ctx);
const b8 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
const b3 = block3([], [b8]);
return multi([b2, b3]);
}
}"
`;
exports[`slots slots in slots, with vars 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot, markRaw } = helpers;
const comp1 = app.createComponent(\`B\`, true, true, false, true);
let block3 = createBlock(\`<div>
<block-child-0/>
</div>\`);
function slot1(ctx, node, key = \\"\\") {
const b5 = text(\`
\`);
const b6 = callSlot(ctx, node, key, 'default', false, {});
const b7 = text(\`
\`);
return multi([b5, b6, b7]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b8 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
const b3 = block3([], [b8]);
return multi([b2, b3]);
}
}"
`;
exports[`slots slots in slots, with vars 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'default', false, {});
return block1([], [b2]);
}
}"
`;
exports[`slots slots in t-foreach and re-rendering 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, capture, markRaw, withKey } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
let block3 = createBlock(\`<div>
<block-child-0/>
</div>\`);
function slot1(ctx, node, key = \\"\\") {
return text(ctx['n_index']);
}
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];
ctx[\`n_index\`] = i1;
const key1 = ctx['n_index'];
const b6 = text(\`
\`);
const ctx1 = capture(ctx);
const b8 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1__\${key1}\`, node, this, null);
const b9 = text(\`
\`);
c_block4[i1] = withKey(multi([b6, b8, b9]), key1);
}
ctx = ctx.__proto__;
const b4 = list(c_block4);
const b3 = block3([], [b4]);
return multi([b2, b3]);
}
}"
`;
exports[`slots slots in t-foreach and re-rendering 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span><block-text-0/><block-child-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['state'].val;
const b2 = callSlot(ctx, node, key, 'default', false, {});
return block1([txt1], [b2]);
}
}"
`;
exports[`slots slots in t-foreach in t-foreach 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, capture, markRaw, withKey } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
let block3 = createBlock(\`<div>
<block-child-0/>
</div>\`);
let block7 = createBlock(\`<div><block-text-0/></div>\`);
let block9 = createBlock(\`<ul>
<block-child-0/>
</ul>\`);
let block15 = createBlock(\`<li><block-text-0/></li>\`);
function slot1(ctx, node, key = \\"\\") {
const b14 = text(\`
\`);
let txt2 = ctx['node1'].value;
const b15 = block15([txt2]);
const b16 = text(\`
\`);
return multi([b14, b15, b16]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
ctx = Object.create(ctx);
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['tree']);;
for (let i1 = 0; i1 < l_block4; i1++) {
ctx[\`node1\`] = v_block4[i1];
const key1 = ctx['node1'].key;
const b6 = text(\`
\`);
let txt1 = ctx['node1'].value;
const b7 = block7([txt1]);
const b8 = text(\`
\`);
ctx = Object.create(ctx);
const [k_block10, v_block10, l_block10, c_block10] = prepareList(ctx['node1'].nodes);;
for (let i2 = 0; i2 < l_block10; i2++) {
ctx[\`node2\`] = v_block10[i2];
const key2 = ctx['node2'].key;
const b12 = text(\`
\`);
const ctx1 = capture(ctx);
const b17 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1__\${key1}__\${key2}\`, node, this, null);
const b18 = text(\`
\`);
c_block10[i2] = withKey(multi([b12, b17, b18]), key2);
}
ctx = ctx.__proto__;
const b10 = list(c_block10);
const b9 = block9([], [b10]);
const b19 = text(\`
\`);
c_block4[i1] = withKey(multi([b6, b7, b8, b9, b19]), key1);
}
ctx = ctx.__proto__;
const b4 = list(c_block4);
const b3 = block3([], [b4]);
return multi([b2, b3]);
}
}"
`;
exports[`slots slots in t-foreach in t-foreach 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b4 = callSlot(ctx, node, key, 'default', false, {});
const b3 = block3([], [b4]);
const b5 = text(\`
\`);
return multi([b2, b3, b5]);
}
}"
`;
exports[`slots slots in t-foreach with t-set and re-rendering 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, isBoundary, withDefault, setContextValue, capture, markRaw, withKey } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
let block3 = createBlock(\`<div>
<block-child-0/>
</div>\`);
function slot1(ctx, node, key = \\"\\") {
return text(ctx['dummy']);
}
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(Array(2));;
for (let i1 = 0; i1 < l_block4; i1++) {
ctx[\`n\`] = v_block4[i1];
ctx[\`n_index\`] = i1;
const key1 = ctx['n_index'];
const b6 = text(\`
\`);
setContextValue(ctx, \\"dummy\\", ctx['n_index']);
const b7 = text(\`
\`);
const ctx1 = capture(ctx);
const b9 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1__\${key1}\`, node, this, null);
const b10 = text(\`
\`);
c_block4[i1] = withKey(multi([b6, b7, b9, b10]), key1);
}
ctx = ctx.__proto__;
const b4 = list(c_block4);
const b3 = block3([], [b4]);
return multi([b2, b3]);
}
}"
`;
exports[`slots slots in t-foreach with t-set and re-rendering 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<span>
<block-text-0/>
<block-child-0/>
</span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
let txt1 = ctx['state'].val;
const b4 = callSlot(ctx, node, key, 'default', false, {});
const b3 = block3([txt1], [b4]);
return multi([b2, b3]);
}
}"
`;
exports[`slots t-debug on a t-set-slot (defining a slot) 1`] = `
"function anonymous(app, bdom, helpers
) {
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>
<block-child-0/>
</div>\`);
function slot1(ctx, node, key = \\"\\") {
debugger;
return text(\`abc\`);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const ctx1 = capture(ctx);
const b5 = comp1({slots: markRaw({'content': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
const b3 = block3([], [b5]);
return multi([b2, b3]);
}
}"
`;
exports[`slots t-debug on a t-set-slot (defining a slot) 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'content', false, {});
return block1([], [b2]);
}
}"
`;
exports[`slots t-set t-value in a slot 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, isBoundary, withDefault, setContextValue, markRaw } = helpers;
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
let block3 = createBlock(\`<div>
<block-child-0/>
</div>\`);
function slot1(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
const b5 = text(\`
\`);
setContextValue(ctx, \\"rainbow\\", 'dash');
const b6 = text(\`
\`);
const b7 = text(ctx['rainbow']);
const b8 = text(\`
\`);
return multi([b5, b6, b7, b8]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const ctx1 = capture(ctx);
const b9 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
const b3 = block3([], [b9]);
return multi([b2, b3]);
}
}"
`;
exports[`slots t-set t-value in a slot 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<span>
<block-child-0/>
</span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b4 = callSlot(ctx, node, key, 'default', false, {});
const b3 = block3([], [b4]);
return multi([b2, b3]);
}
}"
`;
exports[`slots t-slot in recursive templates 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, prepareList, isBoundary, withDefault, setContextValue, zero, withKey, markRaw } = helpers;
const callTemplate_1 = app.getTemplate(\`_test_recursive_template\`);
const comp1 = app.createComponent(\`Wrapper\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
const b4 = text(\`
\`);
const b5 = text(ctx['name']);
const b6 = text(\`
\`);
ctx = Object.create(ctx);
const [k_block7, v_block7, l_block7, c_block7] = prepareList(ctx['items']);;
for (let i1 = 0; i1 < l_block7; i1++) {
ctx[\`item\`] = v_block7[i1];
ctx[\`item_first\`] = i1 === 0;
ctx[\`item_last\`] = i1 === v_block7.length - 1;
ctx[\`item_index\`] = i1;
ctx[\`item_value\`] = k_block7[i1];
const key1 = ctx['item'].name;
let b9,b10,b18,b19;
b9 = text(\`
\`);
if (!ctx['item'].children.length) {
const b11 = text(\`
\`);
const b12 = text(ctx['item'].name);
const b13 = text(\`
\`);
b10 = multi([b11, b12, b13]);
} else {
ctx = Object.create(ctx);
ctx[isBoundary] = 1;
const b15 = text(\`
\`);
setContextValue(ctx, \\"name\\", ctx['item'].name);
const b16 = text(\`
\`);
setContextValue(ctx, \\"items\\", ctx['item'].children);
const b17 = text(\`
\`);
const b14 = multi([b15, b16, b17]);
ctx[zero] = b14;
b18 = callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}\`);
ctx = ctx.__proto__;
}
b19 = text(\`
\`);
c_block7[i1] = withKey(multi([b9, b10, b18, b19]), key1);
}
ctx = ctx.__proto__;
const b7 = list(c_block7);
const b20 = text(\`
\`);
return multi([b4, b5, b6, b7, b20]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const ctx1 = capture(ctx);
const b21 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
return multi([b2, b21]);
}
}"
`;
exports[`slots t-slot in recursive templates 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block3 = createBlock(\`<wrapper>
<block-child-0/>
</wrapper>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b4 = callSlot(ctx, node, key, 'default', false, {});
const b3 = block3([], [b4]);
return multi([b2, b3]);
}
}"
`;
exports[`slots t-slot nested within another slot 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Child3\`, true, false, false, true);
const comp2 = app.createComponent(\`Dialog\`, true, true, false, true);
let block3 = createBlock(\`<span id=\\"c1\\">
<block-child-0/>
</span>\`);
function slot1(ctx, node, key = \\"\\") {
const b5 = text(\`
\`);
const b6 = comp1({}, key + \`__1\`, node, this, null);
const b7 = text(\`
\`);
return multi([b5, b6, b7]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b8 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
const b3 = block3([], [b8]);
return multi([b2, b3]);
}
}"
`;
exports[`slots t-slot nested within another slot 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot, markRaw } = helpers;
const comp1 = app.createComponent(\`Portal\`, true, true, false, true);
const comp2 = app.createComponent(\`Modal\`, true, true, false, true);
let block3 = createBlock(\`<span id=\\"c2\\">
<block-child-0/>
</span>\`);
function slot1(ctx, node, key = \\"\\") {
const b5 = text(\`
\`);
const b10 = comp1({slots: markRaw({'default': {__render: slot2, __ctx: ctx}})}, key + \`__1\`, node, this, null);
const b11 = text(\`
\`);
return multi([b5, b10, b11]);
}
function slot2(ctx, node, key = \\"\\") {
const b7 = text(\`
\`);
const b8 = callSlot(ctx, node, key, 'default', false, {});
const b9 = text(\`
\`);
return multi([b7, b8, b9]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b12 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
const b3 = block3([], [b12]);
return multi([b2, b3]);
}
}"
`;
exports[`slots t-slot nested within another slot 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span id=\\"modal\\"><block-child-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'default', false, {});
return block1([], [b2]);
}
}"
`;
exports[`slots t-slot nested within another slot 4`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span id=\\"portal\\"><block-child-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'default', false, {});
return block1([], [b2]);
}
}"
`;
exports[`slots t-slot nested within another slot 5`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>Child 3</span>\`);
return function template(ctx, node, key = \\"\\") {
return block1();
}
}"
`;
exports[`slots t-slot scope context 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
let block5 = createBlock(\`<button>The Button</button>\`);
function slot1(ctx, node, key = \\"\\") {
const b4 = text(\`
\`);
const b5 = block5();
const b6 = text(\`
\`);
return multi([b4, b5, b6]);
}
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]);
}
}"
`;
exports[`slots t-slot scope context 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot, markRaw } = helpers;
const comp1 = app.createComponent(\`Wrapper\`, true, true, false, true);
let block5 = createBlock(\`<div block-handler-0=\\"click\\">
<block-child-0/>
</div>\`);
function slot1(ctx, node, key = \\"\\") {
const b4 = text(\`
\`);
let hdlr1 = [ctx['onClick'], ctx];
const b6 = callSlot(ctx, node, key, 'default', false, {});
const b5 = block5([hdlr1], [b6]);
const b7 = text(\`
\`);
return multi([b4, b5, b7]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b8 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
const b9 = text(\`
\`);
return multi([b2, b8, b9]);
}
}"
`;
exports[`slots t-slot scope context 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
return function template(ctx, node, key = \\"\\") {
return callSlot(ctx, node, key, 'default', false, {});
}
}"
`;
exports[`slots t-slot within dynamic t-call 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, markRaw } = helpers;
const call = app.callTemplate.bind(app);
const comp1 = app.createComponent(\`Slotted\`, true, true, false, true);
let block3 = createBlock(\`<div>
<block-child-0/>
</div>\`);
function slot1(ctx, node, key = \\"\\") {
const b5 = text(\`
\`);
const template1 = (ctx['tcallTemplate']);
const b6 = call(this, template1, ctx, node, key + \`__1\`);
const b7 = text(\`
\`);
return multi([b5, b6, b7]);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const ctx1 = capture(ctx);
const b8 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
const b3 = block3([], [b8]);
return multi([b2, b3]);
}
}"
`;
exports[`slots t-slot within dynamic t-call 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<div class=\\"slotted\\"><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = callSlot(ctx, node, key, 'default', false, {});
return block1([], [b2]);
}
}"
`;
exports[`slots t-slot within dynamic t-call 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
let block3 = createBlock(\`<div class=\\"slot\\"><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b4 = comp1({}, key + \`__1\`, node, this, null);
const b3 = block3([], [b4]);
const b5 = text(\`
\`);
return multi([b2, b3, b5]);
}
}"
`;
exports[`slots t-slot within dynamic t-call 4`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div class=\\"child\\"/>\`);
return function template(ctx, node, key = \\"\\") {
return block1();
}
}"
`;
exports[`slots template can just return a slot 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
const comp2 = app.createComponent(\`SlotComponent\`, true, true, false, true);
let block3 = createBlock(\`<div>
<block-child-0/>
</div>\`);
function slot1(ctx, node, key = \\"\\") {
return comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null);
}
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b5 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
const b3 = block3([], [b5]);
return multi([b2, b3]);
}
}"
`;
exports[`slots template can just return a slot 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
return function template(ctx, node, key = \\"\\") {
return callSlot(ctx, node, key, 'default', false, {});
}
}"
`;
exports[`slots template can just return a slot 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].value;
return block1([txt1]);
}
}"
`;