[IMP] update to last version

This commit is contained in:
Géry Debongnie
2019-06-18 15:03:22 +02:00
parent dc3a7a11e4
commit d746e01926
3 changed files with 31 additions and 24 deletions
+10 -3
View File
@@ -1297,6 +1297,13 @@
} }
return; return;
} }
const firstLetter = node.tagName[0];
if (firstLetter === firstLetter.toUpperCase()) {
// this is a component, we modify in place the xml document to change
// <SomeComponent ... /> to <t t-widget="SomeComponent" ... />
node.setAttribute('t-widget', node.tagName);
node.nodeValue = 't';
}
const attributes = node.attributes; const attributes = node.attributes;
const validDirectives = []; const validDirectives = [];
let withHandlers = false; let withHandlers = false;
@@ -2711,7 +2718,7 @@
* explanation of the code generated by the t-widget directive for the following * explanation of the code generated by the t-widget directive for the following
* situation: * situation:
* ```xml * ```xml
* <t t-widget="child" * <Child
* t-key="'somestring'" * t-key="'somestring'"
* flag="state.flag" * flag="state.flag"
* t-transition="fade"/> * t-transition="fade"/>
@@ -3490,8 +3497,8 @@
exports.utils = utils; exports.utils = utils;
exports.__info__.version = '0.15.0'; exports.__info__.version = '0.15.0';
exports.__info__.date = '2019-06-17T13:59:39.059Z'; exports.__info__.date = '2019-06-18T13:03:02.358Z';
exports.__info__.hash = '609c108'; exports.__info__.hash = 'a7cd007';
exports.__info__.url = 'https://github.com/odoo/owl'; exports.__info__.url = 'https://github.com/odoo/owl';
}(this.owl = this.owl || {})); }(this.owl = this.owl || {}));
+19 -19
View File
@@ -26,8 +26,8 @@ const COMPONENTS_XML = `<templates>
</button> </button>
<div t-name="App"> <div t-name="App">
<t t-widget="Counter"/> <Counter />
<t t-widget="Counter"/> <Counter />
</div> </div>
</templates>`; </templates>`;
@@ -88,7 +88,7 @@ const ANIMATION_XML = `<templates>
<div class="demo"> <div class="demo">
<button t-on-click="toggle('widgetFlag')">Toggle widget</button> <button t-on-click="toggle('widgetFlag')">Toggle widget</button>
<div> <div>
<t t-widget="Counter" t-if="state.widgetFlag" t-transition="fade"/> <Counter t-if="state.widgetFlag" t-transition="fade"/>
</div> </div>
</div> </div>
@@ -98,7 +98,7 @@ const ANIMATION_XML = `<templates>
<button t-on-click="addNumber">Add a number</button> <button t-on-click="addNumber">Add a number</button>
<div> <div>
<t t-foreach="state.numbers" t-as="n"> <t t-foreach="state.numbers" t-as="n">
<span t-transition="fade" class="numberspan"><t t-esc="n"/></span> <span t-transition="fade" class="numberspan" t-key="n"><t t-esc="n"/></span>
</t> </t>
</div> </div>
</div> </div>
@@ -236,7 +236,7 @@ const LIFECYCLE_DEMO_XML = `<templates>
<button t-on-click="increment">Increment Parent State</button> <button t-on-click="increment">Increment Parent State</button>
<button t-on-click="toggleSubWidget">Toggle SubWidget</button> <button t-on-click="toggleSubWidget">Toggle SubWidget</button>
<div t-if="state.flag"> <div t-if="state.flag">
<t t-widget="DemoWidget" n="state.n"/> <DemoWidget n="state.n"/>
</div> </div>
</div> </div>
</templates>`; </templates>`;
@@ -483,7 +483,7 @@ const TODO_APP_STORE_XML = `<templates>
<label for="toggle-all"></label> <label for="toggle-all"></label>
<ul class="todo-list"> <ul class="todo-list">
<t t-foreach="visibleTodos" t-as="todo"> <t t-foreach="visibleTodos" t-as="todo">
<t t-widget="TodoItem" t-key="todo.id" id="todo.id" completed="todo.completed" title="todo.title"/> <TodoItem t-key="todo.id" id="todo.id" completed="todo.completed" title="todo.title"/>
</t> </t>
</ul> </ul>
</section> </section>
@@ -995,17 +995,17 @@ const RESPONSIVE_XML = `<templates>
</div> </div>
<div t-name="App" class="app" t-att-class="{mobile: env.isMobile, desktop: !env.isMobile}"> <div t-name="App" class="app" t-att-class="{mobile: env.isMobile, desktop: !env.isMobile}">
<t t-widget="Navbar"/> <Navbar/>
<t t-widget="ControlPanel"/> <ControlPanel/>
<div class="content-wrapper" t-if="!env.isMobile"> <div class="content-wrapper" t-if="!env.isMobile">
<div class="content"> <div class="content">
<t t-widget="FormView"/> <FormView />
<t t-widget="Chatter"/> <Chatter />
</div> </div>
</div> </div>
<t t-else="1"> <t t-else="1">
<t t-widget="FormView"/> <FormView />
<t t-widget="Chatter"/> <Chatter />
</t> </t>
</div> </div>
</templates> </templates>
@@ -1128,17 +1128,17 @@ const SLOTS_XML = `<templates>
</div> </div>
<div t-name="App" class="main"> <div t-name="App" class="main">
<t t-widget="Card" title="'Title card A'"> <Card title="'Title card A'">
<t t-set="content">Content of card 1... [<t t-esc="state.a"/>]</t> <t t-set="content">Content of card 1... [<t t-esc="state.a"/>]</t>
<t t-set="footer"><button t-on-click="inc('a', 1)">Increment A</button></t> <t t-set="footer"><button t-on-click="inc('a', 1)">Increment A</button></t>
</t> </Card>
<t t-widget="Card" title="'Title card B'"> <Card title="'Title card B'">
<div t-set="content"> <div t-set="content">
<div>Card 2... [<t t-esc="state.b"/>]</div> <div>Card 2... [<t t-esc="state.b"/>]</div>
<t t-widget="Counter"/> <Counter />
</div> </div>
<t t-set="footer"><button t-on-click="inc('b', -1)">Decrement B</button></t> <t t-set="footer"><button t-on-click="inc('b', -1)">Decrement B</button></t>
</t> </Card>
</div> </div>
</templates>`; </templates>`;
@@ -1226,8 +1226,8 @@ app.mount(document.body);
const ASYNC_COMPONENTS_XML = `<templates> const ASYNC_COMPONENTS_XML = `<templates>
<div t-name="App" class="app"> <div t-name="App" class="app">
<button t-on-click="increment">Increment</button> <button t-on-click="increment">Increment</button>
<t t-widget="SlowWidget" value="state.value"/> <SlowWidget value="state.value"/>
<t t-widget="NotificationList" t-asyncroot="1" notifications="state.notifs"/> <NotificationList t-asyncroot="1" notifications="state.notifs"/>
</div> </div>
<div t-name="SlowWidget" class="value" > <div t-name="SlowWidget" class="value" >
+2 -2
View File
@@ -24,14 +24,14 @@
<a class="btn flash" t-on-click="downloadCode" title="Download a Zip with this Code"><i class="fas fa-download"></i></a> <a class="btn flash" t-on-click="downloadCode" title="Download a Zip with this Code"><i class="fas fa-download"></i></a>
<a class="layout-selector flash" t-on-click="toggleLayout" title="Toggle Layout"><i class="fas" t-att-class="state.splitLayout ? 'fa-toggle-on' : 'fa-toggle-off'"></i></a> <a class="layout-selector flash" t-on-click="toggleLayout" title="Toggle Layout"><i class="fas" t-att-class="state.splitLayout ? 'fa-toggle-on' : 'fa-toggle-off'"></i></a>
</div> </div>
<t t-widget="TabbedEditor" <TabbedEditor
js="state.js" js="state.js"
css="!state.splitLayout and state.css" css="!state.splitLayout and state.css"
xml="!state.splitLayout and state.js" xml="!state.splitLayout and state.js"
t-att-style="topEditorStyle"/> t-att-style="topEditorStyle"/>
<t t-if="state.splitLayout"> <t t-if="state.splitLayout">
<div class="separator horizontal"/> <div class="separator horizontal"/>
<t t-widget="TabbedEditor" t-keepalive="1" <TabbedEditor t-keepalive="1"
js="false" js="false"
css="state.css" css="state.css"
xml="state.xml" xml="state.xml"