From 3f1c1ea6a4e92dbecb0f94dda54178c5cf49ab54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Thu, 1 Sep 2022 15:41:58 +0200 Subject: [PATCH] [IMP] update owl to v2.0.0-beta-17 --- owl.js | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/owl.js b/owl.js index 6a2683bf..f26a285e 100644 --- a/owl.js +++ b/owl.js @@ -2130,12 +2130,18 @@ }; } function validateTarget(target) { - if (!(target instanceof HTMLElement)) { - throw new OwlError("Cannot mount component: the target is not a valid DOM element"); - } - if (!document.body.contains(target)) { - throw new OwlError("Cannot mount a component on a detached dom node"); + // Get the document and HTMLElement corresponding to the target to allow mounting in iframes + const document = target && target.ownerDocument; + if (document) { + const HTMLElement = document.defaultView.HTMLElement; + if (target instanceof HTMLElement) { + if (!document.body.contains(target)) { + throw new OwlError("Cannot mount a component on a detached dom node"); + } + return; + } } + throw new OwlError("Cannot mount component: the target is not a valid DOM element"); } class EventBus extends EventTarget { trigger(name, payload) { @@ -3918,8 +3924,13 @@ expr = compileExpr(ast.attrs[key]); if (attrName && isProp(ast.tag, attrName)) { // we force a new string or new boolean to bypass the equality check in blockdom when patching same value - const C = attrName === "value" ? "String" : "Boolean"; - expr = `new ${C}(${expr})`; + if (attrName === "value") { + // When the expression is falsy, fall back to an empty string + expr = `new String((${expr}) || "")`; + } + else { + expr = `new Boolean(${expr})`; + } } const idx = block.insertData(expr, "attr"); if (key === "t-att") { @@ -5767,9 +5778,9 @@ See https://github.com/odoo/owl/blob/${hash}/doc/reference/app.md#configuration Object.defineProperty(exports, '__esModule', { value: true }); - __info__.version = '2.0.0-beta-16'; - __info__.date = '2022-07-22T07:44:03.166Z'; - __info__.hash = 'b90aa0e'; + __info__.version = '2.0.0-beta-17'; + __info__.date = '2022-09-01T13:41:52.209Z'; + __info__.hash = '9cb74d6'; __info__.url = 'https://github.com/odoo/owl';