Browse Source

Merge pull request #603 in VISUAL/fineui from ~GUY/fineui:master to master

* commit '919c2080760a940eb67cb1206e0793b1845bad15':
  update
  update
  update
  node环境
  update
  add
  update
  update
  added
  multiselect loader
es6
Young 6 years ago
parent
commit
6fcbfe1cf9
  1. 55
      Gruntfile.js
  2. 72
      demo/js/base/tree/demo.part_tree.js
  3. 6
      demo/js/base/tree/demo.sync_tree.js
  4. 137
      demo/js/category/largeTable/largeTable.js
  5. 4
      demo/js/config/category.js
  6. 14
      demo/js/face.js
  7. 39
      dist/_fineui.min.js
  8. 299
      dist/base.js
  9. 695
      dist/bundle.js
  10. 78
      dist/bundle.min.js
  11. 365
      dist/core.js
  12. 234
      dist/demo.js
  13. 701
      dist/fineui.js
  14. 78
      dist/fineui.min.js
  15. 65375
      dist/fineui_without_jquery_polyfill.js
  16. 4
      dist/fix/fix.compact.js
  17. 6
      dist/fix/fix.js
  18. 6
      dist/polyfill.js
  19. 8
      dist/router.js
  20. 138
      dist/utils.js
  21. 10
      dist/utils.min.js
  22. 13
      dist/widget.js
  23. 742
      package-lock.json
  24. 280
      src/base/single/button/buttons/button.js
  25. 12
      src/base/single/input/file.js
  26. 4
      src/base/tree/treeview.js
  27. 20
      src/core/alias.js
  28. 58
      src/core/base.js
  29. 6
      src/core/config.js
  30. 2
      src/core/controller/controller.resizer.js
  31. 14
      src/core/foundation.js
  32. 4
      src/core/func/dom.js
  33. 18
      src/core/inject.js
  34. 2
      src/core/ob.js
  35. 2
      src/core/proto/date.i18n.js
  36. 2
      src/core/shortcut.js
  37. 12
      src/core/utils/detectElementResize.js
  38. 14
      src/core/utils/events/mousemovetracker.js
  39. 2
      src/core/utils/events/wheelhandler.js
  40. 2
      src/core/utils/prefixIntervalTree.js
  41. 50
      src/core/widget.js
  42. 6
      src/core/wrapper/layout.js
  43. 17
      src/core/wrapper/layout/adapt/adapt.center.js
  44. 17
      src/core/wrapper/layout/adapt/adapt.horizontal.js
  45. 17
      src/core/wrapper/layout/adapt/adapt.vertical.js
  46. 17
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js
  47. 17
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js
  48. 17
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js
  49. 18
      src/core/wrapper/layout/layout.horizontal.js
  50. 17
      src/core/wrapper/layout/layout.td.js
  51. 2
      src/polyfill/console.js
  52. 2
      src/polyfill/localStorage.js
  53. 2
      src/polyfill/sort.js
  54. 8
      src/router/router.js
  55. 2
      src/third/jquery.mousewheel.js
  56. 13
      src/widget/multiselect/multiselect.loader.js

55
Gruntfile.js

