Browse Source

Merge branch 'master' of ssh://code.fineres.com:7999/~claire.tang/fineui

es6
Tangjinxia 3 years ago
parent
commit
f7e1eb833b
  1. 1
      changelog.md
  2. 4
      dist/2.0/fineui.css
  3. 4
      dist/2.0/fineui.ie.min.js
  4. 2
      dist/2.0/fineui.ie.min.js.map
  5. 3362
      dist/2.0/fineui.js
  6. 2
      dist/2.0/fineui.js.map
  7. 4
      dist/2.0/fineui.min.css
  8. 4
      dist/2.0/fineui.min.js
  9. 2
      dist/2.0/fineui.min.js.map
  10. 4
      dist/2.0/fineui_without_normalize.css
  11. 4
      dist/2.0/fineui_without_normalize.min.css
  12. 4
      dist/core.css
  13. 3362
      dist/core.js
  14. 2
      dist/core.js.map
  15. 4
      dist/demo.css
  16. 3362
      dist/demo.js
  17. 2
      dist/demo.js.map
  18. 4
      dist/fineui.css
  19. 4
      dist/fineui.ie.min.js
  20. 2
      dist/fineui.ie.min.js.map
  21. 3362
      dist/fineui.js
  22. 2
      dist/fineui.js.map
  23. 4
      dist/fineui.min.css
  24. 4
      dist/fineui.min.js
  25. 2
      dist/fineui.min.js.map
  26. 4
      dist/fineui.proxy.css
  27. 3362
      dist/fineui.proxy.js
  28. 2
      dist/fineui.proxy.js.map
  29. 4
      dist/fineui.proxy.min.css
  30. 4
      dist/fineui.proxy.min.js
  31. 2
      dist/fineui.proxy.min.js.map
  32. 3356
      dist/fineui_without_jquery_polyfill.js
  33. 2
      dist/fineui_without_jquery_polyfill.js.map
  34. 2
      dist/font.css
  35. 3
      dist/lib/base/single/img/img.d.ts
  36. 2
      dist/resource.css
  37. 38
      dist/utils.js
  38. 2
      dist/utils.js.map
  39. 4
      dist/utils.min.js
  40. 2
      dist/utils.min.js.map
  41. 3
      index.html
  42. 2
      package.json
  43. 4
      src/base/combination/loader.js
  44. 3
      src/base/single/editor/editor.js
  45. 1
      src/base/single/editor/editor.textarea.js
  46. 212
      src/base/single/tip/tip.bubble.js
  47. 11
      src/case/layer/pane.list.js
  48. 8
      src/case/list/list.select.js
  49. 0
      src/core/10.worker.js
  50. 2
      src/core/2.base.js
  51. 2
      src/core/4.widget.js
  52. 6
      src/core/5.shortcut.js
  53. 31
      src/core/6.inject.js
  54. 2
      src/core/8.snabdom.js
  55. 1908
      src/core/9.popper.js
  56. 12
      src/core/action/action.js
  57. 4
      src/core/action/action.show.js
  58. 7
      src/core/behavior/0.behavior.js
  59. 11
      src/core/behavior/behavior.highlight.js
  60. 13
      src/core/behavior/behavior.redmark.js
  61. 5
      src/core/controller/0.controller.js
  62. 9
      src/core/controller/controller.broadcast.js
  63. 294
      src/core/controller/controller.bubbles.js
  64. 13
      src/core/controller/controller.layer.js
  65. 10
      src/core/controller/controller.masker.js
  66. 9
      src/core/controller/controller.popover.js
  67. 9
      src/core/controller/controller.resizer.js
  68. 11
      src/core/controller/controller.tooltips.js
  69. 13
      src/core/listener/listener.show.js
  70. 24
      src/core/logic/logic.layout.js
  71. 6
      src/core/wrapper/layout/adapt/absolute.leftrightvertical.js
  72. 10
      src/core/wrapper/layout/adapt/adapt.leftrightvertical.js
  73. 2
      src/core/wrapper/layout/flex/flex.leftrightvertical.center.js
  74. 2
      src/core/wrapper/layout/layout.border.js
  75. 6
      src/core/wrapper/layout/layout.card.js
  76. 4
      src/core/wrapper/layout/layout.division.js
  77. 2
      src/core/wrapper/layout/layout.grid.js
  78. 2
      src/core/wrapper/layout/layout.inline.js
  79. 4
      src/core/wrapper/layout/layout.table.js
  80. 4
      src/core/wrapper/layout/layout.tape.js
  81. 2
      src/core/wrapper/layout/layout.td.js
  82. 4
      src/core/wrapper/layout/layout.window.js
  83. 2
      src/core/wrapper/layout/middle/middle.center.js
  84. 2
      src/core/wrapper/layout/middle/middle.float.center.js
  85. 2
      src/core/wrapper/layout/middle/middle.horizontal.js
  86. 2
      src/core/wrapper/layout/middle/middle.vertical.js
  87. 4
      src/data/pool/pool.buffer.js
  88. 17
      src/less/base/single/tip/tip.bubble.less
  89. 31
      src/widget/multiselect/multiselect.combo.js
  90. 32
      src/widget/multiselect/multiselect.combo.nobar.js
  91. 32
      src/widget/multiselect/multiselect.insert.combo.js
  92. 32
      src/widget/multiselect/multiselect.insert.combo.nobar.js
  93. 2
      src/widget/multiselect/search/multiselect.search.insert.pane.js
  94. 30
      src/widget/multiselectlist/multiselectlist.insert.js
  95. 30
      src/widget/multiselectlist/multiselectlist.insert.nobar.js
  96. 30
      src/widget/multiselectlist/multiselectlist.js
  97. 6
      src/widget/yearmonth/trigger.yearmonth.js
  98. 8
      src/widget/yearquarter/trigger.yearquarter.js
  99. 4
      typescript/base/single/img/img.ts

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志
2.0(2021-07)
- bubble使用popper.js实现
- 优化了日期类型控件标红时的报错提示
- 支持虚拟dom
- 修复了树控件节点未初始化时调用树的getValue始终为空的问题

4
dist/2.0/fineui.css vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.ie.min.js.map vendored

File diff suppressed because one or more lines are too long

3362
dist/2.0/fineui.js vendored

File diff suppressed because it is too large Load Diff

2
dist/2.0/fineui.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.min.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui_without_normalize.css vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui_without_normalize.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/core.css vendored

File diff suppressed because one or more lines are too long

3362
dist/core.js vendored

File diff suppressed because it is too large Load Diff

2
dist/core.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/demo.css vendored

File diff suppressed because one or more lines are too long

3362
dist/demo.js vendored

File diff suppressed because it is too large Load Diff

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.ie.min.js.map vendored

File diff suppressed because one or more lines are too long

3362
dist/fineui.js vendored

File diff suppressed because it is too large Load Diff

2
dist/fineui.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.min.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.proxy.css vendored

File diff suppressed because one or more lines are too long

3362
dist/fineui.proxy.js vendored

File diff suppressed because it is too large Load Diff

2
dist/fineui.proxy.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.proxy.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.proxy.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.proxy.min.js.map vendored

File diff suppressed because one or more lines are too long

3356
dist/fineui_without_jquery_polyfill.js vendored

File diff suppressed because it is too large Load Diff

2
dist/fineui_without_jquery_polyfill.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/font.css vendored

File diff suppressed because one or more lines are too long

3
dist/lib/base/single/img/img.d.ts vendored

@ -1,6 +1,9 @@
import { Single } from "../single";
export declare class Img extends Single {
static xtype: string;
props: {
src: string;
} & Single['props'];
setSrc(src: string): void;
getSrc(): string;
}

2
dist/resource.css vendored

File diff suppressed because one or more lines are too long

