[REF] web,web_*: import owl features using "@odoo/owl" module
In @odoo-module files, we do the following conversion:
`const { ... } = owl;` -> `import { ... } from "@odoo/owl"`.
While in legacy odoo module (odoo.define):
`const { ... } = owl;` -> `const { ... } = require("@odoo/owl");`.
closes odoo/odoo#104260
Task-id: 3032274
Related: odoo/enterprise#33298
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import { browser } from "@web/core/browser/browser";
|
||||
import { localization } from "@web/core/l10n/localization";
|
||||
import { clamp } from "@web/core/utils/numbers";
|
||||
|
||||
const { Component, onMounted, onWillUnmount, useRef, useState } = owl;
|
||||
import { Component, onMounted, onWillUnmount, useRef, useState } from "@odoo/owl";
|
||||
|
||||
const isScrollSwipable = (scrollables) => {
|
||||
return {
|
||||
|
||||
@@ -248,7 +248,7 @@ export const loadBundle = function (desc) {
|
||||
return assets.loadBundle(desc);
|
||||
};
|
||||
|
||||
const { Component, xml, onWillStart } = owl;
|
||||
import { Component, xml, onWillStart } from "@odoo/owl";
|
||||
/**
|
||||
* Utility component that loads an asset bundle before instanciating a component
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useDebounced } from "@web/core/utils/timing";
|
||||
import { getActiveHotkey } from "@web/core/hotkeys/hotkey_service";
|
||||
import { usePosition } from "@web/core/position_hook";
|
||||
|
||||
const { Component, useExternalListener, useRef, useState } = owl;
|
||||
import { Component, useExternalListener, useRef, useState } from "@odoo/owl";
|
||||
|
||||
export class AutoComplete extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useHotkey } from "../hotkeys/hotkey_hook";
|
||||
|
||||
const { Component, useRef } = owl;
|
||||
import { Component, useRef } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* Custom checkbox
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { _lt } from "@web/core/l10n/translation";
|
||||
|
||||
const { Component, useRef, useState, useExternalListener } = owl;
|
||||
import { Component, useRef, useState, useExternalListener } from "@odoo/owl";
|
||||
|
||||
export class ColorList extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { useEffect } = owl;
|
||||
import { useEffect } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* @typedef {import("./command_service").CommandOptions} CommandOptions
|
||||
|
||||
@@ -11,7 +11,7 @@ import { debounce } from "@web/core/utils/timing";
|
||||
import { isMacOS, isMobileOS } from "@web/core/browser/feature_detection";
|
||||
import { escapeRegExp } from "@web/core/utils/strings";
|
||||
|
||||
const {
|
||||
import {
|
||||
Component,
|
||||
onWillStart,
|
||||
onWillDestroy,
|
||||
@@ -20,7 +20,7 @@ const {
|
||||
useState,
|
||||
markRaw,
|
||||
useExternalListener,
|
||||
} = owl;
|
||||
} from "@odoo/owl";
|
||||
|
||||
const DEFAULT_PLACEHOLDER = _lt("Search...");
|
||||
const DEFAULT_EMPTY_MESSAGE = _lt("No result found");
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { registry } from "@web/core/registry";
|
||||
import { CommandPalette } from "./command_palette";
|
||||
|
||||
const { Component, xml, EventBus } = owl;
|
||||
import { Component, xml, EventBus } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* @typedef {import("./command_palette").CommandPaletteConfig} CommandPaletteConfig
|
||||
|
||||
@@ -8,7 +8,7 @@ import { capitalize } from "@web/core/utils/strings";
|
||||
import { getVisibleElements } from "@web/core/utils/ui";
|
||||
import { DefaultCommandItem } from "./command_palette";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
const commandSetupRegistry = registry.category("command_setup");
|
||||
commandSetupRegistry.add("default", {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Dialog } from "../dialog/dialog";
|
||||
import { _lt } from "../l10n/translation";
|
||||
import { useChildRef } from "@web/core/utils/hooks";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class ConfirmationDialog extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -14,7 +14,7 @@ import { localization } from "@web/core/l10n/localization";
|
||||
import { useAutofocus } from "@web/core/utils/hooks";
|
||||
import { isIOS } from "@web/core/browser/feature_detection";
|
||||
|
||||
const {
|
||||
import {
|
||||
Component,
|
||||
onMounted,
|
||||
onWillUpdateProps,
|
||||
@@ -22,7 +22,7 @@ const {
|
||||
useExternalListener,
|
||||
useRef,
|
||||
useState,
|
||||
} = owl;
|
||||
} from "@odoo/owl";
|
||||
const { DateTime } = luxon;
|
||||
|
||||
let datePickerId = 0;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { registry } from "../registry";
|
||||
import { memoize } from "../utils/functions";
|
||||
|
||||
const { useEffect, useEnv, useSubEnv } = owl;
|
||||
import { useEffect, useEnv, useSubEnv } from "@odoo/owl";
|
||||
const debugRegistry = registry.category("debug");
|
||||
|
||||
const getAccessRights = memoize(async function getAccessRights(orm) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useEnvDebugContext } from "./debug_context";
|
||||
import { Dropdown } from "@web/core/dropdown/dropdown";
|
||||
import { DropdownItem } from "@web/core/dropdown/dropdown_item";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class DebugMenuBasic extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { DropdownItem } from "@web/core/dropdown/dropdown_item";
|
||||
import { useBus, useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class ProfilingItem extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { loadBundle } from "@web/core/assets";
|
||||
import { renderToString } from "@web/core/utils/render";
|
||||
import { useDebounced } from "@web/core/utils/timing";
|
||||
|
||||
const { Component, useState, useRef, onWillStart, onMounted, onWillUnmount } = owl;
|
||||
import { Component, useState, useRef, onWillStart, onMounted, onWillUnmount } from "@odoo/owl";
|
||||
|
||||
class MenuItem extends Component {}
|
||||
MenuItem.template = "web.ProfilingQwebView.menuitem";
|
||||
|
||||
@@ -5,7 +5,7 @@ import { ProfilingItem } from "./profiling_item";
|
||||
import { session } from "@web/session";
|
||||
import { profilingSystrayItem } from "./profiling_systray_item";
|
||||
|
||||
const { EventBus, reactive } = owl;
|
||||
import { EventBus, reactive } from "@odoo/owl";
|
||||
|
||||
const systrayRegistry = registry.category("systray");
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module */
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
class ProfilingSystrayItem extends Component {}
|
||||
ProfilingSystrayItem.template = "web.ProfilingSystrayItem";
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useHotkey } from "@web/core/hotkeys/hotkey_hook";
|
||||
import { useActiveElement } from "../ui/ui_service";
|
||||
import { useForwardRefToParent } from "@web/core/utils/hooks";
|
||||
|
||||
const { Component, useChildSubEnv, useState } = owl;
|
||||
import { Component, useChildSubEnv, useState } from "@odoo/owl";
|
||||
export class Dialog extends Component {
|
||||
setup() {
|
||||
this.modalRef = useForwardRefToParent("modalRef");
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { ErrorHandler, WithEnv } from "../utils/components";
|
||||
|
||||
const { Component, xml } = owl;
|
||||
import { Component, xml } from "@odoo/owl";
|
||||
|
||||
export class DialogContainer extends Component {
|
||||
handleError(error, dialog) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { registry } from "../registry";
|
||||
import { DialogContainer } from "./dialog_container";
|
||||
|
||||
const { markRaw, reactive } = owl;
|
||||
import { markRaw, reactive } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* @typedef {{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { Domain } from "@web/core/domain";
|
||||
import { DomainSelectorRootNode } from "./domain_selector_root_node";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class DomainSelector extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { DomainSelectorBranchOperator } from "./domain_selector_branch_operator"
|
||||
import { DomainSelectorControlPanel } from "./domain_selector_control_panel";
|
||||
import { DomainSelectorLeafNode } from "./domain_selector_leaf_node";
|
||||
|
||||
const { Component, useRef } = owl;
|
||||
import { Component, useRef } from "@odoo/owl";
|
||||
|
||||
export class DomainSelectorBranchNode extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { Dropdown } from "@web/core/dropdown/dropdown";
|
||||
import { DropdownItem } from "@web/core/dropdown/dropdown_item";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class DomainSelectorBranchOperator extends Component {
|
||||
onOperatorSelected(operator) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
const { Component, toRaw } = owl;
|
||||
import { Component, toRaw } from "@odoo/owl";
|
||||
|
||||
export class DomainSelectorControlPanel extends Component {
|
||||
deleteNode() {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { ModelFieldSelector } from "@web/core/model_field_selector/model_field_s
|
||||
import { registry } from "@web/core/registry";
|
||||
import { DomainSelectorControlPanel } from "./domain_selector_control_panel";
|
||||
|
||||
const { Component, onWillStart, onWillUpdateProps, useRef } = owl;
|
||||
import { Component, onWillStart, onWillUpdateProps, useRef } from "@odoo/owl";
|
||||
|
||||
export class DomainSelectorLeafNode extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { DomainSelectorBranchNode } from "./domain_selector_branch_node";
|
||||
import { DomainSelectorBranchOperator } from "./domain_selector_branch_operator";
|
||||
import { DomainSelectorLeafNode } from "./domain_selector_leaf_node";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class DomainSelectorRootNode extends Component {
|
||||
get hasNode() {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { _lt } from "@web/core/l10n/translation";
|
||||
import { registry } from "@web/core/registry";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
const dsf = registry.category("domain_selector/fields");
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
} from "@web/core/l10n/dates";
|
||||
import { registry } from "@web/core/registry";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
const dsf = registry.category("domain_selector/fields");
|
||||
const dso = registry.category("domain_selector/operator");
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
const parsers = registry.category("parsers");
|
||||
|
||||
export class DomainSelectorFieldInput extends Component {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
const { Component, useRef } = owl;
|
||||
import { Component, useRef } from "@odoo/owl";
|
||||
|
||||
export class DomainSelectorFieldInputWithTags extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { registry } from "@web/core/registry";
|
||||
import { DomainSelectorFieldInput } from "./domain_selector_field_input";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
const dsf = registry.category("domain_selector/fields");
|
||||
const dso = registry.category("domain_selector/operator");
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { registry } from "@web/core/registry";
|
||||
import { DomainSelectorFieldInput } from "./domain_selector_field_input";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
const dso = registry.category("domain_selector/operator");
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
const dsf = registry.category("domain_selector/fields");
|
||||
const dso = registry.category("domain_selector/operator");
|
||||
|
||||
@@ -4,7 +4,7 @@ import { registry } from "@web/core/registry";
|
||||
import { DomainSelectorFieldInput } from "./domain_selector_field_input";
|
||||
import { DomainSelectorFieldInputWithTags } from "./domain_selector_field_input_with_tags";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
const dsf = registry.category("domain_selector/fields");
|
||||
const dso = registry.category("domain_selector/operator");
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Dialog } from "../dialog/dialog";
|
||||
import { DomainSelector } from "../domain_selector/domain_selector";
|
||||
import { _t } from "../l10n/translation";
|
||||
|
||||
const { Component, useState } = owl;
|
||||
import { Component, useState } from "@odoo/owl";
|
||||
|
||||
export class DomainSelectorDialog extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { usePosition } from "../position_hook";
|
||||
import { useDropdownNavigation } from "./dropdown_navigation_hook";
|
||||
import { localization } from "../l10n/localization";
|
||||
|
||||
const {
|
||||
import {
|
||||
Component,
|
||||
EventBus,
|
||||
onWillStart,
|
||||
@@ -14,7 +14,7 @@ const {
|
||||
useRef,
|
||||
useState,
|
||||
useChildSubEnv,
|
||||
} = owl;
|
||||
} from "@odoo/owl";
|
||||
|
||||
const DIRECTION_CARET_CLASS = {
|
||||
bottom: "dropdown",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** @odoo-module **/
|
||||
import { DROPDOWN } from "./dropdown";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { browser } from "../browser/browser";
|
||||
import { localization } from "@web/core/l10n/localization";
|
||||
import { scrollTo } from "../utils/scrolling";
|
||||
|
||||
const { useComponent, useEffect, useRef } = owl;
|
||||
import { useComponent, useEffect, useRef } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* @typedef {{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
const { EventBus, Component, xml, onWillDestroy } = owl;
|
||||
import { EventBus, Component, xml, onWillDestroy } from "@odoo/owl";
|
||||
|
||||
export class EffectContainer extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { registry } from "../registry";
|
||||
import { EffectContainer } from "./effect_container";
|
||||
import { RainbowMan } from "./rainbow_man";
|
||||
|
||||
const { EventBus } = owl;
|
||||
import { EventBus } from "@odoo/owl";
|
||||
|
||||
const effectRegistry = registry.category("effects");
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { browser } from "@web/core/browser/browser";
|
||||
|
||||
const { Component, useEffect, useExternalListener, useState } = owl;
|
||||
import { Component, useEffect, useExternalListener, useState } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* @typedef Common
|
||||
|
||||
@@ -7,7 +7,7 @@ import { registry } from "../registry";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { capitalize } from "../utils/strings";
|
||||
|
||||
const { Component, useState } = owl;
|
||||
import { Component, useState } from "@odoo/owl";
|
||||
|
||||
// This props are added by the error handler
|
||||
export const standardErrorDialogProps = {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { Component, onMounted, useRef } = owl;
|
||||
import { Component, onMounted, useRef } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* Custom file input
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useService } from "../utils/hooks";
|
||||
import { sprintf } from "../utils/strings";
|
||||
import { ConfirmationDialog } from "../confirmation_dialog/confirmation_dialog";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class FileUploadProgressBar extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class FileUploadProgressContainer extends Component {}
|
||||
FileUploadProgressContainer.template = "web.FileUploadProgressContainer";
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { sprintf } from "../utils/strings";
|
||||
import { FileUploadProgressBar } from "./file_upload_progress_bar";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class FileUploadProgressRecord extends Component {
|
||||
getProgressTexts() {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { registry } from "../registry";
|
||||
import { sprintf } from "../utils/strings";
|
||||
|
||||
const { EventBus, reactive } = owl;
|
||||
import { EventBus, reactive } from "@odoo/owl";
|
||||
|
||||
export const fileUploadService = {
|
||||
dependencies: ["notification"],
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { useEffect } = owl;
|
||||
import { useEffect } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* This hook will register/unregister the given registration
|
||||
|
||||
@@ -3,7 +3,7 @@ import { registry } from "./registry";
|
||||
import { ErrorHandler } from "./utils/components";
|
||||
import { useBus } from "@web/core/utils/hooks";
|
||||
|
||||
const { Component, xml } = owl;
|
||||
import { Component, xml } from "@odoo/owl";
|
||||
|
||||
export class MainComponentsContainer extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useModelField } from "./model_field_hook";
|
||||
import { useUniquePopover } from "./unique_popover_hook";
|
||||
import { ModelFieldSelectorPopover } from "./model_field_selector_popover";
|
||||
|
||||
const { Component, onWillStart, onWillUpdateProps } = owl;
|
||||
import { Component, onWillStart, onWillUpdateProps } from "@odoo/owl";
|
||||
|
||||
export class ModelFieldSelector extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useModelField } from "./model_field_hook";
|
||||
import { fuzzyLookup } from "@web/core/utils/search";
|
||||
import { useAutofocus } from "../utils/hooks";
|
||||
|
||||
const { Component, onWillStart } = owl;
|
||||
import { Component, onWillStart } from "@odoo/owl";
|
||||
|
||||
export class ModelFieldSelectorPopover extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useService } from "@web/core/utils/hooks";
|
||||
import { fuzzyLookup } from "@web/core/utils/search";
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
|
||||
const { Component, onWillStart } = owl;
|
||||
import { Component, onWillStart } from "@odoo/owl";
|
||||
|
||||
export class ModelSelector extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { scrollTo } from "@web/core/utils/scrolling";
|
||||
|
||||
const { Component, onWillDestroy, onWillUpdateProps, useEffect, useRef, useState } = owl;
|
||||
import { Component, onWillDestroy, onWillUpdateProps, useEffect, useRef, useState } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* A notebook component that will render only the current page and allow
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class Notification extends Component {}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { Notification } from "./notification";
|
||||
import { Transition } from "@web/core/transition";
|
||||
|
||||
const { Component, xml, useState } = owl;
|
||||
import { Component, xml, useState } from "@odoo/owl";
|
||||
|
||||
export class NotificationContainer extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { browser } from "../browser/browser";
|
||||
import { registry } from "../registry";
|
||||
import { NotificationContainer } from "./notification_container";
|
||||
|
||||
const { reactive } = owl;
|
||||
import { reactive } from "@odoo/owl";
|
||||
|
||||
const AUTOCLOSE_DELAY = 4000;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { useAutofocus } from "../utils/hooks";
|
||||
import { clamp } from "../utils/numbers";
|
||||
|
||||
const { Component, useExternalListener, useState } = owl;
|
||||
import { Component, useExternalListener, useState } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* Pager
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { usePosition } from "../position_hook";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class Popover extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { Popover } from "./popover";
|
||||
|
||||
const { EventBus, Component, onMounted, onWillUnmount, useExternalListener, useState, xml } = owl;
|
||||
import { EventBus, Component, onMounted, onWillUnmount, useExternalListener, useState, xml } from "@odoo/owl";
|
||||
|
||||
class PopoverController extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { onWillUnmount, status, useComponent } = owl;
|
||||
import { onWillUnmount, status, useComponent } from "@odoo/owl";
|
||||
|
||||
export function usePopover() {
|
||||
const removeFns = new Set();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { registry } from "../registry";
|
||||
import { PopoverContainer } from "./popover_container";
|
||||
|
||||
const { EventBus } = owl;
|
||||
import { EventBus } from "@odoo/owl";
|
||||
|
||||
export const popoverService = {
|
||||
start() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { throttleForAnimation } from "./utils/timing";
|
||||
|
||||
const { onWillUnmount, useEffect, useExternalListener, useRef } = owl;
|
||||
import { onWillUnmount, useEffect, useExternalListener, useRef } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* @typedef {{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
const { EventBus } = owl;
|
||||
import { EventBus } from "@odoo/owl";
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Errors
|
||||
|
||||
@@ -8,7 +8,7 @@ import { pick } from "@web/core/utils/objects";
|
||||
import { renderToString } from "@web/core/utils/render";
|
||||
import { getDataURLFromFile } from "@web/core/utils/urls";
|
||||
|
||||
const { Component, useState, onWillStart, useRef, useEffect } = owl;
|
||||
import { Component, useState, onWillStart, useRef, useEffect } from "@odoo/owl";
|
||||
|
||||
let htmlId = 0;
|
||||
export class NameAndSignature extends Component {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { Dialog } from "@web/core/dialog/dialog";
|
||||
import { NameAndSignature } from "./name_and_signature";
|
||||
|
||||
const { Component, useState } = owl;
|
||||
import { Component, useState } from "@odoo/owl";
|
||||
|
||||
export class SignatureDialog extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class Tooltip extends Component {}
|
||||
Tooltip.template = "web.Tooltip";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { useEffect, useRef } = owl;
|
||||
import { useEffect, useRef } from "@odoo/owl";
|
||||
|
||||
export function useTooltip(refName, params) {
|
||||
const tooltip = useService("tooltip");
|
||||
|
||||
@@ -5,7 +5,7 @@ import { registry } from "@web/core/registry";
|
||||
import { Tooltip } from "./tooltip";
|
||||
import { hasTouch } from "@web/core/browser/feature_detection";
|
||||
|
||||
const { whenReady } = owl;
|
||||
import { whenReady } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* The tooltip service allows to display custom tooltips on every elements with
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** @odoo-module */
|
||||
import { browser } from "./browser/browser";
|
||||
|
||||
const { Component, useState, useEffect, xml, onWillUpdateProps, useComponent } = owl;
|
||||
import { Component, useState, useEffect, xml, onWillUpdateProps, useComponent } from "@odoo/owl";
|
||||
|
||||
// Allows to disable transitions globally, useful for testing (and maybe for
|
||||
// a reduced motion setting in the future?)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { browser } from "@web/core/browser/browser";
|
||||
|
||||
const { EventBus, Component, useState, xml } = owl;
|
||||
import { EventBus, Component, useState, xml } from "@odoo/owl";
|
||||
|
||||
export class BlockUI extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -8,7 +8,7 @@ import { browser } from "@web/core/browser/browser";
|
||||
import { getTabableElements } from "@web/core/utils/ui";
|
||||
import { getActiveHotkey } from "../hotkeys/hotkey_service";
|
||||
|
||||
const { EventBus, useEffect, useRef } = owl;
|
||||
import { EventBus, useEffect, useRef } from "@odoo/owl";
|
||||
|
||||
export const SIZES = { XS: 0, VSM: 1, SM: 2, MD: 3, LG: 4, XL: 5, XXL: 6 };
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
const { Component, onError, xml, useSubEnv } = owl;
|
||||
import { Component, onError, xml, useSubEnv } from "@odoo/owl";
|
||||
|
||||
export class ErrorHandler extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -63,7 +63,7 @@ import { debounce, setRecurringAnimationFrame } from "@web/core/utils/timing";
|
||||
* @property {Function} helpers.execHandler
|
||||
*/
|
||||
|
||||
const { useEffect, useEnv, useExternalListener, onWillUnmount, reactive } = owl;
|
||||
import { useEffect, useEnv, useExternalListener, onWillUnmount, reactive } from "@odoo/owl";
|
||||
|
||||
const DEFAULT_ACCEPTED_PARAMS = {
|
||||
enable: ["boolean", "function"],
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { SERVICES_METADATA } from "@web/env";
|
||||
|
||||
const { status, useComponent, useEffect, useRef, onWillUnmount } = owl;
|
||||
import { status, useComponent, useEffect, useRef, onWillUnmount } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* This file contains various custom hooks.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
const { blockDom, markup } = owl;
|
||||
import { blockDom, markup } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* renders a template with an (optional) context and returns a Markup string,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { browser } from "@web/core/browser/browser";
|
||||
|
||||
const { onWillUnmount, useComponent } = owl;
|
||||
import { onWillUnmount, useComponent } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* Creates a version of the function where only the last call between two
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { registry } from "./core/registry";
|
||||
|
||||
const { EventBus } = owl;
|
||||
import { EventBus } from "@odoo/owl";
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Types
|
||||
|
||||
@@ -11,7 +11,7 @@ import { ViewNotFoundError } from "@web/views/view";
|
||||
import { cleanDomFromBootstrap, wrapSuccessOrFail, useLegacyRefs } from "./utils";
|
||||
import { mapDoActionOptionAPI } from "./backend_utils";
|
||||
|
||||
const {
|
||||
import {
|
||||
Component,
|
||||
onMounted,
|
||||
onWillUnmount,
|
||||
@@ -21,7 +21,7 @@ const {
|
||||
useExternalListener,
|
||||
useComponent,
|
||||
xml,
|
||||
} = owl;
|
||||
} from "@odoo/owl";
|
||||
|
||||
class WarningDialog extends Component {}
|
||||
WarningDialog.template = xml`<Dialog title="props.title">
|
||||
|
||||
@@ -7,7 +7,7 @@ import { formatMany2one } from "@web/views/fields/formatters";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { Component, onWillStart, useState } = owl;
|
||||
import { Component, onWillStart, useState } from "@odoo/owl";
|
||||
|
||||
const debugRegistry = registry.category("debug");
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import ControlPanel from "web.ControlPanel";
|
||||
import Widget from "web.Widget";
|
||||
import { ComponentWrapper } from "web.OwlCompatibility";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
const AbstractAction = Widget.extend(ActionMixin, {
|
||||
config: {
|
||||
ControlPanel: ControlPanel,
|
||||
|
||||
@@ -9,7 +9,7 @@ odoo.define('web.utils', function (require) {
|
||||
|
||||
var translation = require('web.translation');
|
||||
|
||||
const { Component } = owl;
|
||||
const { Component } = require("@odoo/owl");
|
||||
|
||||
var _t = translation._t;
|
||||
var id = -1;
|
||||
|
||||
@@ -29,7 +29,7 @@ import { _t } from "@web/core/l10n/translation";
|
||||
|
||||
|
||||
const serviceRegistry = registry.category("services");
|
||||
const { Component, App, whenReady } = owl;
|
||||
import { Component, App, whenReady } from "@odoo/owl";
|
||||
|
||||
// Load localizations outside the PublicRoot to not wait for DOM ready (but
|
||||
// wait for them in PublicRoot)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** @odoo-module alias=web.AbstractRendererOwl **/
|
||||
|
||||
import { LegacyComponent } from "@web/legacy/legacy_component";
|
||||
const { onMounted, onPatched } = owl;
|
||||
import { onMounted, onPatched } from "@odoo/owl";
|
||||
|
||||
// Renderers may display sample data when there is no real data to display. In
|
||||
// this case the data is displayed with opacity and can't be clicked. Moreover,
|
||||
|
||||
@@ -31,7 +31,7 @@ import SearchPanel from "web.searchPanel";
|
||||
import mvc from 'web.mvc';
|
||||
import viewUtils from 'web.viewUtils';
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
var Factory = mvc.Factory;
|
||||
|
||||
|
||||
@@ -20,12 +20,12 @@ const { WidgetAdapterMixin } = require('web.OwlCompatibility');
|
||||
const FieldWrapper = require('web.FieldWrapper');
|
||||
const WidgetWrapper = require("web.WidgetWrapper");
|
||||
|
||||
const { Component } = owl;
|
||||
const { Component } = require("@odoo/owl");
|
||||
|
||||
var qweb = core.qweb;
|
||||
const _t = core._t;
|
||||
|
||||
const { status } = owl;
|
||||
const { status } = require("@odoo/owl");
|
||||
|
||||
var BasicRenderer = AbstractRenderer.extend(WidgetAdapterMixin, {
|
||||
custom_events: {
|
||||
|
||||
@@ -21,7 +21,7 @@ var utils = require('web.utils');
|
||||
const widgetRegistry = require('web.widget_registry');
|
||||
const widgetRegistryOwl = require('web.widgetRegistry');
|
||||
|
||||
const { Component } = owl;
|
||||
const { Component } = require("@odoo/owl");
|
||||
|
||||
var BasicView = AbstractView.extend({
|
||||
config: _.extend({}, AbstractView.prototype.config, {
|
||||
|
||||
@@ -24,7 +24,7 @@ var QWeb = core.qweb;
|
||||
var KANBAN_RECORD_COLORS = require('web.basic_fields').FieldColorPicker.prototype.RECORD_COLORS;
|
||||
var NB_KANBAN_RECORD_COLORS = KANBAN_RECORD_COLORS.length;
|
||||
|
||||
const { Component } = owl;
|
||||
const { Component } = require("@odoo/owl");
|
||||
|
||||
const { DateTime } = luxon;
|
||||
// As the name suggests, this is a hack that allows archs that work in the new
|
||||
|
||||
@@ -9,7 +9,7 @@ import select_create_controllers_registry from 'web.select_create_controllers_re
|
||||
|
||||
var _t = core._t;
|
||||
|
||||
const { markup } = owl;
|
||||
import { markup } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* Class with everything which is common between FormViewDialog and
|
||||
|
||||
@@ -10,7 +10,7 @@ import { breadcrumbsToLegacy } from "./backend_utils";
|
||||
import { useLegacyRefs } from "./utils";
|
||||
import { LegacyComponent } from "./legacy_component";
|
||||
|
||||
const { xml } = owl;
|
||||
import { xml } from "@odoo/owl";
|
||||
const actionRegistry = registry.category("actions");
|
||||
|
||||
const legacyClientActionTemplate = xml`
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Dialog } from "../core/dialog/dialog";
|
||||
import { patch } from "@web/core/utils/patch";
|
||||
import OwlDialog from "web.OwlDialog";
|
||||
|
||||
const { useEffect } = owl;
|
||||
import { useEffect } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* This is a patch of the new Dialog class.
|
||||
|
||||
@@ -4,7 +4,7 @@ import { registry } from "@web/core/registry";
|
||||
import { ConnectionLostError, RPCError } from "../core/network/rpc_service";
|
||||
import { lostConnectionHandler, rpcErrorHandler } from "@web/core/errors/error_handlers";
|
||||
|
||||
const { OwlError } = owl;
|
||||
import { OwlError } from "@odoo/owl";
|
||||
|
||||
const errorHandlerRegistry = registry.category("error_handlers");
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import * as session from "web.session";
|
||||
import * as makeLegacyWebClientService from "web.pseudo_web_client";
|
||||
import { templates } from "@web/core/assets";
|
||||
|
||||
const { Component, whenReady } = owl;
|
||||
import { Component, whenReady } from "@odoo/owl";
|
||||
|
||||
let legacySetupResolver;
|
||||
export const legacySetupProm = new Promise((resolve) => {
|
||||
|
||||
@@ -16,7 +16,7 @@ import { getBundle, loadBundle } from "@web/core/assets";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { LegacyComponent } from "./legacy_component";
|
||||
|
||||
const { xml, onWillStart } = owl;
|
||||
import { xml, onWillStart } from "@odoo/owl";
|
||||
const viewRegistry = registry.category("views");
|
||||
|
||||
function getJsClassWidget(fieldsInfo) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import * as legacySystrayMenu from "web.SystrayMenu";
|
||||
import { registry } from "../core/registry";
|
||||
import { LegacyComponent } from "@web/legacy/legacy_component";
|
||||
|
||||
const { Component, xml } = owl;
|
||||
import { Component, xml } from "@odoo/owl";
|
||||
const systrayRegistry = registry.category("systray");
|
||||
|
||||
class SystrayItemAdapter extends ComponentAdapter {
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
import { ErrorDialog } from "../core/errors/error_dialogs";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { useComponent } = owl;
|
||||
import { useComponent } from "@odoo/owl";
|
||||
|
||||
export const wowlServicesSymbol = Symbol("wowlServices");
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Dropdown } from "@web/core/dropdown/dropdown";
|
||||
import { DropdownItem } from "@web/core/dropdown/dropdown_item";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { Component, onWillStart, onWillUpdateProps } = owl;
|
||||
import { Component, onWillStart, onWillUpdateProps } from "@odoo/owl";
|
||||
let registryActionId = 0;
|
||||
/**
|
||||
* Action menus (or Action/Print bar, previously called 'Sidebar')
|
||||
|
||||
@@ -5,7 +5,7 @@ import { DropdownItem } from "@web/core/dropdown/dropdown_item";
|
||||
import { FACET_ICONS } from "../utils/misc";
|
||||
import { useBus } from "@web/core/utils/hooks";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class ComparisonMenu extends Component {
|
||||
setup() {
|
||||
|
||||
@@ -11,7 +11,7 @@ import { GroupByMenu } from "../group_by_menu/group_by_menu";
|
||||
import { SearchBar } from "../search_bar/search_bar";
|
||||
import { Dropdown } from "@web/core/dropdown/dropdown";
|
||||
|
||||
const { Component, useState, onMounted, useExternalListener, useRef, useEffect } = owl;
|
||||
import { Component, useState, onMounted, useExternalListener, useRef, useEffect } from "@odoo/owl";
|
||||
|
||||
const MAPPING = {
|
||||
filter: FilterMenu,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { CheckBox } from "@web/core/checkbox/checkbox";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { useAutofocus, useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { Component, useState } = owl;
|
||||
import { Component, useState } from "@odoo/owl";
|
||||
|
||||
const favoriteMenuRegistry = registry.category("favoriteMenu");
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { FACET_ICONS } from "../utils/misc";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { useBus, useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { Component } = owl;
|
||||
import { Component } from "@odoo/owl";
|
||||
const favoriteMenuRegistry = registry.category("favoriteMenu");
|
||||
|
||||
export class FavoriteMenu extends Component {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user