From adad3f06ed26f37b2bed228166656e4ebc0f8cb9 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 12 Jan 2023 15:33:58 +0000 Subject: [PATCH] [FIX] web: update owl from 2.0.3 to 2.0.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Release notes: https://github.com/odoo/owl/releases/tag/v2.0.4 - [IMP] app: expose live apps for the devtools - [FIX] compiler: support t-model radio group in t-foreach - [IMP] runtime: improve useExternalListener typing closes odoo/odoo#110790 X-original-commit: f7192699aea443bea278a55e0e383e59d98394c5 Signed-off-by: Géry Debongnie --- addons/web/static/lib/owl/owl.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/addons/web/static/lib/owl/owl.js b/addons/web/static/lib/owl/owl.js index a8a5bdfa50c..1c8343656d4 100644 --- a/addons/web/static/lib/owl/owl.js +++ b/addons/web/static/lib/owl/owl.js @@ -4018,7 +4018,15 @@ const fullExpression = `${bExprId}[${exprId}]`; let idx; if (specialInitTargetAttr) { - idx = block.insertData(`${fullExpression} === '${attrs[targetAttr]}'`, "attr"); + let targetExpr = targetAttr in attrs && `'${attrs[targetAttr]}'`; + if (!targetExpr && ast.attrs) { + // look at the dynamic attribute counterpart + const dynamicTgExpr = ast.attrs[`t-att-${targetAttr}`]; + if (dynamicTgExpr) { + targetExpr = compileExpr(dynamicTgExpr); + } + } + idx = block.insertData(`${fullExpression} === ${targetExpr}`, "attr"); attrs[`block-attribute-${idx}`] = specialInitTargetAttr; } else if (hasDynamicChildren) { @@ -5556,12 +5564,16 @@ This is not suitable for production use. See https://github.com/odoo/owl/blob/${hash}/doc/reference/app.md#configuration for more information.`; }; + window.__OWL_DEVTOOLS__ || (window.__OWL_DEVTOOLS__ = { + apps: new Set(), + }); class App extends TemplateSet { constructor(Root, config = {}) { super(config); this.scheduler = new Scheduler(); this.root = null; this.Root = Root; + window.__OWL_DEVTOOLS__.apps.add(this); if (config.test) { this.dev = true; } @@ -5618,6 +5630,7 @@ See https://github.com/odoo/owl/blob/${hash}/doc/reference/app.md#configuration this.scheduler.flush(); this.root.destroy(); } + window.__OWL_DEVTOOLS__.apps.delete(this); } createComponent(name, isStatic, hasSlotsProp, hasDynamicPropList, hasNoProp) { const isDynamic = !isStatic; @@ -5858,9 +5871,9 @@ See https://github.com/odoo/owl/blob/${hash}/doc/reference/app.md#configuration Object.defineProperty(exports, '__esModule', { value: true }); - __info__.version = '2.0.3'; - __info__.date = '2023-01-12T15:32:52.837Z'; - __info__.hash = '316eb06'; + __info__.version = '2.0.4'; + __info__.date = '2023-01-23T11:21:36.696Z'; + __info__.hash = 'c30678f'; __info__.url = 'https://github.com/odoo/owl';