@ -13,9 +13,9 @@ module.exports = function (grunt) {
},
coreJs: {
src: [
"src/core/foundation.js",
"src/core/jquery.js",
"src/core/lodash.js",
"src/core/foundation.js",
// 'src/core/mvc/**/*.js',
"src/core/base.js",
"src/core/ob.js",
@ -128,6 +128,52 @@ module.exports = function (grunt) {
dest: "dist/fineui.js"
},
fineuiWithoutJqueryAndPolyfillJs: {
src: ["src/core/foundation.js",
"src/core/lodash.js",
// 'src/core/mvc/**/*.js',
"src/core/base.js",
"src/core/ob.js",
"src/core/widget.js",
// 'src/core/model.js',
// 'src/core/view.js',
"src/core/shortcut.js",
"src/core/utils/*.js",
"src/core/behavior/behavior.js",
"src/core/wrapper/layout.js",
"src/core/plugin.js",
"src/core/**/*.js",
"!src/core/jquery.js",
"!src/core/func/dom.js",
"!src/core/proto/jquery.js",
"!src/core/proto/event.js",
"src/data/data.js",
"src/data/**/*.js",
"dist/fix/fix.js",
"src/base/pane.js",
"src/base/single/single.js",
"src/base/single/text.js",
"src/base/single/button/button.basic.js",
"src/base/single/button/button.node.js",
"src/base/single/tip/tip.js",
"src/base/combination/group.button.js",
"src/base/combination/tree.button.js",
"src/base/combination/map.button.js",
"src/base/**/*.js",
"!src/base/tree/**/*.js",
"!src/base/single/input/file.js",
"src/case/combo/popup.bubble.js",
"src/case/**/*.js",
"!src/case/colorchooser/**/*.js",
"!src/case/tree/tree.display.js",
"dist/widget.js", "dist/fix/fix.compact.js", "ui/js/**/*.js", "!ui/js/fineui.i18n.js"],
dest: "dist/fineui_without_jquery_polyfill.js"
},
fineuiCss: {
src: ["dist/core.css", "dist/base.css", "dist/widget.css", "ui/css/app.css", "ui/css/**/*.css"],
dest: "dist/fineui.css"
@ -147,8 +193,8 @@ module.exports = function (grunt) {
},
utilsJs: {
src: [
"src/core/lodash.js",
"src/core/foundation.js",
"src/core/lodash.js",
"src/core/var.js",
"src/core/proto/array.js",
"src/core/proto/number.js",
@ -250,7 +296,7 @@ module.exports = function (grunt) {
},
watch: {
scripts: {
files: ["src/**/*", "demo/js/**/*.js", "demo/version.js", "demo/config.js", "demo/less/**/*.less"],
files: ["src/**/*.js", "src/**/*.less", "demo/js/**/*.js", "demo/version.js", "demo/config.js", "demo/less/**/*.less"],
tasks: ["less", "concat"],
options: {
spanw: true,
@ -291,12 +337,11 @@ module.exports = function (grunt) {
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks('grunt-contrib-clean');
var defaultTask = ["clean", "less", "concat", "connect", "watch"];
var defaultTask = ["less", "concat", "connect", "watch"];
grunt.registerTask("default", defaultTask);
grunt.registerTask("compile", function () {
grunt.config.set("connect.options.open", false);
grunt.task.run(defaultTask);
});
grunt.registerTask("min", ["clean", "less", "concat", "uglify", "cssmin"]);
grunt.registerTask("build", ["clean", "less", "cssmin", "concat", "uglify"]);
};

72
demo/js/base/tree/demo.part_tree.js

@ -3,7 +3,79 @@ Demo.Func = BI.inherit(BI.Widget, {
baseCls: "demo-func"
},
mounted: function () {
this.partTree.stroke({
keyword: "1"
});
},
render: function () {
var self = this;
return {
type: "bi.vtape",
items: [{
type: "bi.label",
height: 50,
text: "先初始化一份数据,然后再异步获取数据的树"
}, {
type: "bi.part_tree",
ref: function (_ref) {
self.partTree = _ref;
},
paras: {
selectedValues: {"1": {}, "2": {"1": {}}}
},
itemsCreator: function (op, callback) {
if (op.type === BI.TreeView.REQ_TYPE_INIT_DATA) {
callback({
items: [{
id: "1",
text: 1,
isParent: true,
open: true
}, {
id: "11",
pId: "1",
text: 11,
isParent: true,
open: true
}, {
id: "111",
pId: "11",
text: 111,
isParent: true
}, {
id: "2",
text: 2
}, {
id: "3",
text: 3
}],
hasNext: BI.isNull(op.id)
});
return;
}
callback({
items: [{
id: (op.id || "") + "1",
pId: op.id,
text: 1,
isParent: true
}, {
id: (op.id || "") + "2",
pId: op.id,
text: 2
}, {
id: (op.id || "") + "3",
pId: op.id,
text: 3
}],
hasNext: BI.isNull(op.id)
});
}
}]
};
}
});
BI.shortcut("demo.part_tree", Demo.Func);

6
demo/js/base/tree/demo.sync_tree.js

@ -4,7 +4,9 @@ Demo.Func = BI.inherit(BI.Widget, {
},
mounted: function () {
this.syncTree.stroke();
this.syncTree.stroke({
keyword: "1"
});
},
render: function () {
@ -21,7 +23,7 @@ Demo.Func = BI.inherit(BI.Widget, {
self.syncTree = _ref;
},
paras: {
selectedValues: {"_0": {}, "_5": {"_5_0": {}}}
selectedValues: {"1": {}, "2": {"1": {}}}
},
itemsCreator: function (op, callback) {
callback({

137
demo/js/category/largeTable/largeTable.js

@ -1,137 +0,0 @@
Demo.Face = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-face"
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.sequence_table",
ref: function () {
self.table = this;
},
isNeedFreeze: null,
isNeedMerge: false,
summaryCellStyleGetter: function (isLast) {
return {
background: "rgb(4, 177, 194)",
color: "#ffffff",
fontWeight: "bold"
};
},
sequenceCellStyleGetter: function (index) {
return {
background: "rgb(4, 177, 194)",
color: "#ffffff",
fontWeight: "bold"
};
},
headerCellStyleGetter: function () {
return {
background: "rgb(4, 177, 194)",
color: "#ffffff",
fontWeight: "bold"
};
},
el: {
type: "bi.adaptive_table",
el: {
type: "bi.resizable_table",
el: {
type: "bi.grid_table"
}
}
},
sequence: {
type: "bi.sequence_table_list_number",
pageSize: 100,
sequenceHeaderCreator: function () {
return {
type: "bi.normal_sequence_header_cell",
styleGetter: function () {
return {
background: "rgb(4, 177, 194)",
color: "#ffffff",
fontWeight: "bold"
};
}
};
}
},
itemsCreator: function (op, populate) {
}
},
left: 0,
right: 0,
top: 0,
bottom: 0
}]
};
},
mounted: function () {
var self = this;
if (BI.isNull(BI.isExpanded)) {
BI.isExpanded = false;
} else if (!BI.isExpanded) {
TABLE_ITEMS = this._expandData(TABLE_ITEMS, 3);
TABLE_HEADER = this._expandHeadData(TABLE_HEADER, 3);
BI.isExpanded = true;
}
this._resizeHandler = BI.debounce(function () {
var width = self.element.width(), height = self.element.height();
if (self.table.getWidth() !== width || self.table.getHeight() !== height) {
self.table.setWidth(width);
self.table.setHeight(height);
self.table.populate();
}
}, 0);
BI.ResizeDetector.addResizeListener(this, function () {
self._resizeHandler();
});
this.table.setWidth(this.element.width());
this.table.setHeight(this.element.height());
this.table.attr("columnSize", BI.makeArray(TABLE_HEADER[0].length, ""));
this.table.attr("minColumnSize", BI.makeArray(TABLE_HEADER[0].length, 60));
this.table.attr("isNeedFreeze", true);
this.table.attr("freezeCols", []);
this.table.attr("showSequence", true);
this.table.attr("headerRowSize", 15);
this.table.attr("rowSize", 15);
this.table.populate(TABLE_ITEMS, TABLE_HEADER);
},
_expandData: function (items, times) {
var copy = BI.deepClone(items);
for (var m = 0; m < times - 1; m++) {
BI.each(items, function (i, row) {
copy.push(row);
});
}
for (var n = 0; n < copy.length; n++) {
for (var m = 0; m < times - 1; m++) {
BI.each(items[n % 100], function (j, item) {
copy[n].push(item);
});
}
}
return copy;
},
_expandHeadData: function (items, times) {
var copy = BI.deepClone(items);
for (var n = 0; n < copy.length; n++) {
for (var m = 0; m < times - 1; m++) {
BI.each(items[n], function (j, item) {
copy[n].push(item);
});
}
}
return copy;
}
});
BI.shortcut("demo.large_table", Demo.Face);

4
demo/js/config/category.js

@ -5,10 +5,6 @@ Demo.CATEGORY_CONFIG = [{
pId: 100000,
text: "自定义一棵树",
value: "demo.platform_level_tree"
}, {
pId: 100000,
text: "大表格",
value: "demo.large_table"
}, {
pId: 100000,
text: "可以排序的树",

14
demo/js/face.js

@ -548,20 +548,16 @@ Demo.Face = BI.inherit(BI.Widget, {
return {
type: "bi.grid",
items: [[{
column: 0,
row: 0,
el: {
type: "bi.layout"
}
}, {
column: 1,
row: 0,
el: {
type: "bi.vertical",
cls: "face-config bi-border-left",
cls: "face-config bi-border-right",
items: [this._createBaseConfig(),
this._createCommonConfig()]
}
}, {
el: {
type: "bi.layout"
}
}]]
};
},

39
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

299
dist/base.js vendored

@ -72,7 +72,7 @@
function handler (event) {
var orgEvent = event || window.event,
var orgEvent = event || _global.event,
args = slice.call(arguments, 1),
delta = 0,
deltaX = 0,
@ -1720,8 +1720,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
treeNode.times = treeNode.times || 1;
var param = "id=" + treeNode.id
+ "&times=" + (treeNode.times++)
+ "&parentValues= " + window.encodeURIComponent(BI.jsonEncode(parentNode))
+ "&checkState=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));
+ "&parentValues= " + _global.encodeURIComponent(BI.jsonEncode(parentNode))
+ "&checkState=" + _global.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));
return "&" + param;
}
@ -6983,158 +6983,157 @@ BI.ImageButton = BI.inherit(BI.BasicButton, {
}
});
BI.ImageButton.EVENT_CHANGE = "ImageButton.EVENT_CHANGE";
BI.shortcut("bi.image_button", BI.ImageButton);(function ($) {
BI.shortcut("bi.image_button", BI.ImageButton);
/**
* 文字类型的按钮
* @class BI.Button
* @extends BI.BasicButton
*
* @cfg {JSON} options 配置属性
* @cfg {'common'/'success'/'warning'/'ignore'} [options.level='common'] 按钮类型用不同颜色强调不同的场景
*/
BI.Button = BI.inherit(BI.BasicButton, {
/**
* 文字类型的按钮
* @class BI.Button
* @extends BI.BasicButton
*
* @cfg {JSON} options 配置属性
* @cfg {'common'/'success'/'warning'/'ignore'} [options.level='common'] 按钮类型用不同颜色强调不同的场景
*/
BI.Button = BI.inherit(BI.BasicButton, {
_defaultConfig: function (props) {
var conf = BI.Button.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-button",
minWidth: (props.block === true || props.clear === true) ? 0 : 80,
height: 24,
shadow: props.clear !== true,
isShadowShowingOnSelected: true,
readonly: true,
iconCls: "",
level: "common",
block: false, // 是否块状显示,即不显示边框,没有最小宽度的限制
clear: false, // 是否去掉边框和背景
ghost: false, // 是否幽灵显示, 即正常状态无背景
textAlign: "center",
whiteSpace: "nowrap",
forceCenter: false,
textWidth: null,
textHeight: null,
hgap: props.clear ? 0 : 10,
vgap: 0,
tgap: 0,
bgap: 0,
lgap: 0,
rgap: 0
});
},
_defaultConfig: function (props) {
var conf = BI.Button.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-button",
minWidth: (props.block === true || props.clear === true) ? 0 : 80,
height: 24,
shadow: props.clear !== true,
isShadowShowingOnSelected: true,
readonly: true,
iconCls: "",
level: "common",
block: false, // 是否块状显示,即不显示边框,没有最小宽度的限制
clear: false, // 是否去掉边框和背景
ghost: false, // 是否幽灵显示, 即正常状态无背景
textAlign: "center",
whiteSpace: "nowrap",
forceCenter: false,
textWidth: null,
textHeight: null,
hgap: props.clear ? 0 : 10,
vgap: 0,
tgap: 0,
bgap: 0,
lgap: 0,
rgap: 0
_init: function () {
BI.Button.superclass._init.apply(this, arguments);
var o = this.options, self = this;
if (BI.isNumber(o.height) && !o.clear && !o.block) {
this.element.css({height: o.height + "px", lineHeight: (o.height - 2) + "px"});
} else if (o.clear || o.block) {
this.element.css({lineHeight: o.height + "px"});
} else {
this.element.css({lineHeight: (o.height - 2) + "px"});
}
if (BI.isKey(o.iconCls)) {
this.icon = BI.createWidget({
type: "bi.icon",
width: 18,
height: o.height - 2
});
},
_init: function () {
BI.Button.superclass._init.apply(this, arguments);
var o = this.options, self = this;
if (BI.isNumber(o.height) && !o.clear && !o.block) {
this.element.css({height: o.height + "px", lineHeight: (o.height - 2) + "px"});
} else if (o.clear || o.block) {
this.element.css({lineHeight: o.height + "px"});
} else {
this.element.css({lineHeight: (o.height - 2) + "px"});
}
if (BI.isKey(o.iconCls)) {
this.icon = BI.createWidget({
type: "bi.icon",
width: 18,
height: o.height - 2
});
this.text = BI.createWidget({
type: "bi.label",
text: o.text,
value: o.value,
height: o.height - 2
});
BI.createWidget({
type: "bi.horizontal_auto",
cls: o.iconCls,
element: this,
hgap: o.hgap,
vgap: o.vgap,
tgap: o.tgap,
bgap: o.bgap,
lgap: o.lgap,
rgap: o.rgap,
items: [{
type: "bi.horizontal",
items: [this.icon, this.text]
}]
});
} else {
this.text = BI.createWidget({
type: "bi.label",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
forceCenter: o.forceCenter,
textWidth: o.textWidth,
textHeight: o.textHeight,
hgap: o.hgap,
vgap: o.vgap,
tgap: o.tgap,
bgap: o.bgap,
lgap: o.lgap,
rgap: o.rgap,
element: this,
text: o.text,
value: o.value
});
}
if (o.block === true) {
this.element.addClass("block");
}
if (o.clear === true) {
this.element.addClass("clear");
}
if (o.ghost === true) {
this.element.addClass("ghost");
}
if (o.minWidth > 0) {
this.element.css({"min-width": o.minWidth + "px"});
}
},
this.text = BI.createWidget({
type: "bi.label",
text: o.text,
value: o.value,
height: o.height - 2
});
BI.createWidget({
type: "bi.horizontal_auto",
cls: o.iconCls,
element: this,
hgap: o.hgap,
vgap: o.vgap,
tgap: o.tgap,
bgap: o.bgap,
lgap: o.lgap,
rgap: o.rgap,
items: [{
type: "bi.horizontal",
items: [this.icon, this.text]
}]
});
} else {
this.text = BI.createWidget({
type: "bi.label",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
forceCenter: o.forceCenter,
textWidth: o.textWidth,
textHeight: o.textHeight,
hgap: o.hgap,
vgap: o.vgap,
tgap: o.tgap,
bgap: o.bgap,
lgap: o.lgap,
rgap: o.rgap,
element: this,
text: o.text,
value: o.value
});
}
if (o.block === true) {
this.element.addClass("block");
}
if (o.clear === true) {
this.element.addClass("clear");
}
if (o.ghost === true) {
this.element.addClass("ghost");
}
if (o.minWidth > 0) {
this.element.css({"min-width": o.minWidth + "px"});
}
},
doClick: function () {
BI.Button.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.Button.EVENT_CHANGE, this);
}
},
doClick: function () {
BI.Button.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.Button.EVENT_CHANGE, this);
}
},
setText: function (text) {
BI.Button.superclass.setText.apply(this, arguments);
this.text.setText(text);
},
setText: function (text) {
BI.Button.superclass.setText.apply(this, arguments);
this.text.setText(text);
},
setValue: function (text) {
BI.Button.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(text);
}
},
setValue: function (text) {
BI.Button.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(text);
}
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
destroy: function () {
BI.Button.superclass.destroy.apply(this, arguments);
}
});
BI.shortcut("bi.button", BI.Button);
BI.Button.EVENT_CHANGE = "EVENT_CHANGE";
})(jQuery);/**
destroy: function () {
BI.Button.superclass.destroy.apply(this, arguments);
}
});
BI.shortcut("bi.button", BI.Button);
BI.Button.EVENT_CHANGE = "EVENT_CHANGE";
/**
* guy
* 可以点击的一行文字
* @class BI.TextButton
@ -9064,7 +9063,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
* @extends BI.Single
* @abstract
*/
(function () {
(function (document) {
/**
* @description normalize input.files. create if not present, add item method if not present
@ -9211,7 +9210,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
},
false
);
xhr.open("post", handler.url + "&filename=" + window.encodeURIComponent(handler.file.fileName), true);
xhr.open("post", handler.url + "&filename=" + _global.encodeURIComponent(handler.file.fileName), true);
if (!xhr.upload) {
var rpe = {loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true};
rpe.interval = setInterval(function () {
@ -9322,7 +9321,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
handler.attach_array.push(attachO);
}
} catch (e) {
if (isFunction(handler.onerror)) {handler.onerror(rpe, event || window.event);}
if (isFunction(handler.onerror)) {handler.onerror(rpe, event || _global.event);}
}
if (isFunction(handler.onload)) {handler.onload(rpe, {responseText: responseText});}
},
@ -9342,7 +9341,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
iframe.onload = onload;
iframe.onerror = function (event) {
if (isFunction(handler.onerror)) {
handler.onerror(rpe, event || window.event);
handler.onerror(rpe, event || _global.event);
}
};
iframe.onreadystatechange = function () {
@ -9364,7 +9363,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
});
}
};
form.setAttribute("action", handler.url + "&filename=" + window.encodeURIComponent(handler.file.fileName));
form.setAttribute("action", handler.url + "&filename=" + _global.encodeURIComponent(handler.file.fileName));
form.setAttribute("target", iframe.id);
form.setAttribute("method", "post");
form.appendChild(handler.file);
@ -9672,7 +9671,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
BI.File.EVENT_PROGRESS = "EVENT_PROGRESS";
BI.File.EVENT_UPLOADED = "EVENT_UPLOADED";
BI.shortcut("bi.file", BI.File);
})();/**
})(_global.document || {});/**
* guy
* @class BI.Input 一个button和一行数 组成的一行listitem
* @extends BI.Single

695
dist/bundle.js vendored

File diff suppressed because it is too large Load Diff

78
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

365
dist/core.js vendored

@ -1,4 +1,22 @@
/*!
/**
* Created by richie on 15/7/8.
*/
/**
* 初始化BI对象
*/
var _global;
if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (_global.BI == null) {
_global.BI = {};
}/*!
* jQuery JavaScript Library v1.9.1
* http://jquery.com/
*
@ -19704,21 +19722,22 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
}
}.call(this));
/**
* Created by richie on 15/7/8.
*/
/**
* 初始化BI对象
*/
if (window.BI == null) {
window.BI = {};
}/**
* 基本函数
* Create By GUY 2014\11\17
*
*/
if (!window.BI) {
window.BI = {};
var _global;
if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (!_global.BI) {
_global.BI = {};
}
!(function (undefined) {
@ -20160,7 +20179,7 @@ if (!window.BI) {
};
}
var F = function () {
}, spp = sp.prototype;
}, spp = sp.prototype;
F.prototype = spp;
sb.prototype = new F();
sb.superclass = spp;
@ -20446,11 +20465,11 @@ if (!window.BI) {
});
_.extend(BI, {
getTime: function () {
if (window.performance && window.performance.now) {
return window.performance.now();
if (_global.performance && _global.performance.now) {
return _global.performance.now();
}
if (window.performance && window.performance.webkitNow) {
return window.performance.webkitNow();
if (_global.performance && _global.performance.webkitNow) {
return _global.performance.webkitNow();
}
if (Date.now) {
return Date.now();
@ -21075,6 +21094,9 @@ if (!window.BI) {
// 浏览器相关方法
_.extend(BI, {
isIE: function () {
if(!_global.navigator) {
return false;
}
if (this.__isIE == null) {
this.__isIE = /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
}
@ -21082,6 +21104,9 @@ if (!window.BI) {
},
getIEVersion: function () {
if(!_global.navigator) {
return 0;
}
if (this.__IEVersion != null) {
return this.__IEVersion;
}
@ -21109,38 +21134,65 @@ if (!window.BI) {
},
isEdge: function () {
if(!_global.navigator) {
return false;
}
return /edge/i.test(navigator.userAgent.toLowerCase());
},
isChrome: function () {
if(!_global.navigator) {
return false;
}
return /chrome/i.test(navigator.userAgent.toLowerCase());
},
isFireFox: function () {
if(!_global.navigator) {
return false;
}
return /firefox/i.test(navigator.userAgent.toLowerCase());
},
isOpera: function () {
if(!_global.navigator) {
return false;
}
return /opera/i.test(navigator.userAgent.toLowerCase());
},
isSafari: function () {
if(!_global.navigator) {
return false;
}
return /safari/i.test(navigator.userAgent.toLowerCase());
},
isKhtml: function () {
if(!_global.navigator) {
return false;
}
return /Konqueror|Safari|KHTML/i.test(navigator.userAgent);
},
isMac: function () {
if(!_global.navigator) {
return false;
}
return /macintosh|mac os x/i.test(navigator.userAgent);
},
isWindows: function () {
if(!_global.navigator) {
return false;
}
return /windows|win32/i.test(navigator.userAgent);
},
isSupportCss3: function (style) {
if(!_global.document) {
return false;
}
var prefix = ["webkit", "Moz", "ms", "o"],
i, len,
humpString = [],
@ -21196,7 +21248,7 @@ BI.OB = function (config) {
if (BI.isFunction(this.props)) {
props = this.props(config);
}
this.options = (window.$ || window._).extend(this._defaultConfig(config), props, config);
this.options = (_global.$ || _global._).extend(this._defaultConfig(config), props, config);
this._init();
this._initRef();
};
@ -21346,11 +21398,12 @@ _.extend(BI.OB.prototype, {
*/
!(function () {
var lazy = (typeof document !== 'undefined' &&
typeof document.documentMode === 'number') ||
(typeof navigator !== 'undefined' &&
typeof navigator.userAgent === 'string' &&
var lazy = (typeof document !== "undefined" &&
typeof document.documentMode === "number") ||
(typeof navigator !== "undefined" &&
typeof navigator.userAgent === "string" &&
/\bEdge\/\d/.test(navigator.userAgent));
BI.Widget = BI.inherit(BI.OB, {
_defaultConfig: function () {
return BI.extend(BI.Widget.superclass._defaultConfig.apply(this), {
@ -21398,20 +21451,14 @@ _.extend(BI.OB.prototype, {
this._initElementHeight();
this._initVisual();
this._initState();
if (this.isVisible()) {
if (this.beforeInit) {
this.__asking = true;
this.beforeInit(BI.bind(this._render, this));
if (this.__asking === true) {
this.__async = true;
}
} else {
this._render();
if (this.beforeInit) {
this.__asking = true;
this.beforeInit(BI.bind(this._render, this));
if (this.__asking === true) {
this.__async = true;
}
this.rendered = true
}
if (this._isRoot) {
this._mount()
} else {
this._render();
}
},
@ -21524,7 +21571,7 @@ _.extend(BI.OB.prototype, {
_mount: function () {
var self = this;
var isMounted = this._isMounted;
if (this._isMounting || isMounted || !this.isVisible() || this.__asking === true) {
if (isMounted || this.__asking === true) {
return;
}
if (this._isRoot === true) {
@ -21535,30 +21582,17 @@ _.extend(BI.OB.prototype, {
if (!isMounted) {
return;
}
this._isMounting = true
if (!this.rendered) {
if (this.beforeInit) {
this.__asking = true;
this.beforeInit(BI.bind(this._render, this));
if (this.__asking === true) {
this.__async = true;
}
} else {
this._render();
}
}
this.beforeMount && this.beforeMount();
this._isMounted = true;
lazy && this._mountChildren && this._mountChildren();
!lazy && this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(false);
!self.isValid() && widget._setValid(false);
widget._mount && widget._mount();
});
!lazy && this._mountChildren && this._mountChildren();
lazy && this._mountChildren && this._mountChildren();
this.mounted && this.mounted();
this._isMounting = false
return true;
},
_mountChildren: null,
@ -21839,7 +21873,7 @@ _.extend(BI.OB.prototype, {
var kv = {};
BI.shortcut = function (xtype, cls) {
if (kv[xtype] != null) {
console.error("shortcut:[" + xtype + "] has been registed");
_global.console && console.error("shortcut:[" + xtype + "] has been registed");
}
kv[xtype] = cls;
};
@ -22863,19 +22897,19 @@ BI.ScalingCellSizeAndPositionManager.prototype = {
* version: 0.5.3
**/
!(function () {
var attachEvent = document.attachEvent,
var attachEvent = _global.document && _global.document.attachEvent,
stylesCreated = false;
if (!attachEvent) {
if (_global.document && !attachEvent) {
var requestFrame = (function () {
var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame ||
function (fn) { return window.setTimeout(fn, 20); };
var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame ||
function (fn) { return _global.setTimeout(fn, 20); };
return function (fn) { return raf(fn); };
})();
var cancelFrame = (function () {
var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame ||
window.clearTimeout;
var cancel = _global.cancelAnimationFrame || _global.mozCancelAnimationFrame || _global.webkitCancelAnimationFrame ||
_global.clearTimeout;
return function (id) { return cancel(id); };
})();
@ -23343,7 +23377,7 @@ BI.ScalingCellSizeAndPositionManager.prototype = {
return Math.floor(node / 2);
};
var Int32Array = window.Int32Array || function (size) {
var Int32Array = _global.Int32Array || function (size) {
var xs = [];
for (var i = size - 1; i >= 0; --i) {
xs[i] = 0;
@ -24368,6 +24402,10 @@ BI.Layout = BI.inherit(BI.Widget, {
}
},
appendFragment: function (frag) {
this.element.append(frag);
},
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
@ -24379,7 +24417,7 @@ BI.Layout = BI.inherit(BI.Widget, {
}
});
if (hasChild === true) {
this.element.append(frag);
this.appendFragment(frag);
}
},
@ -25021,8 +25059,18 @@ BI.ShowAction = BI.inherit(BI.Action, {
callback && callback();
}
});(function () {
if (!window.BI) {
window.BI = {};
var _global;
if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (!_global.BI) {
_global.BI = {};
}
function isEmpty (value) {
@ -25550,7 +25598,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
try {
// 注意0啊
// var jo = $.parseJSON(text) || {};
var jo = $ ? $.parseJSON(text) : window.JSON.parse(text);
var jo = $ ? $.parseJSON(text) : _global.JSON.parse(text);
if (jo == null) {
jo = {};
}
@ -25603,7 +25651,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) {
return BI.specialCharsMap[str] || str;
});
return window.encodeURIComponent(url);
return _global.encodeURIComponent(url);
};
BI.decodeURIComponent = function (url) {
@ -25615,7 +25663,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
url = url.replaceAll(BI.keys(reserveSpecialCharsMap || []).join("|"), function (str) {
return reserveSpecialCharsMap[str] || str;
});
return window.decodeURIComponent(url);
return _global.decodeURIComponent(url);
};
BI.contentFormat = function (cv, fmt) {
@ -26055,12 +26103,6 @@ BI.RedMarkBehavior = BI.inherit(BI.Behavior, {
return ob;
});
// IE8下滚动条用原生的
$(function () {
if (BI.isIE9Below()) {
BI.GridTableScrollbar.SIZE = 18;
}
});
}());/**
* guy
* 控制器
@ -26687,7 +26729,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
self._resize(ev);
// }
}, 30);
$(window).resize(fn);
_global.$ && $(window).resize(fn);
},
_resize: function (ev) {
@ -27396,9 +27438,9 @@ BI.extend(jQuery.fn, {
var computedStyle = void 0;
// W3C Standard
if (window.getComputedStyle) {
if (_global.getComputedStyle) {
// In certain cases such as within an iframe in FF3, this returns null.
computedStyle = window.getComputedStyle(node, null);
computedStyle = _global.getComputedStyle(node, null);
if (computedStyle) {
return computedStyle.getPropertyValue(BI.hyphenate(name));
}
@ -28231,7 +28273,7 @@ BI.extend(BI.DOM, {
var constantInjection = {};
BI.constant = function (xtype, cls) {
if (constantInjection[xtype] != null) {
console.error("constant:[" + xtype + "] has been registed");
_global.console && console.error("constant:[" + xtype + "] has been registed");
}
constantInjection[xtype] = cls;
};
@ -28239,7 +28281,7 @@ BI.extend(BI.DOM, {
var modelInjection = {};
BI.model = function (xtype, cls) {
if (modelInjection[xtype] != null) {
console.error("model:[" + xtype + "] has been registed");
_global.console && console.error("model:[" + xtype + "] has been registed");
}
modelInjection[xtype] = cls;
};
@ -28247,7 +28289,7 @@ BI.extend(BI.DOM, {
var storeInjection = {};
BI.store = function (xtype, cls) {
if (storeInjection[xtype] != null) {
console.error("store:[" + xtype + "] has been registed");
_global.console && console.error("store:[" + xtype + "] has been registed");
}
storeInjection[xtype] = cls;
};
@ -28255,7 +28297,7 @@ BI.extend(BI.DOM, {
var serviceInjection = {};
BI.service = function (xtype, cls) {
if (serviceInjection[xtype] != null) {
console.error("service:[" + xtype + "] has been registed");
_global.console && console.error("service:[" + xtype + "] has been registed");
}
serviceInjection[xtype] = cls;
};
@ -28263,7 +28305,7 @@ BI.extend(BI.DOM, {
var providerInjection = {};
BI.provider = function (xtype, cls) {
if (providerInjection[xtype] != null) {
console.error("provider:[" + xtype + "] has been registed");
_global.console && console.error("provider:[" + xtype + "] has been registed");
}
providerInjection[xtype] = cls;
};
@ -28333,7 +28375,7 @@ BI.extend(BI.DOM, {
try {
bfns[i].apply(inst, arguments);
} catch (e) {
console.error(e);
_global.console && console.error(e);
}
}
};
@ -28347,7 +28389,7 @@ BI.extend(BI.DOM, {
try {
afns[i].apply(inst, arguments);
} catch (e) {
console.error(e);
_global.console && console.error(e);
}
}
};
@ -28411,7 +28453,7 @@ BI.extend(BI.DOM, {
try {
act(event, config);
} catch (e) {
console.error(e);
_global.console && console.error(e);
}
});
},
@ -28421,7 +28463,7 @@ BI.extend(BI.DOM, {
try {
act.apply(null, args);
} catch (e) {
console.error(e);
_global.console && console.error(e);
}
});
}
@ -28848,7 +28890,7 @@ _.extend(Array.prototype, {
}
}
});
$(function () {
_global.$ && $(function () {
// 牵扯到国际化这些常量在页面加载后再生效
// full day names
Date._DN = [BI.i18nText("BI-Basic_Sunday"),
@ -29680,14 +29722,14 @@ _.extend(String.prototype, {
}
};!(function () {
var cancelAnimationFrame =
window.cancelAnimationFrame ||
window.webkitCancelAnimationFrame ||
window.mozCancelAnimationFrame ||
window.oCancelAnimationFrame ||
window.msCancelAnimationFrame ||
window.clearTimeout;
_global.cancelAnimationFrame ||
_global.webkitCancelAnimationFrame ||
_global.mozCancelAnimationFrame ||
_global.oCancelAnimationFrame ||
_global.msCancelAnimationFrame ||
_global.clearTimeout;
var requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || window.setTimeout;
var requestAnimationFrame = _global.requestAnimationFrame || _global.webkitRequestAnimationFrame || _global.mozRequestAnimationFrame || _global.oRequestAnimationFrame || _global.msRequestAnimationFrame || _global.setTimeout;
BI.MouseMoveTracker = function (onMove, onMoveEnd, domNode) {
@ -29788,7 +29830,7 @@ _.extend(String.prototype, {
var PIXEL_STEP = 10;
var LINE_HEIGHT = 40;
var PAGE_HEIGHT = 800;
var requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || window.setTimeout;
var requestAnimationFrame = _global.requestAnimationFrame || _global.webkitRequestAnimationFrame || _global.mozRequestAnimationFrame || _global.oRequestAnimationFrame || _global.msRequestAnimationFrame || _global.setTimeout;
function normalizeWheel (/* object*/event) /* object*/ {
var sX = 0,
@ -30305,20 +30347,9 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
return td;
},
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
frag.appendChild(widget.element[0]);
hasChild = true;
}
});
if (hasChild === true) {
this.$tr.append(frag);
this.element.append(this.$table);
}
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
},
resize: function () {
@ -30422,20 +30453,9 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
return td;
},
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
frag.appendChild(widget.element[0]);
hasChild = true;
}
});
if (hasChild === true) {
this.$tr.append(frag);
this.element.append(this.$table);
}
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
},
resize: function () {
@ -30712,20 +30732,9 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
return td;
},
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
frag.appendChild(widget.element[0]);
hasChild = true;
}
});
if (hasChild === true) {
this.$tr.append(frag);
this.element.append(this.$table);
}
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
},
_getWrapper: function () {
@ -31306,20 +31315,9 @@ BI.FlexCenterLayout = BI.inherit(BI.Layout, {
return w;
},
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
frag.appendChild(widget.element[0]);
hasChild = true;
}
});
if (hasChild === true) {
this.$wrapper.append(frag);
this.element.append(this.$wrapper);
}
appendFragment: function (frag) {
this.$wrapper.append(frag);
this.element.append(this.$wrapper);
},
_getWrapper: function () {
@ -31391,20 +31389,9 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
return w;
},
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
frag.appendChild(widget.element[0]);
hasChild = true;
}
});
if (hasChild === true) {
this.$wrapper.append(frag);
this.element.append(this.$wrapper);
}
appendFragment: function (frag) {
this.$wrapper.append(frag);
this.element.append(this.$wrapper);
},
_getWrapper: function () {
@ -31476,20 +31463,9 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, {
return w;
},
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
frag.appendChild(widget.element[0]);
hasChild = true;
}
});
if (hasChild === true) {
this.$wrapper.append(frag);
this.element.append(this.$wrapper);
}
appendFragment: function (frag) {
this.$wrapper.append(frag);
this.element.append(this.$wrapper);
},
_getWrapper: function () {
@ -32619,23 +32595,11 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
return td;
},
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
frag.appendChild(widget.element[0]);
hasChild = true;
}
});
if (hasChild === true) {
this.$tr.append(frag);
this.element.append(this.$table);
}
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
},
resize: function () {
// console.log("horizontal layout do not need to resize");
},
@ -33302,20 +33266,9 @@ BI.TdLayout = BI.inherit(BI.Layout, {
return tr;
},
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
frag.appendChild(widget.element[0]);
hasChild = true;
}
});
if (hasChild === true) {
this.$table.append(frag);
this.element.append(this.$table);
}
appendFragment: function (frag) {
this.$table.append(frag);
this.element.append(this.$table);
},
resize: function () {

234
dist/demo.js vendored

@ -965,7 +965,79 @@ BI.shortcut("demo.toast", Demo.Toast);Demo.Func = BI.inherit(BI.Widget, {
baseCls: "demo-func"
},
mounted: function () {
this.partTree.stroke({
keyword: "1"
});
},
render: function () {
var self = this;
return {
type: "bi.vtape",
items: [{
type: "bi.label",
height: 50,
text: "先初始化一份数据,然后再异步获取数据的树"
}, {
type: "bi.part_tree",
ref: function (_ref) {
self.partTree = _ref;
},
paras: {
selectedValues: {"1": {}, "2": {"1": {}}}
},
itemsCreator: function (op, callback) {
if (op.type === BI.TreeView.REQ_TYPE_INIT_DATA) {
callback({
items: [{
id: "1",
text: 1,
isParent: true,
open: true
}, {
id: "11",
pId: "1",
text: 11,
isParent: true,
open: true
}, {
id: "111",
pId: "11",
text: 111,
isParent: true
}, {
id: "2",
text: 2
}, {
id: "3",
text: 3
}],
hasNext: BI.isNull(op.id)
});
return;
}
callback({
items: [{
id: (op.id || "") + "1",
pId: op.id,
text: 1,
isParent: true
}, {
id: (op.id || "") + "2",
pId: op.id,
text: 2
}, {
id: (op.id || "") + "3",
pId: op.id,
text: 3
}],
hasNext: BI.isNull(op.id)
});
}
}]
};
}
});
BI.shortcut("demo.part_tree", Demo.Func);Demo.Func = BI.inherit(BI.Widget, {
@ -974,7 +1046,9 @@ BI.shortcut("demo.part_tree", Demo.Func);Demo.Func = BI.inherit(BI.Widget, {
},
mounted: function () {
this.syncTree.stroke();
this.syncTree.stroke({
keyword: "1"
});
},
render: function () {
@ -991,7 +1065,7 @@ BI.shortcut("demo.part_tree", Demo.Func);Demo.Func = BI.inherit(BI.Widget, {
self.syncTree = _ref;
},
paras: {
selectedValues: {"_0": {}, "_5": {"_5_0": {}}}
selectedValues: {"1": {}, "2": {"1": {}}}
},
itemsCreator: function (op, callback) {
callback({
@ -2867,143 +2941,7 @@ BI.DetailTableHeader = BI.inherit(BI.Widget, {
}
}
});
BI.shortcut("bi.detail_table_header", BI.DetailTableHeader);Demo.Face = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-face"
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.sequence_table",
ref: function () {
self.table = this;
},
isNeedFreeze: null,
isNeedMerge: false,
summaryCellStyleGetter: function (isLast) {
return {
background: "rgb(4, 177, 194)",
color: "#ffffff",
fontWeight: "bold"
};
},
sequenceCellStyleGetter: function (index) {
return {
background: "rgb(4, 177, 194)",
color: "#ffffff",
fontWeight: "bold"
};
},
headerCellStyleGetter: function () {
return {
background: "rgb(4, 177, 194)",
color: "#ffffff",
fontWeight: "bold"
};
},
el: {
type: "bi.adaptive_table",
el: {
type: "bi.resizable_table",
el: {
type: "bi.grid_table"
}
}
},
sequence: {
type: "bi.sequence_table_list_number",
pageSize: 100,
sequenceHeaderCreator: function () {
return {
type: "bi.normal_sequence_header_cell",
styleGetter: function () {
return {
background: "rgb(4, 177, 194)",
color: "#ffffff",
fontWeight: "bold"
};
}
};
}
},
itemsCreator: function (op, populate) {
}
},
left: 0,
right: 0,
top: 0,
bottom: 0
}]
};
},
mounted: function () {
var self = this;
if (BI.isNull(BI.isExpanded)) {
BI.isExpanded = false;
} else if (!BI.isExpanded) {
TABLE_ITEMS = this._expandData(TABLE_ITEMS, 3);
TABLE_HEADER = this._expandHeadData(TABLE_HEADER, 3);
BI.isExpanded = true;
}
this._resizeHandler = BI.debounce(function () {
var width = self.element.width(), height = self.element.height();
if (self.table.getWidth() !== width || self.table.getHeight() !== height) {
self.table.setWidth(width);
self.table.setHeight(height);
self.table.populate();
}
}, 0);
BI.ResizeDetector.addResizeListener(this, function () {
self._resizeHandler();
});
this.table.setWidth(this.element.width());
this.table.setHeight(this.element.height());
this.table.attr("columnSize", BI.makeArray(TABLE_HEADER[0].length, ""));
this.table.attr("minColumnSize", BI.makeArray(TABLE_HEADER[0].length, 60));
this.table.attr("isNeedFreeze", true);
this.table.attr("freezeCols", []);
this.table.attr("showSequence", true);
this.table.attr("headerRowSize", 15);
this.table.attr("rowSize", 15);
this.table.populate(TABLE_ITEMS, TABLE_HEADER);
},
_expandData: function (items, times) {
var copy = BI.deepClone(items);
for (var m = 0; m < times - 1; m++) {
BI.each(items, function (i, row) {
copy.push(row);
});
}
for (var n = 0; n < copy.length; n++) {
for (var m = 0; m < times - 1; m++) {
BI.each(items[n % 100], function (j, item) {
copy[n].push(item);
});
}
}
return copy;
},
_expandHeadData: function (items, times) {
var copy = BI.deepClone(items);
for (var n = 0; n < copy.length; n++) {
for (var m = 0; m < times - 1; m++) {
BI.each(items[n], function (j, item) {
copy[n].push(item);
});
}
}
return copy;
}
});
BI.shortcut("demo.large_table", Demo.Face);/**
BI.shortcut("bi.detail_table_header", BI.DetailTableHeader);/**
* created by young
* 默认风格表格表头
*/
@ -3553,10 +3491,6 @@ BI.shortcut("demo.value_chooser_pane", Demo.ValueChooserPane);Demo.BASE_CONFIG =
pId: 100000,
text: "自定义一棵树",
value: "demo.platform_level_tree"
}, {
pId: 100000,
text: "大表格",
value: "demo.large_table"
}, {
pId: 100000,
text: "可以排序的树",
@ -7495,20 +7429,16 @@ BI.shortcut("demo.searcher_view", Demo.Func);Demo.Face = BI.inherit(BI.Widget, {
return {
type: "bi.grid",
items: [[{
column: 0,
row: 0,
el: {
type: "bi.layout"
}
}, {
column: 1,
row: 0,
el: {
type: "bi.vertical",
cls: "face-config bi-border-left",
cls: "face-config bi-border-right",
items: [this._createBaseConfig(),
this._createCommonConfig()]
}
}, {
el: {
type: "bi.layout"
}
}]]
};
},

701
dist/fineui.js vendored

File diff suppressed because it is too large Load Diff

78
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

65375
dist/fineui_without_jquery_polyfill.js vendored

File diff suppressed because one or more lines are too long

4
dist/fix/fix.compact.js vendored

@ -108,9 +108,8 @@
function createStore() {
var needPop = false;
if (!this._storeCreated && window.Fix && this._store && this.isVisible()) {
if (window.Fix && this._store) {
var store = findStore(this.options.context || this.options.element);
this._storeCreated = true;
if (store) {
pushTarget(store);
needPop = true;
@ -172,7 +171,6 @@
_.each(["_mount"], function (name) {
var old = BI.Widget.prototype[name];
old && (BI.Widget.prototype[name] = function () {
createStore.call(this);
this.store && pushTarget(this.store);
var res = old.apply(this, arguments);
this.store && popTarget();

6
dist/fix/fix.js vendored

@ -24,12 +24,18 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var hasProto = '__proto__' in {};
var isIE = function isIE() {
if (typeof navigator === "undefined") {
return false;
}
return (/(msie|trident)/i.test(navigator.userAgent.toLowerCase())
);
};
var getIEVersion = function getIEVersion() {
var version = 0;
if (typeof navigator === "undefined") {
return false;
}
var agent = navigator.userAgent.toLowerCase();
var v1 = agent.match(/(?:msie\s([\w.]+))/);
var v2 = agent.match(/(?:trident.*rv:([\w.]+))/);

6
dist/polyfill.js vendored

@ -99,7 +99,7 @@ if (!Array.prototype.lastIndexOf) {
* Created by wang on 15/6/23.
*/
// 解决console未定义问题 guy
window.console = window.console || (function () {
_global.console = _global.console || (function () {
var c = {};
c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile
= c.clear = c.exception = c.trace = c.assert = function () {
@ -109,7 +109,7 @@ window.console = window.console || (function () {
/*
* 前端缓存
*/
window.localStorage || (window.localStorage = {
_global.localStorage || (_global.localStorage = {
items: {},
setItem: function (k, v) {
BI.Cache.addCookie(k, v);
@ -216,7 +216,7 @@ if(!Date.now) {
return this;
}
return _sort.call(this);
};
}
}(window);

8
dist/router.js vendored

@ -318,8 +318,8 @@
// Ensure that `History` can be used outside of the browser.
if (typeof window !== "undefined") {
this.location = window.location;
this.history = window.history;
this.location = _global.location;
this.history = _global.history;
}
};
@ -437,7 +437,7 @@
}
// Add a cross-platform `addEventListener` shim for older browsers.
var addEventListener = window.addEventListener || function (eventName, listener) {
var addEventListener = _global.addEventListener || function (eventName, listener) {
return attachEvent("on" + eventName, listener);
};
@ -458,7 +458,7 @@
// but possibly useful for unit testing Routers.
stop: function () {
// Add a cross-platform `removeEventListener` shim for older browsers.
var removeEventListener = window.removeEventListener || function (eventName, listener) {
var removeEventListener = _global.removeEventListener || function (eventName, listener) {
return detachEvent("on" + eventName, listener);
};

138
dist/utils.js vendored

@ -1,4 +1,22 @@
/**
* Created by richie on 15/7/8.
*/
/**
* 初始化BI对象
*/
var _global;
if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (_global.BI == null) {
_global.BI = {};
}/**
* @license
* Lodash (Custom Build) <https://lodash.com/>
* Build: `lodash core plus="debounce,throttle,get,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy,union,zipObject,initial,cloneDeep,clamp,isPlainObject,take,takeRight,without,difference,defaultsDeep,trim"`
@ -10089,14 +10107,6 @@
}
}.call(this));
/**
* Created by richie on 15/7/8.
*/
/**
* 初始化BI对象
*/
if (window.BI == null) {
window.BI = {};
}/**
* 常量
*/
@ -10938,9 +10948,18 @@ Function.prototype.after = function (func) {
* Create By GUY 2014\11\17
*
*/
if (!window.BI) {
window.BI = {};
var _global;
if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (!_global.BI) {
_global.BI = {};
}
!(function (undefined) {
@ -11382,7 +11401,7 @@ if (!window.BI) {
};
}
var F = function () {
}, spp = sp.prototype;
}, spp = sp.prototype;
F.prototype = spp;
sb.prototype = new F();
sb.superclass = spp;
@ -11668,11 +11687,11 @@ if (!window.BI) {
});
_.extend(BI, {
getTime: function () {
if (window.performance && window.performance.now) {
return window.performance.now();
if (_global.performance && _global.performance.now) {
return _global.performance.now();
}
if (window.performance && window.performance.webkitNow) {
return window.performance.webkitNow();
if (_global.performance && _global.performance.webkitNow) {
return _global.performance.webkitNow();
}
if (Date.now) {
return Date.now();
@ -12297,6 +12316,9 @@ if (!window.BI) {
// 浏览器相关方法
_.extend(BI, {
isIE: function () {
if(!_global.navigator) {
return false;
}
if (this.__isIE == null) {
this.__isIE = /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
}
@ -12304,6 +12326,9 @@ if (!window.BI) {
},
getIEVersion: function () {
if(!_global.navigator) {
return 0;
}
if (this.__IEVersion != null) {
return this.__IEVersion;
}
@ -12331,38 +12356,65 @@ if (!window.BI) {
},
isEdge: function () {
if(!_global.navigator) {
return false;
}
return /edge/i.test(navigator.userAgent.toLowerCase());
},
isChrome: function () {
if(!_global.navigator) {
return false;
}
return /chrome/i.test(navigator.userAgent.toLowerCase());
},
isFireFox: function () {
if(!_global.navigator) {
return false;
}
return /firefox/i.test(navigator.userAgent.toLowerCase());
},
isOpera: function () {
if(!_global.navigator) {
return false;
}
return /opera/i.test(navigator.userAgent.toLowerCase());
},
isSafari: function () {
if(!_global.navigator) {
return false;
}
return /safari/i.test(navigator.userAgent.toLowerCase());
},
isKhtml: function () {
if(!_global.navigator) {
return false;
}
return /Konqueror|Safari|KHTML/i.test(navigator.userAgent);
},
isMac: function () {
if(!_global.navigator) {
return false;
}
return /macintosh|mac os x/i.test(navigator.userAgent);
},
isWindows: function () {
if(!_global.navigator) {
return false;
}
return /windows|win32/i.test(navigator.userAgent);
},
isSupportCss3: function (style) {
if(!_global.document) {
return false;
}
var prefix = ["webkit", "Moz", "ms", "o"],
i, len,
humpString = [],
@ -12418,7 +12470,7 @@ BI.OB = function (config) {
if (BI.isFunction(this.props)) {
props = this.props(config);
}
this.options = (window.$ || window._).extend(this._defaultConfig(config), props, config);
this.options = (_global.$ || _global._).extend(this._defaultConfig(config), props, config);
this._init();
this._initRef();
};
@ -12560,8 +12612,18 @@ _.extend(BI.OB.prototype, {
this.purgeListeners();
}
});(function () {
if (!window.BI) {
window.BI = {};
var _global;
if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (!_global.BI) {
_global.BI = {};
}
function isEmpty (value) {
@ -13089,7 +13151,7 @@ _.extend(BI.OB.prototype, {
try {
// 注意0啊
// var jo = $.parseJSON(text) || {};
var jo = $ ? $.parseJSON(text) : window.JSON.parse(text);
var jo = $ ? $.parseJSON(text) : _global.JSON.parse(text);
if (jo == null) {
jo = {};
}
@ -13142,7 +13204,7 @@ _.extend(BI.OB.prototype, {
url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) {
return BI.specialCharsMap[str] || str;
});
return window.encodeURIComponent(url);
return _global.encodeURIComponent(url);
};
BI.decodeURIComponent = function (url) {
@ -13154,7 +13216,7 @@ _.extend(BI.OB.prototype, {
url = url.replaceAll(BI.keys(reserveSpecialCharsMap || []).join("|"), function (str) {
return reserveSpecialCharsMap[str] || str;
});
return window.decodeURIComponent(url);
return _global.decodeURIComponent(url);
};
BI.contentFormat = function (cv, fmt) {
@ -13444,7 +13506,7 @@ _.extend(BI.OB.prototype, {
var constantInjection = {};
BI.constant = function (xtype, cls) {
if (constantInjection[xtype] != null) {
console.error("constant:[" + xtype + "] has been registed");
_global.console && console.error("constant:[" + xtype + "] has been registed");
}
constantInjection[xtype] = cls;
};
@ -13452,7 +13514,7 @@ _.extend(BI.OB.prototype, {
var modelInjection = {};
BI.model = function (xtype, cls) {
if (modelInjection[xtype] != null) {
console.error("model:[" + xtype + "] has been registed");
_global.console && console.error("model:[" + xtype + "] has been registed");
}
modelInjection[xtype] = cls;
};
@ -13460,7 +13522,7 @@ _.extend(BI.OB.prototype, {
var storeInjection = {};
BI.store = function (xtype, cls) {
if (storeInjection[xtype] != null) {
console.error("store:[" + xtype + "] has been registed");
_global.console && console.error("store:[" + xtype + "] has been registed");
}
storeInjection[xtype] = cls;
};
@ -13468,7 +13530,7 @@ _.extend(BI.OB.prototype, {
var serviceInjection = {};
BI.service = function (xtype, cls) {
if (serviceInjection[xtype] != null) {
console.error("service:[" + xtype + "] has been registed");
_global.console && console.error("service:[" + xtype + "] has been registed");
}
serviceInjection[xtype] = cls;
};
@ -13476,7 +13538,7 @@ _.extend(BI.OB.prototype, {
var providerInjection = {};
BI.provider = function (xtype, cls) {
if (providerInjection[xtype] != null) {
console.error("provider:[" + xtype + "] has been registed");
_global.console && console.error("provider:[" + xtype + "] has been registed");
}
providerInjection[xtype] = cls;
};
@ -13546,7 +13608,7 @@ _.extend(BI.OB.prototype, {
try {
bfns[i].apply(inst, arguments);
} catch (e) {
console.error(e);
_global.console && console.error(e);
}
}
};
@ -13560,7 +13622,7 @@ _.extend(BI.OB.prototype, {
try {
afns[i].apply(inst, arguments);
} catch (e) {
console.error(e);
_global.console && console.error(e);
}
}
};
@ -13624,7 +13686,7 @@ _.extend(BI.OB.prototype, {
try {
act(event, config);
} catch (e) {
console.error(e);
_global.console && console.error(e);
}
});
},
@ -13634,7 +13696,7 @@ _.extend(BI.OB.prototype, {
try {
act.apply(null, args);
} catch (e) {
console.error(e);
_global.console && console.error(e);
}
});
}
@ -14616,19 +14678,19 @@ BI.ScalingCellSizeAndPositionManager.prototype = {
* version: 0.5.3
**/
!(function () {
var attachEvent = document.attachEvent,
var attachEvent = _global.document && _global.document.attachEvent,
stylesCreated = false;
if (!attachEvent) {
if (_global.document && !attachEvent) {
var requestFrame = (function () {
var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame ||
function (fn) { return window.setTimeout(fn, 20); };
var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame ||
function (fn) { return _global.setTimeout(fn, 20); };
return function (fn) { return raf(fn); };
})();
var cancelFrame = (function () {
var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame ||
window.clearTimeout;
var cancel = _global.cancelAnimationFrame || _global.mozCancelAnimationFrame || _global.webkitCancelAnimationFrame ||
_global.clearTimeout;
return function (id) { return cancel(id); };
})();
@ -15096,7 +15158,7 @@ BI.ScalingCellSizeAndPositionManager.prototype = {
return Math.floor(node / 2);
};
var Int32Array = window.Int32Array || function (size) {
var Int32Array = _global.Int32Array || function (size) {
var xs = [];
for (var i = size - 1; i >= 0; --i) {
xs[i] = 0;

10
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

13
dist/widget.js vendored

@ -9558,12 +9558,15 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
},
value: this.storeValue
});
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.button_group],
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top), BI.extend({
scrolly: true,
vgap: 5
});
}, opts.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top, this.button_group)
}))));
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});

742
package-lock.json generated

File diff suppressed because it is too large Load Diff

280
src/base/single/button/buttons/button.js

@ -1,152 +1,150 @@
(function ($) {
/**
* 文字类型的按钮
* @class BI.Button
* @extends BI.BasicButton
*
* @cfg {JSON} options 配置属性
* @cfg {'common'/'success'/'warning'/'ignore'} [options.level='common'] 按钮类型用不同颜色强调不同的场景
*/
BI.Button = BI.inherit(BI.BasicButton, {
/**
* 文字类型的按钮
* @class BI.Button
* @extends BI.BasicButton
*
* @cfg {JSON} options 配置属性
* @cfg {'common'/'success'/'warning'/'ignore'} [options.level='common'] 按钮类型用不同颜色强调不同的场景
*/
BI.Button = BI.inherit(BI.BasicButton, {
_defaultConfig: function (props) {
var conf = BI.Button.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-button",
minWidth: (props.block === true || props.clear === true) ? 0 : 80,
height: 24,
shadow: props.clear !== true,
isShadowShowingOnSelected: true,
readonly: true,
iconCls: "",
level: "common",
block: false, // 是否块状显示,即不显示边框,没有最小宽度的限制
clear: false, // 是否去掉边框和背景
ghost: false, // 是否幽灵显示, 即正常状态无背景
textAlign: "center",
whiteSpace: "nowrap",
forceCenter: false,
textWidth: null,
textHeight: null,
hgap: props.clear ? 0 : 10,
vgap: 0,
tgap: 0,
bgap: 0,
lgap: 0,
rgap: 0
});
},
_defaultConfig: function (props) {
var conf = BI.Button.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-button",
minWidth: (props.block === true || props.clear === true) ? 0 : 80,
height: 24,
shadow: props.clear !== true,
isShadowShowingOnSelected: true,
readonly: true,
iconCls: "",
level: "common",
block: false, // 是否块状显示,即不显示边框,没有最小宽度的限制
clear: false, // 是否去掉边框和背景
ghost: false, // 是否幽灵显示, 即正常状态无背景
textAlign: "center",
whiteSpace: "nowrap",
forceCenter: false,
textWidth: null,
textHeight: null,
hgap: props.clear ? 0 : 10,
vgap: 0,
tgap: 0,
bgap: 0,
lgap: 0,
rgap: 0
});
},
_init: function () {
BI.Button.superclass._init.apply(this, arguments);
var o = this.options, self = this;
if (BI.isNumber(o.height) && !o.clear && !o.block) {
this.element.css({height: o.height + "px", lineHeight: (o.height - 2) + "px"});
} else if (o.clear || o.block) {
this.element.css({lineHeight: o.height + "px"});
} else {
this.element.css({lineHeight: (o.height - 2) + "px"});
}
if (BI.isKey(o.iconCls)) {
this.icon = BI.createWidget({
type: "bi.icon",
width: 18,
height: o.height - 2
});
this.text = BI.createWidget({
type: "bi.label",
text: o.text,
value: o.value,
height: o.height - 2
});
BI.createWidget({
type: "bi.horizontal_auto",
cls: o.iconCls,
element: this,
hgap: o.hgap,
vgap: o.vgap,
tgap: o.tgap,
bgap: o.bgap,
lgap: o.lgap,
rgap: o.rgap,
items: [{
type: "bi.horizontal",
items: [this.icon, this.text]
}]
});
} else {
this.text = BI.createWidget({
type: "bi.label",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
forceCenter: o.forceCenter,
textWidth: o.textWidth,
textHeight: o.textHeight,
hgap: o.hgap,
vgap: o.vgap,
tgap: o.tgap,
bgap: o.bgap,
lgap: o.lgap,
rgap: o.rgap,
element: this,
text: o.text,
value: o.value
});
}
if (o.block === true) {
this.element.addClass("block");
}
if (o.clear === true) {
this.element.addClass("clear");
}
if (o.ghost === true) {
this.element.addClass("ghost");
}
if (o.minWidth > 0) {
this.element.css({"min-width": o.minWidth + "px"});
}
},
_init: function () {
BI.Button.superclass._init.apply(this, arguments);
var o = this.options, self = this;
if (BI.isNumber(o.height) && !o.clear && !o.block) {
this.element.css({height: o.height + "px", lineHeight: (o.height - 2) + "px"});
} else if (o.clear || o.block) {
this.element.css({lineHeight: o.height + "px"});
} else {
this.element.css({lineHeight: (o.height - 2) + "px"});
}
if (BI.isKey(o.iconCls)) {
this.icon = BI.createWidget({
type: "bi.icon",
width: 18,
height: o.height - 2
});
this.text = BI.createWidget({
type: "bi.label",
text: o.text,
value: o.value,
height: o.height - 2
});
BI.createWidget({
type: "bi.horizontal_auto",
cls: o.iconCls,
element: this,
hgap: o.hgap,
vgap: o.vgap,
tgap: o.tgap,
bgap: o.bgap,
lgap: o.lgap,
rgap: o.rgap,
items: [{
type: "bi.horizontal",
items: [this.icon, this.text]
}]
});
} else {
this.text = BI.createWidget({
type: "bi.label",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
forceCenter: o.forceCenter,
textWidth: o.textWidth,
textHeight: o.textHeight,
hgap: o.hgap,
vgap: o.vgap,
tgap: o.tgap,
bgap: o.bgap,
lgap: o.lgap,
rgap: o.rgap,
element: this,
text: o.text,
value: o.value
});
}
if (o.block === true) {
this.element.addClass("block");
}
if (o.clear === true) {
this.element.addClass("clear");
}
if (o.ghost === true) {
this.element.addClass("ghost");
}
if (o.minWidth > 0) {
this.element.css({"min-width": o.minWidth + "px"});
}
},
doClick: function () {
BI.Button.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.Button.EVENT_CHANGE, this);
}
},
doClick: function () {
BI.Button.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.Button.EVENT_CHANGE, this);
}
},
setText: function (text) {
BI.Button.superclass.setText.apply(this, arguments);
this.text.setText(text);
},
setText: function (text) {
BI.Button.superclass.setText.apply(this, arguments);
this.text.setText(text);
},
setValue: function (text) {
BI.Button.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(text);
}
},
setValue: function (text) {
BI.Button.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(text);
}
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
destroy: function () {
BI.Button.superclass.destroy.apply(this, arguments);
}
});
BI.shortcut("bi.button", BI.Button);
BI.Button.EVENT_CHANGE = "EVENT_CHANGE";
})(jQuery);
destroy: function () {
BI.Button.superclass.destroy.apply(this, arguments);
}
});
BI.shortcut("bi.button", BI.Button);
BI.Button.EVENT_CHANGE = "EVENT_CHANGE";

12
src/base/single/input/file.js

@ -6,7 +6,7 @@
* @extends BI.Single
* @abstract
*/
(function () {
(function (document) {
/**
* @description normalize input.files. create if not present, add item method if not present
@ -153,7 +153,7 @@
},
false
);
xhr.open("post", handler.url + "&filename=" + window.encodeURIComponent(handler.file.fileName), true);
xhr.open("post", handler.url + "&filename=" + _global.encodeURIComponent(handler.file.fileName), true);
if (!xhr.upload) {
var rpe = {loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true};
rpe.interval = setInterval(function () {
@ -264,7 +264,7 @@
handler.attach_array.push(attachO);
}
} catch (e) {
if (isFunction(handler.onerror)) {handler.onerror(rpe, event || window.event);}
if (isFunction(handler.onerror)) {handler.onerror(rpe, event || _global.event);}
}
if (isFunction(handler.onload)) {handler.onload(rpe, {responseText: responseText});}
},
@ -284,7 +284,7 @@
iframe.onload = onload;
iframe.onerror = function (event) {
if (isFunction(handler.onerror)) {
handler.onerror(rpe, event || window.event);
handler.onerror(rpe, event || _global.event);
}
};
iframe.onreadystatechange = function () {
@ -306,7 +306,7 @@
});
}
};
form.setAttribute("action", handler.url + "&filename=" + window.encodeURIComponent(handler.file.fileName));
form.setAttribute("action", handler.url + "&filename=" + _global.encodeURIComponent(handler.file.fileName));
form.setAttribute("target", iframe.id);
form.setAttribute("method", "post");
form.appendChild(handler.file);
@ -614,4 +614,4 @@
BI.File.EVENT_PROGRESS = "EVENT_PROGRESS";
BI.File.EVENT_UPLOADED = "EVENT_UPLOADED";
BI.shortcut("bi.file", BI.File);
})();
})(_global.document || {});

4
src/base/tree/treeview.js

@ -114,8 +114,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
treeNode.times = treeNode.times || 1;
var param = "id=" + treeNode.id
+ "&times=" + (treeNode.times++)
+ "&parentValues= " + window.encodeURIComponent(BI.jsonEncode(parentNode))
+ "&checkState=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));
+ "&parentValues= " + _global.encodeURIComponent(BI.jsonEncode(parentNode))
+ "&checkState=" + _global.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));
return "&" + param;
}

20
src/core/alias.js

@ -1,6 +1,16 @@
(function () {
if (!window.BI) {
window.BI = {};
var _global;
if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (!_global.BI) {
_global.BI = {};
}
function isEmpty (value) {
@ -528,7 +538,7 @@
try {
// 注意0啊
// var jo = $.parseJSON(text) || {};
var jo = $ ? $.parseJSON(text) : window.JSON.parse(text);
var jo = $ ? $.parseJSON(text) : _global.JSON.parse(text);
if (jo == null) {
jo = {};
}
@ -581,7 +591,7 @@
url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) {
return BI.specialCharsMap[str] || str;
});
return window.encodeURIComponent(url);
return _global.encodeURIComponent(url);
};
BI.decodeURIComponent = function (url) {
@ -593,7 +603,7 @@
url = url.replaceAll(BI.keys(reserveSpecialCharsMap || []).join("|"), function (str) {
return reserveSpecialCharsMap[str] || str;
});
return window.decodeURIComponent(url);
return _global.decodeURIComponent(url);
};
BI.contentFormat = function (cv, fmt) {

58
src/core/base.js

@ -3,9 +3,18 @@
* Create By GUY 2014\11\17
*
*/
if (!window.BI) {
window.BI = {};
var _global;
if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (!_global.BI) {
_global.BI = {};
}
!(function (undefined) {
@ -447,7 +456,7 @@ if (!window.BI) {
};
}
var F = function () {
}, spp = sp.prototype;
}, spp = sp.prototype;
F.prototype = spp;
sb.prototype = new F();
sb.superclass = spp;
@ -733,11 +742,11 @@ if (!window.BI) {
});
_.extend(BI, {
getTime: function () {
if (window.performance && window.performance.now) {
return window.performance.now();
if (_global.performance && _global.performance.now) {
return _global.performance.now();
}
if (window.performance && window.performance.webkitNow) {
return window.performance.webkitNow();
if (_global.performance && _global.performance.webkitNow) {
return _global.performance.webkitNow();
}
if (Date.now) {
return Date.now();
@ -1362,6 +1371,9 @@ if (!window.BI) {
// 浏览器相关方法
_.extend(BI, {
isIE: function () {
if(!_global.navigator) {
return false;
}
if (this.__isIE == null) {
this.__isIE = /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
}
@ -1369,6 +1381,9 @@ if (!window.BI) {
},
getIEVersion: function () {
if(!_global.navigator) {
return 0;
}
if (this.__IEVersion != null) {
return this.__IEVersion;
}
@ -1396,38 +1411,65 @@ if (!window.BI) {
},
isEdge: function () {
if(!_global.navigator) {
return false;
}
return /edge/i.test(navigator.userAgent.toLowerCase());
},
isChrome: function () {
if(!_global.navigator) {
return false;
}
return /chrome/i.test(navigator.userAgent.toLowerCase());
},
isFireFox: function () {
if(!_global.navigator) {
return false;
}
return /firefox/i.test(navigator.userAgent.toLowerCase());
},
isOpera: function () {
if(!_global.navigator) {
return false;
}
return /opera/i.test(navigator.userAgent.toLowerCase());
},
isSafari: function () {
if(!_global.navigator) {
return false;
}
return /safari/i.test(navigator.userAgent.toLowerCase());
},
isKhtml: function () {
if(!_global.navigator) {
return false;
}
return /Konqueror|Safari|KHTML/i.test(navigator.userAgent);
},
isMac: function () {
if(!_global.navigator) {
return false;
}
return /macintosh|mac os x/i.test(navigator.userAgent);
},
isWindows: function () {
if(!_global.navigator) {
return false;
}
return /windows|win32/i.test(navigator.userAgent);
},
isSupportCss3: function (style) {
if(!_global.document) {
return false;
}
var prefix = ["webkit", "Moz", "ms", "o"],
i, len,
humpString = [],

6
src/core/config.js

@ -78,10 +78,4 @@
return ob;
});
// IE8下滚动条用原生的
$(function () {
if (BI.isIE9Below()) {
BI.GridTableScrollbar.SIZE = 18;
}
});
}());

2
src/core/controller/controller.resizer.js

@ -18,7 +18,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
self._resize(ev);
// }
}, 30);
$(window).resize(fn);
_global.$ && $(window).resize(fn);
},
_resize: function (ev) {

14
src/core/foundation.js vendored

@ -4,6 +4,16 @@
/**
* 初始化BI对象
*/
if (window.BI == null) {
window.BI = {};
var _global;
if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (_global.BI == null) {
_global.BI = {};
}

4
src/core/func/dom.js

@ -90,9 +90,9 @@ BI.extend(jQuery.fn, {
var computedStyle = void 0;
// W3C Standard
if (window.getComputedStyle) {
if (_global.getComputedStyle) {
// In certain cases such as within an iframe in FF3, this returns null.
computedStyle = window.getComputedStyle(node, null);
computedStyle = _global.getComputedStyle(node, null);
if (computedStyle) {
return computedStyle.getPropertyValue(BI.hyphenate(name));
}

18
src/core/inject.js

@ -2,7 +2,7 @@
var constantInjection = {};
BI.constant = function (xtype, cls) {
if (constantInjection[xtype] != null) {
console.error("constant:[" + xtype + "] has been registed");
_global.console && console.error("constant:[" + xtype + "] has been registed");
}
constantInjection[xtype] = cls;
};
@ -10,7 +10,7 @@
var modelInjection = {};
BI.model = function (xtype, cls) {
if (modelInjection[xtype] != null) {
console.error("model:[" + xtype + "] has been registed");
_global.console && console.error("model:[" + xtype + "] has been registed");
}
modelInjection[xtype] = cls;
};
@ -18,7 +18,7 @@
var storeInjection = {};
BI.store = function (xtype, cls) {
if (storeInjection[xtype] != null) {
console.error("store:[" + xtype + "] has been registed");
_global.console && console.error("store:[" + xtype + "] has been registed");
}
storeInjection[xtype] = cls;
};
@ -26,7 +26,7 @@
var serviceInjection = {};
BI.service = function (xtype, cls) {
if (serviceInjection[xtype] != null) {
console.error("service:[" + xtype + "] has been registed");
_global.console && console.error("service:[" + xtype + "] has been registed");
}
serviceInjection[xtype] = cls;
};
@ -34,7 +34,7 @@
var providerInjection = {};
BI.provider = function (xtype, cls) {
if (providerInjection[xtype] != null) {
console.error("provider:[" + xtype + "] has been registed");
_global.console && console.error("provider:[" + xtype + "] has been registed");
}
providerInjection[xtype] = cls;
};
@ -104,7 +104,7 @@
try {
bfns[i].apply(inst, arguments);
} catch (e) {
console.error(e);
_global.console && console.error(e);
}
}
};
@ -118,7 +118,7 @@
try {
afns[i].apply(inst, arguments);
} catch (e) {
console.error(e);
_global.console && console.error(e);
}
}
};
@ -182,7 +182,7 @@
try {
act(event, config);
} catch (e) {
console.error(e);
_global.console && console.error(e);
}
});
},
@ -192,7 +192,7 @@
try {
act.apply(null, args);
} catch (e) {
console.error(e);
_global.console && console.error(e);
}
});
}

2
src/core/ob.js

@ -8,7 +8,7 @@ BI.OB = function (config) {
if (BI.isFunction(this.props)) {
props = this.props(config);
}
this.options = (window.$ || window._).extend(this._defaultConfig(config), props, config);
this.options = (_global.$ || _global._).extend(this._defaultConfig(config), props, config);
this._init();
this._initRef();
};

2
src/core/proto/date.i18n.js

@ -1,4 +1,4 @@
$(function () {
_global.$ && $(function () {
// 牵扯到国际化这些常量在页面加载后再生效
// full day names
Date._DN = [BI.i18nText("BI-Basic_Sunday"),

2
src/core/shortcut.js

@ -2,7 +2,7 @@
var kv = {};
BI.shortcut = function (xtype, cls) {
if (kv[xtype] != null) {
console.error("shortcut:[" + xtype + "] has been registed");
_global.console && console.error("shortcut:[" + xtype + "] has been registed");
}
kv[xtype] = cls;
};

12
src/core/utils/detectElementResize.js

@ -8,19 +8,19 @@
* version: 0.5.3
**/
!(function () {
var attachEvent = document.attachEvent,
var attachEvent = _global.document && _global.document.attachEvent,
stylesCreated = false;
if (!attachEvent) {
if (_global.document && !attachEvent) {
var requestFrame = (function () {
var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame ||
function (fn) { return window.setTimeout(fn, 20); };
var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame ||
function (fn) { return _global.setTimeout(fn, 20); };
return function (fn) { return raf(fn); };
})();
var cancelFrame = (function () {
var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame ||
window.clearTimeout;
var cancel = _global.cancelAnimationFrame || _global.mozCancelAnimationFrame || _global.webkitCancelAnimationFrame ||
_global.clearTimeout;
return function (id) { return cancel(id); };
})();

14
src/core/utils/events/mousemovetracker.js

@ -1,13 +1,13 @@
!(function () {
var cancelAnimationFrame =
window.cancelAnimationFrame ||
window.webkitCancelAnimationFrame ||
window.mozCancelAnimationFrame ||
window.oCancelAnimationFrame ||
window.msCancelAnimationFrame ||
window.clearTimeout;
_global.cancelAnimationFrame ||
_global.webkitCancelAnimationFrame ||
_global.mozCancelAnimationFrame ||
_global.oCancelAnimationFrame ||
_global.msCancelAnimationFrame ||
_global.clearTimeout;
var requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || window.setTimeout;
var requestAnimationFrame = _global.requestAnimationFrame || _global.webkitRequestAnimationFrame || _global.mozRequestAnimationFrame || _global.oRequestAnimationFrame || _global.msRequestAnimationFrame || _global.setTimeout;
BI.MouseMoveTracker = function (onMove, onMoveEnd, domNode) {

2
src/core/utils/events/wheelhandler.js

@ -2,7 +2,7 @@
var PIXEL_STEP = 10;
var LINE_HEIGHT = 40;
var PAGE_HEIGHT = 800;
var requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || window.setTimeout;
var requestAnimationFrame = _global.requestAnimationFrame || _global.webkitRequestAnimationFrame || _global.mozRequestAnimationFrame || _global.oRequestAnimationFrame || _global.msRequestAnimationFrame || _global.setTimeout;
function normalizeWheel (/* object*/event) /* object*/ {
var sX = 0,

2
src/core/utils/prefixIntervalTree.js

@ -4,7 +4,7 @@
return Math.floor(node / 2);
};
var Int32Array = window.Int32Array || function (size) {
var Int32Array = _global.Int32Array || function (size) {
var xs = [];
for (var i = size - 1; i >= 0; --i) {
xs[i] = 0;

50
src/core/widget.js

@ -7,11 +7,12 @@
*/
!(function () {
var lazy = (typeof document !== 'undefined' &&
typeof document.documentMode === 'number') ||
(typeof navigator !== 'undefined' &&
typeof navigator.userAgent === 'string' &&
var lazy = (typeof document !== "undefined" &&
typeof document.documentMode === "number") ||
(typeof navigator !== "undefined" &&
typeof navigator.userAgent === "string" &&
/\bEdge\/\d/.test(navigator.userAgent));
BI.Widget = BI.inherit(BI.OB, {
_defaultConfig: function () {
return BI.extend(BI.Widget.superclass._defaultConfig.apply(this), {
@ -59,20 +60,14 @@
this._initElementHeight();
this._initVisual();
this._initState();
if (this.isVisible()) {
if (this.beforeInit) {
this.__asking = true;
this.beforeInit(BI.bind(this._render, this));
if (this.__asking === true) {
this.__async = true;
}
} else {
this._render();
if (this.beforeInit) {
this.__asking = true;
this.beforeInit(BI.bind(this._render, this));
if (this.__asking === true) {
this.__async = true;
}
this.rendered = true
}
if (this._isRoot) {
this._mount()
} else {
this._render();
}
},
@ -185,7 +180,7 @@
_mount: function () {
var self = this;
var isMounted = this._isMounted;
if (this._isMounting || isMounted || !this.isVisible() || this.__asking === true) {
if (isMounted || this.__asking === true) {
return;
}
if (this._isRoot === true) {
@ -196,30 +191,17 @@
if (!isMounted) {
return;
}
this._isMounting = true
if (!this.rendered) {
if (this.beforeInit) {
this.__asking = true;
this.beforeInit(BI.bind(this._render, this));
if (this.__asking === true) {
this.__async = true;
}
} else {
this._render();
}
}
this.beforeMount && this.beforeMount();
this._isMounted = true;
lazy && this._mountChildren && this._mountChildren();
!lazy && this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(false);
!self.isValid() && widget._setValid(false);
widget._mount && widget._mount();
});
!lazy && this._mountChildren && this._mountChildren();
lazy && this._mountChildren && this._mountChildren();
this.mounted && this.mounted();
this._isMounting = false
return true;
},
_mountChildren: null,

6
src/core/wrapper/layout.js

@ -63,6 +63,10 @@ BI.Layout = BI.inherit(BI.Widget, {
}
},
appendFragment: function (frag) {
this.element.append(frag);
},
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
@ -74,7 +78,7 @@ BI.Layout = BI.inherit(BI.Widget, {
}
});
if (hasChild === true) {
this.element.append(frag);
this.appendFragment(frag);
}
},

17
src/core/wrapper/layout/adapt/adapt.center.js

@ -87,20 +87,9 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
return td;
},
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
frag.appendChild(widget.element[0]);
hasChild = true;
}
});
if (hasChild === true) {
this.$tr.append(frag);
this.element.append(this.$table);
}
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
},
resize: function () {

17
src/core/wrapper/layout/adapt/adapt.horizontal.js

@ -86,20 +86,9 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
return td;
},
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
frag.appendChild(widget.element[0]);
hasChild = true;
}
});
if (hasChild === true) {
this.$tr.append(frag);
this.element.append(this.$table);
}
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
},
resize: function () {

17
src/core/wrapper/layout/adapt/adapt.vertical.js

@ -87,20 +87,9 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
return td;
},
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
frag.appendChild(widget.element[0]);
hasChild = true;
}
});
if (hasChild === true) {
this.$tr.append(frag);
this.element.append(this.$table);
}
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
},
_getWrapper: function () {

17
src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js

@ -24,20 +24,9 @@ BI.FlexCenterLayout = BI.inherit(BI.Layout, {
return w;
},
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
frag.appendChild(widget.element[0]);
hasChild = true;
}
});
if (hasChild === true) {
this.$wrapper.append(frag);
this.element.append(this.$wrapper);
}
appendFragment: function (frag) {
this.$wrapper.append(frag);
this.element.append(this.$wrapper);
},
_getWrapper: function () {

17
src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js

@ -54,20 +54,9 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
return w;
},
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
frag.appendChild(widget.element[0]);
hasChild = true;
}
});
if (hasChild === true) {
this.$wrapper.append(frag);
this.element.append(this.$wrapper);
}
appendFragment: function (frag) {
this.$wrapper.append(frag);
this.element.append(this.$wrapper);
},
_getWrapper: function () {

17
src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js

@ -54,20 +54,9 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, {
return w;
},
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
frag.appendChild(widget.element[0]);
hasChild = true;
}
});
if (hasChild === true) {
this.$wrapper.append(frag);
this.element.append(this.$wrapper);
}
appendFragment: function (frag) {
this.$wrapper.append(frag);
this.element.append(this.$wrapper);
},
_getWrapper: function () {

18
src/core/wrapper/layout/layout.horizontal.js

@ -87,23 +87,11 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
return td;
},
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
frag.appendChild(widget.element[0]);
hasChild = true;
}
});
if (hasChild === true) {
this.$tr.append(frag);
this.element.append(this.$table);
}
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
},
resize: function () {
// console.log("horizontal layout do not need to resize");
},

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

@ -119,20 +119,9 @@ BI.TdLayout = BI.inherit(BI.Layout, {
return tr;
},
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
frag.appendChild(widget.element[0]);
hasChild = true;
}
});
if (hasChild === true) {
this.$table.append(frag);
this.element.append(this.$table);
}
appendFragment: function (frag) {
this.$table.append(frag);
this.element.append(this.$table);
},
resize: function () {

2
src/polyfill/console.js

@ -3,7 +3,7 @@
* Created by wang on 15/6/23.
*/
// 解决console未定义问题 guy
window.console = window.console || (function () {
_global.console = _global.console || (function () {
var c = {};
c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile
= c.clear = c.exception = c.trace = c.assert = function () {

2
src/polyfill/localStorage.js

@ -1,7 +1,7 @@
/*
* 前端缓存
*/
window.localStorage || (window.localStorage = {
_global.localStorage || (_global.localStorage = {
items: {},
setItem: function (k, v) {
BI.Cache.addCookie(k, v);

2
src/polyfill/sort.js

@ -25,7 +25,7 @@
return this;
}
return _sort.call(this);
};
}
}(window);

8
src/router/router.js

@ -318,8 +318,8 @@
// Ensure that `History` can be used outside of the browser.
if (typeof window !== "undefined") {
this.location = window.location;
this.history = window.history;
this.location = _global.location;
this.history = _global.history;
}
};
@ -437,7 +437,7 @@
}
// Add a cross-platform `addEventListener` shim for older browsers.
var addEventListener = window.addEventListener || function (eventName, listener) {
var addEventListener = _global.addEventListener || function (eventName, listener) {
return attachEvent("on" + eventName, listener);
};
@ -458,7 +458,7 @@
// but possibly useful for unit testing Routers.
stop: function () {
// Add a cross-platform `removeEventListener` shim for older browsers.
var removeEventListener = window.removeEventListener || function (eventName, listener) {
var removeEventListener = _global.removeEventListener || function (eventName, listener) {
return detachEvent("on" + eventName, listener);
};

2
src/third/jquery.mousewheel.js

@ -72,7 +72,7 @@
function handler (event) {
var orgEvent = event || window.event,
var orgEvent = event || _global.event,
args = slice.call(arguments, 1),
delta = 0,
deltaX = 0,

13
src/widget/multiselect/multiselect.loader.js

@ -103,12 +103,15 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
},
value: this.storeValue
});
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.button_group],
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top), BI.extend({
scrolly: true,
vgap: 5
});
}, opts.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top, this.button_group)
}))));
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});

Loading…
Cancel
Save