|
|
@ -1,4 +1,4 @@ |
|
|
|
/*! time: 2021-3-1 14:10:42 */ |
|
|
|
/*! time: 2021-3-2 15:20:41 */ |
|
|
|
/******/ (function(modules) { // webpackBootstrap
|
|
|
|
/******/ (function(modules) { // webpackBootstrap
|
|
|
|
/******/ // The module cache
|
|
|
|
/******/ // The module cache
|
|
|
|
/******/ var installedModules = {}; |
|
|
|
/******/ var installedModules = {}; |
|
|
@ -4905,6 +4905,9 @@ if (!_global.BI) { |
|
|
|
|
|
|
|
|
|
|
|
// 获得一个当前对象的引用
|
|
|
|
// 获得一个当前对象的引用
|
|
|
|
_initRef: function () { |
|
|
|
_initRef: function () { |
|
|
|
|
|
|
|
if (this.options.__ref) { |
|
|
|
|
|
|
|
this.options.__ref.call(this, this); |
|
|
|
|
|
|
|
} |
|
|
|
if (this.options.ref) { |
|
|
|
if (this.options.ref) { |
|
|
|
this.options.ref.call(this, this); |
|
|
|
this.options.ref.call(this, this); |
|
|
|
} |
|
|
|
} |
|
|
@ -4912,6 +4915,10 @@ if (!_global.BI) { |
|
|
|
|
|
|
|
|
|
|
|
//释放当前对象
|
|
|
|
//释放当前对象
|
|
|
|
_purgeRef: function () { |
|
|
|
_purgeRef: function () { |
|
|
|
|
|
|
|
if (this.options.__ref) { |
|
|
|
|
|
|
|
this.options.__ref.call(null); |
|
|
|
|
|
|
|
this.options.__ref = null; |
|
|
|
|
|
|
|
} |
|
|
|
if (this.options.ref) { |
|
|
|
if (this.options.ref) { |
|
|
|
this.options.ref.call(null); |
|
|
|
this.options.ref.call(null); |
|
|
|
this.options.ref = null; |
|
|
|
this.options.ref = null; |
|
|
@ -13812,7 +13819,8 @@ module.exports = function (exec) { |
|
|
|
baseCls: "", |
|
|
|
baseCls: "", |
|
|
|
extraCls: "", |
|
|
|
extraCls: "", |
|
|
|
cls: "", |
|
|
|
cls: "", |
|
|
|
css: null |
|
|
|
css: null, |
|
|
|
|
|
|
|
updateMode: "manual" // manual / auto
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -13853,8 +13861,11 @@ module.exports = function (exec) { |
|
|
|
|
|
|
|
|
|
|
|
shouldUpdate: null, |
|
|
|
shouldUpdate: null, |
|
|
|
|
|
|
|
|
|
|
|
update: function () { |
|
|
|
update: null, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
beforeUpdate: null, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updated: null, |
|
|
|
|
|
|
|
|
|
|
|
beforeDestroy: null, |
|
|
|
beforeDestroy: null, |
|
|
|
|
|
|
|
|
|
|
@ -14003,26 +14014,59 @@ module.exports = function (exec) { |
|
|
|
* @private |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
_mount: function (force, deep, lifeHook, predicate) { |
|
|
|
_mount: function (force, deep, lifeHook, predicate) { |
|
|
|
|
|
|
|
if (this.__beforeMount(force, deep, lifeHook, predicate)) { |
|
|
|
|
|
|
|
this.__afterMount(lifeHook, predicate); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__beforeMount: function (force, deep, lifeHook, predicate) { |
|
|
|
var self = this; |
|
|
|
var self = this; |
|
|
|
if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) { |
|
|
|
if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
lifeHook !== false && callLifeHook(this, "beforeMount"); |
|
|
|
lifeHook !== false && callLifeHook(this, "beforeMount"); |
|
|
|
this._isMounted = true; |
|
|
|
this._isMounted = true; |
|
|
|
this._mountChildren && this._mountChildren(); |
|
|
|
|
|
|
|
BI.each(this._children, function (i, widget) { |
|
|
|
BI.each(this._children, function (i, widget) { |
|
|
|
!self.isEnabled() && widget._setEnable(false); |
|
|
|
!self.isEnabled() && widget._setEnable(false); |
|
|
|
!self.isValid() && widget._setValid(false); |
|
|
|
!self.isValid() && widget._setValid(false); |
|
|
|
widget._mount && widget._mount(deep ? force : false, deep, lifeHook, predicate); |
|
|
|
widget.__beforeMount && widget.__beforeMount(deep ? force : false, deep, lifeHook, predicate); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this._mountChildren && this._mountChildren(); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__afterMount: function (lifeHook, predicate) { |
|
|
|
|
|
|
|
BI.each(this._children, function (i, widget) { |
|
|
|
|
|
|
|
widget.__afterMount && widget.__afterMount(lifeHook, predicate); |
|
|
|
}); |
|
|
|
}); |
|
|
|
lifeHook !== false && callLifeHook(this, "mounted"); |
|
|
|
lifeHook !== false && callLifeHook(this, "mounted"); |
|
|
|
this.fireEvent(BI.Events.MOUNT); |
|
|
|
this.fireEvent(BI.Events.MOUNT); |
|
|
|
predicate && predicate(this); |
|
|
|
predicate && predicate(this); |
|
|
|
return true; |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_mountChildren: null, |
|
|
|
_mountChildren: null, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_update: function (nextProps, shouldUpdate) { |
|
|
|
|
|
|
|
var o = this.options; |
|
|
|
|
|
|
|
callLifeHook(this, "beforeUpdate"); |
|
|
|
|
|
|
|
if (shouldUpdate) { |
|
|
|
|
|
|
|
var res = this.update && this.update(nextProps, shouldUpdate); |
|
|
|
|
|
|
|
} else if (BI.isNull(shouldUpdate)) { |
|
|
|
|
|
|
|
// 默认使用shallowCompare的方式进行更新
|
|
|
|
|
|
|
|
var nextChange = {}; |
|
|
|
|
|
|
|
BI.each(nextProps, function (key, value) { |
|
|
|
|
|
|
|
if (o[key] !== value) { |
|
|
|
|
|
|
|
nextChange[key] = value; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
var res = this.update && BI.isNotEmptyObject(nextChange) && this.update(nextChange); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
callLifeHook(this, "updated"); |
|
|
|
|
|
|
|
return res; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
isMounted: function () { |
|
|
|
isMounted: function () { |
|
|
|
return this._isMounted; |
|
|
|
return this._isMounted; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -15144,19 +15188,13 @@ BI.Layout = BI.inherit(BI.Widget, { |
|
|
|
if (!child.shouldUpdate) { |
|
|
|
if (!child.shouldUpdate) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
return child.shouldUpdate(this._getOptions(item)) === true; |
|
|
|
return child.shouldUpdate(this._getOptions(item)); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
updateItemAt: function (index, item) { |
|
|
|
updateItemAt: function (index, item) { |
|
|
|
if (index < 0 || index > this.options.items.length - 1) { |
|
|
|
if (index < 0 || index > this.options.items.length - 1) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var child = this._children[this._getChildName(index)]; |
|
|
|
|
|
|
|
var updated; |
|
|
|
|
|
|
|
if (updated = child.update(this._getOptions(item))) { |
|
|
|
|
|
|
|
return updated; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var del = this._children[this._getChildName(index)]; |
|
|
|
var del = this._children[this._getChildName(index)]; |
|
|
|
delete this._children[this._getChildName(index)]; |
|
|
|
delete this._children[this._getChildName(index)]; |
|
|
|
this.options.items.splice(index, 1); |
|
|
|
this.options.items.splice(index, 1); |
|
|
@ -15243,7 +15281,14 @@ BI.Layout = BI.inherit(BI.Widget, { |
|
|
|
|
|
|
|
|
|
|
|
patchItem: function (oldVnode, vnode, index) { |
|
|
|
patchItem: function (oldVnode, vnode, index) { |
|
|
|
var shouldUpdate = this.shouldUpdateItem(index, vnode); |
|
|
|
var shouldUpdate = this.shouldUpdateItem(index, vnode); |
|
|
|
if (shouldUpdate === true || (shouldUpdate === null && !this._compare(oldVnode, vnode))) { |
|
|
|
var child = this._children[this._getChildName(index)]; |
|
|
|
|
|
|
|
if (shouldUpdate) { |
|
|
|
|
|
|
|
return child._update(this._getOptions(vnode), shouldUpdate); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (shouldUpdate === null && !this._compare(oldVnode, vnode)) { |
|
|
|
|
|
|
|
if (child.update) { |
|
|
|
|
|
|
|
return child.update(this._getOptions(vnode)); |
|
|
|
|
|
|
|
} |
|
|
|
return this.updateItemAt(index, vnode); |
|
|
|
return this.updateItemAt(index, vnode); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -22481,6 +22526,7 @@ BI.Single = BI.inherit(BI.Widget, { |
|
|
|
setValue: function (val) { |
|
|
|
setValue: function (val) { |
|
|
|
if (!this.options.readonly) { |
|
|
|
if (!this.options.readonly) { |
|
|
|
this.options.value = val; |
|
|
|
this.options.value = val; |
|
|
|
|
|
|
|
this.options.setValue && this.options.setValue(val); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -22488,14 +22534,27 @@ BI.Single = BI.inherit(BI.Widget, { |
|
|
|
return this.options.value; |
|
|
|
return this.options.value; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
update: function (props, shouldUpdate) { |
|
|
|
|
|
|
|
if (BI.isObject(shouldUpdate)) { |
|
|
|
|
|
|
|
props = shouldUpdate; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ("value" in props) { |
|
|
|
|
|
|
|
this.setValue(props.value); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ("text" in props) { |
|
|
|
|
|
|
|
this.setText && this.setText(props.text); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
destroyed: function () { |
|
|
|
destroyed: function () { |
|
|
|
if (BI.isNotNull(this.showTimeout)) { |
|
|
|
if (BI.isNotNull(this.showTimeout)) { |
|
|
|
clearTimeout(this.showTimeout); |
|
|
|
clearTimeout(this.showTimeout); |
|
|
|
this.showTimeout = null; |
|
|
|
this.showTimeout = null; |
|
|
|
} |
|
|
|
} |
|
|
|
BI.Tooltips.remove(this.getName()); |
|
|
|
BI.Tooltips.remove(this.getName()); |
|
|
|
}, |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
BI.shortcut("bi.single", BI.Single); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ }), |
|
|
@ -23070,11 +23129,6 @@ BI.BasicButton = BI.inherit(BI.Single, { |
|
|
|
return this.options.text; |
|
|
|
return this.options.text; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (value) { |
|
|
|
|
|
|
|
BI.BasicButton.superclass.setValue.apply(this, arguments); |
|
|
|
|
|
|
|
this.options.setValue && this.options.setValue.call(this, value); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_setEnable: function (enable) { |
|
|
|
_setEnable: function (enable) { |
|
|
|
BI.BasicButton.superclass._setEnable.apply(this, arguments); |
|
|
|
BI.BasicButton.superclass._setEnable.apply(this, arguments); |
|
|
|
if (enable === true) { |
|
|
|
if (enable === true) { |
|
|
@ -28571,7 +28625,6 @@ BI.shortcut("bi.image_button", BI.ImageButton); |
|
|
|
/* 429 */ |
|
|
|
/* 429 */ |
|
|
|
/***/ (function(module, exports) { |
|
|
|
/***/ (function(module, exports) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 文字类型的按钮 |
|
|
|
* 文字类型的按钮 |
|
|
|
* @class BI.Button |
|
|
|
* @class BI.Button |
|
|
@ -28617,7 +28670,10 @@ BI.Button = BI.inherit(BI.BasicButton, { |
|
|
|
BI.Button.superclass._init.apply(this, arguments); |
|
|
|
BI.Button.superclass._init.apply(this, arguments); |
|
|
|
var o = this.options, self = this; |
|
|
|
var o = this.options, self = this; |
|
|
|
if (BI.isNumber(o.height) && !o.clear && !o.block) { |
|
|
|
if (BI.isNumber(o.height) && !o.clear && !o.block) { |
|
|
|
this.element.css({height: o.height / BI.pixRatio + BI.pixUnit, lineHeight: (o.height - 2) / BI.pixRatio + BI.pixUnit}); |
|
|
|
this.element.css({ |
|
|
|
|
|
|
|
height: o.height / BI.pixRatio + BI.pixUnit, |
|
|
|
|
|
|
|
lineHeight: (o.height - 2) / BI.pixRatio + BI.pixUnit |
|
|
|
|
|
|
|
}); |
|
|
|
} else if (o.clear || o.block) { |
|
|
|
} else if (o.clear || o.block) { |
|
|
|
this.element.css({lineHeight: o.height / BI.pixRatio + BI.pixUnit}); |
|
|
|
this.element.css({lineHeight: o.height / BI.pixRatio + BI.pixUnit}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -97906,6 +97962,74 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView); |
|
|
|
needPop && popTarget(); |
|
|
|
needPop && popTarget(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BI.Widget.prototype._initElement = function () { |
|
|
|
|
|
|
|
var self = this; |
|
|
|
|
|
|
|
var render = BI.isFunction(this.options.render) ? this.options.render : this.render; |
|
|
|
|
|
|
|
var els; |
|
|
|
|
|
|
|
if (this.options.updateMode === "auto" && this._store) { |
|
|
|
|
|
|
|
// 自动更新模式
|
|
|
|
|
|
|
|
var childComponents = {}; |
|
|
|
|
|
|
|
var rendered = false; |
|
|
|
|
|
|
|
this._watchers.push(Fix.watch(this.model, function () { |
|
|
|
|
|
|
|
if (rendered) { |
|
|
|
|
|
|
|
var newEls = render && render.call(this); |
|
|
|
|
|
|
|
BI.each(childComponents, function (i, childComponent) { |
|
|
|
|
|
|
|
var nextProps = BI.get([newEls], childComponent.path); |
|
|
|
|
|
|
|
if (nextProps) { |
|
|
|
|
|
|
|
var shouldUpdate = childComponent.component.shouldUpdate && childComponent.component.shouldUpdate(nextProps); |
|
|
|
|
|
|
|
childComponent.component._update(nextProps, shouldUpdate); |
|
|
|
|
|
|
|
childComponent.props = BI.extend(childComponent.props, nextProps); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
els = render && render.call(this); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function traverse (parent, path) { |
|
|
|
|
|
|
|
BI.each(parent, function (i, child) { |
|
|
|
|
|
|
|
var childPath = path.concat(i); |
|
|
|
|
|
|
|
if (BI.isArray(child)) { |
|
|
|
|
|
|
|
traverse(child, childPath); |
|
|
|
|
|
|
|
} else if (BI.isPlainObject(child)) { |
|
|
|
|
|
|
|
if (child.type) { |
|
|
|
|
|
|
|
child.__ref = function (_ref) { |
|
|
|
|
|
|
|
if (_ref) { |
|
|
|
|
|
|
|
var comp = childComponents[this.getName()] = {}; |
|
|
|
|
|
|
|
comp.component = _ref; |
|
|
|
|
|
|
|
comp.props = child; |
|
|
|
|
|
|
|
comp.path = childPath; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
delete childComponents[this.getName()]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
traverse(child, childPath); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
traverse([els], []); |
|
|
|
|
|
|
|
rendered = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
})); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
els = render && render.call(this); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (BI.isPlainObject(els)) { |
|
|
|
|
|
|
|
els = [els]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (BI.isArray(els)) { |
|
|
|
|
|
|
|
BI.each(els, function (i, el) { |
|
|
|
|
|
|
|
if (el) { |
|
|
|
|
|
|
|
BI._lazyCreateWidget(el, { |
|
|
|
|
|
|
|
element: self |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// if (this._isRoot === true || !(this instanceof BI.Layout)) {
|
|
|
|
|
|
|
|
this._mount(); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var unMount = BI.Widget.prototype.__d; |
|
|
|
var unMount = BI.Widget.prototype.__d; |
|
|
|
BI.Widget.prototype.__d = function () { |
|
|
|
BI.Widget.prototype.__d = function () { |
|
|
|
try { |
|
|
|
try { |
|
|
|