mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[CLEANUP] update prettier to v2.0.4
This commit is contained in:
@@ -203,7 +203,7 @@ export class Component<Props extends {} = any, T extends Env = Env> {
|
||||
renderFn: qweb.render.bind(qweb, template),
|
||||
classObj: null,
|
||||
refs: null,
|
||||
scope: null
|
||||
scope: null,
|
||||
};
|
||||
if (constr.style) {
|
||||
this.__applyStyles(constr);
|
||||
@@ -514,7 +514,7 @@ export class Component<Props extends {} = any, T extends Env = Env> {
|
||||
const ev = new OwlEvent(component, eventType, {
|
||||
bubbles: true,
|
||||
cancelable: true,
|
||||
detail: payload
|
||||
detail: payload,
|
||||
});
|
||||
const triggerHook = this.env[portalSymbol as any];
|
||||
if (triggerHook) {
|
||||
@@ -549,7 +549,7 @@ export class Component<Props extends {} = any, T extends Env = Env> {
|
||||
}
|
||||
await Promise.all([
|
||||
this.willUpdateProps(nextProps),
|
||||
__owl__.willUpdatePropsCB && __owl__.willUpdatePropsCB(nextProps)
|
||||
__owl__.willUpdatePropsCB && __owl__.willUpdatePropsCB(nextProps),
|
||||
]);
|
||||
if (fiber.isCompleted) {
|
||||
return;
|
||||
@@ -646,7 +646,7 @@ export class Component<Props extends {} = any, T extends Env = Env> {
|
||||
try {
|
||||
let vnode = __owl__.renderFn!(this, {
|
||||
handlers: __owl__.boundHandlers,
|
||||
fiber: fiber
|
||||
fiber: fiber,
|
||||
});
|
||||
// we iterate over the children to detect those that no longer belong to the
|
||||
// current rendering: those ones, if not mounted yet, can (and have to) be
|
||||
|
||||
@@ -7,7 +7,7 @@ import { makeHandlerCode, MODS_CODE } from "../qweb/extensions";
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
const T_COMPONENT_MODS_CODE = Object.assign({}, MODS_CODE, {
|
||||
self: "if (e.target !== vn.elm) {return}"
|
||||
self: "if (e.target !== vn.elm) {return}",
|
||||
});
|
||||
|
||||
QWeb.utils.defineProxy = function defineProxy(target, source) {
|
||||
@@ -18,7 +18,7 @@ QWeb.utils.defineProxy = function defineProxy(target, source) {
|
||||
},
|
||||
set(val) {
|
||||
source[k] = val;
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -238,7 +238,7 @@ QWeb.addDirective({
|
||||
|
||||
// computing the props string representing the props object
|
||||
let propStr = Object.keys(props)
|
||||
.map(k => k + ":" + props[k])
|
||||
.map((k) => k + ":" + props[k])
|
||||
.join(",");
|
||||
let componentID = ctx.generateID();
|
||||
|
||||
@@ -280,7 +280,7 @@ QWeb.addDirective({
|
||||
let classDef = classAttr
|
||||
.trim()
|
||||
.split(/\s+/)
|
||||
.map(a => `'${a}':true`)
|
||||
.map((a) => `'${a}':true`)
|
||||
.join(",");
|
||||
classObj = `_${ctx.generateID()}`;
|
||||
ctx.addLine(`let ${classObj} = {${classDef}};`);
|
||||
@@ -298,7 +298,7 @@ QWeb.addDirective({
|
||||
}
|
||||
}
|
||||
let eventsCode = events
|
||||
.map(function([name, value]) {
|
||||
.map(function ([name, value]) {
|
||||
const capture = name.match(/\.capture/);
|
||||
name = capture ? name.replace(/\.capture/, "") : name;
|
||||
const { event, handler } = makeHandlerCode(
|
||||
@@ -469,5 +469,5 @@ QWeb.addDirective({
|
||||
ctx.addLine(`w${componentID}.__owl__.parentLastFiberId = extra.fiber.id;`);
|
||||
|
||||
return true;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -193,7 +193,7 @@ export class Fiber {
|
||||
|
||||
// build patchQueue
|
||||
const patchQueue: Fiber[] = [];
|
||||
const doWork: (Fiber) => Fiber | null = function(f) {
|
||||
const doWork: (Fiber) => Fiber | null = function (f) {
|
||||
patchQueue.push(f);
|
||||
return f.child;
|
||||
};
|
||||
@@ -280,7 +280,7 @@ export class Fiber {
|
||||
* Cancel a fiber and all its children.
|
||||
*/
|
||||
cancel() {
|
||||
this._walk(f => {
|
||||
this._walk((f) => {
|
||||
if (!f.isRendered) {
|
||||
f.root.counter--;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import { QWeb } from "../qweb/index";
|
||||
* This is why it is only done in 'dev' mode.
|
||||
*/
|
||||
|
||||
QWeb.utils.validateProps = function(Widget, props: Object) {
|
||||
QWeb.utils.validateProps = function (Widget, props: Object) {
|
||||
const propsDef = (<any>Widget).props;
|
||||
if (propsDef instanceof Array) {
|
||||
// list of strings (prop names)
|
||||
|
||||
@@ -50,7 +50,7 @@ export class Scheduler {
|
||||
return reject(fiber.error);
|
||||
}
|
||||
resolve();
|
||||
}
|
||||
},
|
||||
});
|
||||
if (!this.isRunning) {
|
||||
this.start();
|
||||
@@ -60,7 +60,7 @@ export class Scheduler {
|
||||
|
||||
rejectFiber(fiber: Fiber, reason: string) {
|
||||
fiber = fiber.root;
|
||||
const index = this.tasks.findIndex(t => t.fiber === fiber);
|
||||
const index = this.tasks.findIndex((t) => t.fiber === fiber);
|
||||
if (index >= 0) {
|
||||
const [task] = this.tasks.splice(index, 1);
|
||||
fiber.cancel();
|
||||
@@ -76,7 +76,7 @@ export class Scheduler {
|
||||
flush() {
|
||||
let tasks = this.tasks;
|
||||
this.tasks = [];
|
||||
tasks = tasks.filter(task => {
|
||||
tasks = tasks.filter((task) => {
|
||||
if (task.fiber.isCompleted) {
|
||||
task.callback();
|
||||
return false;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
export const STYLESHEETS: { [id: string]: HTMLStyleElement } = {};
|
||||
|
||||
export function processSheet(str: string): string {
|
||||
const tokens = str.split(/(\{|\}|;)/).map(s => s.trim());
|
||||
const tokens = str.split(/(\{|\}|;)/).map((s) => s.trim());
|
||||
const selectorStack: string[][] = [];
|
||||
const parts: string[] = [];
|
||||
let rules: string[] = [];
|
||||
|
||||
Reference in New Issue
Block a user