From 2b80c6783909deca5d0b28ef920aabf2a4953ebf Mon Sep 17 00:00:00 2001 From: "Zhenfei.Li" Date: Tue, 27 Dec 2022 01:17:11 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-13947=20refactor:=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E6=8C=82=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/action/action.js | 2 - src/core/action/action.show.js | 2 - src/core/behavior/0.behavior.js | 1 - src/core/behavior/behavior.highlight.js | 1 - src/core/behavior/behavior.redmark.js | 1 - src/core/controller/0.controller.js | 1 - src/core/controller/controller.broadcast.js | 3 +- src/core/controller/controller.bubbles.js | 1 - src/core/controller/controller.drawer.js | 1 - src/core/controller/controller.layer.js | 1 - src/core/controller/controller.masker.js | 1 - src/core/controller/controller.popover.js | 1 - src/core/controller/controller.resizer.js | 2 - src/core/controller/controller.tooltips.js | 3 +- src/core/index.js | 48 +++++++++++++++++++++ 15 files changed, 50 insertions(+), 19 deletions(-) create mode 100644 src/core/index.js diff --git a/src/core/action/action.js b/src/core/action/action.js index 3ed7acd44..e582778ea 100644 --- a/src/core/action/action.js +++ b/src/core/action/action.js @@ -21,8 +21,6 @@ export default class Action extends OB { } } -BI.extend(BI, { Action }); - BI.ActionFactory = { createAction: function (key, options) { var action; diff --git a/src/core/action/action.show.js b/src/core/action/action.show.js index 34903513e..6ab3b7e1c 100644 --- a/src/core/action/action.show.js +++ b/src/core/action/action.show.js @@ -18,5 +18,3 @@ export default class ShowAction extends Action { callback && callback(); } } - -BI.extend(BI, { ShowAction }); diff --git a/src/core/behavior/0.behavior.js b/src/core/behavior/0.behavior.js index dcd82a58d..25d82b529 100644 --- a/src/core/behavior/0.behavior.js +++ b/src/core/behavior/0.behavior.js @@ -32,4 +32,3 @@ export default class Behavior extends OB { } } -BI.extend(BI, { Behavior }); diff --git a/src/core/behavior/behavior.highlight.js b/src/core/behavior/behavior.highlight.js index de7306c49..6ba710da0 100644 --- a/src/core/behavior/behavior.highlight.js +++ b/src/core/behavior/behavior.highlight.js @@ -32,4 +32,3 @@ export default class HighlightBehavior extends Behavior { }); } } -BI.extend(BI, { HighlightBehavior }); diff --git a/src/core/behavior/behavior.redmark.js b/src/core/behavior/behavior.redmark.js index e59cde9f3..1b2b349cf 100644 --- a/src/core/behavior/behavior.redmark.js +++ b/src/core/behavior/behavior.redmark.js @@ -22,4 +22,3 @@ export default class RedMarkBehavior extends Behavior { }); } } -BI.extend(BI, { RedMarkBehavior }) diff --git a/src/core/controller/0.controller.js b/src/core/controller/0.controller.js index fd79f532d..0b5bd7b09 100644 --- a/src/core/controller/0.controller.js +++ b/src/core/controller/0.controller.js @@ -10,4 +10,3 @@ import OB from "../3.ob"; export default class Controller extends OB { static EVENT_CHANGE = "__EVENT_CHANGE__"; } -BI.extend(BI, { Controller }) diff --git a/src/core/controller/controller.broadcast.js b/src/core/controller/controller.broadcast.js index 8cb4db3a3..f6d7b8951 100644 --- a/src/core/controller/controller.broadcast.js +++ b/src/core/controller/controller.broadcast.js @@ -34,5 +34,4 @@ export default class BroadcastController extends Controller { } return this; } -} -BI.extend(BI, { BroadcastController }) \ No newline at end of file +} \ No newline at end of file diff --git a/src/core/controller/controller.bubbles.js b/src/core/controller/controller.bubbles.js index fcdd69f4b..a62717081 100644 --- a/src/core/controller/controller.bubbles.js +++ b/src/core/controller/controller.bubbles.js @@ -99,4 +99,3 @@ export default class BubblesController extends Controller { return this; } } -BI.extend(BI, { BubblesController }); diff --git a/src/core/controller/controller.drawer.js b/src/core/controller/controller.drawer.js index d90c226f2..4b2daca9e 100644 --- a/src/core/controller/controller.drawer.js +++ b/src/core/controller/controller.drawer.js @@ -154,4 +154,3 @@ export default class DrawerController extends Controller { return this; } } -BI.extend(BI, { DrawerController }); diff --git a/src/core/controller/controller.layer.js b/src/core/controller/controller.layer.js index d12c807d7..a2a6735b7 100644 --- a/src/core/controller/controller.layer.js +++ b/src/core/controller/controller.layer.js @@ -169,4 +169,3 @@ export default class LayerController extends Controller { return this; } } -BI.extend(BI, { LayerController }); diff --git a/src/core/controller/controller.masker.js b/src/core/controller/controller.masker.js index cda5be1e6..33bffef75 100644 --- a/src/core/controller/controller.masker.js +++ b/src/core/controller/controller.masker.js @@ -11,4 +11,3 @@ export default class MaskersController extends LayerController { this.zindex = BI.zIndex_masker; } } -BI.extend(BI, { MaskersController }); diff --git a/src/core/controller/controller.popover.js b/src/core/controller/controller.popover.js index 08f40cf60..bcb129f3b 100644 --- a/src/core/controller/controller.popover.js +++ b/src/core/controller/controller.popover.js @@ -166,4 +166,3 @@ export default class PopoverController extends Controller { return this.zindex++; } } -BI.extend(BI, { PopoverController }); diff --git a/src/core/controller/controller.resizer.js b/src/core/controller/controller.resizer.js index 13eaa441e..3a6dcd31a 100644 --- a/src/core/controller/controller.resizer.js +++ b/src/core/controller/controller.resizer.js @@ -64,5 +64,3 @@ export default class ResizeController extends Controller { return this; } } - -BI.extend(BI, { ResizeController }); diff --git a/src/core/controller/controller.tooltips.js b/src/core/controller/controller.tooltips.js index efc0a1517..4b99266e0 100644 --- a/src/core/controller/controller.tooltips.js +++ b/src/core/controller/controller.tooltips.js @@ -57,7 +57,7 @@ export default class TooltipsController extends Controller { // scale影响要计算在内 // const scale = context.element.offset().left / context.element.get(0).getBoundingClientRect().left; // const x = (e.pageX || e.clientX) * scale + 15, y = (e.pageY || e.clientY) * scale + 15; - const x = (e.pageX || e.clientX) + 15, y = (e.pageY || e.clientY) + 15; + let x = (e.pageX || e.clientX) + 15, y = (e.pageY || e.clientY) + 15; if (x + tooltip.element.outerWidth() > BI.Widget._renderEngine.createElement("body").outerWidth()) { x -= tooltip.element.outerWidth() + 15; } @@ -144,4 +144,3 @@ export default class TooltipsController extends Controller { return this; } } -BI.extend(BI, { TooltipsController }); diff --git a/src/core/index.js b/src/core/index.js new file mode 100644 index 000000000..1937cff2e --- /dev/null +++ b/src/core/index.js @@ -0,0 +1,48 @@ +import Action from "./action/action"; +import ShowAction from "./action/action.show"; +import Behavior from "./behavior/0.behavior"; +import HighlightBehavior from "./behavior/behavior.highlight"; +import RedMarkBehavior from "./behavior/behavior.redmark"; +import Controller from "./controller/0.controller"; +import BroadcastController from "./controller/controller.broadcast"; +import BubblesController from "./controller/controller.bubbles"; +import DrawerController from "./controller/controller.drawer"; +import LayerController from "./controller/controller.layer"; +import MaskersController from "./controller/controller.masker"; +import PopoverController from "./controller/controller.popover"; +import ResizeController from "./controller/controller.resizer"; +import TooltipsController from "./controller/controller.tooltips"; + +BI.extend(BI, { + Action, + ShowAction, + Behavior, + HighlightBehavior, + RedMarkBehavior, + Controller, + BroadcastController, + BubblesController, + DrawerController, + LayerController, + MaskersController, + PopoverController, + ResizeController, + TooltipsController, +}); + +export { + Action, + ShowAction, + Behavior, + HighlightBehavior, + RedMarkBehavior, + Controller, + BroadcastController, + BubblesController, + DrawerController, + LayerController, + MaskersController, + PopoverController, + ResizeController, + TooltipsController, +} \ No newline at end of file