mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
6ea40a66da
t-out automatically escaped content when it is a string not marked with the `markup` function t-out renders the raw content if it is a Block, or if it has been marked with the `markup` funtion. t-esc has been kept since it is safe and is optimized to render text nodes. all t-raw calls are in fact the same as t-out.
61 lines
2.2 KiB
Plaintext
61 lines
2.2 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`refs basic use 1`] = `
|
|
"function anonymous(bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, component } = bdom;
|
|
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers;
|
|
|
|
let block1 = createBlock(\`<div block-ref=\\"0\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const refs = ctx.__owl__.refs;
|
|
let d1 = (el) => refs[\`div\`] = el;
|
|
return block1([d1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`refs refs are properly bound in slots 1`] = `
|
|
"function anonymous(bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, component } = bdom;
|
|
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers;
|
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let b2 = callSlot(ctx, node, key, 'footer');
|
|
return block1([], [b2]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`refs refs are properly bound in slots 2`] = `
|
|
"function anonymous(bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, component } = bdom;
|
|
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers;
|
|
let assign = Object.assign;
|
|
|
|
let block1 = createBlock(\`<div><span class=\\"counter\\"><block-text-0/></span><block-child-0/></div>\`);
|
|
let block2 = createBlock(\`<button block-handler-0=\\"click\\" block-ref=\\"1\\">do something</button>\`);
|
|
|
|
const slot3 = ctx => (node, key) => {
|
|
const refs = ctx.__owl__.refs
|
|
const v4 = ctx['doSomething'];
|
|
let d2 = [v4, ctx];
|
|
let d3 = (el) => refs[\`myButton\`] = el;
|
|
return block2([d2, d3]);
|
|
}
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const refs = ctx.__owl__.refs;
|
|
let d1 = ctx['state'].val;
|
|
const ctx2 = capture(ctx);
|
|
let b3 = assign(component(\`Dialog\`, {}, key + \`__1\`, node, ctx), {slots: {'footer': slot3(ctx2)}});
|
|
return block1([d1], [b3]);
|
|
}
|
|
}"
|
|
`;
|