|
|
@ -12358,6 +12358,13 @@ _.extend(BI.OB.prototype, { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//释放当前对象
|
|
|
|
|
|
|
|
_purgeRef: function(){ |
|
|
|
|
|
|
|
if (this.options.ref) { |
|
|
|
|
|
|
|
this.options.ref.call(null); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_getEvents: function () { |
|
|
|
_getEvents: function () { |
|
|
|
if (!$.isArray(this.events)) { |
|
|
|
if (!$.isArray(this.events)) { |
|
|
|
this.events = []; |
|
|
|
this.events = []; |
|
|
@ -12453,6 +12460,7 @@ _.extend(BI.OB.prototype, { |
|
|
|
|
|
|
|
|
|
|
|
destroy: function () { |
|
|
|
destroy: function () { |
|
|
|
this.destroyed && this.destroyed(); |
|
|
|
this.destroyed && this.destroyed(); |
|
|
|
|
|
|
|
this._purgeRef(); |
|
|
|
this.purgeListeners(); |
|
|
|
this.purgeListeners(); |
|
|
|
} |
|
|
|
} |
|
|
|
});/** |
|
|
|
});/** |
|
|
@ -12510,13 +12518,18 @@ BI.Widget = BI.inherit(BI.OB, { |
|
|
|
this._initVisual(); |
|
|
|
this._initVisual(); |
|
|
|
this._initState(); |
|
|
|
this._initState(); |
|
|
|
if (this.beforeInit) { |
|
|
|
if (this.beforeInit) { |
|
|
|
|
|
|
|
this.__asking = true; |
|
|
|
this.beforeInit(BI.bind(this._render, this)); |
|
|
|
this.beforeInit(BI.bind(this._render, this)); |
|
|
|
|
|
|
|
if (this.__asking === true) { |
|
|
|
|
|
|
|
this.__async = true; |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this._render(); |
|
|
|
this._render(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_render: function () { |
|
|
|
_render: function () { |
|
|
|
|
|
|
|
this.__asking = false; |
|
|
|
this.beforeCreate && this.beforeCreate(); |
|
|
|
this.beforeCreate && this.beforeCreate(); |
|
|
|
this._initElement(); |
|
|
|
this._initElement(); |
|
|
|
this._initEffects(); |
|
|
|
this._initEffects(); |
|
|
@ -12916,6 +12929,7 @@ BI.Widget = BI.inherit(BI.OB, { |
|
|
|
this.__d(); |
|
|
|
this.__d(); |
|
|
|
this.element.destroy(); |
|
|
|
this.element.destroy(); |
|
|
|
this.fireEvent(BI.Events.DESTROY); |
|
|
|
this.fireEvent(BI.Events.DESTROY); |
|
|
|
|
|
|
|
this._purgeRef(); |
|
|
|
this.purgeListeners(); |
|
|
|
this.purgeListeners(); |
|
|
|
} |
|
|
|
} |
|
|
|
});(function () { |
|
|
|
});(function () { |
|
|
@ -20327,15 +20341,52 @@ BI.extend(BI.DOM, { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var points = {}; |
|
|
|
|
|
|
|
BI.point = function (type, action, pointFn, after) { |
|
|
|
|
|
|
|
if (!points[type]) { |
|
|
|
|
|
|
|
points[type] = {}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!points[type][action]) { |
|
|
|
|
|
|
|
points[type][action] = {}; |
|
|
|
|
|
|
|
points[type][action][after ? "after" : "before"] = []; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
points[type][action][after ? "after" : "before"].push(pointFn); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
BI.Constants = { |
|
|
|
BI.Constants = { |
|
|
|
getConstant: function (type) { |
|
|
|
getConstant: function (type) { |
|
|
|
return constantInjection[type]; |
|
|
|
return constantInjection[type]; |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var callPoint = function (inst, type) { |
|
|
|
|
|
|
|
if (points[type]) { |
|
|
|
|
|
|
|
for (var action in points[type]) { |
|
|
|
|
|
|
|
var bfns = points[type][action].before; |
|
|
|
|
|
|
|
if (bfns) { |
|
|
|
|
|
|
|
BI.aspect.before(inst, action, function () { |
|
|
|
|
|
|
|
for (var i = 0, len = bfns.length; i < len; i++) { |
|
|
|
|
|
|
|
bfns[i].apply(inst, arguments); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var afns = points[type][action].after; |
|
|
|
|
|
|
|
if (afns) { |
|
|
|
|
|
|
|
BI.aspect.after(inst, action, function () { |
|
|
|
|
|
|
|
for (var i = 0, len = afns.length; i < len; i++) { |
|
|
|
|
|
|
|
afns[i].apply(inst, arguments); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
BI.Models = { |
|
|
|
BI.Models = { |
|
|
|
getModel: function (type, config) { |
|
|
|
getModel: function (type, config) { |
|
|
|
return new modelInjection[type](config); |
|
|
|
var inst = new modelInjection[type](config); |
|
|
|
|
|
|
|
callPoint(inst, type); |
|
|
|
|
|
|
|
return inst; |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -20346,10 +20397,9 @@ BI.extend(BI.DOM, { |
|
|
|
if (stores[type]) { |
|
|
|
if (stores[type]) { |
|
|
|
return stores[type]; |
|
|
|
return stores[type]; |
|
|
|
} |
|
|
|
} |
|
|
|
return stores[type] = new storeInjection[type](config); |
|
|
|
stores[type] = new storeInjection[type](config); |
|
|
|
}, |
|
|
|
callPoint(stores[type], type); |
|
|
|
releaseStore: function (type) { |
|
|
|
return stores[type]; |
|
|
|
delete stores[type]; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -20360,10 +20410,9 @@ BI.extend(BI.DOM, { |
|
|
|
if (services[type]) { |
|
|
|
if (services[type]) { |
|
|
|
return services[type]; |
|
|
|
return services[type]; |
|
|
|
} |
|
|
|
} |
|
|
|
return services[type] = new serviceInjection[type](config); |
|
|
|
services[type] = new serviceInjection[type](config); |
|
|
|
}, |
|
|
|
callPoint(services[type], type); |
|
|
|
releaseService: function (type) { |
|
|
|
return services[type]; |
|
|
|
delete services[type]; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -20378,10 +20427,6 @@ BI.extend(BI.DOM, { |
|
|
|
providerInstance[type] = new providers[type].$get()(config); |
|
|
|
providerInstance[type] = new providers[type].$get()(config); |
|
|
|
} |
|
|
|
} |
|
|
|
return providerInstance[type]; |
|
|
|
return providerInstance[type]; |
|
|
|
}, |
|
|
|
|
|
|
|
releaseProvider: function (type) { |
|
|
|
|
|
|
|
delete providers[type]; |
|
|
|
|
|
|
|
delete providerInstance[type]; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -26218,6 +26263,16 @@ BI.Pane = BI.inherit(BI.Widget, { |
|
|
|
|
|
|
|
|
|
|
|
_init: function () { |
|
|
|
_init: function () { |
|
|
|
BI.Pane.superclass._init.apply(this, arguments); |
|
|
|
BI.Pane.superclass._init.apply(this, arguments); |
|
|
|
|
|
|
|
if (this.__async) { |
|
|
|
|
|
|
|
this.loading(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_render: function () { |
|
|
|
|
|
|
|
BI.Pane.superclass._render.apply(this, arguments); |
|
|
|
|
|
|
|
if (this.__async) { |
|
|
|
|
|
|
|
this.loaded(); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_assertTip: function () { |
|
|
|
_assertTip: function () { |
|
|
@ -29786,18 +29841,29 @@ BI.shortcut("bi.combo_group", BI.ComboGroup);BI.VirtualGroup = BI.inherit(BI.Wid |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
render: function () { |
|
|
|
this.populate(this.options.items); |
|
|
|
var o = this.options; |
|
|
|
|
|
|
|
this.populate(o.items); |
|
|
|
|
|
|
|
if (BI.isKey(o.value)) { |
|
|
|
|
|
|
|
this.setValue(o.value); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_packageBtns: function (items) { |
|
|
|
_packageBtns: function (items) { |
|
|
|
var o = this.options; |
|
|
|
var o = this.options; |
|
|
|
|
|
|
|
var map = this.buttonMap = {}; |
|
|
|
for (var i = o.layouts.length - 1; i > 0; i--) { |
|
|
|
for (var i = o.layouts.length - 1; i > 0; i--) { |
|
|
|
items = BI.map(items, function (k, it) { |
|
|
|
items = BI.map(items, function (k, it) { |
|
|
|
|
|
|
|
var el = BI.stripEL(it); |
|
|
|
return BI.extend({}, o.layouts[i], { |
|
|
|
return BI.extend({}, o.layouts[i], { |
|
|
|
items: [ |
|
|
|
items: [ |
|
|
|
BI.extend({}, o.layouts[i].el, { |
|
|
|
BI.extend({}, o.layouts[i].el, { |
|
|
|
el: BI.stripEL(it) |
|
|
|
el: BI.extend({ |
|
|
|
|
|
|
|
ref: function (_ref) { |
|
|
|
|
|
|
|
if (BI.isKey(map[el.value])) { |
|
|
|
|
|
|
|
map[el.value] = _ref; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, el) |
|
|
|
}) |
|
|
|
}) |
|
|
|
] |
|
|
|
] |
|
|
|
}); |
|
|
|
}); |
|
|
@ -29806,10 +29872,6 @@ BI.shortcut("bi.combo_group", BI.ComboGroup);BI.VirtualGroup = BI.inherit(BI.Wid |
|
|
|
return items; |
|
|
|
return items; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_packageItems: function (items, packBtns) { |
|
|
|
|
|
|
|
return BI.createItems(BI.makeArrayByArray(items, {}), BI.clone(packBtns)); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_packageLayout: function (items) { |
|
|
|
_packageLayout: function (items) { |
|
|
|
var o = this.options, layout = BI.deepClone(o.layouts[0]); |
|
|
|
var o = this.options, layout = BI.deepClone(o.layouts[0]); |
|
|
|
|
|
|
|
|
|
|
@ -29830,11 +29892,40 @@ BI.shortcut("bi.combo_group", BI.ComboGroup);BI.VirtualGroup = BI.inherit(BI.Wid |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
setValue: function (v) { |
|
|
|
// this.layouts.setValue(v);
|
|
|
|
v = BI.isArray(v) ? v : [v]; |
|
|
|
|
|
|
|
BI.each(this.buttonMap, function (key, item) { |
|
|
|
|
|
|
|
if (item) { |
|
|
|
|
|
|
|
if (v.deepContains(key)) { |
|
|
|
|
|
|
|
item.setSelected && item.setSelected(true); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
item.setSelected && item.setSelected(false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getNotSelectedValue: function () { |
|
|
|
|
|
|
|
var v = []; |
|
|
|
|
|
|
|
BI.each(this.buttonMap, function (i, item) { |
|
|
|
|
|
|
|
if (item) { |
|
|
|
|
|
|
|
if (item.isEnabled() && !(item.isSelected && item.isSelected())) { |
|
|
|
|
|
|
|
v.push(item.getValue()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return v; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getValue: function () { |
|
|
|
getValue: function () { |
|
|
|
return this.layouts.getValue(); |
|
|
|
var v = []; |
|
|
|
|
|
|
|
BI.each(this.buttonMap, function (i, item) { |
|
|
|
|
|
|
|
if (item) { |
|
|
|
|
|
|
|
if (item.isEnabled() && item.isSelected && item.isSelected()) { |
|
|
|
|
|
|
|
v.push(item.getValue()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return v; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
populate: function (items) { |
|
|
|