38
dist/utils.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-7-18 18:31:24 */
/*! time: 2021-7-23 9:50:32 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -2867,7 +2867,7 @@ _.extend(BI, {
BI.BufferPool = {
put: function (name, cache) {
if (BI.isNotNull(Buffer[name])) {
throw new Error("Buffer Pool has the key already!");
throw new Error("key值:[" + name + "] 已存在!", Buffer);
}
Buffer[name] = cache;
},
@ -2878,6 +2878,7 @@ _.extend(BI, {
};
})();
/***/ }),
/***/ 111:
@ -3705,7 +3706,7 @@ if (!_global.BI) {
createWidgets: function (items, options, context) {
if (!BI.isArray(items)) {
throw new Error("cannot create Widgets");
throw new Error("items必须是数组", items);
}
if (BI.isWidget(options)) {
context = options;
@ -5362,7 +5363,7 @@ if (!_global.BI) {
var moduleInjection = {};
BI.module = BI.module || function (xtype, cls) {
if (moduleInjection[xtype] != null) {
_global.console && console.error("module:[" + xtype + "] has been registed");
_global.console && console.error("module[" + xtype + "] 已经注册过了");
}
moduleInjection[xtype] = cls;
};
@ -5370,7 +5371,7 @@ if (!_global.BI) {
var constantInjection = {};
BI.constant = BI.constant || function (xtype, cls) {
if (constantInjection[xtype] != null) {
_global.console && console.error("constant:[" + xtype + "] has been registed");
_global.console && console.error("constant: [" + xtype + "]已经注册过了");
}
constantInjection[xtype] = cls;
};
@ -5378,7 +5379,7 @@ if (!_global.BI) {
var modelInjection = {};
BI.model = BI.model || function (xtype, cls) {
if (modelInjection[xtype] != null) {
_global.console && console.error("model:[" + xtype + "] has been registed");
_global.console && console.error("model: [" + xtype + "] 已经注册过了");
}
modelInjection[xtype] = cls;
};
@ -5386,7 +5387,7 @@ if (!_global.BI) {
var storeInjection = {};
BI.store = BI.store || function (xtype, cls) {
if (storeInjection[xtype] != null) {
_global.console && console.error("store:[" + xtype + "] has been registed");
_global.console && console.error("store: [" + xtype + "] 已经注册过了");
}
storeInjection[xtype] = cls;
};
@ -5394,7 +5395,7 @@ if (!_global.BI) {
var serviceInjection = {};
BI.service = BI.service || function (xtype, cls) {
if (serviceInjection[xtype] != null) {
_global.console && console.error("service:[" + xtype + "] has been registed");
_global.console && console.error("service: [" + xtype + "] 已经注册过了");
}
serviceInjection[xtype] = cls;
};
@ -5402,7 +5403,7 @@ if (!_global.BI) {
var providerInjection = {};
BI.provider = BI.provider || function (xtype, cls) {
if (providerInjection[xtype] != null) {
_global.console && console.error("provider:[" + xtype + "] has been registed");
_global.console && console.error("provider: [" + xtype + "] 已经注册过了");
}
providerInjection[xtype] = cls;
};
@ -5498,8 +5499,7 @@ if (!_global.BI) {
BI.Modules = BI.Modules || {
getModule: function (type) {
if (!moduleInjection[type]) {
_global.console && console.error("module:[" + type + "] does not exists");
return false;
_global.console && console.error("module: [" + type + "] 未定义");
}
return moduleInjection[type];
},
@ -5510,6 +5510,9 @@ if (!_global.BI) {
BI.Constants = BI.Constants || {
getConstant: function (type) {
if (!constantInjection[type]) {
_global.console && console.error("constant: [" + type + "] 未定义");
}
return constantInjection[type];
}
};
@ -5554,6 +5557,9 @@ if (!_global.BI) {
BI.Models = BI.Models || {
getModel: function (type, config) {
if (!modelInjection[type]) {
_global.console && console.error("model: [" + type + "] 未定义");
}
var inst = new modelInjection[type](config);
inst._constructor && inst._constructor(config);
inst.mixins && callPoint(inst, inst.mixins);
@ -5566,6 +5572,9 @@ if (!_global.BI) {
BI.Stores = BI.Stores || {
getStore: function (type, config) {
if (!storeInjection[type]) {
_global.console && console.error("store: [" + type + "] 未定义");
}
if (stores[type]) {
return stores[type];
}
@ -5582,6 +5591,9 @@ if (!_global.BI) {
BI.Services = BI.Services || {
getService: function (type, config) {
if (!serviceInjection[type]) {
_global.console && console.error("service: [" + type + "] 未定义");
}
if (services[type]) {
return services[type];
}
@ -5596,6 +5608,9 @@ if (!_global.BI) {
BI.Providers = BI.Providers || {
getProvider: function (type, config) {
if (!providerInjection[type]) {
_global.console && console.error("provider: [" + type + "] 未定义");
}
if (!providers[type]) {
providers[type] = new providerInjection[type]();
}
@ -5644,6 +5659,7 @@ if (!_global.BI) {
if (providerInjection[type]) {
return BI.Providers.getProvider(type, config);
}
throw new Error("未知类型: [" + type + "] 未定义");
};
})();

2
dist/utils.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/utils.min.js.map vendored

File diff suppressed because one or more lines are too long

3
index.html

@ -11,4 +11,5 @@
<div id="wrapper"></div>
</body>
<script src="./dist/demo.js"></script>
</html>
<script src="./dist/router.js"></script>
</html>

2
package.json

@ -1,6 +1,6 @@
{
"name": "fineui",
"version": "2.0.20210718183406",
"version": "2.0.20210723095138",
"description": "fineui",
"main": "dist/fineui.min.js",
"types": "dist/lib/index.d.ts",

4
src/base/combination/loader.js

@ -169,7 +169,7 @@ BI.Loader = BI.inherit(BI.Widget, {
if (arguments.length === 0 && (BI.isFunction(o.itemsCreator))) {
o.itemsCreator.apply(this, [{times: 1}, function () {
if (arguments.length === 0) {
throw new Error("arguments can not be null!!!");
throw new Error("参数不能为空");
}
self.populate.apply(self, arguments);
o.onLoaded();
@ -257,4 +257,4 @@ BI.Loader = BI.inherit(BI.Widget, {
}
});
BI.Loader.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.loader", BI.Loader);
BI.shortcut("bi.loader", BI.Loader);

3
src/base/single/editor/editor.js

@ -175,7 +175,7 @@ BI.Editor = BI.inherit(BI.Single, {
errorText = errorText(this.editor.getValue());
}
if (BI.isKey(errorText)) {
if (!this.isEnabled() || this.isValid() || (BI.Bubbles.has(this.getName()) && BI.Bubbles.get(this.getName()).isVisible())) {
if (!this.isEnabled() || this.isValid() || BI.Bubbles.has(this.getName())) {
this.setTitle("");
} else {
this.setTitle(errorText);
@ -273,7 +273,6 @@ BI.Editor = BI.inherit(BI.Single, {
adjustYOffset: 2
});
this._checkToolTip();
return BI.Bubbles.get(this.getName());
}
},

1
src/base/single/editor/editor.textarea.js

@ -184,7 +184,6 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
adjustXOffset: o.adjustXOffset,
offsetStyle: o.offsetStyle,
});
return BI.Bubbles.get(this.getName());
}
},

212
src/base/single/tip/tip.bubble.js

@ -1,212 +0,0 @@
/**
* guy
* 气泡提示
* @class BI.Bubble
* @extends BI.Tip
* @type {*|void|Object}
*/
BI.Bubble = BI.inherit(BI.Tip, {
_defaultConfig: function () {
return BI.extend(BI.Bubble.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-bubble",
direction: "top",
text: "",
level: "error",
height: 18
});
},
_init: function () {
BI.Bubble.superclass._init.apply(this, arguments);
var fn = function (e) {
e.stopPropagation();
e.stopEvent();
return false;
};
this.element.bind({click: fn, mousedown: fn, mouseup: fn, mouseover: fn, mouseenter: fn, mouseleave: fn, mousemove: fn});
BI.createWidget({
type: "bi.adaptive",
element: this,
items: [this["_" + this.options.direction]()]
});
},
_createBubbleText: function () {
var o = this.options;
return (this.text = BI.createWidget({
type: "bi.label",
cls: "bubble-text" + " bubble-" + o.level,
text: o.text,
hgap: 5,
height: 18
}));
},
_top: function () {
return BI.createWidget({
type: "bi.vertical",
items: [{
el: this._createBubbleText(),
height: 18
}, {
el: {
type: "bi.layout"
},
height: 3
}]
});
},
_bottom: function () {
return BI.createWidget({
type: "bi.vertical",
items: [{
el: {
type: "bi.layout"
},
height: 3
}, {
el: this._createBubbleText(),
height: 18
}]
});
},
_left: function () {
return BI.createWidget({
type: "bi.right",
items: [{
el: {
type: "bi.layout",
width: 3,
height: 18
}
}, {
el: this._createBubbleText()
}]
});
},
_right: function () {
return BI.createWidget({
type: "bi.left",
items: [{
el: {
type: "bi.layout",
width: 3,
height: 18
}
}, {
el: this._createBubbleText()
}]
});
},
setText: function (text) {
this.text.setText(text);
}
});
BI.shortcut("bi.bubble", BI.Bubble);
BI.BubbleView = BI.inherit(BI.Single, {
_defaultConfig: function () {
return BI.extend(BI.BubbleView.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-bubble",
direction: "top",
text: "",
level: "error",
height: 18
});
},
_init: function () {
BI.BubbleView.superclass._init.apply(this, arguments);
var fn = function (e) {
e.stopPropagation();
e.stopEvent();
return false;
};
this.element.bind({click: fn, mousedown: fn, mouseup: fn, mouseover: fn, mouseenter: fn, mouseleave: fn, mousemove: fn});
BI.createWidget({
type: "bi.adaptive",
element: this,
items: [this["_" + this.options.direction]()]
});
},
_createBubbleText: function () {
var o = this.options;
return (this.text = BI.createWidget({
type: "bi.label",
cls: "bubble-text" + " bubble-" + o.level,
text: o.text,
hgap: 5,
height: 18
}));
},
_top: function () {
return BI.createWidget({
type: "bi.vertical",
items: [{
el: this._createBubbleText(),
height: 18
}, {
el: {
type: "bi.layout"
},
height: 3
}]
});
},
_bottom: function () {
return BI.createWidget({
type: "bi.vertical",
items: [{
el: {
type: "bi.layout"
},
height: 3
}, {
el: this._createBubbleText(),
height: 18
}]
});
},
_left: function () {
return BI.createWidget({
type: "bi.right",
items: [{
el: {
type: "bi.layout",
width: 3,
height: 18
}
}, {
el: this._createBubbleText()
}]
});
},
_right: function () {
return BI.createWidget({
type: "bi.left",
items: [{
el: {
type: "bi.layout",
width: 3,
height: 18
}
}, {
el: this._createBubbleText()
}]
});
},
setText: function (text) {
this.text.setText(text);
}
});
BI.shortcut("bi.bubble_view", BI.BubbleView);

11
src/case/layer/pane.list.js

@ -121,11 +121,16 @@ BI.ListPane = BI.inherit(BI.Pane, {
}]);
return;
}
BI.ListPane.superclass.populate.apply(this, arguments);
var context = BI.get(arguments, [2], {});
var tipText = context.tipText || '';
BI.isNotEmptyString(tipText) && this.setTipText(tipText);
this.button_group.populate.apply(this.button_group, arguments);
if (BI.isNotEmptyString(tipText)) {
BI.ListPane.superclass.populate.apply(this, []);
this.setTipText(tipText);
} else {
BI.ListPane.superclass.populate.apply(this, arguments);
this.button_group.populate.apply(this.button_group, arguments);
}
},
empty: function () {

8
src/case/list/list.select.js

@ -48,11 +48,13 @@ BI.SelectList = BI.inherit(BI.Widget, {
items: o.items,
itemsCreator: function (op, callback) {
op.times === 1 && self.toolbar.setVisible(false);
o.itemsCreator(op, function (items) {
o.itemsCreator(op, function (items, keywords, context) {
callback.apply(self, arguments);
if (op.times === 1) {
self.toolbar.setVisible(items && items.length > 0);
self.toolbar.setEnable(self.isEnabled() && items && items.length > 0);
var tipText = BI.get(context, 'tipText', '');
var visible = BI.isEmptyString(tipText) && items && items.length > 0;
self.toolbar.setVisible(visible);
self.toolbar.setEnable(self.isEnabled() && visible);
}
self._checkAllSelected();
});

0
src/core/worker.js → src/core/10.worker.js

2
src/core/2.base.js

@ -75,7 +75,7 @@ if (!_global.BI) {
createWidgets: function (items, options, context) {
if (!BI.isArray(items)) {
throw new Error("cannot create Widgets");
throw new Error("items必须是数组", items);
}
if (BI.isWidget(options)) {
context = options;

2
src/core/4.widget.js

@ -449,7 +449,7 @@
}
name = name || widget.getName() || BI.uniqueId("widget");
if (this._children[name]) {
throw new Error("name has already been existed");
throw new Error("组件:组件名已存在,不能进行添加");
}
widget._setParent && widget._setParent(this);
widget.on(BI.Events.DESTROY, function () {

6
src/core/5.shortcut.js

@ -2,7 +2,7 @@
var kv = {};
BI.shortcut = BI.component = BI.shortcut || function (xtype, cls) {
if (kv[xtype] != null) {
_global.console && console.error("shortcut:[" + xtype + "] has been registed");
_global.console && console.error("组件: [" + xtype + "] 已经注册过了");
}
if (cls) {
cls["xtype"] = xtype;
@ -15,7 +15,7 @@
var cls = kv[config.type];
if (!cls) {
throw new Error("组件" + config.type + "未定义");
throw new Error("组件: [" + config.type + "] 未定义");
}
var pushed = false;
var widget = new cls();
@ -88,7 +88,7 @@
if (BI.isWidget(item.el)) {
return item.el;
}
throw new Error("无法根据item创建组件");
throw new Error("组件:无法根据item创建组件", item);
};
BI._lazyCreateWidget = BI._lazyCreateWidget || function (item, options, context) {

31
src/core/6.inject.js

@ -2,7 +2,7 @@
var moduleInjection = {};
BI.module = BI.module || function (xtype, cls) {
if (moduleInjection[xtype] != null) {
_global.console && console.error("module:[" + xtype + "] has been registed");
_global.console && console.error("module[" + xtype + "] 已经注册过了");
}
moduleInjection[xtype] = cls;
};
@ -10,7 +10,7 @@
var constantInjection = {};
BI.constant = BI.constant || function (xtype, cls) {
if (constantInjection[xtype] != null) {
_global.console && console.error("constant:[" + xtype + "] has been registed");
_global.console && console.error("constant: [" + xtype + "]已经注册过了");
}
constantInjection[xtype] = cls;
};
@ -18,7 +18,7 @@
var modelInjection = {};
BI.model = BI.model || function (xtype, cls) {
if (modelInjection[xtype] != null) {
_global.console && console.error("model:[" + xtype + "] has been registed");
_global.console && console.error("model: [" + xtype + "] 已经注册过了");
}
modelInjection[xtype] = cls;
};
@ -26,7 +26,7 @@
var storeInjection = {};
BI.store = BI.store || function (xtype, cls) {
if (storeInjection[xtype] != null) {
_global.console && console.error("store:[" + xtype + "] has been registed");
_global.console && console.error("store: [" + xtype + "] 已经注册过了");
}
storeInjection[xtype] = cls;
};
@ -34,7 +34,7 @@
var serviceInjection = {};
BI.service = BI.service || function (xtype, cls) {
if (serviceInjection[xtype] != null) {
_global.console && console.error("service:[" + xtype + "] has been registed");
_global.console && console.error("service: [" + xtype + "] 已经注册过了");
}
serviceInjection[xtype] = cls;
};
@ -42,7 +42,7 @@
var providerInjection = {};
BI.provider = BI.provider || function (xtype, cls) {
if (providerInjection[xtype] != null) {
_global.console && console.error("provider:[" + xtype + "] has been registed");
_global.console && console.error("provider: [" + xtype + "] 已经注册过了");
}
providerInjection[xtype] = cls;
};
@ -138,8 +138,7 @@
BI.Modules = BI.Modules || {
getModule: function (type) {
if (!moduleInjection[type]) {
_global.console && console.error("module:[" + type + "] does not exists");
return false;
_global.console && console.error("module: [" + type + "] 未定义");
}
return moduleInjection[type];
},
@ -150,6 +149,9 @@
BI.Constants = BI.Constants || {
getConstant: function (type) {
if (!constantInjection[type]) {
_global.console && console.error("constant: [" + type + "] 未定义");
}
return constantInjection[type];
}
};
@ -194,6 +196,9 @@
BI.Models = BI.Models || {
getModel: function (type, config) {
if (!modelInjection[type]) {
_global.console && console.error("model: [" + type + "] 未定义");
}
var inst = new modelInjection[type](config);
inst._constructor && inst._constructor(config);
inst.mixins && callPoint(inst, inst.mixins);
@ -206,6 +211,9 @@
BI.Stores = BI.Stores || {
getStore: function (type, config) {
if (!storeInjection[type]) {
_global.console && console.error("store: [" + type + "] 未定义");
}
if (stores[type]) {
return stores[type];
}
@ -222,6 +230,9 @@
BI.Services = BI.Services || {
getService: function (type, config) {
if (!serviceInjection[type]) {
_global.console && console.error("service: [" + type + "] 未定义");
}
if (services[type]) {
return services[type];
}
@ -236,6 +247,9 @@
BI.Providers = BI.Providers || {
getProvider: function (type, config) {
if (!providerInjection[type]) {
_global.console && console.error("provider: [" + type + "] 未定义");
}
if (!providers[type]) {
providers[type] = new providerInjection[type]();
}
@ -284,5 +298,6 @@
if (providerInjection[type]) {
return BI.Providers.getProvider(type, config);
}
throw new Error("未知类型: [" + type + "] 未定义");
};
})();

2
src/core/8.snabdom.js

@ -929,7 +929,7 @@
var propsModule = { create: updateProps, update: updateProps };
// Bindig `requestAnimationFrame` like this fixes a bug in IE/Edge. See #360 and #409.
var raf$1 = typeof window !== "undefined" && window.requestAnimationFrame.bind(window) || setTimeout;
var raf$1 = typeof window !== "undefined" && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window)) || setTimeout;
var nextFrame$1 = function nextFrame$1(fn) {
raf$1(function () {
raf$1(fn);

1908
src/core/9.popper.js

File diff suppressed because it is too large Load Diff

12
src/core/action/action.js

@ -6,15 +6,11 @@
* @abstract
*/
BI.Action = BI.inherit(BI.OB, {
_defaultConfig: function () {
return BI.extend(BI.Action.superclass._defaultConfig.apply(this, arguments), {
props: function () {
return {
src: null,
tar: null
});
},
_init: function () {
BI.Action.superclass._init.apply(this, arguments);
};
},
actionPerformed: function (src, tar, callback) {
@ -36,4 +32,4 @@ BI.ActionFactory = {
}
return new action(options);
}
};
};

4
src/core/action/action.show.js

@ -5,10 +5,6 @@
* @extends BI.Action
*/
BI.ShowAction = BI.inherit(BI.Action, {
_defaultConfig: function () {
return BI.extend(BI.ShowAction.superclass._defaultConfig.apply(this, arguments), {});
},
actionPerformed: function (src, tar, callback) {
tar = tar || this.options.tar;
tar.setVisible(true);

7
src/core/behavior/0.behavior.js

@ -26,12 +26,7 @@ BI.Behavior = BI.inherit(BI.OB, {
});
},
_init: function () {
BI.Behavior.superclass._init.apply(this, arguments);
},
doBehavior: function () {
}
});
});

11
src/core/behavior/behavior.highlight.js

@ -5,15 +5,6 @@
* @extends BI.Behavior
*/
BI.HighlightBehavior = BI.inherit(BI.Behavior, {
_defaultConfig: function () {
return BI.extend(BI.HighlightBehavior.superclass._defaultConfig.apply(this, arguments), {});
},
_init: function () {
BI.HighlightBehavior.superclass._init.apply(this, arguments);
},
doBehavior: function (items) {
var args = Array.prototype.slice.call(arguments, 1),
o = this.options;
@ -39,4 +30,4 @@ BI.HighlightBehavior = BI.inherit(BI.Behavior, {
}
});
}
});
});

13
src/core/behavior/behavior.redmark.js

@ -5,17 +5,6 @@
* @extends BI.Behavior
*/
BI.RedMarkBehavior = BI.inherit(BI.Behavior, {
_defaultConfig: function () {
return BI.extend(BI.RedMarkBehavior.superclass._defaultConfig.apply(this, arguments), {
});
},
_init: function () {
BI.RedMarkBehavior.superclass._init.apply(this, arguments);
},
doBehavior: function (items) {
var args = Array.prototype.slice.call(arguments, 1),
o = this.options;
@ -31,4 +20,4 @@ BI.RedMarkBehavior = BI.inherit(BI.Behavior, {
}
});
}
});
});

5
src/core/controller/0.controller.js

@ -7,10 +7,5 @@
* @abstract
*/
BI.Controller = BI.inherit(BI.OB, {
_defaultConfig: function () {
return BI.extend(BI.Controller.superclass._defaultConfig.apply(this, arguments), {
});
}
});
BI.Controller.EVENT_CHANGE = "__EVENT_CHANGE__";

9
src/core/controller/controller.broadcast.js

@ -5,12 +5,7 @@
* @class
*/
BI.BroadcastController = BI.inherit(BI.Controller, {
_defaultConfig: function () {
return BI.extend(BI.BroadcastController.superclass._defaultConfig.apply(this, arguments), {});
},
_init: function () {
BI.BroadcastController.superclass._init.apply(this, arguments);
init: function () {
this._broadcasts = {};
},
@ -47,4 +42,4 @@ BI.BroadcastController = BI.inherit(BI.Controller, {
}
return this;
}
});
});

294
src/core/controller/controller.bubbles.js

@ -6,99 +6,8 @@
* @class
*/
BI.BubblesController = BI.inherit(BI.Controller, {
_defaultConfig: function () {
return BI.extend(BI.BubblesController.superclass._defaultConfig.apply(this, arguments), {});
},
_const: {
bubbleHeight: 18
},
_init: function () {
BI.BubblesController.superclass._init.apply(this, arguments);
var self = this;
this.fixedBubblesManager = {};
this.fixedStoreBubbles = {};
this.bubblesManager = {};
init: function () {
this.storeBubbles = {};
BI.Resizers.add("bubbleController" + BI.uniqueId(), function () {
BI.each(self.fixedBubblesManager, function (name) {
self.remove(name);
});
self.fixedBubblesManager = {};
self.fixedStoreBubbles = {};
});
},
_createBubble: function (direct, text, level, height, fixed) {
return BI.createWidget({
type: fixed === false ? "bi.bubble_view" : "bi.bubble",
text: text,
level: level,
height: height || 18,
direction: direct
});
},
_getOffsetLeft: function (name, context, offsetStyle) {
var left = 0;
if ("center" === offsetStyle) {
left = context.element.offset().left + (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
if (left < 0) {
left = 0;
}
return left;
}
if ("right" === offsetStyle) {
left = context.element.offset().left + context.element.bounds().width - this.get(name).element.bounds().width;
if (left < 0) {
left = 0;
}
return left;
}
return context.element.offset().left;
},
_getOffsetTop: function (name, context, offsetStyle) {
var top = 0;
if ("center" === offsetStyle) {
top = context.element.offset().top + (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
if (top < 0) {
top = 0;
}
return top;
} else if ("right" === offsetStyle) {
top = context.element.offset().top + context.element.bounds().height - this.get(name).element.bounds().height;
if (top < 0) {
top = 0;
}
return top;
}
return context.element.offset().top;
},
_getLeftPosition: function (name, context, offsetStyle) {
var position = BI.DOM.getLeftPosition(context, this.get(name));
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},
_getBottomPosition: function (name, context, offsetStyle) {
var position = BI.DOM.getBottomPosition(context, this.get(name));
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getTopPosition: function (name, context, offsetStyle) {
var position = BI.DOM.getTopPosition(context, this.get(name));
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getRightPosition: function (name, context, offsetStyle) {
var position = BI.DOM.getRightPosition(context, this.get(name));
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},
/**
@ -116,189 +25,60 @@ BI.BubblesController = BI.inherit(BI.Controller, {
var level = opt.level || "error";
var adjustYOffset = opt.adjustYOffset || 0;
var adjustXOffset = opt.adjustXOffset || 0;
var fixed = opt.fixed !== false;
// 如果是非固定位置(fixed)的bubble
if (fixed === false) {
if (!this.storeBubbles[name]) {
this.storeBubbles[name] = {};
}
if (!this.storeBubbles[name]["top"]) {
this.storeBubbles[name]["top"] = this._createBubble("top", text, level, null, fixed);
}
BI.createWidget({
type: "bi.absolute",
element: container,
items: [{
el: this.storeBubbles[name]["top"]
}]
// var fixed = opt.fixed !== false;
if (!this.storeBubbles[name]) {
this.storeBubbles[name] = BI.createWidget({
type: "bi.label",
cls: "bi-bubble" + " bubble-" + level,
text: text,
hgap: 5,
height: 18
});
this.set(name, this.storeBubbles[name]["top"]);
var bubble = this.storeBubbles[name]["top"];
var bounds = bubble.element.bounds();
if (BI.DOM.isTopSpaceEnough(context, this.get(name), adjustYOffset)) {
var top = -(bounds.height + adjustYOffset);
switch (offsetStyle) {
case "center":
bubble.element.css({
left: (context.element.bounds().width - bounds.width) / 2 + adjustXOffset,
top: top
});
break;
case "right":
bubble.element.css({
right: adjustXOffset,
top: top
});
break;
default:
bubble.element.css({
left: adjustXOffset,
top: top
});
break;
}
} else {
var bottom = -(bounds.height + adjustYOffset);
switch (offsetStyle) {
case "center":
bubble.element.css({
left: (context.element.bounds().width - bounds.width) / 2 + adjustXOffset,
bottom: bottom
});
break;
case "right":
bubble.element.css({
right: adjustXOffset,
bottom: bottom
});
break;
default:
bubble.element.css({
left: adjustXOffset,
bottom: bottom
});
break;
}
}
} else {
if (!this.fixedStoreBubbles[name]) {
this.fixedStoreBubbles[name] = {};
}
if (!this.fixedStoreBubbles[name]["top"]) {
this.fixedStoreBubbles[name]["top"] = this._createBubble("top", text, level, null, fixed);
}
BI.createWidget({
type: "bi.absolute",
element: container,
items: [{
el: this.fixedStoreBubbles[name]["top"]
}]
});
this.set(name, this.fixedStoreBubbles[name]["top"]);
var position = this._getTopPosition(name, context, offsetStyle);
this.get(name).element.css({left: position.left + adjustXOffset, top: position.top - adjustYOffset});
if (!BI.DOM.isTopSpaceEnough(context, this.get(name), adjustYOffset)) {
this.get(name).invisible();
if (!this.fixedStoreBubbles[name]["bottom"]) {
this.fixedStoreBubbles[name]["bottom"] = this._createBubble("bottom", text, level);
}
BI.createWidget({
type: "bi.absolute",
element: container,
items: [{
el: this.fixedStoreBubbles[name]["bottom"]
}]
});
this.set(name, this.fixedStoreBubbles[name]["bottom"]);
var position = this._getBottomPosition(name, context, offsetStyle);
this.get(name).element.css({left: position.left + adjustXOffset, top: position.top + adjustYOffset});
if (!BI.DOM.isBottomSpaceEnough(context, this.get(name), adjustYOffset)) {
this.get(name).invisible();
if (!this.fixedStoreBubbles[name]["right"]) {
this.fixedStoreBubbles[name]["right"] = this._createBubble("right", text, level);
}
BI.createWidget({
type: "bi.absolute",
element: container,
items: [{
el: this.fixedStoreBubbles[name]["right"]
}]
});
this.set(name, this.fixedStoreBubbles[name]["right"]);
var position = this._getRightPosition(name, context, offsetStyle);
this.get(name).element.css({
left: position.left + adjustXOffset,
top: position.top - adjustYOffset
});
if (!BI.DOM.isRightSpaceEnough(context, this.get(name), adjustXOffset)) {
this.get(name).invisible();
if (!this.fixedStoreBubbles[name]["left"]) {
this.fixedStoreBubbles[name]["left"] = this._createBubble("left", text, level, 30);
}
BI.createWidget({
type: "bi.absolute",
element: container,
items: [{
el: this.fixedStoreBubbles[name]["left"]
}]
});
this.set(name, this.fixedStoreBubbles[name]["left"]);
var position = this._getLeftPosition(name, context, offsetStyle);
this.get(name).element.css({
left: position.left - adjustXOffset,
top: position.top - adjustYOffset
});
}
var bubble = this.storeBubbles[name];
BI.createWidget({
type: "bi.default",
element: container,
items: [{
el: bubble
}]
});
BI.Popper.createPopper(context.element[0], bubble.element[0], {
placement: ({
left: "top-start",
center: "top",
right: "top-end"
})[offsetStyle],
strategy: "fixed",
modifiers: [
{
name: "offset",
options: {
offset: [adjustXOffset, adjustYOffset]
}
}
}
}
this.get(name).setText(text);
this.get(name).visible();
]
});
return this;
},
hide: function (name) {
if (!this.has(name)) {
return this;
}
this.get(name).invisible();
this.remove(name);
return this;
},
add: function (name, bubble) {
if (this.has(name)) {
return this;
}
this.set(name, bubble);
return this;
},
get: function (name) {
return this.fixedBubblesManager[name] || this.bubblesManager[name];
},
set: function (name, bubble, fixed) {
fixed === false ? (this.bubblesManager[name] = bubble) : (this.fixedBubblesManager[name] = bubble);
},
has: function (name) {
return this.fixedBubblesManager[name] != null || this.bubblesManager[name] != null;
return this.storeBubbles[name] != null;
},
remove: function (name) {
if (!this.has(name)) {
return this;
}
BI.each(this.fixedStoreBubbles[name], function (dir, bubble) {
bubble.destroy();
});
delete this.fixedStoreBubbles[name];
delete this.fixedBubblesManager[name];
BI.each(this.storeBubbles[name], function (dir, bubble) {
bubble.destroy();
});
this.storeBubbles[name].destroy();
delete this.storeBubbles[name];
delete this.bubblesManager[name];
return this;
}
});

13
src/core/controller/controller.layer.js

@ -5,14 +5,13 @@
* @class
*/
BI.LayerController = BI.inherit(BI.Controller, {
_defaultConfig: function () {
return BI.extend(BI.LayerController.superclass._defaultConfig.apply(this, arguments), {
props: function () {
return {
render: "body"
});
};
},
_init: function () {
BI.LayerController.superclass._init.apply(this, arguments);
init: function () {
this.layerManager = {};
this.layouts = {};
this.zindex = BI.zIndex_layer;
@ -125,7 +124,7 @@ BI.LayerController = BI.inherit(BI.Controller, {
add: function (name, layer, layout) {
if (this.has(name)) {
throw new Error("name is already exist");
throw new Error("不能创建同名的Layer");
}
layout.setVisible(false);
this.layerManager[name] = layer;
@ -167,4 +166,4 @@ BI.LayerController = BI.inherit(BI.Controller, {
this.layouts = {};
return this;
}
});
});

10
src/core/controller/controller.masker.js

@ -5,12 +5,8 @@
* @class
*/
BI.MaskersController = BI.inherit(BI.LayerController, {
_defaultConfig: function () {
return BI.extend(BI.MaskersController.superclass._defaultConfig.apply(this, arguments), {});
},
_init: function () {
BI.MaskersController.superclass._init.apply(this, arguments);
init: function () {
BI.MaskersController.superclass.init.apply(this, arguments);
this.zindex = BI.zIndex_masker;
}
});
});

9
src/core/controller/controller.popover.js

@ -5,15 +5,14 @@
* @extends BI.Controller
*/
BI.PopoverController = BI.inherit(BI.Controller, {
_defaultConfig: function () {
return BI.extend(BI.PopoverController.superclass._defaultConfig.apply(this, arguments), {
props: function () {
return {
modal: true, // 模态窗口
render: "body"
});
};
},
_init: function () {
BI.PopoverController.superclass._init.apply(this, arguments);
init: function () {
this.modal = this.options.modal;
this.floatManager = {};
this.floatLayer = {};

9
src/core/controller/controller.resizer.js

@ -5,12 +5,7 @@
* @class
*/
BI.ResizeController = BI.inherit(BI.Controller, {
_defaultConfig: function () {
return BI.extend(BI.ResizeController.superclass._defaultConfig.apply(this, arguments), {});
},
_init: function () {
BI.ResizeController.superclass._init.apply(this, arguments);
init: function () {
var self = this;
this.resizerManger = {};
var fn = BI.debounce(function (ev) {
@ -70,4 +65,4 @@ BI.ResizeController = BI.inherit(BI.Controller, {
delete this.resizerManger[name];
return this;
}
});
});

11
src/core/controller/controller.tooltips.js

@ -7,16 +7,7 @@
* @extends BI.Controller
*/
BI.TooltipsController = BI.inherit(BI.Controller, {
_defaultConfig: function () {
return BI.extend(BI.TooltipsController.superclass._defaultConfig.apply(this, arguments), {});
},
_const: {
height: 18
},
_init: function () {
BI.TooltipsController.superclass._init.apply(this, arguments);
init: function () {
this.tooltipsManager = {};
this.showingTips = {};// 存储正在显示的tooltip
},

13
src/core/listener/listener.show.js

@ -6,8 +6,8 @@
* @extends BI.OB
*/
BI.ShowListener = BI.inherit(BI.OB, {
_defaultConfig: function () {
return BI.extend(BI.ShowListener.superclass._defaultConfig.apply(this, arguments), {
props: function () {
return {
eventObj: BI.createWidget(),
cardLayout: null,
cardNameCreator: function (v) {
@ -16,11 +16,10 @@ BI.ShowListener = BI.inherit(BI.OB, {
cardCreator: BI.emptyFn,
afterCardCreated: BI.emptyFn,
afterCardShow: BI.emptyFn
});
};
},
_init: function () {
BI.ShowListener.superclass._init.apply(this, arguments);
init: function () {
var self = this, o = this.options;
if (o.eventObj) {
o.eventObj.on(BI.Controller.EVENT_CHANGE, function (type, v, ob) {
@ -28,7 +27,7 @@ BI.ShowListener = BI.inherit(BI.OB, {
v = v || o.eventObj.getValue();
v = BI.isArray(v) ? (v.length > 1 ? v.toString() : v[0]) : v;
if (BI.isNull(v)) {
throw new Error("value cannot be null");
throw new Error("不能为null");
}
var cardName = o.cardNameCreator(v);
if (!o.cardLayout.isCardExisted(cardName)) {
@ -46,4 +45,4 @@ BI.ShowListener = BI.inherit(BI.OB, {
}
}
});
BI.ShowListener.EVENT_CHANGE = "EVENT_CHANGE";
BI.ShowListener.EVENT_CHANGE = "EVENT_CHANGE";

24
src/core/logic/logic.layout.js

@ -7,8 +7,8 @@
* @extends BI.Logic
*/
BI.VerticalLayoutLogic = BI.inherit(BI.Logic, {
_defaultConfig: function () {
return BI.extend(BI.VerticalLayoutLogic.superclass._defaultConfig.apply(this, arguments), {
props: function () {
return {
dynamic: false,
scrollable: null,
scrolly: false,
@ -20,7 +20,7 @@ BI.VerticalLayoutLogic = BI.inherit(BI.Logic, {
rgap: 0,
tgap: 0,
bgap: 0
});
};
},
createLogic: function () {
@ -56,8 +56,8 @@ BI.VerticalLayoutLogic = BI.inherit(BI.Logic, {
* @extends BI.Logic
*/
BI.HorizontalLayoutLogic = BI.inherit(BI.Logic, {
_defaultConfig: function () {
return BI.extend(BI.HorizontalLayoutLogic.superclass._defaultConfig.apply(this, arguments), {
props: function () {
return {
dynamic: false,
scrollable: null,
scrolly: false,
@ -69,7 +69,7 @@ BI.HorizontalLayoutLogic = BI.inherit(BI.Logic, {
rgap: 0,
tgap: 0,
bgap: 0
});
};
},
createLogic: function () {
@ -104,8 +104,8 @@ BI.HorizontalLayoutLogic = BI.inherit(BI.Logic, {
* @extends BI.OB
*/
BI.TableLayoutLogic = BI.inherit(BI.Logic, {
_defaultConfig: function () {
return BI.extend(BI.TableLayoutLogic.superclass._defaultConfig.apply(this, arguments), {
props: function () {
return {
dynamic: false,
scrollable: null,
scrolly: false,
@ -117,7 +117,7 @@ BI.TableLayoutLogic = BI.inherit(BI.Logic, {
hgap: 0,
vgap: 0,
items: []
});
};
},
createLogic: function () {
@ -151,8 +151,8 @@ BI.TableLayoutLogic = BI.inherit(BI.Logic, {
* @extends BI.Logic
*/
BI.HorizontalFillLayoutLogic = BI.inherit(BI.Logic, {
_defaultConfig: function () {
return BI.extend(BI.HorizontalFillLayoutLogic.superclass._defaultConfig.apply(this, arguments), {
props: function () {
return {
dynamic: false,
scrollable: null,
scrolly: false,
@ -164,7 +164,7 @@ BI.HorizontalFillLayoutLogic = BI.inherit(BI.Logic, {
rgap: 0,
tgap: 0,
bgap: 0
});
};
},
createLogic: function () {

6
src/core/wrapper/layout/adapt/absolute.leftrightvertical.js

@ -85,7 +85,7 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
addItem: function () {
// do nothing
throw new Error("cannot be added");
throw new Error("不能添加子组件");
},
populate: function (items) {
@ -137,11 +137,11 @@ BI.AbsoluteRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
addItem: function () {
// do nothing
throw new Error("cannot be added");
throw new Error("不能添加子组件");
},
populate: function (items) {
this.layout.populate(items);
}
});
BI.shortcut("bi.absolute_right_vertical_adapt", BI.AbsoluteRightVerticalAdaptLayout);
BI.shortcut("bi.absolute_right_vertical_adapt", BI.AbsoluteRightVerticalAdaptLayout);

10
src/core/wrapper/layout/adapt/adapt.leftrightvertical.js

@ -81,7 +81,7 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
addItem: function () {
// do nothing
throw new Error("cannot be added");
throw new Error("不能添加子组件");
},
populate: function (items) {
@ -97,6 +97,7 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-l-v-a",
items: [],
columnSize: [],
lgap: 0,
rgap: 0,
hgap: 0,
@ -114,6 +115,7 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
self.layout = _ref;
},
items: o.items,
columnSize: o.columnSize,
hgap: o.hgap,
lgap: o.lgap,
rgap: o.rgap,
@ -132,7 +134,7 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
addItem: function () {
// do nothing
throw new Error("cannot be added");
throw new Error("不能添加子组件");
},
populate: function (items) {
@ -146,6 +148,7 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.RightVerticalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-r-v-a",
items: [],
columnSize: [],
lgap: 0,
rgap: 0,
hgap: 0,
@ -164,6 +167,7 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
},
horizontalAlign: BI.HorizontalAlign.Right,
items: o.items,
columnSize: o.columnSize,
hgap: o.hgap,
lgap: o.lgap,
rgap: o.rgap,
@ -182,7 +186,7 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
addItem: function () {
// do nothing
throw new Error("cannot be added");
throw new Error("不能添加子组件");
},
populate: function (items) {

2
src/core/wrapper/layout/flex/flex.leftrightvertical.center.js

@ -75,7 +75,7 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
addItem: function () {
// do nothing
throw new Error("cannot be added");
throw new Error("不能添加子组件");
},
populate: function (items) {

2
src/core/wrapper/layout/layout.border.js

@ -22,7 +22,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
addItem: function (item) {
// do nothing
throw new Error("cannot be added");
throw new Error("不能添加子组件");
},
stroke: function (regions) {

6
src/core/wrapper/layout/layout.card.js

@ -70,7 +70,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
getCardByName: function (cardName) {
if (!this.isCardExisted(cardName)) {
throw new Error("cardName is not exist");
throw new Error("cardName不存在", cardName);
}
return this._children[this._getChildName(cardName)];
},
@ -87,7 +87,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
deleteCardByName: function (cardName) {
if (!this.isCardExisted(cardName)) {
throw new Error("cardName is not exist");
throw new Error("cardName不存在", cardName);
}
var child = this._children[this._getChildName(cardName)];
@ -97,7 +97,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
addCardByName: function (cardName, cardItem) {
if (this.isCardExisted(cardName)) {
throw new Error("cardName is already exist");
throw new Error("cardName 已存在", cardName);
}
var widget = BI._lazyCreateWidget(cardItem, this);
widget.element.css({

4
src/core/wrapper/layout/layout.division.js

@ -47,7 +47,7 @@ BI.DivisionLayout = BI.inherit(BI.Layout, {
addItem: function (item) {
// do nothing
throw new Error("cannot be added");
throw new Error("不能添加子组件");
},
stroke: function (items) {
@ -112,7 +112,7 @@ BI.DivisionLayout = BI.inherit(BI.Layout, {
var totalW = 0;
for (var j = 0; j < columns; j++) {
if (!map[i][j]) {
throw new Error("item be required");
throw new Error("item(" + i + "" + j + ") 必须", map);
}
if (!this.hasWidget(this._getChildName(i + "_" + j))) {
var w = BI._lazyCreateWidget(map[i][j]);

2
src/core/wrapper/layout/layout.grid.js

@ -41,7 +41,7 @@ BI.GridLayout = BI.inherit(BI.Layout, {
addItem: function () {
// do nothing
throw new Error("cannot be added");
throw new Error("不能添加子组件");
},
stroke: function (items) {

2
src/core/wrapper/layout/layout.inline.js

@ -99,7 +99,7 @@ BI.InlineLayout = BI.inherit(BI.Layout, {
},
addItem: function (item) {
throw new Error("不能添加元素");
throw new Error("不能添加子组件");
},
populate: function (items) {

4
src/core/wrapper/layout/layout.table.js

@ -88,7 +88,7 @@ BI.TableLayout = BI.inherit(BI.Layout, {
}, arr[j]));
right += o.columnSize[j] + (o.columnSize[j] < 1 ? 0 : o.hgap);
} else {
throw new Error("item with fill can only be one");
throw new Error("构造错误", arr);
}
}
if (i >= 0 && i < arr.length) {
@ -123,7 +123,7 @@ BI.TableLayout = BI.inherit(BI.Layout, {
addItem: function (arr) {
if (!BI.isArray(arr)) {
throw new Error("item must be array");
throw new Error("必须是数组", arr);
}
return BI.TableLayout.superclass.addItem.apply(this, arguments);
},

4
src/core/wrapper/layout/layout.tape.js

@ -28,7 +28,7 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
},
addItem: function (item) {
// do nothing
throw new Error("cannot be added");
throw new Error("不能添加子组件");
},
stroke: function (items) {
@ -168,7 +168,7 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
addItem: function (item) {
// do nothing
throw new Error("cannot be added");
throw new Error("不能添加子组件");
},
stroke: function (items) {

2
src/core/wrapper/layout/layout.td.js

@ -163,7 +163,7 @@ BI.TdLayout = BI.inherit(BI.Layout, {
addItem: function (arr) {
if (!BI.isArray(arr)) {
throw new Error("item must be array");
throw new Error("必须是数组", arr);
}
return BI.TdLayout.superclass.addItem.apply(this, arguments);
},

4
src/core/wrapper/layout/layout.window.js

@ -31,7 +31,7 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
addItem: function (item) {
// do nothing
throw new Error("cannot be added");
throw new Error("不能添加子组件");
},
stroke: function (items) {
@ -83,7 +83,7 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
for (var i = 0; i < o.rows; i++) {
for (var j = 0; j < o.columns; j++) {
if (!o.items[i][j]) {
throw new Error("item be required");
throw new Error("构造错误", o.items);
}
if (!this.hasWidget(this._getChildName(i + "_" + j))) {
var w = BI._lazyCreateWidget(o.items[i][j]);

2
src/core/wrapper/layout/middle/middle.center.js

@ -62,7 +62,7 @@ BI.CenterLayout = BI.inherit(BI.Layout, {
addItem: function (item) {
// do nothing
throw new Error("cannot be added");
throw new Error("不能添加子组件");
},
update: function (opt) {

2
src/core/wrapper/layout/middle/middle.float.center.js

@ -61,7 +61,7 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, {
addItem: function (item) {
// do nothing
throw new Error("cannot be added");
throw new Error("不能添加子组件");
},
update: function (opt) {

2
src/core/wrapper/layout/middle/middle.horizontal.js

@ -60,7 +60,7 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, {
addItem: function (item) {
// do nothing
throw new Error("cannot be added");
throw new Error("不能添加子组件");
},
update: function (opt) {

2
src/core/wrapper/layout/middle/middle.vertical.js

@ -61,7 +61,7 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, {
addItem: function (item) {
// do nothing
throw new Error("cannot be added");
throw new Error("不能添加子组件");
},
update: function (opt) {

4
src/data/pool/pool.buffer.js

@ -10,7 +10,7 @@
BI.BufferPool = {
put: function (name, cache) {
if (BI.isNotNull(Buffer[name])) {
throw new Error("Buffer Pool has the key already!");
throw new Error("key值:[" + name + "] 已存在!", Buffer);
}
Buffer[name] = cache;
},
@ -19,4 +19,4 @@
return Buffer[name];
}
};
})();
})();

17
src/less/base/single/tip/tip.bubble.less

@ -1,30 +1,29 @@
@import "../../../index";
.bi-bubble{
& .bubble-text{
.border-radius(2px);
}
.bi-bubble {
z-index: @zIndex-tip;
.border-radius(2px);
& .bubble-error{
&.bubble-error{
background: @color-bi-background-light-failure;
color: @color-bi-text-failure;
}
.bi-theme-dark & .bubble-error {
.bi-theme-dark &.bubble-error {
background: @color-bi-background-dark-failure;
}
& .bubble-common{
&.bubble-common{
background: @color-bi-background-light-highlight;
color: @color-bi-text-highlight;
}
& .bubble-success{
&.bubble-success{
background: @color-bi-background-light-success;
color: @color-bi-text-success;
}
& .bubble-warning{
&.bubble-warning{
background: @color-bi-background-light-warning;
color: @color-bi-text-redmark;
}

31
src/widget/multiselect/multiselect.combo.js

@ -336,26 +336,27 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
var self = this; var o = this.options;
this._assertValue(res);
this.requesting = true;
if (this.storeValue.type === res.type) {
var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey());
var change = false;
var map = this._makeMap(this.storeValue.value);
BI.each(BI.concat(result.match, result.find), function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
self.storeValue.assist && self.storeValue.assist.push(map[v]);
delete map[v];
}
});
change && (this.storeValue.value = BI.values(map));
this._adjust(callback);
return;
}
o.itemsCreator({
type: BI.MultiSelectCombo.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()],
selectedValues: this.storeValue.value,
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
self.storeValue.assist && self.storeValue.assist.push(map[v]);
delete map[v];
}
});
change && (self.storeValue.value = BI.values(map));
self._adjust(callback);
return;
}
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];

32
src/widget/multiselect/multiselect.combo.nobar.js

@ -363,25 +363,27 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
var self = this, o = this.options;
this._assertValue(res);
this.requesting = true;
if (this.storeValue.type === res.type) {
var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey());
var change = false;
var map = self._makeMap(this.storeValue.value);
BI.each(BI.concat(result.match, result.find), function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
self.storeValue.assist && self.storeValue.assist.push(map[v]);
delete map[v];
}
});
change && (this.storeValue.value = BI.values(map));
this._adjust(callback);
return;
}
o.itemsCreator({
type: BI.MultiSelectNoBarCombo.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()]
keywords: [this.trigger.getKey()],
selectedValues: this.storeValue.value,
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
self.storeValue.assist && self.storeValue.assist.push(map[v]);
delete map[v];
}
});
change && (self.storeValue.value = BI.values(map));
self._adjust(callback);
return;
}
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];

32
src/widget/multiselect/multiselect.insert.combo.js

@ -350,25 +350,27 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
var self = this, o = this.options;
this._assertValue(res);
this.requesting = true;
if (this.storeValue.type === res.type) {
var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey());
var change = false;
var map = this._makeMap(this.storeValue.value);
BI.each(BI.concat(result.match, result.find), function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
self.storeValue.assist && self.storeValue.assist.push(map[v]);
delete map[v];
}
});
change && (this.storeValue.value = BI.values(map));
this._adjust(callback);
return;
}
o.itemsCreator({
type: BI.MultiSelectInsertCombo.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()]
keywords: [this.trigger.getKey()],
selectedValues: this.storeValue.value,
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
self.storeValue.assist && self.storeValue.assist.push(map[v]);
delete map[v];
}
});
change && (self.storeValue.value = BI.values(map));
self._adjust(callback);
return;
}
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];

32
src/widget/multiselect/multiselect.insert.combo.nobar.js

@ -348,25 +348,27 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
var self = this, o = this.options;
this._assertValue(res);
this.requesting = true;
if (this.storeValue.type === res.type) {
var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey());
var change = false;
var map = this._makeMap(this.storeValue.value);
BI.each(BI.concat(result.match, result.find), function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
self.storeValue.assist && self.storeValue.assist.push(map[v]);
delete map[v];
}
});
change && (this.storeValue.value = BI.values(map));
this._adjust(callback);
return;
}
o.itemsCreator({
type: BI.MultiSelectInsertNoBarCombo.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()]
keywords: [this.trigger.getKey()],
selectedValues: this.storeValue.value,
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
self.storeValue.assist && self.storeValue.assist.push(map[v]);
delete map[v];
}
});
change && (self.storeValue.value = BI.values(map));
self._adjust(callback);
return;
}
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];

2
src/widget/multiselect/search/multiselect.search.insert.pane.js

@ -31,7 +31,7 @@ BI.MultiSelectSearchInsertPane = BI.inherit(BI.Widget, {
type: "bi.label",
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
cls: "bi-high-light",
cls: "bi-keyword-red-mark",
hgap: 5,
});

30
src/widget/multiselectlist/multiselectlist.insert.js

@ -239,24 +239,26 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
_joinAll: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
if (this.storeValue.type === res.type) {
var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey());
var change = false;
var map = this._makeMap(this.storeValue.value);
BI.each(BI.concat(result.match, result.find), function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
delete map[v];
}
});
change && (this.storeValue.value = BI.values(map));
callback();
return;
}
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keywords: [self.trigger.getKeyword()]
keywords: [this.trigger.getKeyword()],
selectedValues: this.storeValue.value,
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
delete map[v];
}
});
change && (self.storeValue.value = BI.values(map));
callback();
return;
}
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];

30
src/widget/multiselectlist/multiselectlist.insert.nobar.js

@ -243,24 +243,26 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
_joinAll: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
if (this.storeValue.type === res.type) {
var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey());
var change = false;
var map = this._makeMap(this.storeValue.value);
BI.each(BI.concat(result.match, result.find), function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
delete map[v];
}
});
change && (this.storeValue.value = BI.values(map));
callback();
return;
}
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,
keywords: [self.trigger.getKeyword()]
keywords: [this.trigger.getKeyword()],
selectedValues: this.storeValue.value,
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
delete map[v];
}
});
change && (self.storeValue.value = BI.values(map));
callback();
return;
}
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];

30
src/widget/multiselectlist/multiselectlist.js

@ -229,24 +229,26 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
_joinAll: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
if (this.storeValue.type === res.type) {
var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey());
var change = false;
var map = this._makeMap(this.storeValue.value);
BI.each(BI.concat(result.match, result.find), function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
delete map[v];
}
});
change && (this.storeValue.value = BI.values(map));
this._adjust(callback);
return;
}
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()]
keywords: [this.trigger.getKey()],
selectedValues: this.storeValue.value,
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
delete map[v];
}
});
change && (self.storeValue.value = BI.values(map));
self._adjust(callback);
return;
}
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];

6
src/widget/yearmonth/trigger.yearmonth.js

@ -67,7 +67,11 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, {
height: o.height,
validationChecker: function (v) {
if (isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, parseInt(v, 10) === BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear() ? BI.parseDateTime(o.min, "%Y-%X-%d").getMonth() + 1 : 1, 1, o.min, o.max)[0]);
var month = self.monthEditor.getValue();
if(BI.isEmptyString(month)) {
month = parseInt(v, 10) === BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear() ? (BI.parseDateTime(o.min, "%Y-%X-%d").getMonth() + 1) : 1;
}
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, month, 1, o.min, o.max)[0]);
}
var year = self.yearEditor.getValue();

8
src/widget/yearquarter/trigger.yearquarter.js

@ -65,7 +65,13 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, {
height: o.height,
validationChecker: function (v) {
if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, parseInt(v, 10) === BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear() ? BI.parseDateTime(o.min, "%Y-%X-%d").getMonth() + 1 : 1, 1, o.min, o.max)[0]);
var month = self.quarterEditor.getValue();
if(BI.isEmptyString(month)) {
month = parseInt(v, 10) === BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear() ? BI.parseDateTime(o.min, "%Y-%X-%d").getMonth() + 1 : 1;
} else {
month = (v - 1) * 3 + 1;
}
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, month, 1, o.min, o.max)[0]);
}
var year = self.yearEditor.getValue();

4
typescript/base/single/img/img.ts

@ -3,6 +3,10 @@ import { Single } from "../single";
export declare class Img extends Single {
static xtype: string;
props: {
src: string;
} & Single['props'];
setSrc(src: string): void;
getSrc(): string;
}

Loading…
Cancel
Save