mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e579a993fd | |||
| ea3c6f7bf0 | |||
| 9cfafc30b5 | |||
| ad42c583c6 |
@@ -14,7 +14,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [10.x, 12.x, 14.x]
|
node-version: [12.x, 14.x]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ npm install @odoo/owl
|
|||||||
|
|
||||||
If you want to use a simple `<script>` tag, the last release can be downloaded here:
|
If you want to use a simple `<script>` tag, the last release can be downloaded here:
|
||||||
|
|
||||||
- [owl-1.4.0](https://github.com/odoo/owl/releases/tag/v1.4.0)
|
- [owl-1.4.1](https://github.com/odoo/owl/releases/tag/v1.4.1)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@odoo/owl",
|
"name": "@odoo/owl",
|
||||||
"version": "1.4.0",
|
"version": "1.4.1",
|
||||||
"description": "Odoo Web Library (OWL)",
|
"description": "Odoo Web Library (OWL)",
|
||||||
"main": "dist/owl.cjs.js",
|
"main": "dist/owl.cjs.js",
|
||||||
"browser": "dist/owl.iife.js",
|
"browser": "dist/owl.iife.js",
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.15.3"
|
"node": ">=12.18.3"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:bundle": "rollup -c",
|
"build:bundle": "rollup -c",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
# 🦉 OWL Roadmap 🦉
|
# 🦉 OWL Roadmap 🦉
|
||||||
|
|
||||||
- Current version: 1.4.0
|
- Current version: 1.4.1
|
||||||
- Status: stable
|
- Status: stable
|
||||||
|
|
||||||
This roadmap is only an attempt at predicting Owl's future. Everything may
|
This roadmap is only an attempt at predicting Owl's future. Everything may
|
||||||
|
|||||||
+3
-2
@@ -139,8 +139,9 @@ const UTILS: Utils = {
|
|||||||
},
|
},
|
||||||
combine(context, scope) {
|
combine(context, scope) {
|
||||||
const clone = Object.create(context);
|
const clone = Object.create(context);
|
||||||
for (let k in scope) {
|
while (!isComponent(scope)) {
|
||||||
clone[k] = scope[k];
|
Object.assign(clone, scope);
|
||||||
|
scope = scope.__proto__;
|
||||||
}
|
}
|
||||||
return clone;
|
return clone;
|
||||||
},
|
},
|
||||||
|
|||||||
+2
-1
@@ -231,7 +231,8 @@ function updateClass(oldVnode: VNode, vnode: VNode): void {
|
|||||||
elm = vnode.elm as Element;
|
elm = vnode.elm as Element;
|
||||||
|
|
||||||
for (name in oldClass) {
|
for (name in oldClass) {
|
||||||
if (name && !klass[name]) {
|
if (name && !klass[name] && !Object.prototype.hasOwnProperty.call(klass, name)) {
|
||||||
|
// was `true` and now not provided
|
||||||
elm.classList.remove(name);
|
elm.classList.remove(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1257,4 +1257,50 @@ describe("t-slot directive", () => {
|
|||||||
`<div><div class="slotted"><div class="slot"><div class="child"></div></div></div></div>`
|
`<div><div class="slotted"><div class="slot"><div class="child"></div></div></div></div>`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("t-slot scope context", async () => {
|
||||||
|
expect.assertions(1);
|
||||||
|
|
||||||
|
class Wrapper extends Component {
|
||||||
|
static template = xml`<t t-slot="default"/>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
let dialog;
|
||||||
|
|
||||||
|
class Dialog extends Component {
|
||||||
|
static template = xml`
|
||||||
|
<Wrapper>
|
||||||
|
<div t-on-click="onClick">
|
||||||
|
<t t-slot="default" />
|
||||||
|
</div>
|
||||||
|
</Wrapper>
|
||||||
|
`;
|
||||||
|
|
||||||
|
static components = { Wrapper };
|
||||||
|
|
||||||
|
setup() {
|
||||||
|
dialog = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
onClick(ev) {
|
||||||
|
// we do not use expect(this).toBe(dialog) here because if it fails, it
|
||||||
|
// may blow up jest because it then tries to compute a diff, which is
|
||||||
|
// infinite if there is a cycle
|
||||||
|
expect(this === dialog).toBe(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Parent extends Component {
|
||||||
|
static template = xml`
|
||||||
|
<Dialog>
|
||||||
|
<button>The Button</button>
|
||||||
|
</Dialog>`;
|
||||||
|
static components = { Dialog };
|
||||||
|
}
|
||||||
|
|
||||||
|
await mount(Parent, { target: fixture });
|
||||||
|
|
||||||
|
document.querySelector("button").click();
|
||||||
|
await nextTick();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user