2020-11-26 16:45:25 +01:00
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
|
2021-11-25 13:56:56 +01:00
|
|
|
exports[`slots can define a default content 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-25 13:56:56 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, false, false, true);
|
2021-11-25 13:56:56 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b2 = comp1({}, key + \`__1\`, node, this, null);
|
2021-11-25 13:56:56 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots can define a default content 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
|
|
|
|
|
|
|
|
|
function defaultContent1(ctx, node, key = \\"\\") {
|
|
|
|
|
return text(\`default content\`);
|
|
|
|
|
}
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b3 = callSlot(ctx, node, key, 'default', false, {}, defaultContent1);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b3]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots can define and call slots 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
let block2 = createBlock(\`<span>header</span>\`);
|
|
|
|
|
let block3 = createBlock(\`<span>footer</span>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return block2();
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot2(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return block3();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b4 = comp1({slots: markRaw({'header': {__render: slot1, __ctx: ctx1}, 'footer': {__render: slot2, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
2021-11-19 13:43:21 +01:00
|
|
|
return block1([], [b4]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots can define and call slots 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-19 13:43:21 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2021-11-19 13:43:21 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><div><block-child-0/></div><div><block-child-1/></div></div>\`);
|
2021-11-19 13:43:21 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'header', false, {});
|
|
|
|
|
const b3 = callSlot(ctx, node, key, 'footer', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2, b3]);
|
2021-11-19 13:43:21 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-02-08 09:57:49 +01:00
|
|
|
exports[`slots can define and call slots with bound params 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-02-08 09:57:49 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { capture, bind, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
2022-02-08 09:57:49 +01:00
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
|
|
|
return text(\`abc\`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'abc': {__render: slot1, __ctx: ctx1, getValue: bind(ctx, ctx['getValue'])}})}, key + \`__1\`, node, this, null);
|
2022-02-08 09:57:49 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots can define and call slots with bound params 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-02-08 09:57:49 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-02-08 09:57:49 +01:00
|
|
|
let { callSlot } = helpers;
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'abc', false, {});
|
2022-03-06 10:27:07 +01:00
|
|
|
const b3 = text(ctx['props'].slots['abc'].getValue());
|
2022-02-08 09:57:49 +01:00
|
|
|
return multi([b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots can define and call slots with params 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-19 13:43:21 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
2021-11-19 13:43:21 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
let block2 = createBlock(\`<span>header</span>\`);
|
|
|
|
|
let block3 = createBlock(\`<span>footer</span>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
return block2();
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot2(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
return block3();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b4 = comp1({slots: markRaw({'header': {__render: slot1, __ctx: ctx1, param: ctx['var']}, 'footer': {__render: slot2, __ctx: ctx1, param: '5'}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b4]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots can define and call slots with params 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-10 09:13:17 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2021-11-10 09:13:17 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-text-0/><div><block-child-0/></div><block-text-1/><div><block-child-1/></div></div>\`);
|
|
|
|
|
|
2021-11-10 09:13:17 +01:00
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['props'].slots['header'].param;
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'header', false, {});
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt2 = ctx['props'].slots['footer'].param;
|
2022-06-06 08:17:51 +02:00
|
|
|
const b3 = callSlot(ctx, node, key, 'footer', false, {});
|
2021-12-22 11:33:12 +01:00
|
|
|
return block1([txt1, txt2], [b2, b3]);
|
2021-11-10 09:13:17 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots can render node with t-ref and Component in same slot 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-10 09:13:17 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
|
|
|
|
const comp2 = app.createComponent(\`Child\`, true, true, false, true);
|
2021-11-10 09:13:17 +01:00
|
|
|
|
|
|
|
|
let block2 = createBlock(\`<div block-ref=\\"0\\"/>\`);
|
|
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
|
|
|
const refs = ctx.__owl__.refs;
|
2021-12-22 08:52:51 +01:00
|
|
|
const ref1 = (el) => refs[\`div\`] = el;
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = block2([ref1]);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({}, key + \`__1\`, node, this, null);
|
2021-11-10 09:13:17 +01:00
|
|
|
return multi([b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
2021-11-10 09:13:17 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots can render node with t-ref and Component in same slot 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-20 11:19:59 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-20 11:19:59 +01:00
|
|
|
let { callSlot } = helpers;
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
return callSlot(ctx, node, key, 'default', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-11-10 09:04:22 +01:00
|
|
|
exports[`slots can render only empty slot 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-10 09:04:22 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2021-11-10 09:04:22 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
return callSlot(ctx, node, key, 'default', false, {});
|
2021-11-10 09:04:22 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-11-24 14:13:09 +01:00
|
|
|
exports[`slots can use component in default-content of t-slot 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-24 14:13:09 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
2021-11-24 14:13:09 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2021-11-24 14:13:09 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots can use component in default-content of t-slot 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-24 14:13:09 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`GrandChild\`, true, false, false, true);
|
2021-11-24 14:13:09 +01:00
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function defaultContent1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2021-11-24 14:13:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
return callSlot(ctx, node, key, 'default', false, {}, defaultContent1);
|
2021-11-24 14:13:09 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots can use component in default-content of t-slot 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-24 14:13:09 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-24 14:13:09 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
return text(\`\`);
|
2021-11-24 14:13:09 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots can use t-call in default-content of t-slot 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-24 14:13:09 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
2021-11-24 14:13:09 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2021-11-24 14:13:09 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots can use t-call in default-content of t-slot 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-24 14:13:09 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-05-26 15:09:09 +02:00
|
|
|
let { callSlot } = helpers;
|
|
|
|
|
const callTemplate_1 = app.getTemplate(\`__template__999\`);
|
2021-11-24 14:13:09 +01:00
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function defaultContent1(ctx, node, key = \\"\\") {
|
2021-12-22 12:33:17 +01:00
|
|
|
return callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
2021-11-24 14:13:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
return callSlot(ctx, node, key, 'default', false, {}, defaultContent1);
|
2021-11-24 14:13:09 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots can use t-call in default-content of t-slot 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-24 14:13:09 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-24 14:13:09 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
return text(\`\`);
|
2021-11-24 14:13:09 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2020-11-26 16:45:25 +01:00
|
|
|
exports[`slots content is the default slot (variation) 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span>sts rocks</span>\`);
|
|
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots content is the default slot (variation) 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
return callSlot(ctx, node, key, 'default', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots content is the default slot 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
let block2 = createBlock(\`<span>sts rocks</span>\`);
|
|
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return block2();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots content is the default slot 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots default content is not rendered if named slot is provided 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return text(\`hey\`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({slots: markRaw({'header': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots default content is not rendered if named slot is provided 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
|
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function defaultContent1(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return text(\`default content\`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b3 = callSlot(ctx, node, key, 'header', false, {}, defaultContent1);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots default content is not rendered if slot is provided 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return text(\`hey\`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots default content is not rendered if slot is provided 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function defaultContent1(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
return text(\`default content\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b3 = callSlot(ctx, node, key, 'default', false, {}, defaultContent1);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b3]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots default slot next to named slot, with default content 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return text(\` Overridden footer \`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({slots: markRaw({'footer': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots default slot next to named slot, with default content 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = 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 \`);
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-26 16:45:25 +01:00
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b3 = callSlot(ctx, node, key, 'default', false, {}, defaultContent1);
|
|
|
|
|
const b5 = callSlot(ctx, node, key, 'footer', false, {}, defaultContent2);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b3, b5]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-02-08 09:57:49 +01:00
|
|
|
exports[`slots default slot with params with - in it 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-02-08 09:57:49 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
2022-02-08 09:57:49 +01:00
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
|
|
|
return text(ctx['slotScope']['some-value']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx, __scope: \\"slotScope\\"}})}, key + \`__1\`, node, this, null);
|
2022-02-08 09:57:49 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots default slot with params with - in it 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-02-08 09:57:49 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-02-08 09:57:49 +01:00
|
|
|
let { callSlot } = helpers;
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return callSlot(ctx, node, key, 'default', false, {'some-value': ctx['state'].value});
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-02-02 08:36:11 +01:00
|
|
|
exports[`slots default slot with slot scope: shorthand syntax 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-02-02 08:36:11 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
2022-02-02 08:36:11 +01:00
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2,b3;
|
|
|
|
|
if (ctx['slotScope'].bool) {
|
|
|
|
|
b2 = text(\`some text\`);
|
|
|
|
|
} else {
|
|
|
|
|
b3 = text(\`other text\`);
|
|
|
|
|
}
|
|
|
|
|
return multi([b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx, __scope: \\"slotScope\\"}})}, key + \`__1\`, node, this, null);
|
2022-02-02 08:36:11 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots default slot with slot scope: shorthand syntax 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-02-02 08:36:11 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-02-02 08:36:11 +01:00
|
|
|
let { callSlot } = helpers;
|
|
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {bool: ctx['state'].bool});
|
2022-02-02 08:36:11 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots default slot work with text nodes (variation) 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return text(\`sts rocks\`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots default slot work with text nodes (variation) 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
return callSlot(ctx, node, key, 'default', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots default slot work with text nodes 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return text(\`sts rocks\`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots default slot work with text nodes 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots dynamic t-slot call 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Toggler\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
let block3 = createBlock(\`<p>slot1</p>\`);
|
|
|
|
|
let block4 = createBlock(\`<span>content</span>\`);
|
|
|
|
|
let block5 = createBlock(\`<h1>slot2</h1>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-03-06 10:27:07 +01:00
|
|
|
const b3 = block3();
|
|
|
|
|
const b4 = block4();
|
2020-11-26 16:45:25 +01:00
|
|
|
return multi([b3, b4]);
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot2(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return block5();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b6 = comp1({slots: markRaw({'slot1': {__render: slot1, __ctx: ctx1}, 'slot2': {__render: slot2, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b6]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots dynamic t-slot call 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-child-0/></button>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let hdlr1 = [ctx['toggle'], ctx];
|
2021-12-20 11:19:59 +01:00
|
|
|
const slot1 = (ctx['current'].slot);
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = toggler(slot1, callSlot(ctx, node, key, slot1, true, {}));
|
2021-12-22 11:33:12 +01:00
|
|
|
return block1([hdlr1], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots dynamic t-slot call with default 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Toggler\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
let block3 = createBlock(\`<p>slot1</p>\`);
|
|
|
|
|
let block4 = createBlock(\`<span>content</span>\`);
|
|
|
|
|
let block5 = createBlock(\`<h1>slot2</h1>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-03-06 10:27:07 +01:00
|
|
|
const b3 = block3();
|
|
|
|
|
const b4 = block4();
|
2020-11-26 16:45:25 +01:00
|
|
|
return multi([b3, b4]);
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot2(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return block5();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b6 = comp1({slots: markRaw({'slot1': {__render: slot1, __ctx: ctx1}, 'slot2': {__render: slot2, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b6]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots dynamic t-slot call with default 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-child-0/></button>\`);
|
|
|
|
|
|
|
|
|
|
function defaultContent1(ctx, node, key = \\"\\") {
|
|
|
|
|
return text(\` owl \`);
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-26 16:45:25 +01:00
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let hdlr1 = [ctx['toggle'], ctx];
|
2022-06-06 08:17:51 +02:00
|
|
|
const b3 = callSlot(ctx, node, key, (ctx['current'].slot), true, {}, defaultContent1);
|
2021-12-22 11:33:12 +01:00
|
|
|
return block1([hdlr1], [b3]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots fun: two calls to the same slot 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return text(\`some text\`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots fun: two calls to the same slot 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
|
|
|
|
const b3 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
return multi([b2, b3]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots missing slots are ignored 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, false, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b2 = comp1({}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots missing slots are ignored 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span><block-child-0/><span>some content</span><block-child-1/></span>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
|
|
|
|
const b3 = callSlot(ctx, node, key, 'footer', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2, b3]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-01-10 14:35:57 +01:00
|
|
|
exports[`slots mix of slots, t-call, t-call with body, and giving own props child 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-10 14:35:57 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`P\`, true, false, false, true);
|
2022-01-10 14:35:57 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2022-01-10 14:35:57 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots mix of slots, t-call, t-call with body, and giving own props child 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-10 14:35:57 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`A\`, true, false, false, false);
|
2022-01-10 14:35:57 +01:00
|
|
|
|
|
|
|
|
let block2 = createBlock(\`<button block-handler-0=\\"click\\">inc</button>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let hdlr1 = [ctx['inc'], ctx];
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = block2([hdlr1]);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({number: ctx['state'].number}, key + \`__1\`, node, this, null);
|
2022-01-10 14:35:57 +01:00
|
|
|
return multi([b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots mix of slots, t-call, t-call with body, and giving own props child 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-10 14:35:57 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-05-26 15:09:09 +02:00
|
|
|
let { capture, markRaw } = helpers;
|
|
|
|
|
const callTemplate_1 = app.getTemplate(\`__template__1002\`);
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`B\`, true, true, false, true);
|
2022-01-10 14:35:57 +01:00
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = text(\`[A]\`);
|
|
|
|
|
const b3 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
2022-01-10 14:35:57 +01:00
|
|
|
return multi([b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
|
2022-01-10 14:35:57 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots mix of slots, t-call, t-call with body, and giving own props child 4`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-10 14:35:57 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-05-26 15:09:09 +02:00
|
|
|
let { isBoundary, withDefault, setContextValue } = helpers;
|
|
|
|
|
const callTemplate_1 = app.getTemplate(\`__template__1001\`);
|
2022-01-10 14:35:57 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
ctx = Object.create(ctx);
|
|
|
|
|
ctx[isBoundary] = 1
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = text(\`[sub1] \`);
|
2022-01-10 14:35:57 +01:00
|
|
|
setContextValue(ctx, \\"dummy\\", ctx['validate']);
|
|
|
|
|
ctx = Object.create(ctx);
|
|
|
|
|
ctx[isBoundary] = 1;
|
|
|
|
|
setContextValue(ctx, \\"v\\", ctx['props'].number);
|
2022-03-06 10:27:07 +01:00
|
|
|
const b3 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
2022-01-10 14:35:57 +01:00
|
|
|
return multi([b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots mix of slots, t-call, t-call with body, and giving own props child 5`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-10 14:35:57 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = text(\`[sub2\`);
|
|
|
|
|
const b3 = text(ctx['v']);
|
|
|
|
|
const b4 = text(\`]\`);
|
2022-01-10 14:35:57 +01:00
|
|
|
return multi([b2, b3, b4]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots mix of slots, t-call, t-call with body, and giving own props child 6`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-10 14:35:57 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`C\`, true, false, false, false);
|
2022-01-10 14:35:57 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = text(\`[B]\`);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({slots: ctx['props'].slots}, key + \`__1\`, node, this, null);
|
2022-01-10 14:35:57 +01:00
|
|
|
return multi([b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots mix of slots, t-call, t-call with body, and giving own props child 7`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-10 14:35:57 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { callSlot } = helpers;
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = text(\`[C]\`);
|
2022-06-06 08:17:51 +02:00
|
|
|
const b3 = callSlot(ctx, node, key, 'default', false, {});
|
2022-01-10 14:35:57 +01:00
|
|
|
return multi([b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots multiple roots are allowed in a default slot 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
let block3 = createBlock(\`<span>sts</span>\`);
|
|
|
|
|
let block4 = createBlock(\`<span>rocks</span>\`);
|
|
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-03-06 10:27:07 +01:00
|
|
|
const b3 = block3();
|
|
|
|
|
const b4 = block4();
|
2020-11-26 16:45:25 +01:00
|
|
|
return multi([b3, b4]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b5 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b5]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots multiple roots are allowed in a default slot 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots multiple roots are allowed in a named slot 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
let block3 = createBlock(\`<span>sts</span>\`);
|
|
|
|
|
let block4 = createBlock(\`<span>rocks</span>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-03-06 10:27:07 +01:00
|
|
|
const b3 = block3();
|
|
|
|
|
const b4 = block4();
|
2020-11-26 16:45:25 +01:00
|
|
|
return multi([b3, b4]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b5 = comp1({slots: markRaw({'content': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b5]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots multiple roots are allowed in a named slot 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'content', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots multiple slots containing components 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
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);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({val: 1}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot2(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp2({val: 2}, key + \`__2\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp3({slots: markRaw({'s1': {__render: slot1, __ctx: ctx1}, 's2': {__render: slot2, __ctx: ctx1}})}, key + \`__3\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots multiple slots containing components 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 's1', false, {});
|
|
|
|
|
const b3 = callSlot(ctx, node, key, 's2', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots multiple slots containing components 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-20 11:19:59 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-20 11:19:59 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['props'].val;
|
|
|
|
|
return block1([txt1]);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots named slot inside slot 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
|
|
|
|
const comp2 = app.createComponent(\`Child\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
let block2 = createBlock(\`<p>A<block-text-0/></p>\`);
|
|
|
|
|
let block3 = createBlock(\`<p>B<block-text-0/></p>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['value'];
|
|
|
|
|
return block2([txt1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot2(ctx, node, key = \\"\\") {
|
|
|
|
|
const ctx2 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'brol': {__render: slot3, __ctx: ctx2}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot3(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt2 = ctx['value'];
|
|
|
|
|
return block3([txt2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b5 = comp2({slots: markRaw({'brol': {__render: slot1, __ctx: ctx1}, 'default': {__render: slot2, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b5]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots named slot inside slot 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'brol', false, {});
|
|
|
|
|
const b3 = callSlot(ctx, node, key, 'default', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots named slot inside slot, part 3 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
|
|
|
|
const comp2 = app.createComponent(\`Child\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
let block2 = createBlock(\`<p>A<block-text-0/></p>\`);
|
|
|
|
|
let block3 = createBlock(\`<p>B<block-text-0/></p>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['value'];
|
|
|
|
|
return block2([txt1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot2(ctx, node, key = \\"\\") {
|
|
|
|
|
const ctx2 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'brol': {__render: slot3, __ctx: ctx2}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot3(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt2 = ctx['value'];
|
|
|
|
|
return block3([txt2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b5 = comp2({slots: markRaw({'brol': {__render: slot1, __ctx: ctx1}, 'default': {__render: slot2, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b5]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots named slot inside slot, part 3 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'brol', false, {});
|
|
|
|
|
const b3 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2, b3]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots named slots can define a default content 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, false, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b2 = comp1({}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots named slots can define a default content 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function defaultContent1(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
return text(\`default content\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b3 = callSlot(ctx, node, key, 'header', false, {}, defaultContent1);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b3]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots named slots inside slot, again 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
|
|
|
|
const comp2 = app.createComponent(\`Child\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
let block2 = createBlock(\`<p>A<block-text-0/></p>\`);
|
|
|
|
|
let block3 = createBlock(\`<p>B<block-text-0/></p>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['value'];
|
|
|
|
|
return block2([txt1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot2(ctx, node, key = \\"\\") {
|
|
|
|
|
const ctx2 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'brol2': {__render: slot3, __ctx: ctx2}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot3(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt2 = ctx['value'];
|
|
|
|
|
return block3([txt2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b5 = comp2({slots: markRaw({'brol1': {__render: slot1, __ctx: ctx1}, 'default': {__render: slot2, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b5]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots named slots inside slot, again 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = 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\`);
|
|
|
|
|
}
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b3 = callSlot(ctx, node, key, 'brol1', false, {}, defaultContent1);
|
|
|
|
|
const b5 = callSlot(ctx, node, key, 'brol2', false, {}, defaultContent2);
|
|
|
|
|
const b6 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b3, b5, b6]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots nested slots in same template 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
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);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span id=\\"parent\\"><block-child-0/></span>\`);
|
|
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp2({slots: markRaw({'default': {__render: slot2, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function slot2(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b4 = comp3({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__3\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b4]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots nested slots in same template 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-20 11:19:59 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span id=\\"c1\\"><div><block-child-0/></div></span>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots nested slots in same template 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-20 11:19:59 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span id=\\"c2\\"><block-child-0/></span>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots nested slots in same template 4`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span>Child 3</span>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1();
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots nested slots: evaluation context and parented relationship 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Slot\`, true, false, false, false);
|
|
|
|
|
const comp2 = app.createComponent(\`Child\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots nested slots: evaluation context and parented relationship 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { callSlot, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`GrandChild\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
return callSlot(ctx, node, key, 'default', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots nested slots: evaluation context and parented relationship 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-20 11:19:59 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots nested slots: evaluation context and parented relationship 4`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['props'].val;
|
|
|
|
|
return block1([txt1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots no named slot content => just no children 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, false, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots no named slot content => just no children 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'header', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots simple default slot 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return text(\`some text\`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
2021-11-19 13:43:21 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots simple default slot 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-19 13:43:21 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2021-11-19 13:43:21 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2021-11-19 13:43:21 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots simple default slot with params 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-19 13:43:21 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
2021-11-19 13:43:21 +01:00
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
let b2,b3;
|
|
|
|
|
if (ctx['slotScope'].bool) {
|
|
|
|
|
b2 = text(\`some text\`);
|
|
|
|
|
} else {
|
|
|
|
|
b3 = text(\`other text\`);
|
|
|
|
|
}
|
|
|
|
|
return multi([b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
2021-11-19 13:43:21 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots simple default slot with params 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-19 13:43:21 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2021-11-19 13:43:21 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {bool: ctx['state'].bool});
|
2021-11-19 13:43:21 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-02-08 09:57:49 +01:00
|
|
|
exports[`slots simple default slot with params and bound function 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-02-08 09:57:49 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
2022-02-08 09:57:49 +01:00
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
|
|
|
return text(ctx['slotScope'].fn());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx, __scope: \\"slotScope\\"}})}, key + \`__1\`, node, this, null);
|
2022-02-08 09:57:49 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots simple default slot with params and bound function 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-02-08 09:57:49 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-02-08 09:57:49 +01:00
|
|
|
let { callSlot, bind } = helpers;
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return callSlot(ctx, node, key, 'default', false, {fn: bind(ctx, ctx['getValue'])});
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-02-02 08:36:11 +01:00
|
|
|
exports[`slots simple default slot, variation 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-19 13:43:21 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
2021-11-19 13:43:21 +01:00
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-02-02 08:36:11 +01:00
|
|
|
return text(\`some text\`);
|
2021-11-19 13:43:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-02-02 08:36:11 +01:00
|
|
|
exports[`slots simple default slot, variation 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
return callSlot(ctx, node, key, 'default', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-03-31 15:52:04 +02:00
|
|
|
exports[`slots simple dynamic slot with slot scope 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-03-31 15:52:04 +02:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-03-31 15:52:04 +02:00
|
|
|
let { capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
2022-03-31 15:52:04 +02:00
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2,b3;
|
|
|
|
|
if (ctx['slotScope'].bool) {
|
|
|
|
|
b2 = text(\`some text\`);
|
|
|
|
|
} else {
|
|
|
|
|
b3 = text(\`other text\`);
|
|
|
|
|
}
|
|
|
|
|
return multi([b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'slotName': {__render: slot1, __ctx: ctx1, __scope: \\"slotScope\\"}})}, key + \`__1\`, node, this, null);
|
2022-03-31 15:52:04 +02:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots simple dynamic slot with slot scope 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-03-31 15:52:04 +02:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-03-31 15:52:04 +02:00
|
|
|
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]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-03-29 10:16:31 +02:00
|
|
|
exports[`slots simple named and empty slot -- 2 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-03-29 10:16:31 +02:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-03-29 10:16:31 +02:00
|
|
|
let { capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
2022-03-29 10:16:31 +02:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'myEmptySlot': {myProp: 'myProp text'}})}, key + \`__1\`, node, this, null);
|
2022-03-29 10:16:31 +02:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots simple named and empty slot -- 2 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-03-29 10:16:31 +02:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-03-29 10:16:31 +02:00
|
|
|
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 = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b3 = callSlot(ctx, node, key, 'myEmptySlot', false, {}, defaultContent1);
|
2022-03-29 10:16:31 +02:00
|
|
|
return block1([], [b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots simple named and empty slot 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-03-29 10:16:31 +02:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-03-29 10:16:31 +02:00
|
|
|
let { capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
2022-03-29 10:16:31 +02:00
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
|
|
|
return text(\`some text\`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'myEmptySlot': {}, 'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
2022-03-29 10:16:31 +02:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots simple named and empty slot 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-03-29 10:16:31 +02:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-03-29 10:16:31 +02:00
|
|
|
let { callSlot } = helpers;
|
|
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span><block-child-0/><block-child-1/></span>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
|
|
|
|
const b3 = callSlot(ctx, node, key, 'myEmptySlot', false, {});
|
2022-03-29 10:16:31 +02:00
|
|
|
return block1([], [b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-02-02 08:36:11 +01:00
|
|
|
exports[`slots simple slot with slot scope 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-02-02 08:36:11 +01:00
|
|
|
let b2,b3;
|
|
|
|
|
if (ctx['slotScope'].bool) {
|
|
|
|
|
b2 = text(\`some text\`);
|
|
|
|
|
} else {
|
|
|
|
|
b3 = text(\`other text\`);
|
|
|
|
|
}
|
|
|
|
|
return multi([b2, b3]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-02-02 08:36:11 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'slotName': {__render: slot1, __ctx: ctx1, __scope: \\"slotScope\\"}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-02-02 08:36:11 +01:00
|
|
|
exports[`slots simple slot with slot scope 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2022-02-02 08:36:11 +01:00
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
|
|
|
|
|
2020-11-26 16:45:25 +01:00
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = callSlot(ctx, node, key, 'slotName', false, {bool: ctx['state'].bool});
|
2022-02-02 08:36:11 +01:00
|
|
|
return block1([], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slot and (inline) t-call 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-05-26 15:09:09 +02:00
|
|
|
let { capture, markRaw } = helpers;
|
|
|
|
|
const callTemplate_1 = app.getTemplate(\`__template__999\`);
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
|
|
|
return callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slot and (inline) t-call 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<p>sokka</p>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slot and (inline) t-call 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slot and t-call 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-05-26 15:09:09 +02:00
|
|
|
let { capture, markRaw } = helpers;
|
|
|
|
|
const callTemplate_1 = app.getTemplate(\`__template__999\`);
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
|
|
|
return callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slot and t-call 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-20 11:19:59 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-20 11:19:59 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<p>sokka</p>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots slot and t-call 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slot and t-esc 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return text('toph');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slot and t-esc 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slot are properly rendered if inner props are changed 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`SomeComponent\`, true, false, false, false);
|
|
|
|
|
const comp2 = app.createComponent(\`GenericComponent\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><button block-handler-0=\\"click\\">Inc[<block-text-1/>]</button><block-child-0/></div>\`);
|
|
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let hdlr1 = [ctx['inc'], ctx];
|
2021-12-22 12:33:17 +01:00
|
|
|
let txt1 = ctx['state'].val;
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
2021-12-22 12:33:17 +01:00
|
|
|
return block1([hdlr1, txt1], [b3]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slot are properly rendered if inner props are changed 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-25 13:56:56 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2021-11-25 13:56:56 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
2021-11-25 13:56:56 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2021-11-25 13:56:56 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slot are properly rendered if inner props are changed 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-20 11:19:59 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-20 11:19:59 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div> SC:<block-text-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['props'].val;
|
|
|
|
|
return block1([txt1]);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-01-14 15:29:00 +01:00
|
|
|
exports[`slots slot content has different key from other content -- dynamic slot 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-14 15:29:00 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
|
|
|
|
const comp2 = app.createComponent(\`SlotDisplay\`, true, true, false, true);
|
2022-01-14 15:29:00 +01:00
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({parent: 'Parent'}, key + \`__1\`, node, this, null);
|
2022-01-14 15:29:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
2022-01-14 15:29:00 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots slot content has different key from other content -- dynamic slot 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-14 15:29:00 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-14 15:29:00 +01:00
|
|
|
let { callSlot } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
2022-01-14 15:29:00 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b2 = comp1({parent: 'SlotDisplay'}, key + \`__1\`, node, this, null);
|
2022-01-14 15:29:00 +01:00
|
|
|
const slot1 = (ctx['slotName']);
|
2022-06-06 08:17:51 +02:00
|
|
|
const b3 = toggler(slot1, callSlot(ctx, node, key, slot1, true, {}));
|
2022-01-14 15:29:00 +01:00
|
|
|
return multi([b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots slot content has different key from other content -- dynamic slot 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-14 15:29:00 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-14 15:29:00 +01:00
|
|
|
|
|
|
|
|
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`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-14 15:29:00 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
|
|
|
|
const comp2 = app.createComponent(\`SlotDisplay\`, true, true, false, true);
|
2022-01-14 15:29:00 +01:00
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({parent: 'Parent'}, key + \`__1\`, node, this, null);
|
2022-01-14 15:29:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
2022-01-14 15:29:00 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots slot content has different key from other content -- static slot 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-14 15:29:00 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-14 15:29:00 +01:00
|
|
|
let { callSlot } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
2022-01-14 15:29:00 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b2 = comp1({parent: 'SlotDisplay'}, key + \`__1\`, node, this, null);
|
2022-06-06 08:17:51 +02:00
|
|
|
const b3 = callSlot(ctx, node, key, 'default', false, {});
|
2022-01-14 15:29:00 +01:00
|
|
|
return multi([b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots slot content has different key from other content -- static slot 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-14 15:29:00 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-14 15:29:00 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let txt1 = ctx['props'].parent;
|
|
|
|
|
return block1([txt1]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slot content is bound to caller (variation) 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-25 13:56:56 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { capture, isBoundary, withDefault, setContextValue, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
2021-11-25 13:56:56 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<button block-handler-0=\\"click\\">some text</button>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2021-11-25 14:50:40 +01:00
|
|
|
ctx = Object.create(ctx);
|
|
|
|
|
ctx[isBoundary] = 1
|
2021-11-25 13:56:56 +01:00
|
|
|
setContextValue(ctx, \\"var\\", 1);
|
2021-12-22 11:33:12 +01:00
|
|
|
let hdlr1 = [()=>this.inc(), ctx];
|
|
|
|
|
return block1([hdlr1]);
|
2021-11-25 13:56:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
2021-11-25 13:56:56 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slot content is bound to caller (variation) 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slot content is bound to caller 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<button block-handler-0=\\"click\\">some text</button>\`);
|
|
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let hdlr1 = [ctx['inc'], ctx];
|
|
|
|
|
return block1([hdlr1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slot content is bound to caller 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slot preserves properly parented relationship 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`GrandChild\`, true, false, false, true);
|
|
|
|
|
const comp2 = app.createComponent(\`Child\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slot preserves properly parented relationship 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
return callSlot(ctx, node, key, 'default', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slot preserves properly parented relationship 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return text(\`Grand Child\`);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slot preserves properly parented relationship, even through t-call 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-05-26 15:09:09 +02:00
|
|
|
let { capture, markRaw } = helpers;
|
|
|
|
|
const callTemplate_1 = app.getTemplate(\`sub\`);
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
|
|
|
return callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slot preserves properly parented relationship, even through t-call 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-20 11:19:59 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`GrandChild\`, true, false, false, true);
|
2021-12-20 11:19:59 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots slot preserves properly parented relationship, even through t-call 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
return callSlot(ctx, node, key, 'default', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots slot preserves properly parented relationship, even through t-call 4`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-20 11:19:59 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
return text(\`Grand Child\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-06-06 08:17:51 +02:00
|
|
|
exports[`slots slot with slot scope and t-props 1`] = `
|
|
|
|
|
"function anonymous(app, bdom, helpers
|
|
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-06 08:17:51 +02:00
|
|
|
let { capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
2022-06-06 08:17:51 +02:00
|
|
|
|
|
|
|
|
let block2 = createBlock(\`<p><block-text-0/></p>\`);
|
|
|
|
|
let block3 = createBlock(\`<p><block-text-0/></p>\`);
|
|
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
|
|
|
let txt1 = ctx['info'].a;
|
|
|
|
|
const b2 = block2([txt1]);
|
|
|
|
|
let txt2 = ctx['info'].b;
|
|
|
|
|
const b3 = block3([txt2]);
|
|
|
|
|
return multi([b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'slotName': {__render: slot1, __ctx: ctx1, __scope: \\"info\\"}})}, key + \`__1\`, node, this, null);
|
2022-06-06 08:17:51 +02:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots slot with slot scope and t-props 2`] = `
|
|
|
|
|
"function anonymous(app, bdom, helpers
|
|
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-06 08:17:51 +02:00
|
|
|
let { callSlot } = helpers;
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return callSlot(ctx, node, key, 'slotName', false, Object.assign({}, ctx['info']));
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots and wrapper components 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Link\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return text(\`hey\`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots and wrapper components 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-25 13:56:56 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-20 11:19:59 +01:00
|
|
|
let { callSlot } = helpers;
|
2021-11-25 13:56:56 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<a href=\\"abc\\"><block-child-0/></a>\`);
|
2021-11-25 13:56:56 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2]);
|
2021-11-25 13:56:56 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots are properly bound to correct component 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-25 13:56:56 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
2021-11-25 13:56:56 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2021-11-25 13:56:56 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots are properly bound to correct component 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-20 11:19:59 +01:00
|
|
|
let { callSlot, isBoundary, withDefault, setContextValue } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-text-1/></button>\`);
|
|
|
|
|
|
|
|
|
|
function defaultContent1(ctx, node, key = \\"\\") {
|
|
|
|
|
ctx = Object.create(ctx);
|
|
|
|
|
ctx[isBoundary] = 1
|
|
|
|
|
setContextValue(ctx, \\"var\\", 1);
|
2021-12-22 11:33:12 +01:00
|
|
|
let hdlr1 = [()=>this.increment(), ctx];
|
2021-12-22 12:33:17 +01:00
|
|
|
let txt1 = ctx['state'].value;
|
|
|
|
|
return block1([hdlr1, txt1]);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
return callSlot(ctx, node, key, 'default', false, {}, defaultContent1);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots are rendered with proper context 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><span class=\\"counter\\"><block-text-0/></span><block-child-0/></div>\`);
|
|
|
|
|
let block2 = createBlock(\`<button block-handler-0=\\"click\\">do something</button>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
|
|
|
let hdlr1 = [ctx['doSomething'], ctx];
|
|
|
|
|
return block2([hdlr1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['state'].val;
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({slots: markRaw({'footer': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
2021-12-22 11:33:12 +01:00
|
|
|
return block1([txt1], [b3]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots are rendered with proper context 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'footer', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots are rendered with proper context, part 2 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { prepareList, capture, markRaw, withKey } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Link\`, true, true, false, false);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><u><block-child-0/></u></div>\`);
|
|
|
|
|
let block3 = createBlock(\`<li><block-child-0/></li>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-03-06 10:27:07 +01:00
|
|
|
const b5 = text(\`User \`);
|
|
|
|
|
const b6 = text(ctx['user'].name);
|
2020-11-26 16:45:25 +01:00
|
|
|
return multi([b5, b6]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
ctx = Object.create(ctx);
|
2022-03-06 10:27:07 +01:00
|
|
|
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state'].users);;
|
2021-10-15 13:08:07 +02:00
|
|
|
for (let i1 = 0; i1 < l_block2; i1++) {
|
|
|
|
|
ctx[\`user\`] = v_block2[i1];
|
2022-03-06 10:27:07 +01:00
|
|
|
const key1 = ctx['user'].id;
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b7 = comp1({to: '/user/'+ctx['user'].id,slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1__\${key1}\`, node, this, null);
|
2021-10-15 13:08:07 +02:00
|
|
|
c_block2[i1] = withKey(block3([], [b7]), key1);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = list(c_block2);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots are rendered with proper context, part 2 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<a block-attribute-0=\\"href\\"><block-child-0/></a>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let attr1 = ctx['props'].to;
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-22 11:33:12 +01:00
|
|
|
return block1([attr1], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots are rendered with proper context, part 3 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { prepareList, isBoundary, withDefault, setContextValue, capture, markRaw, withKey } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Link\`, true, true, false, false);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><u><block-child-0/></u></div>\`);
|
|
|
|
|
let block3 = createBlock(\`<li><block-child-0/></li>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return text(ctx['userdescr']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
ctx = Object.create(ctx);
|
2021-10-19 11:00:26 +02:00
|
|
|
ctx[isBoundary] = 1
|
2020-11-26 16:45:25 +01:00
|
|
|
ctx = Object.create(ctx);
|
2022-03-06 10:27:07 +01:00
|
|
|
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state'].users);;
|
2021-10-15 13:08:07 +02:00
|
|
|
for (let i1 = 0; i1 < l_block2; i1++) {
|
|
|
|
|
ctx[\`user\`] = v_block2[i1];
|
2022-03-06 10:27:07 +01:00
|
|
|
const key1 = ctx['user'].id;
|
2021-10-19 11:00:26 +02:00
|
|
|
setContextValue(ctx, \\"userdescr\\", 'User '+ctx['user'].name);
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b5 = comp1({to: '/user/'+ctx['user'].id,slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1__\${key1}\`, node, this, null);
|
2021-10-15 13:08:07 +02:00
|
|
|
c_block2[i1] = withKey(block3([], [b5]), key1);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = list(c_block2);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots are rendered with proper context, part 3 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<a block-attribute-0=\\"href\\"><block-child-0/></a>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let attr1 = ctx['props'].to;
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-22 11:33:12 +01:00
|
|
|
return block1([attr1], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots are rendered with proper context, part 4 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { isBoundary, withDefault, setContextValue, capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Link\`, true, true, false, false);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return text(ctx['userdescr']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
ctx = Object.create(ctx);
|
2021-10-19 11:00:26 +02:00
|
|
|
ctx[isBoundary] = 1
|
|
|
|
|
setContextValue(ctx, \\"userdescr\\", 'User '+ctx['state'].user.name);
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({to: '/user/'+ctx['state'].user.id,slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots are rendered with proper context, part 4 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<a block-attribute-0=\\"href\\"><block-child-0/></a>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let attr1 = ctx['props'].to;
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-22 11:33:12 +01:00
|
|
|
return block1([attr1], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots in slots, with vars 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { isBoundary, withDefault, setContextValue, capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`A\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
2021-12-20 11:19:59 +01:00
|
|
|
let block2 = createBlock(\`<p>hey<block-text-0/></p>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['test'];
|
|
|
|
|
return block2([txt1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
ctx = Object.create(ctx);
|
|
|
|
|
ctx[isBoundary] = 1
|
|
|
|
|
setContextValue(ctx, \\"test\\", ctx['state'].name);
|
|
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots in slots, with vars 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { callSlot, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`B\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
return callSlot(ctx, node, key, 'default', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots in slots, with vars 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots in t-foreach and re-rendering 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { prepareList, capture, markRaw, withKey } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return text(ctx['n_index']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
ctx = Object.create(ctx);
|
2022-03-06 10:27:07 +01:00
|
|
|
const [k_block2, v_block2, l_block2, c_block2] = prepareList(Array(2));;
|
2021-10-15 13:08:07 +02:00
|
|
|
for (let i1 = 0; i1 < l_block2; i1++) {
|
|
|
|
|
ctx[\`n\`] = v_block2[i1];
|
2020-11-26 16:45:25 +01:00
|
|
|
ctx[\`n_index\`] = i1;
|
2022-03-06 10:27:07 +01:00
|
|
|
const key1 = ctx['n_index'];
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
c_block2[i1] = withKey(comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1__\${key1}\`, node, this, null), key1);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = list(c_block2);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots in t-foreach and re-rendering 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span><block-text-0/><block-child-0/></span>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['state'].val;
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-22 11:33:12 +01:00
|
|
|
return block1([txt1], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots in t-foreach in t-foreach 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { prepareList, capture, markRaw, withKey } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
let block4 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
|
let block5 = createBlock(\`<ul><block-child-0/></ul>\`);
|
|
|
|
|
let block7 = createBlock(\`<li><block-text-0/></li>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt2 = ctx['node1'].value;
|
|
|
|
|
return block7([txt2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
ctx = Object.create(ctx);
|
2022-03-06 10:27:07 +01:00
|
|
|
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['tree']);;
|
2021-10-15 13:08:07 +02:00
|
|
|
for (let i1 = 0; i1 < l_block2; i1++) {
|
|
|
|
|
ctx[\`node1\`] = v_block2[i1];
|
2022-03-06 10:27:07 +01:00
|
|
|
const key1 = ctx['node1'].key;
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['node1'].value;
|
2022-03-06 10:27:07 +01:00
|
|
|
const b4 = block4([txt1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
ctx = Object.create(ctx);
|
2022-03-06 10:27:07 +01:00
|
|
|
const [k_block6, v_block6, l_block6, c_block6] = prepareList(ctx['node1'].nodes);;
|
2021-10-15 13:08:07 +02:00
|
|
|
for (let i2 = 0; i2 < l_block6; i2++) {
|
|
|
|
|
ctx[\`node2\`] = v_block6[i2];
|
2022-03-06 10:27:07 +01:00
|
|
|
const key2 = ctx['node2'].key;
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
c_block6[i2] = withKey(comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1__\${key1}__\${key2}\`, node, this, null), key2);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
ctx = ctx.__proto__;
|
2022-03-06 10:27:07 +01:00
|
|
|
const b6 = list(c_block6);
|
|
|
|
|
const b5 = block5([], [b6]);
|
2021-10-15 13:08:07 +02:00
|
|
|
c_block2[i1] = withKey(multi([b4, b5]), key1);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = list(c_block2);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots in t-foreach in t-foreach 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots in t-foreach with t-set and re-rendering 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { prepareList, isBoundary, withDefault, setContextValue, capture, markRaw, withKey } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
return text(ctx['dummy']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
ctx = Object.create(ctx);
|
2021-10-19 11:00:26 +02:00
|
|
|
ctx[isBoundary] = 1
|
2020-11-26 16:45:25 +01:00
|
|
|
ctx = Object.create(ctx);
|
2022-03-06 10:27:07 +01:00
|
|
|
const [k_block2, v_block2, l_block2, c_block2] = prepareList(Array(2));;
|
2021-10-15 13:08:07 +02:00
|
|
|
for (let i1 = 0; i1 < l_block2; i1++) {
|
|
|
|
|
ctx[\`n\`] = v_block2[i1];
|
2020-11-26 16:45:25 +01:00
|
|
|
ctx[\`n_index\`] = i1;
|
2022-03-06 10:27:07 +01:00
|
|
|
const key1 = ctx['n_index'];
|
2021-10-19 11:00:26 +02:00
|
|
|
setContextValue(ctx, \\"dummy\\", ctx['n_index']);
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
c_block2[i1] = withKey(comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1__\${key1}\`, node, this, null), key1);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = list(c_block2);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots slots in t-foreach with t-set and re-rendering 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span><block-text-0/><block-child-0/></span>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['state'].val;
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-22 11:33:12 +01:00
|
|
|
return block1([txt1], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots t-debug on a t-set-slot (defining a slot) 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { capture, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2020-11-26 16:45:25 +01:00
|
|
|
debugger;
|
|
|
|
|
return text(\`abc\`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({slots: markRaw({'content': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots t-debug on a t-set-slot (defining a slot) 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'content', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots t-set t-value in a slot 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { capture, isBoundary, withDefault, setContextValue, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2021-11-25 14:50:40 +01:00
|
|
|
ctx = Object.create(ctx);
|
|
|
|
|
ctx[isBoundary] = 1
|
2021-10-19 11:00:26 +02:00
|
|
|
setContextValue(ctx, \\"rainbow\\", 'dash');
|
2020-11-26 16:45:25 +01:00
|
|
|
return text(ctx['rainbow']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots t-set t-value in a slot 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots t-slot in recursive templates 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-05-26 15:09:09 +02:00
|
|
|
let { capture, prepareList, isBoundary, withDefault, setContextValue, withKey, markRaw } = helpers;
|
|
|
|
|
const callTemplate_1 = app.getTemplate(\`_test_recursive_template\`);
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Wrapper\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2021-11-25 14:50:40 +01:00
|
|
|
ctx = Object.create(ctx);
|
|
|
|
|
ctx[isBoundary] = 1
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = text(ctx['name']);
|
2020-11-26 16:45:25 +01:00
|
|
|
ctx = Object.create(ctx);
|
2022-03-06 10:27:07 +01:00
|
|
|
const [k_block3, v_block3, l_block3, c_block3] = prepareList(ctx['items']);;
|
2021-10-15 13:08:07 +02:00
|
|
|
for (let i1 = 0; i1 < l_block3; i1++) {
|
|
|
|
|
ctx[\`item\`] = v_block3[i1];
|
2020-11-26 16:45:25 +01:00
|
|
|
ctx[\`item_first\`] = i1 === 0;
|
2021-10-15 13:08:07 +02:00
|
|
|
ctx[\`item_last\`] = i1 === v_block3.length - 1;
|
2020-11-26 16:45:25 +01:00
|
|
|
ctx[\`item_index\`] = i1;
|
2021-10-15 13:08:07 +02:00
|
|
|
ctx[\`item_value\`] = k_block3[i1];
|
2022-03-06 10:27:07 +01:00
|
|
|
const key1 = ctx['item'].name;
|
2020-11-26 16:45:25 +01:00
|
|
|
let b5,b6;
|
|
|
|
|
if (!ctx['item'].children.length) {
|
|
|
|
|
b5 = text(ctx['item'].name);
|
|
|
|
|
} else {
|
|
|
|
|
ctx = Object.create(ctx);
|
2021-10-19 11:00:26 +02:00
|
|
|
ctx[isBoundary] = 1;
|
|
|
|
|
setContextValue(ctx, \\"name\\", ctx['item'].name);
|
|
|
|
|
setContextValue(ctx, \\"items\\", ctx['item'].children);
|
2021-12-22 12:33:17 +01:00
|
|
|
b6 = callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
ctx = ctx.__proto__;
|
|
|
|
|
}
|
2021-10-15 13:08:07 +02:00
|
|
|
c_block3[i1] = withKey(multi([b5, b6]), key1);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
ctx = ctx.__proto__;
|
2022-03-06 10:27:07 +01:00
|
|
|
const b3 = list(c_block3);
|
2020-11-26 16:45:25 +01:00
|
|
|
return multi([b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`slots t-slot in recursive templates 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-20 11:19:59 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-20 11:19:59 +01:00
|
|
|
let { callSlot } = helpers;
|
|
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<wrapper><block-child-0/></wrapper>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2020-11-26 16:45:25 +01:00
|
|
|
exports[`slots t-slot nested within another slot 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child3\`, true, false, false, true);
|
|
|
|
|
const comp2 = app.createComponent(\`Dialog\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span id=\\"c1\\"><block-child-0/></span>\`);
|
|
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b3]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots t-slot nested within another slot 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { callSlot, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Portal\`, true, true, false, true);
|
|
|
|
|
const comp2 = app.createComponent(\`Modal\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span id=\\"c2\\"><block-child-0/></span>\`);
|
|
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'default': {__render: slot2, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function slot2(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
return callSlot(ctx, node, key, 'default', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b4 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b4]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots t-slot nested within another slot 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span id=\\"modal\\"><block-child-0/></span>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots t-slot nested within another slot 4`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span id=\\"portal\\"><block-child-0/></span>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots t-slot nested within another slot 5`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span>Child 3</span>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1();
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots t-slot scope context 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
2021-12-20 11:19:59 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<button>The Button</button>\`);
|
|
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
|
|
|
|
}
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots t-slot scope context 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { callSlot, markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Wrapper\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div block-handler-0=\\"click\\"><block-child-0/></div>\`);
|
|
|
|
|
|
2021-11-25 14:50:40 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let hdlr1 = [ctx['onClick'], ctx];
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2021-12-22 11:33:12 +01:00
|
|
|
return block1([hdlr1], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots t-slot scope context 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-20 11:19:59 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
return callSlot(ctx, node, key, 'default', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots t-slot within dynamic t-call 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-05-26 15:09:09 +02:00
|
|
|
let { capture, markRaw } = helpers;
|
|
|
|
|
const call = app.callTemplate.bind(app);
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Slotted\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
|
|
|
const template1 = (ctx['tcallTemplate']);
|
|
|
|
|
return call(this, template1, ctx, node, key + \`__1\`);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b3]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots t-slot within dynamic t-call 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div class=\\"slotted\\"><block-child-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
const b2 = callSlot(ctx, node, key, 'default', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots t-slot within dynamic t-call 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div class=\\"slot\\"><block-child-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b2 = comp1({}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots t-slot within dynamic t-call 4`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div class=\\"child\\"/>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1();
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots template can just return a slot 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
|
|
|
|
const comp2 = app.createComponent(\`SlotComponent\`, true, true, false, true);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b3]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots template can just return a slot 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
return callSlot(ctx, node, key, 'default', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`slots template can just return a slot 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['props'].value;
|
|
|
|
|
return block1([txt1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|