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