|
|
@ -11888,7 +11888,7 @@ if (!window.BI) { |
|
|
|
clone = {}; |
|
|
|
clone = {}; |
|
|
|
|
|
|
|
|
|
|
|
for (var i in obj) { |
|
|
|
for (var i in obj) { |
|
|
|
if (_.has(obj, i)) { |
|
|
|
if (BI.has(obj, i)) { |
|
|
|
clone[i] = BI.deepClone(obj[i]); |
|
|
|
clone[i] = BI.deepClone(obj[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -12653,6 +12653,8 @@ BI.Widget = BI.inherit(BI.OB, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
beforeInit: null, |
|
|
|
|
|
|
|
|
|
|
|
// 生命周期函数
|
|
|
|
// 生命周期函数
|
|
|
|
beforeCreate: null, |
|
|
|
beforeCreate: null, |
|
|
|
|
|
|
|
|
|
|
@ -12675,12 +12677,20 @@ BI.Widget = BI.inherit(BI.OB, { |
|
|
|
|
|
|
|
|
|
|
|
_init: function () { |
|
|
|
_init: function () { |
|
|
|
BI.Widget.superclass._init.apply(this, arguments); |
|
|
|
BI.Widget.superclass._init.apply(this, arguments); |
|
|
|
this.beforeCreate && this.beforeCreate(); |
|
|
|
|
|
|
|
this._initRoot(); |
|
|
|
this._initRoot(); |
|
|
|
this._initElementWidth(); |
|
|
|
this._initElementWidth(); |
|
|
|
this._initElementHeight(); |
|
|
|
this._initElementHeight(); |
|
|
|
this._initVisual(); |
|
|
|
this._initVisual(); |
|
|
|
this._initState(); |
|
|
|
this._initState(); |
|
|
|
|
|
|
|
if (this.beforeInit) { |
|
|
|
|
|
|
|
this.beforeInit(BI.bind(this._render, this)); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this._render(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_render: function(){ |
|
|
|
|
|
|
|
this.beforeCreate && this.beforeCreate(); |
|
|
|
this._initElement(); |
|
|
|
this._initElement(); |
|
|
|
this._initEffects(); |
|
|
|
this._initEffects(); |
|
|
|
this.created && this.created(); |
|
|
|
this.created && this.created(); |
|
|
@ -13100,9 +13110,15 @@ BI.Widget = BI.inherit(BI.OB, { |
|
|
|
return new cls(config); |
|
|
|
return new cls(config); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
BI.createWidget = function (item, options) { |
|
|
|
BI.createWidget = function (item, options, context) { |
|
|
|
var el, w; |
|
|
|
var el, w; |
|
|
|
options || (options = {}); |
|
|
|
item || (item = {}); |
|
|
|
|
|
|
|
if (BI.isWidget(options)) { |
|
|
|
|
|
|
|
context = options; |
|
|
|
|
|
|
|
options = {}; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
options || (options = {}); |
|
|
|
|
|
|
|
} |
|
|
|
if (BI.isEmpty(item) && BI.isEmpty(options)) { |
|
|
|
if (BI.isEmpty(item) && BI.isEmpty(options)) { |
|
|
|
return BI.createWidget({ |
|
|
|
return BI.createWidget({ |
|
|
|
type: "bi.layout" |
|
|
|
type: "bi.layout" |
|
|
@ -13111,17 +13127,17 @@ BI.Widget = BI.inherit(BI.OB, { |
|
|
|
if (BI.isWidget(item)) { |
|
|
|
if (BI.isWidget(item)) { |
|
|
|
return item; |
|
|
|
return item; |
|
|
|
} |
|
|
|
} |
|
|
|
if (item && (item.type || options.type)) { |
|
|
|
if (item.type || options.type) { |
|
|
|
el = BI.extend({}, options, item); |
|
|
|
el = BI.extend({}, options, item); |
|
|
|
w = BI.Plugin.getWidget(el.type, el); |
|
|
|
w = BI.Plugin.getWidget(el.type, el); |
|
|
|
return w.type === el.type ? BI.Plugin.getObject(el.type, createWidget(w)) : BI.createWidget(BI.extend({}, item, {type: w.type}, options)); |
|
|
|
return w.type === el.type ? BI.Plugin.getObject(el.type, createWidget(w)) : BI.createWidget(BI.extend({}, item, {type: w.type}, options)); |
|
|
|
} |
|
|
|
} |
|
|
|
if (item && item.el && (item.el.type || options.type)) { |
|
|
|
if (item.el && (item.el.type || options.type)) { |
|
|
|
el = BI.extend({}, options, item.el); |
|
|
|
el = BI.extend({}, options, item.el); |
|
|
|
w = BI.Plugin.getWidget(el.type, el); |
|
|
|
w = BI.Plugin.getWidget(el.type, el); |
|
|
|
return w.type === el.type ? BI.Plugin.getObject(el.type, createWidget(w)) : BI.createWidget(BI.extend({}, item, {type: w.type}, options)); |
|
|
|
return w.type === el.type ? BI.Plugin.getObject(el.type, createWidget(w)) : BI.createWidget(BI.extend({}, item, {type: w.type}, options)); |
|
|
|
} |
|
|
|
} |
|
|
|
if (item && BI.isWidget(item.el)) { |
|
|
|
if (BI.isWidget(item.el)) { |
|
|
|
return item.el; |
|
|
|
return item.el; |
|
|
|
} |
|
|
|
} |
|
|
|
throw new Error("无法根据item创建组件"); |
|
|
|
throw new Error("无法根据item创建组件"); |
|
|
@ -16790,7 +16806,7 @@ BI.Layout = BI.inherit(BI.Widget, { |
|
|
|
_addElement: function (i, item) { |
|
|
|
_addElement: function (i, item) { |
|
|
|
var self = this, w; |
|
|
|
var self = this, w; |
|
|
|
if (!this.hasWidget(this._getChildName(i))) { |
|
|
|
if (!this.hasWidget(this._getChildName(i))) { |
|
|
|
w = BI.createWidget(item); |
|
|
|
w = BI.createWidget(item, this); |
|
|
|
w.on(BI.Events.DESTROY, function () { |
|
|
|
w.on(BI.Events.DESTROY, function () { |
|
|
|
BI.each(self._children, function (name, child) { |
|
|
|
BI.each(self._children, function (name, child) { |
|
|
|
if (child === w) { |
|
|
|
if (child === w) { |
|
|
@ -17279,9 +17295,15 @@ BI.shortcut("bi.layout", BI.Layout);BI.Plugin = BI.Plugin || {}; |
|
|
|
!(function () { |
|
|
|
!(function () { |
|
|
|
var _WidgetsPlugin = {}; |
|
|
|
var _WidgetsPlugin = {}; |
|
|
|
var _ObjectPlugin = {}; |
|
|
|
var _ObjectPlugin = {}; |
|
|
|
|
|
|
|
var _ConfigPlugin = {}; |
|
|
|
BI.extend(BI.Plugin, { |
|
|
|
BI.extend(BI.Plugin, { |
|
|
|
|
|
|
|
|
|
|
|
getWidget: function (type, options) { |
|
|
|
getWidget: function (type, options) { |
|
|
|
|
|
|
|
if (_ConfigPlugin[type]) { |
|
|
|
|
|
|
|
for (var i = _ConfigPlugin[type].length - 1; i >= 0; i--) { |
|
|
|
|
|
|
|
_ConfigPlugin[type][i](options); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if (_WidgetsPlugin[type]) { |
|
|
|
if (_WidgetsPlugin[type]) { |
|
|
|
var res; |
|
|
|
var res; |
|
|
|
for (var i = _WidgetsPlugin[type].length - 1; i >= 0; i--) { |
|
|
|
for (var i = _WidgetsPlugin[type].length - 1; i >= 0; i--) { |
|
|
@ -17293,6 +17315,13 @@ BI.shortcut("bi.layout", BI.Layout);BI.Plugin = BI.Plugin || {}; |
|
|
|
return options; |
|
|
|
return options; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
configWidget: function (type, fn) { |
|
|
|
|
|
|
|
if (!_ConfigPlugin[type]) { |
|
|
|
|
|
|
|
_ConfigPlugin[type] = []; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
_ConfigPlugin[type].push(fn); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
registerWidget: function (type, fn) { |
|
|
|
registerWidget: function (type, fn) { |
|
|
|
if (!_WidgetsPlugin[type]) { |
|
|
|
if (!_WidgetsPlugin[type]) { |
|
|
|
_WidgetsPlugin[type] = []; |
|
|
|
_WidgetsPlugin[type] = []; |
|
|
@ -18593,19 +18622,19 @@ BI.FloatBoxController = BI.inherit(BI.Controller, { |
|
|
|
return BI.isNotNull(this.floatManager[name]); |
|
|
|
return BI.isNotNull(this.floatManager[name]); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
create: function (name, section, options) { |
|
|
|
create: function (name, section, options, context) { |
|
|
|
if (this._check(name)) { |
|
|
|
if (this._check(name)) { |
|
|
|
return this; |
|
|
|
return this; |
|
|
|
} |
|
|
|
} |
|
|
|
var floatbox = BI.createWidget({ |
|
|
|
var floatbox = BI.createWidget({ |
|
|
|
type: "bi.float_box" |
|
|
|
type: "bi.float_box" |
|
|
|
}, options); |
|
|
|
}, options, context); |
|
|
|
floatbox.populate(section); |
|
|
|
floatbox.populate(section); |
|
|
|
this.add(name, floatbox, options); |
|
|
|
this.add(name, floatbox, options, context); |
|
|
|
return this; |
|
|
|
return this; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
add: function (name, floatbox, options) { |
|
|
|
add: function (name, floatbox, options, context) { |
|
|
|
var self = this; |
|
|
|
var self = this; |
|
|
|
options || (options = {}); |
|
|
|
options || (options = {}); |
|
|
|
if (this._check(name)) { |
|
|
|
if (this._check(name)) { |
|
|
@ -18618,7 +18647,7 @@ BI.FloatBoxController = BI.inherit(BI.Controller, { |
|
|
|
el: (this.floatLayer[name] = BI.createWidget({ |
|
|
|
el: (this.floatLayer[name] = BI.createWidget({ |
|
|
|
type: "bi.absolute", |
|
|
|
type: "bi.absolute", |
|
|
|
items: [floatbox] |
|
|
|
items: [floatbox] |
|
|
|
})), |
|
|
|
}, context)), |
|
|
|
left: 0, |
|
|
|
left: 0, |
|
|
|
right: 0, |
|
|
|
right: 0, |
|
|
|
top: 0, |
|
|
|
top: 0, |
|
|
@ -18745,7 +18774,7 @@ BI.LayerController = BI.inherit(BI.Controller, { |
|
|
|
return this.create(name, null, op); |
|
|
|
return this.create(name, null, op); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
create: function (name, from, op) { |
|
|
|
create: function (name, from, op, context) { |
|
|
|
if (this.has(name)) { |
|
|
|
if (this.has(name)) { |
|
|
|
return this.get(name); |
|
|
|
return this.get(name); |
|
|
|
} |
|
|
|
} |
|
|
@ -18764,7 +18793,7 @@ BI.LayerController = BI.inherit(BI.Controller, { |
|
|
|
var widget = BI.createWidget((op.render || {}), { |
|
|
|
var widget = BI.createWidget((op.render || {}), { |
|
|
|
type: "bi.layout", |
|
|
|
type: "bi.layout", |
|
|
|
cls: op.cls |
|
|
|
cls: op.cls |
|
|
|
}); |
|
|
|
}, context); |
|
|
|
var layout = BI.createWidget({ |
|
|
|
var layout = BI.createWidget({ |
|
|
|
type: "bi.absolute", |
|
|
|
type: "bi.absolute", |
|
|
|
items: [{ |
|
|
|
items: [{ |
|
|
@ -18774,7 +18803,7 @@ BI.LayerController = BI.inherit(BI.Controller, { |
|
|
|
top: 0, |
|
|
|
top: 0, |
|
|
|
bottom: 0 |
|
|
|
bottom: 0 |
|
|
|
}] |
|
|
|
}] |
|
|
|
}); |
|
|
|
}, context); |
|
|
|
BI.createWidget({ |
|
|
|
BI.createWidget({ |
|
|
|
type: "bi.absolute", |
|
|
|
type: "bi.absolute", |
|
|
|
element: op.container || this.options.render, |
|
|
|
element: op.container || this.options.render, |
|
|
@ -20454,7 +20483,7 @@ BI.extend(BI.DOM, { |
|
|
|
} |
|
|
|
} |
|
|
|
return configFn(providers[type]); |
|
|
|
return configFn(providers[type]); |
|
|
|
} |
|
|
|
} |
|
|
|
BI.Plugin.registerWidget(type, configFn); |
|
|
|
BI.Plugin.configWidget(type, configFn); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var actions = {}; |
|
|
|
var actions = {}; |
|
|
@ -22609,7 +22638,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, { |
|
|
|
var td; |
|
|
|
var td; |
|
|
|
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; |
|
|
|
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; |
|
|
|
if (!this.hasWidget(this._getChildName(i))) { |
|
|
|
if (!this.hasWidget(this._getChildName(i))) { |
|
|
|
var w = BI.createWidget(item); |
|
|
|
var w = BI.createWidget(item, this); |
|
|
|
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); |
|
|
|
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); |
|
|
|
td = BI.createWidget({ |
|
|
|
td = BI.createWidget({ |
|
|
|
type: "bi.default", |
|
|
|
type: "bi.default", |
|
|
@ -22618,7 +22647,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, { |
|
|
|
width: width |
|
|
|
width: width |
|
|
|
}, |
|
|
|
}, |
|
|
|
items: [w] |
|
|
|
items: [w] |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
this.addWidget(this._getChildName(i), td); |
|
|
|
this.addWidget(this._getChildName(i), td); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
td = this.getWidgetByName(this._getChildName(i)); |
|
|
|
td = this.getWidgetByName(this._getChildName(i)); |
|
|
@ -22727,7 +22756,7 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, { |
|
|
|
var td; |
|
|
|
var td; |
|
|
|
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; |
|
|
|
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; |
|
|
|
if (!this.hasWidget(this._getChildName(i))) { |
|
|
|
if (!this.hasWidget(this._getChildName(i))) { |
|
|
|
var w = BI.createWidget(item); |
|
|
|
var w = BI.createWidget(item, this); |
|
|
|
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); |
|
|
|
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); |
|
|
|
td = BI.createWidget({ |
|
|
|
td = BI.createWidget({ |
|
|
|
type: "bi.default", |
|
|
|
type: "bi.default", |
|
|
@ -22736,7 +22765,7 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, { |
|
|
|
width: width |
|
|
|
width: width |
|
|
|
}, |
|
|
|
}, |
|
|
|
items: [w] |
|
|
|
items: [w] |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
this.addWidget(this._getChildName(i), td); |
|
|
|
this.addWidget(this._getChildName(i), td); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
td = this.getWidgetByName(this._getChildName(i)); |
|
|
|
td = this.getWidgetByName(this._getChildName(i)); |
|
|
@ -22850,7 +22879,7 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { |
|
|
|
hgap: o.lhgap, |
|
|
|
hgap: o.lhgap, |
|
|
|
lgap: o.llgap, |
|
|
|
lgap: o.llgap, |
|
|
|
rgap: o.lrgap |
|
|
|
rgap: o.lrgap |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
left.element.css("height", "100%"); |
|
|
|
left.element.css("height", "100%"); |
|
|
|
BI.createWidget({ |
|
|
|
BI.createWidget({ |
|
|
|
type: "bi.left", |
|
|
|
type: "bi.left", |
|
|
@ -22865,7 +22894,7 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { |
|
|
|
hgap: o.rhgap, |
|
|
|
hgap: o.rhgap, |
|
|
|
lgap: o.rlgap, |
|
|
|
lgap: o.rlgap, |
|
|
|
rgap: o.rrgap |
|
|
|
rgap: o.rrgap |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
right.element.css("height", "100%"); |
|
|
|
right.element.css("height", "100%"); |
|
|
|
BI.createWidget({ |
|
|
|
BI.createWidget({ |
|
|
|
type: "bi.right", |
|
|
|
type: "bi.right", |
|
|
@ -22915,7 +22944,7 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, { |
|
|
|
lgap: o.lgap, |
|
|
|
lgap: o.lgap, |
|
|
|
hgap: o.hgap, |
|
|
|
hgap: o.hgap, |
|
|
|
rgap: o.rgap |
|
|
|
rgap: o.rgap |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
left.element.css("height", "100%"); |
|
|
|
left.element.css("height", "100%"); |
|
|
|
BI.createWidget({ |
|
|
|
BI.createWidget({ |
|
|
|
type: "bi.left", |
|
|
|
type: "bi.left", |
|
|
@ -22963,7 +22992,7 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, { |
|
|
|
lgap: o.lgap, |
|
|
|
lgap: o.lgap, |
|
|
|
hgap: o.hgap, |
|
|
|
hgap: o.hgap, |
|
|
|
rgap: o.rgap |
|
|
|
rgap: o.rgap |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
right.element.css("height", "100%"); |
|
|
|
right.element.css("height", "100%"); |
|
|
|
BI.createWidget({ |
|
|
|
BI.createWidget({ |
|
|
|
type: "bi.right", |
|
|
|
type: "bi.right", |
|
|
@ -23016,7 +23045,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, { |
|
|
|
var td; |
|
|
|
var td; |
|
|
|
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; |
|
|
|
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; |
|
|
|
if (!this.hasWidget(this._getChildName(i))) { |
|
|
|
if (!this.hasWidget(this._getChildName(i))) { |
|
|
|
var w = BI.createWidget(item); |
|
|
|
var w = BI.createWidget(item, this); |
|
|
|
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); |
|
|
|
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); |
|
|
|
td = BI.createWidget({ |
|
|
|
td = BI.createWidget({ |
|
|
|
type: "bi.default", |
|
|
|
type: "bi.default", |
|
|
@ -23025,7 +23054,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, { |
|
|
|
width: width |
|
|
|
width: width |
|
|
|
}, |
|
|
|
}, |
|
|
|
items: [w] |
|
|
|
items: [w] |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
this.addWidget(this._getChildName(i), td); |
|
|
|
this.addWidget(this._getChildName(i), td); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
td = this.getWidgetByName(this._getChildName(i)); |
|
|
|
td = this.getWidgetByName(this._getChildName(i)); |
|
|
@ -23215,7 +23244,7 @@ BI.FloatCenterAdaptLayout = BI.inherit(BI.Layout, { |
|
|
|
bgap: o.bgap, |
|
|
|
bgap: o.bgap, |
|
|
|
lgap: o.lgap, |
|
|
|
lgap: o.lgap, |
|
|
|
rgap: o.rgap |
|
|
|
rgap: o.rgap |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
|
|
|
|
|
|
|
|
this.container = BI.createWidget({ |
|
|
|
this.container = BI.createWidget({ |
|
|
|
type: "bi.left", |
|
|
|
type: "bi.left", |
|
|
@ -23283,7 +23312,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, { |
|
|
|
bgap: o.bgap, |
|
|
|
bgap: o.bgap, |
|
|
|
lgap: o.lgap, |
|
|
|
lgap: o.lgap, |
|
|
|
rgap: o.rgap |
|
|
|
rgap: o.rgap |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
|
|
|
|
|
|
|
|
this.container = BI.createWidget({ |
|
|
|
this.container = BI.createWidget({ |
|
|
|
type: "bi.left", |
|
|
|
type: "bi.left", |
|
|
@ -23922,7 +23951,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, { |
|
|
|
if (item != null) { |
|
|
|
if (item != null) { |
|
|
|
if (item.el) { |
|
|
|
if (item.el) { |
|
|
|
if (!this.hasWidget(this.getName() + "north")) { |
|
|
|
if (!this.hasWidget(this.getName() + "north")) { |
|
|
|
var w = BI.createWidget(item); |
|
|
|
var w = BI.createWidget(item, this); |
|
|
|
this.addWidget(this.getName() + "north", w); |
|
|
|
this.addWidget(this.getName() + "north", w); |
|
|
|
} |
|
|
|
} |
|
|
|
this.getWidgetByName(this.getName() + "north").element.height(item.height) |
|
|
|
this.getWidgetByName(this.getName() + "north").element.height(item.height) |
|
|
@ -23942,7 +23971,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, { |
|
|
|
if (item != null) { |
|
|
|
if (item != null) { |
|
|
|
if (item.el) { |
|
|
|
if (item.el) { |
|
|
|
if (!this.hasWidget(this.getName() + "south")) { |
|
|
|
if (!this.hasWidget(this.getName() + "south")) { |
|
|
|
var w = BI.createWidget(item); |
|
|
|
var w = BI.createWidget(item, this); |
|
|
|
this.addWidget(this.getName() + "south", w); |
|
|
|
this.addWidget(this.getName() + "south", w); |
|
|
|
} |
|
|
|
} |
|
|
|
this.getWidgetByName(this.getName() + "south").element.height(item.height) |
|
|
|
this.getWidgetByName(this.getName() + "south").element.height(item.height) |
|
|
@ -23962,7 +23991,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, { |
|
|
|
if (item != null) { |
|
|
|
if (item != null) { |
|
|
|
if (item.el) { |
|
|
|
if (item.el) { |
|
|
|
if (!this.hasWidget(this.getName() + "west")) { |
|
|
|
if (!this.hasWidget(this.getName() + "west")) { |
|
|
|
var w = BI.createWidget(item); |
|
|
|
var w = BI.createWidget(item, this); |
|
|
|
this.addWidget(this.getName() + "west", w); |
|
|
|
this.addWidget(this.getName() + "west", w); |
|
|
|
} |
|
|
|
} |
|
|
|
this.getWidgetByName(this.getName() + "west").element.width(item.width) |
|
|
|
this.getWidgetByName(this.getName() + "west").element.width(item.width) |
|
|
@ -23982,7 +24011,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, { |
|
|
|
if (item != null) { |
|
|
|
if (item != null) { |
|
|
|
if (item.el) { |
|
|
|
if (item.el) { |
|
|
|
if (!this.hasWidget(this.getName() + "east")) { |
|
|
|
if (!this.hasWidget(this.getName() + "east")) { |
|
|
|
var w = BI.createWidget(item); |
|
|
|
var w = BI.createWidget(item, this); |
|
|
|
this.addWidget(this.getName() + "east", w); |
|
|
|
this.addWidget(this.getName() + "east", w); |
|
|
|
} |
|
|
|
} |
|
|
|
this.getWidgetByName(this.getName() + "east").element.width(item.width) |
|
|
|
this.getWidgetByName(this.getName() + "east").element.width(item.width) |
|
|
@ -24001,7 +24030,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, { |
|
|
|
item = regions["center"]; |
|
|
|
item = regions["center"]; |
|
|
|
if (item != null) { |
|
|
|
if (item != null) { |
|
|
|
if (!this.hasWidget(this.getName() + "center")) { |
|
|
|
if (!this.hasWidget(this.getName() + "center")) { |
|
|
|
var w = BI.createWidget(item); |
|
|
|
var w = BI.createWidget(item, this); |
|
|
|
this.addWidget(this.getName() + "center", w); |
|
|
|
this.addWidget(this.getName() + "center", w); |
|
|
|
} |
|
|
|
} |
|
|
|
this.getWidgetByName(this.getName() + "center").element |
|
|
|
this.getWidgetByName(this.getName() + "center").element |
|
|
@ -24045,7 +24074,7 @@ BI.CardLayout = BI.inherit(BI.Layout, { |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
if (item) { |
|
|
|
if (item) { |
|
|
|
if (!self.hasWidget(item.cardName)) { |
|
|
|
if (!self.hasWidget(item.cardName)) { |
|
|
|
var w = BI.createWidget(item); |
|
|
|
var w = BI.createWidget(item, this); |
|
|
|
w.on(BI.Events.DESTROY, function () { |
|
|
|
w.on(BI.Events.DESTROY, function () { |
|
|
|
var index = BI.findIndex(o.items, function (i, tItem) { |
|
|
|
var index = BI.findIndex(o.items, function (i, tItem) { |
|
|
|
return tItem.cardName == item.cardName; |
|
|
|
return tItem.cardName == item.cardName; |
|
|
@ -24115,7 +24144,7 @@ BI.CardLayout = BI.inherit(BI.Layout, { |
|
|
|
if (this.isCardExisted(cardName)) { |
|
|
|
if (this.isCardExisted(cardName)) { |
|
|
|
throw new Error("cardName is already exist"); |
|
|
|
throw new Error("cardName is already exist"); |
|
|
|
} |
|
|
|
} |
|
|
|
var widget = BI.createWidget(cardItem); |
|
|
|
var widget = BI.createWidget(cardItem, this); |
|
|
|
widget.element.css({ |
|
|
|
widget.element.css({ |
|
|
|
position: "relative", |
|
|
|
position: "relative", |
|
|
|
top: "0", |
|
|
|
top: "0", |
|
|
@ -24396,7 +24425,7 @@ BI.DivisionLayout = BI.inherit(BI.Layout, { |
|
|
|
throw new Error("item be required"); |
|
|
|
throw new Error("item be required"); |
|
|
|
} |
|
|
|
} |
|
|
|
if(!this.hasWidget(this.getName() + i + "_" + j)) { |
|
|
|
if(!this.hasWidget(this.getName() + i + "_" + j)) { |
|
|
|
var w = BI.createWidget(map[i][j]); |
|
|
|
var w = BI.createWidget(map[i][j], this); |
|
|
|
this.addWidget(this.getName() + i + "_" + j, w); |
|
|
|
this.addWidget(this.getName() + i + "_" + j, w); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
w = this.getWidgetByName(this.getName() + i + "_" + j); |
|
|
|
w = this.getWidgetByName(this.getName() + i + "_" + j); |
|
|
@ -24476,6 +24505,9 @@ BI.FloatLeftLayout = BI.inherit(BI.Layout, { |
|
|
|
if (BI.isNotNull(item.top)) { |
|
|
|
if (BI.isNotNull(item.top)) { |
|
|
|
w.element.css({top: item.top}); |
|
|
|
w.element.css({top: item.top}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (BI.isNotNull(item.bottom)) { |
|
|
|
|
|
|
|
w.element.css({bottom: item.bottom}); |
|
|
|
|
|
|
|
} |
|
|
|
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { |
|
|
|
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { |
|
|
|
w.element.css({ |
|
|
|
w.element.css({ |
|
|
|
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px" |
|
|
|
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px" |
|
|
@ -24549,6 +24581,9 @@ BI.FloatRightLayout = BI.inherit(BI.Layout, { |
|
|
|
if (BI.isNotNull(item.top)) { |
|
|
|
if (BI.isNotNull(item.top)) { |
|
|
|
w.element.css({top: item.top}); |
|
|
|
w.element.css({top: item.top}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (BI.isNotNull(item.bottom)) { |
|
|
|
|
|
|
|
w.element.css({bottom: item.bottom}); |
|
|
|
|
|
|
|
} |
|
|
|
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { |
|
|
|
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { |
|
|
|
w.element.css({ |
|
|
|
w.element.css({ |
|
|
|
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px" |
|
|
|
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px" |
|
|
@ -24675,18 +24710,18 @@ BI.GridLayout = BI.inherit(BI.Layout, { |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
if (BI.isArray(item)) { |
|
|
|
if (BI.isArray(item)) { |
|
|
|
BI.each(item, function (j, el) { |
|
|
|
BI.each(item, function (j, el) { |
|
|
|
els[i][j] = BI.createWidget(el); |
|
|
|
els[i][j] = BI.createWidget(el, this); |
|
|
|
}); |
|
|
|
}); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
els[item.row][item.column] = BI.createWidget(item); |
|
|
|
els[item.row][item.column] = BI.createWidget(item, this); |
|
|
|
}); |
|
|
|
}); |
|
|
|
for (var i = 0; i < rows; i++) { |
|
|
|
for (var i = 0; i < rows; i++) { |
|
|
|
for (var j = 0; j < columns; j++) { |
|
|
|
for (var j = 0; j < columns; j++) { |
|
|
|
if (!els[i][j]) { |
|
|
|
if (!els[i][j]) { |
|
|
|
els[i][j] = BI.createWidget({ |
|
|
|
els[i][j] = BI.createWidget({ |
|
|
|
type: "bi.layout" |
|
|
|
type: "bi.layout" |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
} |
|
|
|
} |
|
|
|
first(els[i][j], i, j); |
|
|
|
first(els[i][j], i, j); |
|
|
|
els[i][j].element.css({ |
|
|
|
els[i][j].element.css({ |
|
|
@ -24745,7 +24780,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, { |
|
|
|
var td; |
|
|
|
var td; |
|
|
|
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; |
|
|
|
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; |
|
|
|
if (!this.hasWidget(this._getChildName(i))) { |
|
|
|
if (!this.hasWidget(this._getChildName(i))) { |
|
|
|
var w = BI.createWidget(item); |
|
|
|
var w = BI.createWidget(item, this); |
|
|
|
w.element.css({position: "relative", margin: "0px auto"}); |
|
|
|
w.element.css({position: "relative", margin: "0px auto"}); |
|
|
|
td = BI.createWidget({ |
|
|
|
td = BI.createWidget({ |
|
|
|
type: "bi.default", |
|
|
|
type: "bi.default", |
|
|
@ -24754,7 +24789,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, { |
|
|
|
width: width |
|
|
|
width: width |
|
|
|
}, |
|
|
|
}, |
|
|
|
items: [w] |
|
|
|
items: [w] |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
this.addWidget(this._getChildName(i), td); |
|
|
|
this.addWidget(this._getChildName(i), td); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
td = this.getWidgetByName(this._getChildName(i)); |
|
|
|
td = this.getWidgetByName(this._getChildName(i)); |
|
|
@ -25057,7 +25092,7 @@ BI.TableLayout = BI.inherit(BI.Layout, { |
|
|
|
type: "bi.absolute", |
|
|
|
type: "bi.absolute", |
|
|
|
height: BI.isArray(o.rowSize) ? o.rowSize[this.rows] : o.rowSize, |
|
|
|
height: BI.isArray(o.rowSize) ? o.rowSize[this.rows] : o.rowSize, |
|
|
|
items: abs |
|
|
|
items: abs |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
if (this.rows > 0) { |
|
|
|
if (this.rows > 0) { |
|
|
|
this.getWidgetByName(this.getName() + (this.rows - 1)).element.css({ |
|
|
|
this.getWidgetByName(this.getName() + (this.rows - 1)).element.css({ |
|
|
|
"margin-bottom": o.vgap |
|
|
|
"margin-bottom": o.vgap |
|
|
@ -25135,7 +25170,7 @@ BI.HTapeLayout = BI.inherit(BI.Layout, { |
|
|
|
items = BI.compact(items); |
|
|
|
items = BI.compact(items); |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
if (!self.hasWidget(self.getName() + i + "")) { |
|
|
|
if (!self.hasWidget(self.getName() + i + "")) { |
|
|
|
var w = BI.createWidget(item); |
|
|
|
var w = BI.createWidget(item, this); |
|
|
|
self.addWidget(self.getName() + i + "", w); |
|
|
|
self.addWidget(self.getName() + i + "", w); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
w = self.getWidgetByName(self.getName() + i + ""); |
|
|
|
w = self.getWidgetByName(self.getName() + i + ""); |
|
|
@ -25240,7 +25275,7 @@ BI.VTapeLayout = BI.inherit(BI.Layout, { |
|
|
|
items = BI.compact(items); |
|
|
|
items = BI.compact(items); |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
if (!self.hasWidget(self.getName() + i + "")) { |
|
|
|
if (!self.hasWidget(self.getName() + i + "")) { |
|
|
|
var w = BI.createWidget(item); |
|
|
|
var w = BI.createWidget(item, this); |
|
|
|
self.addWidget(self.getName() + i + "", w); |
|
|
|
self.addWidget(self.getName() + i + "", w); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
w = self.getWidgetByName(self.getName() + i + ""); |
|
|
|
w = self.getWidgetByName(self.getName() + i + ""); |
|
|
@ -25375,10 +25410,10 @@ BI.TdLayout = BI.inherit(BI.Layout, { |
|
|
|
var tr = BI.createWidget({ |
|
|
|
var tr = BI.createWidget({ |
|
|
|
type: "bi.default", |
|
|
|
type: "bi.default", |
|
|
|
tagName: "tr" |
|
|
|
tagName: "tr" |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < arr.length; i++) { |
|
|
|
for (var i = 0; i < arr.length; i++) { |
|
|
|
var w = BI.createWidget(arr[i]); |
|
|
|
var w = BI.createWidget(arr[i], this); |
|
|
|
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); |
|
|
|
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); |
|
|
|
if (arr[i].lgap) { |
|
|
|
if (arr[i].lgap) { |
|
|
|
w.element.css({"margin-left": arr[i].lgap + "px"}); |
|
|
|
w.element.css({"margin-left": arr[i].lgap + "px"}); |
|
|
@ -25400,7 +25435,7 @@ BI.TdLayout = BI.inherit(BI.Layout, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
tagName: "td", |
|
|
|
tagName: "td", |
|
|
|
items: [w] |
|
|
|
items: [w] |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
td.element.css({ |
|
|
|
td.element.css({ |
|
|
|
position: "relative", |
|
|
|
position: "relative", |
|
|
|
"vertical-align": "middle", |
|
|
|
"vertical-align": "middle", |
|
|
@ -25604,7 +25639,7 @@ BI.WindowLayout = BI.inherit(BI.Layout, { |
|
|
|
throw new Error("item be required"); |
|
|
|
throw new Error("item be required"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!this.hasWidget(this.getName() + i + "_" + j)) { |
|
|
|
if (!this.hasWidget(this.getName() + i + "_" + j)) { |
|
|
|
var w = BI.createWidget(o.items[i][j]); |
|
|
|
var w = BI.createWidget(o.items[i][j], this); |
|
|
|
w.element.css({position: "absolute"}); |
|
|
|
w.element.css({position: "absolute"}); |
|
|
|
this.addWidget(this.getName() + i + "_" + j, w); |
|
|
|
this.addWidget(this.getName() + i + "_" + j, w); |
|
|
|
} |
|
|
|
} |
|
|
@ -25736,12 +25771,12 @@ BI.CenterLayout = BI.inherit(BI.Layout, { |
|
|
|
el: BI.createWidget({ |
|
|
|
el: BI.createWidget({ |
|
|
|
type: "bi.default", |
|
|
|
type: "bi.default", |
|
|
|
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "") |
|
|
|
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "") |
|
|
|
}) |
|
|
|
}, this) |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
if (item) { |
|
|
|
if (item) { |
|
|
|
var w = BI.createWidget(item); |
|
|
|
var w = BI.createWidget(item, this); |
|
|
|
w.element.css({ |
|
|
|
w.element.css({ |
|
|
|
position: "absolute", |
|
|
|
position: "absolute", |
|
|
|
left: o.hgap + o.lgap, |
|
|
|
left: o.hgap + o.lgap, |
|
|
@ -25805,7 +25840,7 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, { |
|
|
|
BI.each(items, function (i) { |
|
|
|
BI.each(items, function (i) { |
|
|
|
var widget = BI.createWidget({ |
|
|
|
var widget = BI.createWidget({ |
|
|
|
type: "bi.default" |
|
|
|
type: "bi.default" |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
widget.element.addClass("center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")).css({ |
|
|
|
widget.element.addClass("center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")).css({ |
|
|
|
width: width + "%", |
|
|
|
width: width + "%", |
|
|
|
height: "100%" |
|
|
|
height: "100%" |
|
|
@ -25816,7 +25851,7 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
if (item) { |
|
|
|
if (item) { |
|
|
|
var w = BI.createWidget(item); |
|
|
|
var w = BI.createWidget(item, this); |
|
|
|
w.element.css({ |
|
|
|
w.element.css({ |
|
|
|
position: "absolute", |
|
|
|
position: "absolute", |
|
|
|
left: o.hgap + o.lgap, |
|
|
|
left: o.hgap + o.lgap, |
|
|
@ -25882,12 +25917,12 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, { |
|
|
|
el: BI.createWidget({ |
|
|
|
el: BI.createWidget({ |
|
|
|
type: "bi.default", |
|
|
|
type: "bi.default", |
|
|
|
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "") |
|
|
|
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "") |
|
|
|
}) |
|
|
|
}, this) |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
if (item) { |
|
|
|
if (item) { |
|
|
|
var w = BI.createWidget(item); |
|
|
|
var w = BI.createWidget(item, this); |
|
|
|
w.element.css({ |
|
|
|
w.element.css({ |
|
|
|
position: "absolute", |
|
|
|
position: "absolute", |
|
|
|
left: o.hgap + o.lgap, |
|
|
|
left: o.hgap + o.lgap, |
|
|
@ -25954,12 +25989,12 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, { |
|
|
|
el: BI.createWidget({ |
|
|
|
el: BI.createWidget({ |
|
|
|
type: "bi.default", |
|
|
|
type: "bi.default", |
|
|
|
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "") |
|
|
|
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "") |
|
|
|
}) |
|
|
|
}, this) |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
if (item) { |
|
|
|
if (item) { |
|
|
|
var w = BI.createWidget(item); |
|
|
|
var w = BI.createWidget(item, this); |
|
|
|
w.element.css({ |
|
|
|
w.element.css({ |
|
|
|
position: "absolute", |
|
|
|
position: "absolute", |
|
|
|
left: o.hgap + o.lgap, |
|
|
|
left: o.hgap + o.lgap, |
|
|
@ -27432,7 +27467,7 @@ Data.Source = BISource = { |
|
|
|
var targetStack = []; |
|
|
|
var targetStack = []; |
|
|
|
|
|
|
|
|
|
|
|
function pushTarget (_target) { |
|
|
|
function pushTarget (_target) { |
|
|
|
if (target) targetStack.push(target); |
|
|
|
if (_target) targetStack.push(_target); |
|
|
|
Fix.Model.target = target = _target; |
|
|
|
Fix.Model.target = target = _target; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -27440,6 +27475,18 @@ Data.Source = BISource = { |
|
|
|
Fix.Model.target = target = targetStack.pop(); |
|
|
|
Fix.Model.target = target = targetStack.pop(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var context = null; |
|
|
|
|
|
|
|
var contextStack = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function pushContext (_context) { |
|
|
|
|
|
|
|
if (_context) contextStack.push(_context); |
|
|
|
|
|
|
|
Fix.Model.context = context = _context; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function popContext () { |
|
|
|
|
|
|
|
Fix.Model.context = context = contextStack.pop(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var oldWatch = Fix.watch; |
|
|
|
var oldWatch = Fix.watch; |
|
|
|
Fix.watch = function (model, expOrFn, cb, options) { |
|
|
|
Fix.watch = function (model, expOrFn, cb, options) { |
|
|
|
if (BI.isPlainObject(cb)) { |
|
|
|
if (BI.isPlainObject(cb)) { |
|
|
@ -27471,11 +27518,27 @@ Data.Source = BISource = { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _create = BI.createWidget; |
|
|
|
|
|
|
|
BI.createWidget = function (item, options, context) { |
|
|
|
|
|
|
|
var pushed = false; |
|
|
|
|
|
|
|
if (BI.isWidget(options)) { |
|
|
|
|
|
|
|
pushContext(options); |
|
|
|
|
|
|
|
pushed = true; |
|
|
|
|
|
|
|
} else if (context != null) { |
|
|
|
|
|
|
|
pushContext(context); |
|
|
|
|
|
|
|
pushed = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var result = _create.apply(this, arguments); |
|
|
|
|
|
|
|
pushed && popContext(); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var _init = BI.Widget.prototype._init; |
|
|
|
var _init = BI.Widget.prototype._init; |
|
|
|
BI.Widget.prototype._init = function () { |
|
|
|
BI.Widget.prototype._init = function () { |
|
|
|
|
|
|
|
var self = this; |
|
|
|
var needPop = false; |
|
|
|
var needPop = false; |
|
|
|
if (window.Fix && this._store) { |
|
|
|
if (window.Fix && this._store) { |
|
|
|
var store = findStore(this.options.element); |
|
|
|
var store = findStore(this.options.element || context); |
|
|
|
if (store) { |
|
|
|
if (store) { |
|
|
|
pushTarget(store); |
|
|
|
pushTarget(store); |
|
|
|
needPop = true; |
|
|
|
needPop = true; |
|
|
@ -27489,13 +27552,20 @@ Data.Source = BISource = { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.model = this.store; |
|
|
|
this.model = this.store; |
|
|
|
} |
|
|
|
} |
|
|
|
initWatch(this, this.watch); |
|
|
|
|
|
|
|
needPop = true; |
|
|
|
needPop = true; |
|
|
|
} |
|
|
|
} |
|
|
|
_init.apply(this, arguments); |
|
|
|
_init.apply(this, arguments); |
|
|
|
needPop && popTarget(); |
|
|
|
needPop && popTarget(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _render = BI.Widget.prototype._render; |
|
|
|
|
|
|
|
BI.Widget.prototype._render = function () { |
|
|
|
|
|
|
|
if (window.Fix && this._store) { |
|
|
|
|
|
|
|
initWatch(this, this.watch); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
_render.apply(this, arguments); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var unMount = BI.Widget.prototype.__d; |
|
|
|
var unMount = BI.Widget.prototype.__d; |
|
|
|
BI.Widget.prototype.__d = function () { |
|
|
|
BI.Widget.prototype.__d = function () { |
|
|
|
unMount.apply(this, arguments); |
|
|
|
unMount.apply(this, arguments); |
|
|
@ -30722,7 +30792,7 @@ BI.Combo = BI.inherit(BI.Widget, { |
|
|
|
this.popupView = BI.createWidget(this.options.popup, { |
|
|
|
this.popupView = BI.createWidget(this.options.popup, { |
|
|
|
type: "bi.popup_view", |
|
|
|
type: "bi.popup_view", |
|
|
|
value: o.value |
|
|
|
value: o.value |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { |
|
|
|
this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { |
|
|
|
if (type === BI.Events.CLICK) { |
|
|
|
if (type === BI.Events.CLICK) { |
|
|
|
self.combo.setValue(self.getValue()); |
|
|
|
self.combo.setValue(self.getValue()); |
|
|
@ -31123,7 +31193,7 @@ BI.Expander = BI.inherit(BI.Widget, { |
|
|
|
vgap: 0 |
|
|
|
vgap: 0 |
|
|
|
}], |
|
|
|
}], |
|
|
|
value: o.value |
|
|
|
value: o.value |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { |
|
|
|
this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { |
|
|
|
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); |
|
|
|
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); |
|
|
|
if (type === BI.Events.CLICK) { |
|
|
|
if (type === BI.Events.CLICK) { |
|
|
@ -31963,7 +32033,7 @@ BI.Searcher = BI.inherit(BI.Widget, { |
|
|
|
BI.Maskers.create(this.getName(), o.adapter, BI.extend({ |
|
|
|
BI.Maskers.create(this.getName(), o.adapter, BI.extend({ |
|
|
|
container: this, |
|
|
|
container: this, |
|
|
|
render: this.popupView |
|
|
|
render: this.popupView |
|
|
|
}, o.masker)); |
|
|
|
}, o.masker), this); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -32120,7 +32190,7 @@ BI.Searcher = BI.inherit(BI.Widget, { |
|
|
|
return o.popup.value; |
|
|
|
return o.popup.value; |
|
|
|
} |
|
|
|
} |
|
|
|
return this.popupView.getValue(); |
|
|
|
return this.popupView.getValue(); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
populate: function (result, searchResult, keyword) { |
|
|
|
populate: function (result, searchResult, keyword) { |
|
|
@ -32291,7 +32361,7 @@ BI.Switcher = BI.inherit(BI.Widget, { |
|
|
|
vgap: 0 |
|
|
|
vgap: 0 |
|
|
|
}], |
|
|
|
}], |
|
|
|
value: o.value |
|
|
|
value: o.value |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { |
|
|
|
this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { |
|
|
|
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); |
|
|
|
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); |
|
|
|
if (type === BI.Events.CLICK) { |
|
|
|
if (type === BI.Events.CLICK) { |
|
|
@ -42994,7 +43064,7 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
|
|
|
|
|
|
|
|
_createView: function () { |
|
|
|
_createView: function () { |
|
|
|
var o = this.options; |
|
|
|
var o = this.options; |
|
|
|
this.button_group = BI.createWidget(o.el, {type: "bi.button_group", value: o.value}); |
|
|
|
this.button_group = BI.createWidget(o.el, {type: "bi.button_group", value: o.value}, this); |
|
|
|
this.button_group.element.css({"min-height": o.minHeight + "px"}); |
|
|
|
this.button_group.element.css({"min-height": o.minHeight + "px"}); |
|
|
|
return this.button_group; |
|
|
|
return this.button_group; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -43004,7 +43074,7 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
if (false === o.tool) { |
|
|
|
if (false === o.tool) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
return BI.createWidget(o.tool); |
|
|
|
return BI.createWidget(o.tool, this); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_createTab: function () { |
|
|
|
_createTab: function () { |
|
|
@ -43018,7 +43088,7 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
height: 25, |
|
|
|
height: 25, |
|
|
|
items: o.tabs, |
|
|
|
items: o.tabs, |
|
|
|
value: o.value |
|
|
|
value: o.value |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_createToolBar: function () { |
|
|
|
_createToolBar: function () { |
|
|
@ -43036,7 +43106,7 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
shadow: true, |
|
|
|
shadow: true, |
|
|
|
isShadowShowingOnSelected: true |
|
|
|
isShadowShowingOnSelected: true |
|
|
|
}) |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, this); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getView: function () { |
|
|
|
getView: function () { |
|
|
@ -76962,39 +77032,11 @@ BI.BranchRelation = BI.inherit(BI.Widget, { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_transformToTreeFormat: function (sNodes) { |
|
|
|
|
|
|
|
var i, l; |
|
|
|
|
|
|
|
if (!sNodes) { |
|
|
|
|
|
|
|
return []; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (BI.isArray(sNodes)) { |
|
|
|
|
|
|
|
var r = []; |
|
|
|
|
|
|
|
var tmpMap = []; |
|
|
|
|
|
|
|
for (i = 0, l = sNodes.length; i < l; i++) { |
|
|
|
|
|
|
|
tmpMap[sNodes[i].id] = sNodes[i]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for (i = 0, l = sNodes.length; i < l; i++) { |
|
|
|
|
|
|
|
if (tmpMap[sNodes[i].pId] && sNodes[i].id != sNodes[i].pId) { |
|
|
|
|
|
|
|
if (!tmpMap[sNodes[i].pId].children) { |
|
|
|
|
|
|
|
tmpMap[sNodes[i].pId].children = []; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
tmpMap[sNodes[i].pId].children.push(sNodes[i]); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
r.push(sNodes[i]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return r; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return [sNodes]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
populate: function (items) { |
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
o.items = items || []; |
|
|
|
o.items = items || []; |
|
|
|
this.empty(); |
|
|
|
this.empty(); |
|
|
|
items = this._transformToTreeFormat(o.items); |
|
|
|
items = BI.Tree.transformToTreeFormat(o.items); |
|
|
|
this.tree = new BI.Tree(); |
|
|
|
this.tree = new BI.Tree(); |
|
|
|
this.tree.initTree(items); |
|
|
|
this.tree.initTree(items); |
|
|
|
|
|
|
|
|
|
|
|