|
|
@ -1,4 +1,4 @@ |
|
|
|
/*! time: 2020-11-16 12:50:27 */ |
|
|
|
/*! time: 2020-11-16 16:50:28 */ |
|
|
|
/******/ (function(modules) { // webpackBootstrap
|
|
|
|
/******/ (function(modules) { // webpackBootstrap
|
|
|
|
/******/ // The module cache
|
|
|
|
/******/ // The module cache
|
|
|
|
/******/ var installedModules = {}; |
|
|
|
/******/ var installedModules = {}; |
|
|
@ -13562,6 +13562,15 @@ module.exports = function (exec) { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
!(function () { |
|
|
|
!(function () { |
|
|
|
|
|
|
|
function callLifeHook (self, life) { |
|
|
|
|
|
|
|
if (self[life]) { |
|
|
|
|
|
|
|
var hooks = BI.isArray(self[life]) ? self[life] : [self[life]]; |
|
|
|
|
|
|
|
BI.each(hooks, function (i, hook) { |
|
|
|
|
|
|
|
hook(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
BI.Widget = BI.Widget || BI.inherit(BI.OB, { |
|
|
|
BI.Widget = BI.Widget || BI.inherit(BI.OB, { |
|
|
|
_defaultConfig: function () { |
|
|
|
_defaultConfig: function () { |
|
|
|
return BI.extend(BI.Widget.superclass._defaultConfig.apply(this), { |
|
|
|
return BI.extend(BI.Widget.superclass._defaultConfig.apply(this), { |
|
|
@ -13583,7 +13592,11 @@ module.exports = function (exec) { |
|
|
|
|
|
|
|
|
|
|
|
// 覆盖父类的_constructor方法,widget不走ob的生命周期
|
|
|
|
// 覆盖父类的_constructor方法,widget不走ob的生命周期
|
|
|
|
_constructor: function () { |
|
|
|
_constructor: function () { |
|
|
|
// do nothing
|
|
|
|
if (this.setup) { |
|
|
|
|
|
|
|
pushTarget(this); |
|
|
|
|
|
|
|
this.render = this.setup(); |
|
|
|
|
|
|
|
popTarget(); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_lazyConstructor: function () { |
|
|
|
_lazyConstructor: function () { |
|
|
@ -13639,10 +13652,10 @@ module.exports = function (exec) { |
|
|
|
|
|
|
|
|
|
|
|
_render: function () { |
|
|
|
_render: function () { |
|
|
|
this.__asking = false; |
|
|
|
this.__asking = false; |
|
|
|
this.beforeCreate && this.beforeCreate(); |
|
|
|
callLifeHook(this, "beforeCreate"); |
|
|
|
this._initElement(); |
|
|
|
this._initElement(); |
|
|
|
this._initEffects(); |
|
|
|
this._initEffects(); |
|
|
|
this.created && this.created(); |
|
|
|
callLifeHook(this, "created"); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -13727,11 +13740,6 @@ module.exports = function (exec) { |
|
|
|
_initElement: function () { |
|
|
|
_initElement: function () { |
|
|
|
var self = this; |
|
|
|
var self = this; |
|
|
|
var els = this.render && this.render(); |
|
|
|
var els = this.render && this.render(); |
|
|
|
if (!els) { |
|
|
|
|
|
|
|
pushTarget(this); |
|
|
|
|
|
|
|
els = this.setup && this.setup(); |
|
|
|
|
|
|
|
popTarget(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (BI.isPlainObject(els)) { |
|
|
|
if (BI.isPlainObject(els)) { |
|
|
|
els = [els]; |
|
|
|
els = [els]; |
|
|
|
} |
|
|
|
} |
|
|
@ -13765,7 +13773,7 @@ module.exports = function (exec) { |
|
|
|
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 && this.beforeMount && this.beforeMount(); |
|
|
|
lifeHook !== false && callLifeHook(this, "beforeMount"); |
|
|
|
this._isMounted = true; |
|
|
|
this._isMounted = true; |
|
|
|
this._mountChildren && this._mountChildren(); |
|
|
|
this._mountChildren && this._mountChildren(); |
|
|
|
BI.each(this._children, function (i, widget) { |
|
|
|
BI.each(this._children, function (i, widget) { |
|
|
@ -13773,7 +13781,7 @@ module.exports = function (exec) { |
|
|
|
!self.isValid() && widget._setValid(false); |
|
|
|
!self.isValid() && widget._setValid(false); |
|
|
|
widget._mount && widget._mount(deep ? force : false, deep, lifeHook, predicate); |
|
|
|
widget._mount && widget._mount(deep ? force : false, deep, lifeHook, predicate); |
|
|
|
}); |
|
|
|
}); |
|
|
|
lifeHook !== false && this.mounted && 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; |
|
|
|
return true; |
|
|
@ -14012,7 +14020,7 @@ module.exports = function (exec) { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
__d: function () { |
|
|
|
__d: function () { |
|
|
|
this.beforeDestroy && this.beforeDestroy(); |
|
|
|
callLifeHook(this, "beforeDestroy"); |
|
|
|
this.beforeDestroy = null; |
|
|
|
this.beforeDestroy = null; |
|
|
|
BI.each(this._children, function (i, widget) { |
|
|
|
BI.each(this._children, function (i, widget) { |
|
|
|
widget && widget._unMount && widget._unMount(); |
|
|
|
widget && widget._unMount && widget._unMount(); |
|
|
@ -14020,7 +14028,7 @@ module.exports = function (exec) { |
|
|
|
this._children = {}; |
|
|
|
this._children = {}; |
|
|
|
this._parent = null; |
|
|
|
this._parent = null; |
|
|
|
this._isMounted = false; |
|
|
|
this._isMounted = false; |
|
|
|
this.destroyed && this.destroyed(); |
|
|
|
callLifeHook(this, "destroyed"); |
|
|
|
this.destroyed = null; |
|
|
|
this.destroyed = null; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -14081,24 +14089,69 @@ module.exports = function (exec) { |
|
|
|
BI.Widget.current = current = currentStack.pop(); |
|
|
|
BI.Widget.current = current = currentStack.pop(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BI.useStore = function (_store) { |
|
|
|
|
|
|
|
if (current && current.store) { |
|
|
|
|
|
|
|
return current.store; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (current && current.$storeDelegate) { |
|
|
|
|
|
|
|
return current.$storeDelegate; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (current) { |
|
|
|
|
|
|
|
var delegate = {}; |
|
|
|
|
|
|
|
current._store = function () { |
|
|
|
|
|
|
|
var st = _store.apply(this, arguments); |
|
|
|
|
|
|
|
BI.extend(delegate, st); |
|
|
|
|
|
|
|
return st; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
return current.$storeDelegate = delegate; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BI.watch = function (watch, handler) { |
|
|
|
|
|
|
|
if (BI.Widget.current) { |
|
|
|
|
|
|
|
BI.Widget.current.$watchDelayCallbacks || (BI.Widget.current.$watchDelayCallbacks = []); |
|
|
|
|
|
|
|
BI.Widget.current.$watchDelayCallbacks.push([watch, handler]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
BI.onBeforeMount = function (beforeMount) { |
|
|
|
BI.onBeforeMount = function (beforeMount) { |
|
|
|
if (current) { |
|
|
|
if (current) { |
|
|
|
current.beforeMount = beforeMount; |
|
|
|
if (!current.beforeMount) { |
|
|
|
|
|
|
|
current.beforeMount = []; |
|
|
|
|
|
|
|
} else if (!BI.isArray(current.beforeMount)) { |
|
|
|
|
|
|
|
current.beforeMount = [current.beforeMount]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
current.beforeMount.push(beforeMount); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
BI.onMounted = function (mounted) { |
|
|
|
BI.onMounted = function (mounted) { |
|
|
|
if (current) { |
|
|
|
if (current) { |
|
|
|
current.mounted = mounted; |
|
|
|
if (!current.mounted) { |
|
|
|
|
|
|
|
current.mounted = []; |
|
|
|
|
|
|
|
} else if (!BI.isArray(current.mounted)) { |
|
|
|
|
|
|
|
current.mounted = [current.mounted]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
current.mounted.push(mounted); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
BI.onBeforeUnmount = function (beforeDestroy) { |
|
|
|
BI.onBeforeUnmount = function (beforeDestroy) { |
|
|
|
if (current) { |
|
|
|
if (current) { |
|
|
|
current.beforeDestroy = beforeDestroy; |
|
|
|
if (!current.beforeDestroy) { |
|
|
|
|
|
|
|
current.beforeDestroy = []; |
|
|
|
|
|
|
|
} else if (!BI.isArray(current.beforeDestroy)) { |
|
|
|
|
|
|
|
current.beforeDestroy = [current.beforeDestroy]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
current.beforeDestroy.push(beforeDestroy); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
BI.onUnmounted = function (destroyed) { |
|
|
|
BI.onUnmounted = function (destroyed) { |
|
|
|
if (current) { |
|
|
|
if (current) { |
|
|
|
current.destroyed = destroyed; |
|
|
|
if (!current.destroyed) { |
|
|
|
|
|
|
|
current.destroyed = []; |
|
|
|
|
|
|
|
} else if (!BI.isArray(current.destroyed)) { |
|
|
|
|
|
|
|
current.destroyed = [current.destroyed]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
current.destroyed.push(destroyed); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -91969,6 +92022,25 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView); |
|
|
|
vm._watchers.push(createWatcher(vm, key, handler)); |
|
|
|
vm._watchers.push(createWatcher(vm, key, handler)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
BI.each(vm.$watchDelayCallbacks, function (i, watchDelayCallback) { |
|
|
|
|
|
|
|
var innerWatch = watchDelayCallback[0]; |
|
|
|
|
|
|
|
var innerHandler = watchDelayCallback[1]; |
|
|
|
|
|
|
|
if (BI.isKey(innerWatch)) { |
|
|
|
|
|
|
|
var key = innerWatch; |
|
|
|
|
|
|
|
innerWatch = {}; |
|
|
|
|
|
|
|
innerWatch[key] = innerHandler; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for (var key in innerWatch) { |
|
|
|
|
|
|
|
var handler = innerWatch[key]; |
|
|
|
|
|
|
|
if (BI.isArray(handler)) { |
|
|
|
|
|
|
|
for (var i = 0; i < handler.length; i++) { |
|
|
|
|
|
|
|
vm._watchers.push(createWatcher(vm, key, handler[i])); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
vm._watchers.push(createWatcher(vm, key, handler)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function createWatcher (vm, keyOrFn, cb, options) { |
|
|
|
function createWatcher (vm, keyOrFn, cb, options) { |
|
|
@ -92056,26 +92128,6 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView); |
|
|
|
// return result;
|
|
|
|
// return result;
|
|
|
|
// };
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
|
|
BI.watch = function (watch, handler) { |
|
|
|
|
|
|
|
if (BI.Widget.current) { |
|
|
|
|
|
|
|
if (BI.isKey(watch)) { |
|
|
|
|
|
|
|
var key = watch; |
|
|
|
|
|
|
|
watch = {}; |
|
|
|
|
|
|
|
watch[key] = handler; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for (var key in watch) { |
|
|
|
|
|
|
|
var handler = watch[key]; |
|
|
|
|
|
|
|
if (BI.isArray(handler)) { |
|
|
|
|
|
|
|
for (var i = 0; i < handler.length; i++) { |
|
|
|
|
|
|
|
BI.Widget.current._watchers.push(createWatcher(BI.Widget.current, key, handler[i])); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
BI.Widget.current._watchers.push(createWatcher(BI.Widget.current, key, handler)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_.each(["populate", "addItems", "prependItems"], function (name) { |
|
|
|
_.each(["populate", "addItems", "prependItems"], function (name) { |
|
|
|
var old = BI.Loader.prototype[name]; |
|
|
|
var old = BI.Loader.prototype[name]; |
|
|
|
BI.Loader.prototype[name] = function () { |
|
|
|
BI.Loader.prototype[name] = function () { |
|
|
|