Fix some imports for et2 widgets

This commit is contained in:
Hadi Nategh 2021-06-09 14:28:29 +02:00
parent 08d7b7df3e
commit 42305a6562
8 changed files with 22 additions and 14 deletions

View File

@ -2537,3 +2537,7 @@ export function egwActionObjectManager(_id, _manager)
return ao; return ao;
} }
export const EGW_AI_DRAG = 0x0100; // Use the first byte as mask for event types - 01 is for events used with drag stuff
export const EGW_AI_DRAG_OUT = EGW_AI_DRAG | 0x01;
export const EGW_AI_DRAG_OVER = EGW_AI_DRAG | 0x02;

View File

@ -535,10 +535,6 @@ export function getDropImplementation()
return _dropActionImpl; return _dropActionImpl;
} }
var EGW_AI_DRAG = 0x0100; // Use the first byte as mask for event types - 01 is for events used with drag stuff
var EGW_AI_DRAG_OUT = EGW_AI_DRAG | 0x01;
var EGW_AI_DRAG_OVER = EGW_AI_DRAG | 0x02;
export function egwDropActionImplementation() export function egwDropActionImplementation()
{ {
var ai = new egwActionImplementation(); var ai = new egwActionImplementation();

View File

@ -16,7 +16,7 @@ import { ClassWithAttributes } from './et2_core_inheritance';
import { et2_IDOMNode } from "./et2_core_interfaces"; import { et2_IDOMNode } from "./et2_core_interfaces";
import { et2_hasChild, et2_no_init } from "./et2_core_common"; import { et2_hasChild, et2_no_init } from "./et2_core_common";
import { et2_widget } from "./et2_core_widget"; import { et2_widget } from "./et2_core_widget";
import '../egw_action/egw_action.js'; import { egw_getActionManager, egwActionObject, egwActionObjectInterface, egw_getAppObjectManager, EGW_AI_DRAG_OVER, EGW_AI_DRAG_OUT } from '../egw_action/egw_action.js';
import { egw } from "../jsapi/egw_global"; import { egw } from "../jsapi/egw_global";
/** /**
* Abstract widget class which can be inserted into the DOM. All widget classes * Abstract widget class which can be inserted into the DOM. All widget classes
@ -400,7 +400,7 @@ export class et2_DOMWidget extends et2_widget {
} }
// Initialize the action manager and add some actions to it // Initialize the action manager and add some actions to it
// Only look 1 level deep // Only look 1 level deep
var gam = window.egw_getActionManager(this.egw().appName, true, 1); var gam = egw_getActionManager(this.egw().appName, true, 1);
if (typeof this._actionManager != "object") { if (typeof this._actionManager != "object") {
if (gam.getActionById(this.getInstanceManager().uniqueId, 1) !== null) { if (gam.getActionById(this.getInstanceManager().uniqueId, 1) !== null) {
gam = gam.getActionById(this.getInstanceManager().uniqueId, 1); gam = gam.getActionById(this.getInstanceManager().uniqueId, 1);

View File

@ -18,7 +18,13 @@ import {ClassWithAttributes} from './et2_core_inheritance';
import {et2_IDOMNode} from "./et2_core_interfaces"; import {et2_IDOMNode} from "./et2_core_interfaces";
import {et2_hasChild, et2_no_init} from "./et2_core_common"; import {et2_hasChild, et2_no_init} from "./et2_core_common";
import {et2_widget, WidgetConfig} from "./et2_core_widget"; import {et2_widget, WidgetConfig} from "./et2_core_widget";
import '../egw_action/egw_action.js'; import {
egw_getActionManager,
egwActionObject,
egwActionObjectInterface,
egw_getAppObjectManager,
EGW_AI_DRAG_OVER, EGW_AI_DRAG_OUT
} from '../egw_action/egw_action.js';
import {egw} from "../jsapi/egw_global"; import {egw} from "../jsapi/egw_global";
// fixing circular dependencies by only importing type // fixing circular dependencies by only importing type
import type {et2_tabbox} from "./et2_widget_tabs"; import type {et2_tabbox} from "./et2_widget_tabs";
@ -594,7 +600,7 @@ export abstract class et2_DOMWidget extends et2_widget implements et2_IDOMNode
// Initialize the action manager and add some actions to it // Initialize the action manager and add some actions to it
// Only look 1 level deep // Only look 1 level deep
var gam = window.egw_getActionManager(this.egw().appName,true,1); var gam = egw_getActionManager(this.egw().appName,true,1);
if(typeof this._actionManager != "object") if(typeof this._actionManager != "object")
{ {
if(gam.getActionById(this.getInstanceManager().uniqueId,1) !== null) if(gam.getActionById(this.getInstanceManager().uniqueId,1) !== null)

View File

@ -17,7 +17,7 @@ import { et2_no_init } from "./et2_core_common";
import { et2_register_widget, et2_widget } from "./et2_core_widget"; import { et2_register_widget, et2_widget } from "./et2_core_widget";
import { ClassWithAttributes } from "./et2_core_inheritance"; import { ClassWithAttributes } from "./et2_core_inheritance";
import { et2_action_object_impl, et2_DOMWidget } from "./et2_core_DOMWidget"; import { et2_action_object_impl, et2_DOMWidget } from "./et2_core_DOMWidget";
import '../egw_action/egw_action.js'; import { egw_getAppObjectManager, egwActionObject } from '../egw_action/egw_action.js';
import { et2_directChildrenByTagName, et2_filteredNodeIterator, et2_readAttrWithDefault } from "./et2_core_xml"; import { et2_directChildrenByTagName, et2_filteredNodeIterator, et2_readAttrWithDefault } from "./et2_core_xml";
import { egw } from "../jsapi/egw_global"; import { egw } from "../jsapi/egw_global";
/** /**
@ -719,7 +719,7 @@ export class et2_grid extends et2_DOMWidget {
// Get the top level element for the tree // Get the top level element for the tree
// get appObjectManager for the actual app, it might not always be the current app(e.g. running app content under admin tab) // get appObjectManager for the actual app, it might not always be the current app(e.g. running app content under admin tab)
// @ts-ignore // @ts-ignore
let objectManager = window.egw_getAppObjectManager(true, this.getInstanceManager().app); let objectManager = egw_getAppObjectManager(true, this.getInstanceManager().app);
objectManager = objectManager.getObjectById(this.getInstanceManager().uniqueId, 2) || objectManager; objectManager = objectManager.getObjectById(this.getInstanceManager().uniqueId, 2) || objectManager;
let widget_object = objectManager.getObjectById(this.id); let widget_object = objectManager.getObjectById(this.id);
if (widget_object == null) { if (widget_object == null) {

View File

@ -20,7 +20,7 @@ import {et2_IAligned, et2_IDetachedDOM, et2_IResizeable} from "./et2_core_interf
import {et2_register_widget, et2_widget, WidgetConfig} from "./et2_core_widget"; import {et2_register_widget, et2_widget, WidgetConfig} from "./et2_core_widget";
import {ClassWithAttributes} from "./et2_core_inheritance"; import {ClassWithAttributes} from "./et2_core_inheritance";
import {et2_action_object_impl, et2_DOMWidget} from "./et2_core_DOMWidget"; import {et2_action_object_impl, et2_DOMWidget} from "./et2_core_DOMWidget";
import '../egw_action/egw_action.js'; import {egw_getAppObjectManager, egwActionObject} from '../egw_action/egw_action.js';
import {et2_directChildrenByTagName, et2_filteredNodeIterator, et2_readAttrWithDefault} from "./et2_core_xml"; import {et2_directChildrenByTagName, et2_filteredNodeIterator, et2_readAttrWithDefault} from "./et2_core_xml";
import {egw} from "../jsapi/egw_global"; import {egw} from "../jsapi/egw_global";
@ -1005,7 +1005,7 @@ export class et2_grid extends et2_DOMWidget implements et2_IDetachedDOM, et2_IAl
// Get the top level element for the tree // Get the top level element for the tree
// get appObjectManager for the actual app, it might not always be the current app(e.g. running app content under admin tab) // get appObjectManager for the actual app, it might not always be the current app(e.g. running app content under admin tab)
// @ts-ignore // @ts-ignore
let objectManager = window.egw_getAppObjectManager(true, this.getInstanceManager().app); let objectManager = egw_getAppObjectManager(true, this.getInstanceManager().app);
objectManager = objectManager.getObjectById(this.getInstanceManager().uniqueId,2) || objectManager; objectManager = objectManager.getObjectById(this.getInstanceManager().uniqueId,2) || objectManager;
let widget_object = objectManager.getObjectById(this.id); let widget_object = objectManager.getObjectById(this.id);
if (widget_object == null) { if (widget_object == null) {

View File

@ -16,9 +16,10 @@
import { et2_DOMWidget } from "./et2_core_DOMWidget"; import { et2_DOMWidget } from "./et2_core_DOMWidget";
import { et2_createWidget, et2_register_widget } from "./et2_core_widget"; import { et2_createWidget, et2_register_widget } from "./et2_core_widget";
import { ClassWithAttributes } from "./et2_core_inheritance"; import { ClassWithAttributes } from "./et2_core_inheritance";
import '../egw_action/egw_action.js'; import { egwActionObject, egw_getObjectManager, egwActionObjectManager } from '../egw_action/egw_action.js';
import { et2_dialog } from "./et2_widget_dialog"; import { et2_dialog } from "./et2_widget_dialog";
import { egw } from "../jsapi/egw_global"; import { egw } from "../jsapi/egw_global";
import { egwIsMobile } from "../egw_action/egw_action_common.js";
/** /**
* This toolbar gets its contents from its actions * This toolbar gets its contents from its actions
* *

View File

@ -18,12 +18,13 @@
import {et2_DOMWidget} from "./et2_core_DOMWidget"; import {et2_DOMWidget} from "./et2_core_DOMWidget";
import {et2_createWidget, et2_register_widget, WidgetConfig} from "./et2_core_widget"; import {et2_createWidget, et2_register_widget, WidgetConfig} from "./et2_core_widget";
import {ClassWithAttributes} from "./et2_core_inheritance"; import {ClassWithAttributes} from "./et2_core_inheritance";
import '../egw_action/egw_action.js'; import {egwActionObject, egw_getObjectManager, egwActionObjectManager} from '../egw_action/egw_action.js';
import {et2_dialog} from "./et2_widget_dialog"; import {et2_dialog} from "./et2_widget_dialog";
import {et2_dropdown_button} from "./et2_widget_dropdown_button"; import {et2_dropdown_button} from "./et2_widget_dropdown_button";
import {et2_checkbox} from "./et2_widget_checkbox"; import {et2_checkbox} from "./et2_widget_checkbox";
import {et2_IInput} from "./et2_core_interfaces"; import {et2_IInput} from "./et2_core_interfaces";
import {egw} from "../jsapi/egw_global"; import {egw} from "../jsapi/egw_global";
import {egwIsMobile} from "../egw_action/egw_action_common.js";
/** /**
* This toolbar gets its contents from its actions * This toolbar gets its contents from its actions
* *