2020-11-26 16:45:25 +01:00
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
|
|
|
|
|
exports[`style and class handling can set class on multi root component 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(\`Child\`, true, false, false, 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({class: 'fromparent'}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`style and class handling can set class on multi root 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;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block2 = createBlock(\`<div>a</div>\`);
|
|
|
|
|
let block3 = createBlock(\`<span block-attribute-0=\\"class\\">b</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 = block2();
|
2021-12-22 11:33:12 +01:00
|
|
|
let attr1 = ctx['props'].class;
|
2022-03-06 10:27:07 +01:00
|
|
|
const b3 = block3([attr1]);
|
2021-12-20 11:19:59 +01:00
|
|
|
return multi([b2, b3]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`style and class handling can set class on sub component, as prop 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(\`Child\`, true, false, false, 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({class: 'some-class'}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`style and class handling can set class on sub component, as prop 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
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">child</div>\`);
|
|
|
|
|
|
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'].class;
|
|
|
|
|
return block1([attr1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`style and class handling can set class on sub sub component 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(\`Child\`, true, false, false, 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({class: 'fromparent'}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`style and class handling can set class on sub sub 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;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`ChildChild\`, true, false, false, 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({class: (ctx['props'].class||'')+' fromchild'}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`style and class handling can set class on sub sub component 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(\`<div block-attribute-0=\\"class\\">childchild</div>\`);
|
|
|
|
|
|
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'].class;
|
|
|
|
|
return block1([attr1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`style and class handling can set more than one class on sub component 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(\`Child\`, true, false, false, 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({class: 'a b'}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`style and class handling can set more than one class on sub 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;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">child</div>\`);
|
|
|
|
|
|
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'].class;
|
|
|
|
|
return block1([attr1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`style and class handling can set style and class inside component 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;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div style=\\"font-weight:bold;\\" class=\\"some-class\\">world</div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-10-15 11:40:37 +02:00
|
|
|
exports[`style and class handling class on components do not interfere with user defined classes 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-10-15 11:40:37 +02:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-10-15 11:40:37 +02:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let attr1 = {c:ctx['state'].c};
|
|
|
|
|
return block1([attr1]);
|
2021-10-15 11:40:37 +02:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2020-11-26 16:45:25 +01:00
|
|
|
exports[`style and class handling class on sub component, which is switched to another 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(\`Child\`, true, false, false, 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({class: 'someclass',child: ctx['state'].child}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`style and class handling class on sub component, which is switched to another 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-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`ChildA\`, true, false, false, false);
|
|
|
|
|
const comp2 = app.createComponent(\`ChildB\`, true, false, false, false);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2,b3;
|
|
|
|
|
if (ctx['props'].child==='a') {
|
2022-06-22 15:39:31 +02:00
|
|
|
b2 = comp1({class: ctx['props'].class}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
} else {
|
2022-06-22 15:39:31 +02:00
|
|
|
b3 = comp2({class: ctx['props'].class}, key + \`__2\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
return multi([b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`style and class handling class on sub component, which is switched to another 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(\`<div block-attribute-0=\\"class\\">a</div>\`);
|
|
|
|
|
|
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'].class;
|
|
|
|
|
return block1([attr1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`style and class handling class on sub component, which is switched to another 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-attribute-0=\\"class\\">b</span>\`);
|
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'].class;
|
|
|
|
|
return block1([attr1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`style and class handling class with extra whitespaces (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-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<p><block-child-0/></p>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b2 = comp1({class: 'a b c d'}, 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[`style and class handling class with extra whitespaces (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;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let attr1 = ctx['props'].class;
|
|
|
|
|
return block1([attr1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`style and class handling class with extra whitespaces 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(\`Child\`, true, false, false, 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({class: 'a b c d'}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`style and class handling class with extra whitespaces 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
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
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'].class;
|
|
|
|
|
return block1([attr1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`style and class handling component class and parent class combine together 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(\`Child\`, true, false, false, 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({class: 'from parent'}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`style and class handling component class and parent class combine together 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(\`<div class=\\"child\\" block-attribute-0=\\"class\\">child</div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let attr1 = ctx['props'].class;
|
|
|
|
|
return block1([attr1]);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-10-15 11:40:37 +02:00
|
|
|
exports[`style and class handling dynamic t-att-style is properly added and updated on widget root el 1`] = `
|
|
|
|
|
"function anonymous(bdom, helpers
|
|
|
|
|
) {
|
|
|
|
|
let { text, createBlock, list, multi, html, toggler, component } = bdom;
|
|
|
|
|
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers;
|
|
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"style\\"/>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let d1 = {'font-size':'20px',...ctx['props'].style};
|
|
|
|
|
return block1([d1]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`style and class handling dynamic t-att-style is properly added and updated on widget root el 2`] = `
|
|
|
|
|
"function anonymous(bdom, helpers
|
|
|
|
|
) {
|
|
|
|
|
let { text, createBlock, list, multi, html, toggler, component } = bdom;
|
|
|
|
|
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers;
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return component(\`Child\`, {style: ctx['state'].style}, key + \`__1\`, node, ctx);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2020-11-26 16:45:25 +01:00
|
|
|
exports[`style and class handling empty class attribute is not added on widget root el 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(\`Child\`, true, false, false, false);
|
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-22 15:39:31 +02:00
|
|
|
const b2 = comp1({class: undefined}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`style and class handling empty class attribute is not added on widget root el 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
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span block-attribute-0=\\"class\\"/>\`);
|
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'].class;
|
|
|
|
|
return block1([attr1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-10-15 11:40:37 +02:00
|
|
|
exports[`style and class handling error in subcomponent with class 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-10-15 11:40:37 +02: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, false);
|
2021-10-15 11:40:37 +02:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({class: 'a'}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`style and class handling error in subcomponent with class 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
|
|
|
|
2021-10-15 11:40:37 +02:00
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"><block-text-1/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let attr1 = ctx['props'].class;
|
2021-12-22 12:33:17 +01:00
|
|
|
let txt1 = this.will.crash;
|
|
|
|
|
return block1([attr1, txt1]);
|
2021-10-15 11:40:37 +02:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`style and class handling no class is set is child ignores it 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-10-15 11:40:37 +02: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, false);
|
2021-10-15 11:40:37 +02:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({class: 'hey'}, key + \`__1\`, node, this, null);
|
2021-10-15 11:40:37 +02:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`style and class handling no class is set is child ignores it 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(\`<div>child</div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`style and class handling no class is set is parent does not give it as prop 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(\`Child\`, 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[`style and class handling no class is set is parent does not give it as prop 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(\`<div block-attribute-0=\\"class\\">child</div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let attr1 = ctx['props'].class;
|
|
|
|
|
return block1([attr1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`style and class handling style is properly added on widget root el 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(\`Child\`, true, false, false, 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({style: 'font-weight: bold;'}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`style and class handling style is properly added on widget root el 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-10-15 11:40:37 +02:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-10-15 11:40:37 +02:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"style\\"/>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let attr1 = ctx['props'].style;
|
|
|
|
|
return block1([attr1]);
|
2021-10-15 11:40:37 +02:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`style and class handling t-att-class is properly added/removed on widget root el (v2) 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-10-15 11:40:37 +02: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, false);
|
2021-10-15 11:40:37 +02:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
2021-10-15 11:40:37 +02:00
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b2 = comp1({class: {b:ctx['state'].b}}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2]);
|
2021-10-15 11:40:37 +02:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`style and class handling t-att-class is properly added/removed on widget root el (v2) 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(\`<span class=\\"c\\" block-attribute-0=\\"class\\"/>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let attr1 = {d:ctx['state'].d,...ctx['props'].class};
|
|
|
|
|
return block1([attr1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`style and class handling t-att-class is properly added/removed on widget root el (v3) 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(\`Child\`, true, false, false, 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({class: {a:true,b:ctx['state'].b}}, key + \`__1\`, node, this, null);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
2021-11-10 08:18:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`style and class handling t-att-class is properly added/removed on widget root el (v3) 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-10 08:18:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-10 08:18:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span class=\\"c\\" block-attribute-0=\\"class\\"/>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let attr1 = {d:ctx['state'].d,...ctx['props'].class};
|
|
|
|
|
return block1([attr1]);
|
2021-11-10 08:18:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|