").css({
position: "absolute",
zIndex: BI.zIndex_tip - 2,
top: 0,
@@ -84,7 +86,7 @@ BI.Msg = ((function () {
bottom: 0,
opacity: 0.5,
}).appendTo("body"));
- $pop = BI.Widget._renderEngine.createElement("
").css({
+ $pop = Widget._renderEngine.createElement("
").css({
position: "absolute",
zIndex: BI.zIndex_tip - 1,
top: 0,
@@ -100,7 +102,7 @@ BI.Msg = ((function () {
$mask = null;
}
}
- var controlItems = [];
+ let controlItems = [];
if (hasCancel === true) {
controlItems.push({
el: {
@@ -109,7 +111,7 @@ BI.Msg = ((function () {
level: "ignore",
handler: function () {
close();
- if (BI.isFunction(callback)) {
+ if (isFunction(callback)) {
callback.apply(null, [false]);
}
},
@@ -122,13 +124,13 @@ BI.Msg = ((function () {
text: BI.i18nText("BI-Basic_OK"),
handler: function () {
close();
- if (BI.isFunction(callback)) {
+ if (isFunction(callback)) {
callback.apply(null, [true]);
}
},
},
});
- var conf = {
+ const conf = {
element: $pop,
type: "bi.center_adapt",
items: [
@@ -141,13 +143,13 @@ BI.Msg = ((function () {
this.element.keyup(function (e) {
if (e.keyCode === BI.KeyCode.ENTER) {
close();
- if (BI.isFunction(callback)) {
+ if (isFunction(callback)) {
callback.apply(null, [true]);
}
} else if (e.keyCode === BI.KeyCode.ESCAPE) {
close();
if (hasCancel === true) {
- if (BI.isFunction(callback)) {
+ if (isFunction(callback)) {
callback.apply(null, [false]);
}
}
@@ -183,7 +185,7 @@ BI.Msg = ((function () {
// height: 50,
handler: function () {
close();
- if (BI.isFunction(callback)) {
+ if (isFunction(callback)) {
callback.apply(null, [false]);
}
},
@@ -228,7 +230,7 @@ BI.Msg = ((function () {
],
};
- messageShows[messageShows.length] = BI.createWidget(conf);
+ messageShows[messageShows.length] = createWidget(conf);
},
};
})());
diff --git a/src/base/index.js b/src/base/index.js
index 723070d48..2c1dc228c 100644
--- a/src/base/index.js
+++ b/src/base/index.js
@@ -1,93 +1,31 @@
-import { extend } from "../core";
-import Pane from "./1.pane";
-import Single from "./single/0.single";
-import Text from "./single/1.text";
-import A from "./single/a/a";
-import Tip from "./single/tip/0.tip";
-import Toast from "./single/tip/tip.toast";
-import Tooltip from "./single/tip/tip.tooltip";
-import Drawer from "./layer/layer.drawer";
-import { Popover, BarPopover } from "./layer/layer.popover";
-import PopupView from "./layer/layer.popup";
-import SearcherView from "./layer/layer.searcher";
-import ListView from "./list/listview";
-import VirtualGroupList from "./list/virtualgrouplist";
-import VirtualList from "./list/virtuallist";
+import { Pane } from "./1.pane";
+import * as single from "./single";
+import * as layer from "./layer";
+import * as list from "./list";
import GridView from "./grid/grid";
import Pager from "./pager/pager";
-import Bubble from "./combination/bubble";
-import Combo from "./combination/combo";
-import Expander from "./combination/expander";
-import ButtonGroup from "./combination/group.button";
-import ComboGroup from "./combination/group.combo";
-import VirtualGroup from "./combination/group.virtual";
-import Loader from "./combination/loader";
-import Navigation from "./combination/navigation";
-import Searcher from "./combination/searcher";
-import Switcher from "./combination/switcher";
-import Tab from "./combination/tab";
-import ButtonTree from "./combination/tree.button";
+import * as combination from "./combination";
+import { Msg } from "./foundation/message";
-extend(BI, {
+Object.assign(BI, {
Pane,
- Single,
- Text,
- A,
- Tip,
- Toast,
- Tooltip,
- Drawer,
- Popover,
- BarPopover,
- PopupView,
- SearcherView,
- ListView,
- VirtualGroupList,
- VirtualList,
+ ...layer,
+ ...list,
+ ...single,
GridView,
Pager,
- Bubble,
- Combo,
- Expander,
- ButtonGroup,
- ComboGroup,
- VirtualGroup,
- Loader,
- Navigation,
- Searcher,
- Switcher,
- Tab,
- ButtonTree,
+ ...combination,
+ Msg,
});
+export * from "./0.base";
+export * from "./combination";
+export * from "./layer";
+export * from "./list";
+export * from "./single";
export {
Pane,
- Single,
- Text,
- A,
- Tip,
- Toast,
- Tooltip,
- Drawer,
- Popover,
- BarPopover,
- PopupView,
- SearcherView,
- ListView,
- VirtualGroupList,
- VirtualList,
GridView,
Pager,
- Bubble,
- Combo,
- Expander,
- ButtonGroup,
- ComboGroup,
- VirtualGroup,
- Loader,
- Navigation,
- Searcher,
- Switcher,
- Tab,
- ButtonTree,
+ Msg,
}
\ No newline at end of file
diff --git a/src/base/layer/index.js b/src/base/layer/index.js
new file mode 100644
index 000000000..8f04625d9
--- /dev/null
+++ b/src/base/layer/index.js
@@ -0,0 +1,4 @@
+export { Drawer } from "./layer.drawer";
+export { Popover, BarPopover } from "./layer.popover";
+export { PopupView } from "./layer.popup";
+export { SearcherView } from "./layer.searcher";
\ No newline at end of file
diff --git a/src/base/layer/layer.drawer.js b/src/base/layer/layer.drawer.js
index 890981d0e..75ef6b04b 100644
--- a/src/base/layer/layer.drawer.js
+++ b/src/base/layer/layer.drawer.js
@@ -6,7 +6,7 @@
import { Widget, shortcut } from "../../core";
@shortcut()
-export default class Drawer extends Widget {
+export class Drawer extends Widget {
SIZE = {
SMALL: "small",
NORMAL: "normal",
diff --git a/src/base/layer/layer.popup.js b/src/base/layer/layer.popup.js
index ea4a35196..fd79d015f 100644
--- a/src/base/layer/layer.popup.js
+++ b/src/base/layer/layer.popup.js
@@ -6,7 +6,7 @@
import { Widget, shortcut } from "../../core";
@shortcut()
-export default class PopupView extends Widget {
+export class PopupView extends Widget {
_const = {
TRIANGLE_LENGTH: 12,
}
diff --git a/src/base/layer/layer.searcher.js b/src/base/layer/layer.searcher.js
index f76aa7a17..9d4cfbb0e 100644
--- a/src/base/layer/layer.searcher.js
+++ b/src/base/layer/layer.searcher.js
@@ -7,10 +7,10 @@
*/
import { shortcut } from "../../core";
-import Pane from "../1.pane";
+import { Pane } from "../1.pane";
@shortcut()
-export default class SearcherView extends Pane {
+export class SearcherView extends Pane {
static xtype = "bi.searcher_view";
static EVENT_CHANGE = "EVENT_CHANGE";
diff --git a/src/base/list/index.js b/src/base/list/index.js
new file mode 100644
index 000000000..0a1c500cd
--- /dev/null
+++ b/src/base/list/index.js
@@ -0,0 +1,3 @@
+export { ListView } from "./listview";
+export { VirtualGroupList } from "./virtualgrouplist";
+export { VirtualList } from "./virtuallist";
\ No newline at end of file
diff --git a/src/base/list/listview.js b/src/base/list/listview.js
index 3ec9dc162..ce2870e75 100644
--- a/src/base/list/listview.js
+++ b/src/base/list/listview.js
@@ -7,7 +7,7 @@
*/
import { Widget, shortcut } from "../../core";
@shortcut()
-export default class ListView extends Widget {
+export class ListView extends Widget {
props() {
return {
baseCls: "bi-list-view",
diff --git a/src/base/list/virtualgrouplist.js b/src/base/list/virtualgrouplist.js
index be9845cc1..d89cb32a0 100644
--- a/src/base/list/virtualgrouplist.js
+++ b/src/base/list/virtualgrouplist.js
@@ -8,7 +8,7 @@
import { Widget, shortcut } from "../../core";
@shortcut()
-export default class VirtualGroupList extends Widget {
+export class VirtualGroupList extends Widget {
props() {
return {
baseCls: "bi-virtual-group-list",
diff --git a/src/base/list/virtuallist.js b/src/base/list/virtuallist.js
index ed788acdd..d2ce62311 100644
--- a/src/base/list/virtuallist.js
+++ b/src/base/list/virtuallist.js
@@ -8,7 +8,7 @@
import { Widget, shortcut } from "../../core";
@shortcut()
-export default class VirtualList extends Widget {
+export class VirtualList extends Widget {
props() {
return {
baseCls: "bi-virtual-list",
diff --git a/src/base/single/0.single.js b/src/base/single/0.single.js
index 845e8c33d..cd6ec00b0 100644
--- a/src/base/single/0.single.js
+++ b/src/base/single/0.single.js
@@ -14,7 +14,7 @@ import { Widget, shortcut } from "../../core";
import { Tooltips } from "../0.base";
@shortcut()
-export default class Single extends Widget {
+export class Single extends Widget {
static xtype = "bi.single";
_defaultConfig() {
diff --git a/src/base/single/1.text.js b/src/base/single/1.text.js
index 33001a7bd..294a2aaec 100644
--- a/src/base/single/1.text.js
+++ b/src/base/single/1.text.js
@@ -3,11 +3,11 @@
* @class BI.Text
* @extends BI.Single
*/
-import { shortcut } from "../../core/decorator";
-import { Single } from "../index";
+import { shortcut } from "../../core";
+import { Single } from "./0.single";
@shortcut()
-export default class Text extends Single {
+export class Text extends Single {
static xtype = "bi.text";
props = {
diff --git a/src/base/single/a/a.js b/src/base/single/a/a.js
index 7acf03231..c52006dd3 100644
--- a/src/base/single/a/a.js
+++ b/src/base/single/a/a.js
@@ -7,9 +7,9 @@
* @abstract
*/
import { shortcut } from "../../../core";
-import Text from "../1.text";
+import { Text } from "../1.text";
@shortcut()
-export default class A extends Text {
+export class A extends Text {
static xtype = "bi.a";
_defaultConfig() {
diff --git a/src/base/single/index.js b/src/base/single/index.js
new file mode 100644
index 000000000..748788816
--- /dev/null
+++ b/src/base/single/index.js
@@ -0,0 +1,4 @@
+export { Single } from "./0.single";
+export { Text } from "./1.text";
+export { A } from "./a/a";
+export * from "./tip";
\ No newline at end of file
diff --git a/src/base/single/tip/0.tip.js b/src/base/single/tip/0.tip.js
index d9ac9fee7..a4b93f4e5 100644
--- a/src/base/single/tip/0.tip.js
+++ b/src/base/single/tip/0.tip.js
@@ -7,8 +7,8 @@
* @abstract
*/
-import Single from "../0.single";
-export default class Tip extends Single {
+import { Single } from "../0.single";
+export class Tip extends Single {
_defaultConfig() {
const conf = super._defaultConfig(arguments);
return BI.extend(conf, {
diff --git a/src/base/single/tip/index.js b/src/base/single/tip/index.js
new file mode 100644
index 000000000..509c6be4c
--- /dev/null
+++ b/src/base/single/tip/index.js
@@ -0,0 +1,3 @@
+export { Tip } from "./0.tip";
+export { Toast } from "./tip.toast";
+export { Tooltip } from "./tip.tooltip";
\ No newline at end of file
diff --git a/src/base/single/tip/tip.toast.js b/src/base/single/tip/tip.toast.js
index e93b3627a..2dce887e5 100644
--- a/src/base/single/tip/tip.toast.js
+++ b/src/base/single/tip/tip.toast.js
@@ -7,9 +7,9 @@
*/
import { shortcut } from "../../../core";
-import Tip from "./0.tip";
+import { Tip } from "./0.tip";
@shortcut()
-export default class Toast extends Tip {
+export class Toast extends Tip {
_const= {
closableMinWidth: 146,
minWidth: 100,
diff --git a/src/base/single/tip/tip.tooltip.js b/src/base/single/tip/tip.tooltip.js
index d50a52c19..d101bcab8 100644
--- a/src/base/single/tip/tip.tooltip.js
+++ b/src/base/single/tip/tip.tooltip.js
@@ -7,9 +7,9 @@
*/
import { shortcut } from "../../../core";
-import Tip from "./0.tip";
+import { Tip } from "./0.tip";
@shortcut()
-export default class Tooltip extends Tip {
+export class Tooltip extends Tip {
_const = {
hgap: 8,
vgap: 4,
diff --git a/src/core/2.base.js b/src/core/2.base.js
index a4e8df688..01814415b 100644
--- a/src/core/2.base.js
+++ b/src/core/2.base.js
@@ -139,20 +139,6 @@ export function trans2Element(widgets) {
return map(widgets, (i, wi) => wi.element);
}
-// Utility
-BI._.extend(BI, {
- assert,
- warn,
- UUID,
- isWidget,
- createWidgets,
- createItems,
- packageItems,
- formatEL,
- stripEL,
- trans2Element,
-});
-
// 集合相关方法
BI._.each(["where", "findWhere", "invoke", "pluck", "shuffle", "sample", "toArray", "size"], function (name) {
BI[name] = _apply(name);
@@ -384,27 +370,6 @@ export function int2Abc(num) {
return str;
}
-BI._.extend(BI, {
- count,
- inverse,
- firstKey,
- lastKey,
- firstObject,
- lastObject,
- concat,
- backEach,
- backAny,
- backEvery,
- backFindKey,
- backFind,
- remove,
- removeAt,
- string2Array,
- array2String,
- abc2Int,
- int2Abc,
-});
-
// 数组相关的方法
BI._.each([
"first", "initial", "last", "rest", "compact", "flatten", "without", "union", "intersection",
@@ -493,13 +458,6 @@ export function uniq(array, isSorted, iteratee, context) {
return uniq.call(BI._, array, isSorted, iteratee, context);
}
-BI._.extend(BI, {
- makeArray,
- makeObject,
- makeArrayByArray,
- uniq,
-});
-
// 对象相关方法
BI._.each([
"keys", "allKeys", "values", "pairs", "invert", "create", "functions", "extend", "extendOwn",
@@ -652,24 +610,6 @@ export function isPromise(obj) {
return !!obj && (isObject(obj) || isFunction(obj)) && isFunction(obj.then);
}
-BI._.extend(BI, {
- inherit,
- init,
- has,
- freeze,
- isKey,
- isCapitalEqual,
- isWidthOrHeight,
- isNotNull,
- isNull,
- isEmptyArray,
- isNotEmptyArray,
- isEmptyObject,
- isNotEmptyObject,
- isWindow,
- isPromise,
-});
-
export const deepClone = BI._.cloneDeep;
export const deepExtend = BI._.deepExtend;
@@ -781,20 +721,6 @@ export function deepDiff(object, other) {
return result;
}
-// deep方法
-BI._.extend(BI, {
- deepClone: BI._.cloneDeep,
- deepExtend: BI._.merge,
- isDeepMatch,
- contains,
- deepContains,
- deepIndexOf,
- deepRemove,
- deepWithout,
- deepUnique,
- deepDiff,
-});
-
// 通用方法
BI._.each(["uniqueId", "result", "chain", "iteratee", "unescape", "before", "after", "chunk"], function (name) {
BI[name] = function () {
@@ -893,8 +819,6 @@ export const nextTick = (function () {
};
})();
-BI._.extend(BI, { nextTick });
-
// 数字相关方法
BI._.each(["random"], function (name) {
BI[name] = _apply(name);
@@ -985,22 +909,6 @@ export function average(array, iteratee, context) {
return sumResult / array.length;
}
-BI._.extend(BI, {
- parseInt,
- parseSafeInt,
- parseFloat,
- isNaturalNumber,
- isPositiveInteger,
- isNegativeInteger,
- isInteger,
- isNumeric,
- isFloat,
- isOdd,
- isEven,
- sum,
- average,
-});
-
export function trim() {
return BI._.trim.apply(BI._, arguments);
}
@@ -1126,25 +1034,6 @@ export function format(format) {
return format.replace(/\{(\d+)\}/g, (m, i) => args[i]);
}
-// 字符串相关方法
-BI._.extend(BI, {
- trim,
- toUpperCase,
- toLowerCase,
- isEndWithBlank,
- isLiteral,
- stripQuotes,
- camelize,
- hyphenate,
- isNotEmptyString,
- isEmptyString,
- encrypt,
- decrypt,
- escape,
- leftPad,
- format,
-});
-
/**
* 是否是闰年
* @param year
@@ -1454,15 +1343,5 @@ export function getTime() {
return dt.getTime() - BI.timeZone - new Date().getTimezoneOffset() * 60000;
}
return dt.getTime();
-
}
-// 日期相关方法
-BI._.extend(BI, {
- isLeapYear,
- checkDateVoid,
- checkDateLegal,
- parseDateTime,
- getDate,
- getTime,
-});
diff --git a/src/core/3.ob.js b/src/core/3.ob.js
index f51a68f06..fcd9db92a 100644
--- a/src/core/3.ob.js
+++ b/src/core/3.ob.js
@@ -1,4 +1,4 @@
-import { isFunction, isArray, isObject, isArguments, reduce, bind, extend } from "./2.base";
+import { isFunction, isArray, isObject, isArguments, reduce, bind } from "./2.base";
function obExtend() {
let target = arguments[0] || {}, length = arguments.length, i = 1, name, copy;
@@ -26,7 +26,7 @@ function obExtend() {
return target;
}
-export default class OB {
+export class OB {
// props = {};
// init = null;
@@ -215,5 +215,3 @@ export default class OB {
this.purgeListeners();
}
}
-
-extend(BI, { OB });
diff --git a/src/core/4.widget.js b/src/core/4.widget.js
index 54e833b51..e67bdb4dc 100644
--- a/src/core/4.widget.js
+++ b/src/core/4.widget.js
@@ -7,7 +7,7 @@
*/
import { isFunction, isArray, each, extend, isPlainObject, isNull, uniqueId, isWidget, isWidthOrHeight, isKey, remove, any, isNotNull } from "./2.base";
-import OB from "./3.ob";
+import { OB } from "./3.ob";
import { Providers, _lazyCreateWidget } from "./5.inject";
const cancelAnimationFrame =
@@ -35,7 +35,7 @@ function callLifeHook(self, life) {
});
}
-export default class Widget extends OB {
+export class Widget extends OB {
_defaultConfig () {
return extend(super._defaultConfig(), {
root: false,
@@ -1079,15 +1079,3 @@ export function mount(widget, container, predicate, hydrate) {
}
return widget._mount(true, false, false, predicate);
}
-
-extend(BI, {
- Widget,
- useStore,
- useContext,
- watch,
- onBeforeMount,
- onMounted,
- onBeforeUnmount,
- onUnmounted,
- mount,
-});
diff --git a/src/core/5.inject.js b/src/core/5.inject.js
index a8ec6786d..77faa02f3 100644
--- a/src/core/5.inject.js
+++ b/src/core/5.inject.js
@@ -1,6 +1,6 @@
import { isFunction, isNull, isNotNull, isArray, each, isWidget, extend, init, isEmpty, remove } from "./2.base";
-import OB from "./3.ob";
-import Widget from "./4.widget"
+import { OB } from "./3.ob";
+import { Widget } from "./4.widget"
let moduleInjection = {}, moduleInjectionMap = {
components: {},
@@ -39,7 +39,6 @@ export function module(xtype, cls) {
return () => Modules.getModule(xtype);
}
-BI.module = BI.module || module;
let constantInjection = {};
export function constant(xtype, cls) {
@@ -51,7 +50,6 @@ export function constant(xtype, cls) {
return () => Constants.getConstant(xtype);
}
-BI.constant = BI.constant || constant;
let modelInjection = {};
export function model(xtype, cls) {
@@ -63,7 +61,6 @@ export function model(xtype, cls) {
return (config) => Models.getModel(xtype, config);
}
-BI.model = BI.model || model;
let storeInjection = {};
export function store(xtype, cls) {
@@ -75,7 +72,6 @@ export function store(xtype, cls) {
return (config) => Stores.getStore(xtype, config);
}
-BI.store = BI.store || store;
let serviceInjection = {};
export function service(xtype, cls) {
@@ -87,7 +83,6 @@ export function service(xtype, cls) {
return (config) => Services.getService(xtype, config);
}
-BI.service = BI.service || service;
let providerInjection = {};
export function provider(xtype, cls) {
@@ -99,7 +94,6 @@ export function provider(xtype, cls) {
return (config) => Providers.getProvider(xtype, config);
}
-BI.provider = BI.provider || provider;
let configFunctions = OB.configFunctions = {};
const runConfigFunction = function (type, configFn) {
@@ -200,12 +194,10 @@ export function config(type, configFn, opt) {
return runConfigFunction(type, configFn);
}
}
-BI.config = BI.config || config;
export function getReference(type, fn) {
return BI.Plugin.registerObject(type, fn);
}
-BI.getReference = BI.getReference || getReference;
let actions = {};
let globalAction = [];
@@ -227,7 +219,6 @@ export function action(type, actionFn) {
}
};
}
-BI.action = BI.action || action;
let points = {};
export function point(type, action, pointFn, after) {
@@ -242,7 +233,6 @@ export function point(type, action, pointFn, after) {
}
points[type][action][after ? "after" : "before"].push(pointFn);
}
-BI.point = BI.point || point;
export const Modules = {
getModule: function (type) {
@@ -255,7 +245,6 @@ export const Modules = {
return moduleInjection;
}
}
-BI.Modules = BI.Modules || Modules;
export const Constants = {
getConstant: function (type) {
@@ -266,7 +255,6 @@ export const Constants = {
return isFunction(constantInjection[type]) ? constantInjection[type]() : constantInjection[type];
}
}
-BI.Constants = BI.Constants || Constants;
const callPoint = function (inst, types) {
types = isArray(types) ? types : [types];
@@ -319,7 +307,6 @@ export const Models = {
return inst;
}
}
-BI.Models = BI.Models || Models;
let stores = {};
export const Stores = {
@@ -338,7 +325,6 @@ export const Stores = {
return inst;
}
}
-BI.Stores = BI.Stores || Stores;
let services = {};
export const Services = {
@@ -354,7 +340,6 @@ export const Services = {
return services[type];
}
}
-BI.Services = BI.Services || Services;
let providers = {},
providerInstance = {};
@@ -373,7 +358,6 @@ export const Providers = {
return providerInstance[type];
}
}
-BI.Providers = BI.Providers || Providers;
export const Actions = {
runAction: function (type, event, config) {
@@ -396,7 +380,6 @@ export const Actions = {
});
}
}
-BI.Actions = BI.Actions || Actions;
let kv = {};
export function shortcut(xtype, cls) {
@@ -408,7 +391,6 @@ export function shortcut(xtype, cls) {
}
kv[xtype] = cls;
}
-BI.shortcut = BI.component = BI.shortcut || shortcut;
// 根据配置属性生成widget
const createRealWidget = function (config, context, lazy) {
@@ -496,18 +478,15 @@ export function createWidget(item, options, context, lazy) {
}
throw new Error("组件:无法根据item创建组件", item);
}
-BI.createWidget = BI.createWidget || createWidget;
export function _lazyCreateWidget (item, options, context) {
return createWidget(item, options, context, true);
}
-BI._lazyCreateWidget = BI._lazyCreateWidget || _lazyCreateWidget;
export function createElement() {
const widget = createWidget.apply(this, arguments);
return widget.element;
}
-BI.createElement = BI.createElement || createElement;
export function getResource(type, config) {
if (isNotNull(constantInjection[type])) {
@@ -527,4 +506,3 @@ export function getResource(type, config) {
}
throw new Error("未知类型: [" + type + "] 未定义");
}
-BI.getResource = BI.getResource || getResource;
diff --git a/src/core/action/action.js b/src/core/action/action.js
index e582778ea..b87ea1e21 100644
--- a/src/core/action/action.js
+++ b/src/core/action/action.js
@@ -5,8 +5,8 @@
* @extends BI.OB
* @abstract
*/
-import OB from "../3.ob";
-export default class Action extends OB {
+import { OB } from "../3.ob";
+export class Action extends OB {
props = {
src: null,
tar: null
diff --git a/src/core/action/action.show.js b/src/core/action/action.show.js
index 6ab3b7e1c..1084ec542 100644
--- a/src/core/action/action.show.js
+++ b/src/core/action/action.show.js
@@ -4,8 +4,8 @@
* @class BI.ShowAction
* @extends BI.Action
*/
-import Action from "./action";
-export default class ShowAction extends Action {
+import { Action } from "./action";
+export class ShowAction extends Action {
actionPerformed(src, tar, callback) {
tar = tar || this.options.tar;
tar.setVisible(true);
diff --git a/src/core/action/index.js b/src/core/action/index.js
new file mode 100644
index 000000000..f82304e43
--- /dev/null
+++ b/src/core/action/index.js
@@ -0,0 +1,2 @@
+export { Action } from "./action";
+export { ShowAction } from "./action.show";
\ No newline at end of file
diff --git a/src/core/behavior/0.behavior.js b/src/core/behavior/0.behavior.js
index 25d82b529..5adc59d3d 100644
--- a/src/core/behavior/0.behavior.js
+++ b/src/core/behavior/0.behavior.js
@@ -20,8 +20,8 @@ BI.BehaviorFactory = {
* @extends BI.OB
*/
-import OB from "../3.ob";
-export default class Behavior extends OB {
+import { OB } from "../3.ob";
+export class Behavior extends OB {
_defaultConfig() {
return BI.extend(super._defaultConfig(arguments), {
rule: () => true
diff --git a/src/core/behavior/behavior.highlight.js b/src/core/behavior/behavior.highlight.js
index 6ba710da0..1c0676b90 100644
--- a/src/core/behavior/behavior.highlight.js
+++ b/src/core/behavior/behavior.highlight.js
@@ -4,8 +4,8 @@
* @class BI.HighlightBehavior
* @extends BI.Behavior
*/
-import Behavior from "./0.behavior";
-export default class HighlightBehavior extends Behavior {
+import { Behavior } from "./0.behavior";
+export class HighlightBehavior extends Behavior {
doBehavior(items) {
const args = Array.prototype.slice.call(arguments, 1),
o = this.options;
diff --git a/src/core/behavior/behavior.redmark.js b/src/core/behavior/behavior.redmark.js
index 1b2b349cf..5beb0797f 100644
--- a/src/core/behavior/behavior.redmark.js
+++ b/src/core/behavior/behavior.redmark.js
@@ -4,8 +4,8 @@
* @class BI.RedMarkBehavior
* @extends BI.Behavior
*/
-import Behavior from "./0.behavior";
-export default class RedMarkBehavior extends Behavior {
+import { Behavior } from "./0.behavior";
+export class RedMarkBehavior extends Behavior {
doBehavior(items) {
const args = Array.prototype.slice.call(arguments, 1),
o = this.options;
diff --git a/src/core/behavior/index.js b/src/core/behavior/index.js
new file mode 100644
index 000000000..ee2ae69ed
--- /dev/null
+++ b/src/core/behavior/index.js
@@ -0,0 +1,3 @@
+export { Behavior } from "./0.behavior";
+export { HighlightBehavior } from "./behavior.highlight";
+export { RedMarkBehavior } from "./behavior.redmark";
\ No newline at end of file
diff --git a/src/core/controller/0.controller.js b/src/core/controller/0.controller.js
index 0b5bd7b09..0841a9358 100644
--- a/src/core/controller/0.controller.js
+++ b/src/core/controller/0.controller.js
@@ -6,7 +6,7 @@
* @extends BI.OB
* @abstract
*/
-import OB from "../3.ob";
-export default class Controller extends OB {
+import { OB } from "../3.ob";
+export class Controller extends OB {
static EVENT_CHANGE = "__EVENT_CHANGE__";
}
diff --git a/src/core/controller/controller.broadcast.js b/src/core/controller/controller.broadcast.js
index f6d7b8951..f0cc90c8d 100644
--- a/src/core/controller/controller.broadcast.js
+++ b/src/core/controller/controller.broadcast.js
@@ -4,8 +4,8 @@
* Created by GUY on 2015/12/23.
* @class
*/
-import Controller from "./0.controller";
-export default class BroadcastController extends Controller {
+import { Controller } from "./0.controller";
+export class BroadcastController extends Controller {
init() {
this._broadcasts = {};
}
diff --git a/src/core/controller/controller.bubbles.js b/src/core/controller/controller.bubbles.js
index 815b94728..e596eac60 100644
--- a/src/core/controller/controller.bubbles.js
+++ b/src/core/controller/controller.bubbles.js
@@ -5,8 +5,8 @@
* Created by GUY on 2015/8/21.
* @class
*/
-import Controller from "./0.controller";
-export default class BubblesController extends Controller {
+import { Controller } from "./0.controller";
+export class BubblesController extends Controller {
init() {
this.storeBubbles = {};
this.storePoppers = {};
diff --git a/src/core/controller/controller.drawer.js b/src/core/controller/controller.drawer.js
index c288d019f..51a80b734 100644
--- a/src/core/controller/controller.drawer.js
+++ b/src/core/controller/controller.drawer.js
@@ -4,8 +4,8 @@
* @class BI.popoverController
* @extends BI.Controller
*/
-import Controller from "./0.controller";
-export default class DrawerController extends Controller {
+import { Controller } from "./0.controller";
+export class DrawerController extends Controller {
constructor() {
super();
this._constructor();
diff --git a/src/core/controller/controller.layer.js b/src/core/controller/controller.layer.js
index 54273957b..6356588ab 100644
--- a/src/core/controller/controller.layer.js
+++ b/src/core/controller/controller.layer.js
@@ -4,8 +4,8 @@
* Created by GUY on 2015/6/24.
* @class
*/
-import Controller from "./0.controller";
-export default class LayerController extends Controller {
+import { Controller } from "./0.controller";
+export class LayerController extends Controller {
constructor() {
super();
this._constructor();
diff --git a/src/core/controller/controller.masker.js b/src/core/controller/controller.masker.js
index 33bffef75..7ff0532bc 100644
--- a/src/core/controller/controller.masker.js
+++ b/src/core/controller/controller.masker.js
@@ -4,8 +4,8 @@
* Created by GUY on 2015/6/24.
* @class
*/
-import LayerController from "./controller.layer";
-export default class MaskersController extends LayerController {
+import { LayerController } from "./controller.layer";
+export class MaskersController extends LayerController {
init() {
super.init(arguments);
this.zindex = BI.zIndex_masker;
diff --git a/src/core/controller/controller.popover.js b/src/core/controller/controller.popover.js
index 0c48b68ec..dc8e6a14d 100644
--- a/src/core/controller/controller.popover.js
+++ b/src/core/controller/controller.popover.js
@@ -4,8 +4,8 @@
* @class BI.popoverController
* @extends BI.Controller
*/
-import Controller from "./0.controller";
-export default class PopoverController extends Controller {
+import { Controller } from "./0.controller";
+export class PopoverController extends Controller {
constructor() {
super();
this._constructor();
diff --git a/src/core/controller/controller.resizer.js b/src/core/controller/controller.resizer.js
index 3a6dcd31a..5b8c400b8 100644
--- a/src/core/controller/controller.resizer.js
+++ b/src/core/controller/controller.resizer.js
@@ -4,8 +4,8 @@
* Created by GUY on 2015/6/24.
* @class
*/
-import Controller from "./0.controller";
-export default class ResizeController extends Controller {
+import { Controller } from "./0.controller";
+export class ResizeController extends Controller {
init() {
this.resizerManger = {};
diff --git a/src/core/controller/controller.tooltips.js b/src/core/controller/controller.tooltips.js
index 0e397aa33..e084caba9 100644
--- a/src/core/controller/controller.tooltips.js
+++ b/src/core/controller/controller.tooltips.js
@@ -6,8 +6,8 @@
* @class BI.TooltipsController
* @extends BI.Controller
*/
-import Controller from "./0.controller";
-export default class TooltipsController extends Controller {
+import { Controller } from "./0.controller";
+export class TooltipsController extends Controller {
init() {
this.tooltipsManager = {};
this.showingTips = {};// 存储正在显示的tooltip
diff --git a/src/core/controller/index.js b/src/core/controller/index.js
new file mode 100644
index 000000000..91701e15f
--- /dev/null
+++ b/src/core/controller/index.js
@@ -0,0 +1,9 @@
+export { Controller } from "./0.controller";
+export { BroadcastController } from "./controller.broadcast";
+export { BubblesController } from "./controller.bubbles";
+export { DrawerController } from "./controller.drawer";
+export { LayerController } from "./controller.layer";
+export { MaskersController } from "./controller.masker";
+export { PopoverController } from "./controller.popover";
+export { ResizeController } from "./controller.resizer";
+export { TooltipsController } from "./controller.tooltips";
\ No newline at end of file
diff --git a/src/core/func/index.js b/src/core/func/index.js
index 9b24275bf..b04392bdc 100644
--- a/src/core/func/index.js
+++ b/src/core/func/index.js
@@ -4,20 +4,3 @@ export * from "./date";
export * from "./function";
export * from "./number";
export * from "./string";
-
-// need delete
-import * as _alias from "./alias";
-import * as _array from "./array";
-import * as _date from "./date";
-import * as _function from "./function";
-import * as _number from "./number";
-import * as _string from "./string";
-
-Object.assign(BI, {
- ..._alias,
- ..._array,
- ..._date,
- ..._function,
- ..._number,
- ..._string,
-});
diff --git a/src/core/index.js b/src/core/index.js
index 3c660e1de..53a8cd755 100644
--- a/src/core/index.js
+++ b/src/core/index.js
@@ -1,68 +1,42 @@
-import {shortcut} from "./decorator";
-import OB from "./3.ob";
-import Widget from "./4.widget";
-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";
-import StyleLoaderManager from "./loader/loader.style";
-import "./h";
-import ShowListener from "./listener/listener.show";
-BI.extend(BI, {
- OB,
- Widget,
- Action,
- ShowAction,
- Behavior,
- HighlightBehavior,
- RedMarkBehavior,
- Controller,
- BroadcastController,
- BubblesController,
- DrawerController,
- LayerController,
- MaskersController,
- PopoverController,
- ResizeController,
- TooltipsController,
- StyleLoaderManager,
- ShowListener,
-});
+import * as base from "./2.base";
+import * as ob from "./3.ob";
+import * as widget from "./4.widget";
+import * as inject from "./5.inject";
+import * as action from "./action";
+import * as behavior from "./behavior";
+import * as controllers from "./controller";
+import * as func from "./func";
+import { StyleLoaderManager } from "./loader/loader.style";
+import "./h";
+import { ShowListener } from "./listener/listener.show";
+import { shortcut } from "./decorator";
export * from "./2.base";
+export * from "./3.ob";
export * from "./4.widget";
export * from "./5.inject";
+export * from "./action";
+export * from "./behavior";
+export * from "./controller";
export * from "./func";
export {
+ StyleLoaderManager,
+ ShowListener,
shortcut,
- OB,
- Widget,
- Action,
- ShowAction,
- Behavior,
- HighlightBehavior,
- RedMarkBehavior,
- Controller,
- BroadcastController,
- BubblesController,
- DrawerController,
- LayerController,
- MaskersController,
- PopoverController,
- ResizeController,
- TooltipsController,
+}
+
+Object.assign(BI, {
+ ...base,
+ ...ob,
+ ...widget,
+ ...inject,
+ ...behavior,
+ component: inject.shortcut,
+ ...action,
+ ...controllers,
+ ...func,
StyleLoaderManager,
- ShowListener
-};
+ ShowListener,
+});
diff --git a/src/core/listener/listener.show.js b/src/core/listener/listener.show.js
index 1c9469473..25ddc7ea2 100644
--- a/src/core/listener/listener.show.js
+++ b/src/core/listener/listener.show.js
@@ -5,12 +5,12 @@
* @class BI.ShowListener
* @extends BI.OB
*/
-import OB from "../3.ob";
+import { OB } from "../3.ob";
import { isArray, isNull, nextTick, } from "../2.base";
import { createWidget } from "../5.inject";
-import Controller from "../controller/0.controller";
+import { Controller } from "../controller/0.controller";
-export default class ShowListener extends OB {
+export class ShowListener extends OB {
static EVENT_CHANGE = "EVENT_CHANGE";
props() {
diff --git a/src/core/loader/loader.style.js b/src/core/loader/loader.style.js
index e10007cc3..1c65a2ede 100644
--- a/src/core/loader/loader.style.js
+++ b/src/core/loader/loader.style.js
@@ -4,9 +4,9 @@
* Created by GUY on 2015/9/7.
* @class
*/
-import OB from "../3.ob";
+import { OB } from "../3.ob";
-export default class StyleLoaderManager extends OB {
+export class StyleLoaderManager extends OB {
_defaultConfig() {
return BI.extend(super._defaultConfig(arguments), {});
}