Browse Source

Merge remote-tracking branch 'origin/master' into bugfix

es6
iapyang 4 years ago
parent
commit
ac6d4a1ed0
  1. 2
      dist/2.0/fineui.css
  2. 4
      dist/2.0/fineui.ie.min.js
  3. 2
      dist/2.0/fineui.ie.min.js.map
  4. 172
      dist/2.0/fineui.js
  5. 2
      dist/2.0/fineui.js.map
  6. 2
      dist/2.0/fineui.min.css
  7. 4
      dist/2.0/fineui.min.js
  8. 2
      dist/2.0/fineui.min.js.map
  9. 2
      dist/2.0/fineui_without_normalize.css
  10. 2
      dist/2.0/fineui_without_normalize.min.css
  11. 2
      dist/bundle.min.css
  12. 4
      dist/bundle.min.js
  13. 2
      dist/bundle.min.js.map
  14. 2
      dist/demo.css
  15. 172
      dist/demo.js
  16. 2
      dist/demo.js.map
  17. 2
      dist/fineui.css
  18. 4
      dist/fineui.ie.min.js
  19. 2
      dist/fineui.ie.min.js.map
  20. 172
      dist/fineui.js
  21. 2
      dist/fineui.js.map
  22. 2
      dist/fineui.min.css
  23. 4
      dist/fineui.min.js
  24. 2
      dist/fineui.min.js.map
  25. 172
      dist/fineui_without_jquery_polyfill.js
  26. 2
      dist/fineui_without_jquery_polyfill.js.map
  27. 39
      dist/fix/fix.compact.ie.js
  28. 39
      dist/fix/fix.compact.js
  29. 2
      dist/font.css
  30. BIN
      dist/font/iconfont.eot
  31. 15
      dist/font/iconfont.svg
  32. BIN
      dist/font/iconfont.ttf
  33. BIN
      dist/font/iconfont.woff
  34. BIN
      dist/font/iconfont.woff2
  35. 2
      dist/utils.js
  36. 2
      dist/utils.min.js
  37. 217
      hooks.html
  38. 2
      package.json
  39. 85
      src/core/widget.js

2
dist/2.0/fineui.css vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.ie.min.js.map vendored

File diff suppressed because one or more lines are too long

172
dist/2.0/fineui.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-11-16 12:50:27 */
/*! time: 2020-11-16 17:10:38 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -13562,6 +13562,15 @@ module.exports = function (exec) {
*/
!(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, {
_defaultConfig: function () {
return BI.extend(BI.Widget.superclass._defaultConfig.apply(this), {
@ -13583,7 +13592,11 @@ module.exports = function (exec) {
// 覆盖父类的_constructor方法,widget不走ob的生命周期
_constructor: function () {
// do nothing
if (this.setup) {
pushTarget(this);
this.render = this.setup();
popTarget();
}
},
_lazyConstructor: function () {
@ -13639,10 +13652,10 @@ module.exports = function (exec) {
_render: function () {
this.__asking = false;
this.beforeCreate && this.beforeCreate();
callLifeHook(this, "beforeCreate");
this._initElement();
this._initEffects();
this.created && this.created();
callLifeHook(this, "created");
},
/**
@ -13727,11 +13740,6 @@ module.exports = function (exec) {
_initElement: function () {
var self = this;
var els = this.render && this.render();
if (!els) {
pushTarget(this);
els = this.setup && this.setup();
popTarget();
}
if (BI.isPlainObject(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)))) {
return false;
}
lifeHook !== false && this.beforeMount && this.beforeMount();
lifeHook !== false && callLifeHook(this, "beforeMount");
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
@ -13773,7 +13781,7 @@ module.exports = function (exec) {
!self.isValid() && widget._setValid(false);
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);
predicate && predicate(this);
return true;
@ -14012,7 +14020,7 @@ module.exports = function (exec) {
},
__d: function () {
this.beforeDestroy && this.beforeDestroy();
callLifeHook(this, "beforeDestroy");
this.beforeDestroy = null;
BI.each(this._children, function (i, widget) {
widget && widget._unMount && widget._unMount();
@ -14020,7 +14028,7 @@ module.exports = function (exec) {
this._children = {};
this._parent = null;
this._isMounted = false;
this.destroyed && this.destroyed();
callLifeHook(this, "destroyed");
this.destroyed = null;
},
@ -14081,24 +14089,69 @@ module.exports = function (exec) {
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) {
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) {
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) {
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) {
if (current) {
current.destroyed = destroyed;
if (!current.destroyed) {
current.destroyed = [];
} else if (!BI.isArray(current.destroyed)) {
current.destroyed = [current.destroyed];
}
current.destroyed.push(destroyed);
}
};
@ -51117,6 +51170,12 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -51588,6 +51647,12 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -52081,6 +52146,12 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -52571,6 +52642,12 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -54812,6 +54889,9 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
this.switcher.on(BI.Switcher.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW);
});
this.switcher.on(BI.Switcher.EVENT_AFTER_HIDEVIEW, function () {
self.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW);
});
this.switcher.on(BI.Switcher.EVENT_AFTER_POPUPVIEW, function () {
var me = this;
BI.nextTick(function () {
@ -54861,6 +54941,7 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE";
BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
BI.shortcut("bi.multi_select_check_selected_switcher", BI.MultiSelectCheckSelectedSwitcher);
/***/ }),
@ -56567,6 +56648,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -56926,6 +57013,12 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
self.trigger.refreshPlaceHolderWidth((b === true ? self.numberCounter.element.outerWidth() + 8 : 0));
@ -57326,6 +57419,12 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -91969,6 +92068,25 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
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) {
@ -92056,26 +92174,6 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
// 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) {
var old = BI.Loader.prototype[name];
BI.Loader.prototype[name] = function () {

2
dist/2.0/fineui.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.min.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui_without_normalize.css vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui_without_normalize.min.css vendored

File diff suppressed because one or more lines are too long

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/bundle.min.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/demo.css vendored

File diff suppressed because one or more lines are too long

172
dist/demo.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-11-16 12:50:27 */
/*! time: 2020-11-16 17:10:38 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -13562,6 +13562,15 @@ module.exports = function (exec) {
*/
!(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, {
_defaultConfig: function () {
return BI.extend(BI.Widget.superclass._defaultConfig.apply(this), {
@ -13583,7 +13592,11 @@ module.exports = function (exec) {
// 覆盖父类的_constructor方法,widget不走ob的生命周期
_constructor: function () {
// do nothing
if (this.setup) {
pushTarget(this);
this.render = this.setup();
popTarget();
}
},
_lazyConstructor: function () {
@ -13639,10 +13652,10 @@ module.exports = function (exec) {
_render: function () {
this.__asking = false;
this.beforeCreate && this.beforeCreate();
callLifeHook(this, "beforeCreate");
this._initElement();
this._initEffects();
this.created && this.created();
callLifeHook(this, "created");
},
/**
@ -13727,11 +13740,6 @@ module.exports = function (exec) {
_initElement: function () {
var self = this;
var els = this.render && this.render();
if (!els) {
pushTarget(this);
els = this.setup && this.setup();
popTarget();
}
if (BI.isPlainObject(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)))) {
return false;
}
lifeHook !== false && this.beforeMount && this.beforeMount();
lifeHook !== false && callLifeHook(this, "beforeMount");
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
@ -13773,7 +13781,7 @@ module.exports = function (exec) {
!self.isValid() && widget._setValid(false);
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);
predicate && predicate(this);
return true;
@ -14012,7 +14020,7 @@ module.exports = function (exec) {
},
__d: function () {
this.beforeDestroy && this.beforeDestroy();
callLifeHook(this, "beforeDestroy");
this.beforeDestroy = null;
BI.each(this._children, function (i, widget) {
widget && widget._unMount && widget._unMount();
@ -14020,7 +14028,7 @@ module.exports = function (exec) {
this._children = {};
this._parent = null;
this._isMounted = false;
this.destroyed && this.destroyed();
callLifeHook(this, "destroyed");
this.destroyed = null;
},
@ -14081,24 +14089,69 @@ module.exports = function (exec) {
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) {
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) {
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) {
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) {
if (current) {
current.destroyed = destroyed;
if (!current.destroyed) {
current.destroyed = [];
} else if (!BI.isArray(current.destroyed)) {
current.destroyed = [current.destroyed];
}
current.destroyed.push(destroyed);
}
};
@ -51117,6 +51170,12 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -51588,6 +51647,12 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -52081,6 +52146,12 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -52571,6 +52642,12 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -54812,6 +54889,9 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
this.switcher.on(BI.Switcher.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW);
});
this.switcher.on(BI.Switcher.EVENT_AFTER_HIDEVIEW, function () {
self.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW);
});
this.switcher.on(BI.Switcher.EVENT_AFTER_POPUPVIEW, function () {
var me = this;
BI.nextTick(function () {
@ -54861,6 +54941,7 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE";
BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
BI.shortcut("bi.multi_select_check_selected_switcher", BI.MultiSelectCheckSelectedSwitcher);
/***/ }),
@ -56567,6 +56648,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -56926,6 +57013,12 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
self.trigger.refreshPlaceHolderWidth((b === true ? self.numberCounter.element.outerWidth() + 8 : 0));
@ -57326,6 +57419,12 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -91969,6 +92068,25 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
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) {
@ -92056,26 +92174,6 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
// 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) {
var old = BI.Loader.prototype[name];
BI.Loader.prototype[name] = function () {

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.ie.min.js.map vendored

File diff suppressed because one or more lines are too long

172
dist/fineui.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-11-16 12:50:27 */
/*! time: 2020-11-16 17:10:38 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -13562,6 +13562,15 @@ module.exports = function (exec) {
*/
!(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, {
_defaultConfig: function () {
return BI.extend(BI.Widget.superclass._defaultConfig.apply(this), {
@ -13583,7 +13592,11 @@ module.exports = function (exec) {
// 覆盖父类的_constructor方法,widget不走ob的生命周期
_constructor: function () {
// do nothing
if (this.setup) {
pushTarget(this);
this.render = this.setup();
popTarget();
}
},
_lazyConstructor: function () {
@ -13639,10 +13652,10 @@ module.exports = function (exec) {
_render: function () {
this.__asking = false;
this.beforeCreate && this.beforeCreate();
callLifeHook(this, "beforeCreate");
this._initElement();
this._initEffects();
this.created && this.created();
callLifeHook(this, "created");
},
/**
@ -13727,11 +13740,6 @@ module.exports = function (exec) {
_initElement: function () {
var self = this;
var els = this.render && this.render();
if (!els) {
pushTarget(this);
els = this.setup && this.setup();
popTarget();
}
if (BI.isPlainObject(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)))) {
return false;
}
lifeHook !== false && this.beforeMount && this.beforeMount();
lifeHook !== false && callLifeHook(this, "beforeMount");
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
@ -13773,7 +13781,7 @@ module.exports = function (exec) {
!self.isValid() && widget._setValid(false);
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);
predicate && predicate(this);
return true;
@ -14012,7 +14020,7 @@ module.exports = function (exec) {
},
__d: function () {
this.beforeDestroy && this.beforeDestroy();
callLifeHook(this, "beforeDestroy");
this.beforeDestroy = null;
BI.each(this._children, function (i, widget) {
widget && widget._unMount && widget._unMount();
@ -14020,7 +14028,7 @@ module.exports = function (exec) {
this._children = {};
this._parent = null;
this._isMounted = false;
this.destroyed && this.destroyed();
callLifeHook(this, "destroyed");
this.destroyed = null;
},
@ -14081,24 +14089,69 @@ module.exports = function (exec) {
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) {
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) {
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) {
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) {
if (current) {
current.destroyed = destroyed;
if (!current.destroyed) {
current.destroyed = [];
} else if (!BI.isArray(current.destroyed)) {
current.destroyed = [current.destroyed];
}
current.destroyed.push(destroyed);
}
};
@ -51117,6 +51170,12 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -51588,6 +51647,12 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -52081,6 +52146,12 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -52571,6 +52642,12 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -54812,6 +54889,9 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
this.switcher.on(BI.Switcher.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW);
});
this.switcher.on(BI.Switcher.EVENT_AFTER_HIDEVIEW, function () {
self.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW);
});
this.switcher.on(BI.Switcher.EVENT_AFTER_POPUPVIEW, function () {
var me = this;
BI.nextTick(function () {
@ -54861,6 +54941,7 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE";
BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
BI.shortcut("bi.multi_select_check_selected_switcher", BI.MultiSelectCheckSelectedSwitcher);
/***/ }),
@ -56567,6 +56648,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -56926,6 +57013,12 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
self.trigger.refreshPlaceHolderWidth((b === true ? self.numberCounter.element.outerWidth() + 8 : 0));
@ -57326,6 +57419,12 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -91939,6 +92038,25 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
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) {
@ -92026,26 +92144,6 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
// 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) {
var old = BI.Loader.prototype[name];
BI.Loader.prototype[name] = function () {

2
dist/fineui.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.min.js.map vendored

File diff suppressed because one or more lines are too long

172
dist/fineui_without_jquery_polyfill.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-11-16 12:50:27 */
/*! time: 2020-11-16 17:10:38 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -9589,6 +9589,15 @@ BI.Req = {
*/
!(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, {
_defaultConfig: function () {
return BI.extend(BI.Widget.superclass._defaultConfig.apply(this), {
@ -9610,7 +9619,11 @@ BI.Req = {
// 覆盖父类的_constructor方法,widget不走ob的生命周期
_constructor: function () {
// do nothing
if (this.setup) {
pushTarget(this);
this.render = this.setup();
popTarget();
}
},
_lazyConstructor: function () {
@ -9666,10 +9679,10 @@ BI.Req = {
_render: function () {
this.__asking = false;
this.beforeCreate && this.beforeCreate();
callLifeHook(this, "beforeCreate");
this._initElement();
this._initEffects();
this.created && this.created();
callLifeHook(this, "created");
},
/**
@ -9754,11 +9767,6 @@ BI.Req = {
_initElement: function () {
var self = this;
var els = this.render && this.render();
if (!els) {
pushTarget(this);
els = this.setup && this.setup();
popTarget();
}
if (BI.isPlainObject(els)) {
els = [els];
}
@ -9792,7 +9800,7 @@ BI.Req = {
if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) {
return false;
}
lifeHook !== false && this.beforeMount && this.beforeMount();
lifeHook !== false && callLifeHook(this, "beforeMount");
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
@ -9800,7 +9808,7 @@ BI.Req = {
!self.isValid() && widget._setValid(false);
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);
predicate && predicate(this);
return true;
@ -10039,7 +10047,7 @@ BI.Req = {
},
__d: function () {
this.beforeDestroy && this.beforeDestroy();
callLifeHook(this, "beforeDestroy");
this.beforeDestroy = null;
BI.each(this._children, function (i, widget) {
widget && widget._unMount && widget._unMount();
@ -10047,7 +10055,7 @@ BI.Req = {
this._children = {};
this._parent = null;
this._isMounted = false;
this.destroyed && this.destroyed();
callLifeHook(this, "destroyed");
this.destroyed = null;
},
@ -10108,24 +10116,69 @@ BI.Req = {
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) {
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) {
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) {
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) {
if (current) {
current.destroyed = destroyed;
if (!current.destroyed) {
current.destroyed = [];
} else if (!BI.isArray(current.destroyed)) {
current.destroyed = [current.destroyed];
}
current.destroyed.push(destroyed);
}
};
@ -47144,6 +47197,12 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -47615,6 +47674,12 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -48108,6 +48173,12 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -48598,6 +48669,12 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -50839,6 +50916,9 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
this.switcher.on(BI.Switcher.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW);
});
this.switcher.on(BI.Switcher.EVENT_AFTER_HIDEVIEW, function () {
self.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW);
});
this.switcher.on(BI.Switcher.EVENT_AFTER_POPUPVIEW, function () {
var me = this;
BI.nextTick(function () {
@ -50888,6 +50968,7 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE";
BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
BI.shortcut("bi.multi_select_check_selected_switcher", BI.MultiSelectCheckSelectedSwitcher);
/***/ }),
@ -52594,6 +52675,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -52953,6 +53040,12 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
self.trigger.refreshPlaceHolderWidth((b === true ? self.numberCounter.element.outerWidth() + 8 : 0));
@ -53353,6 +53446,12 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
});
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_AFTER_HIDEVIEW, function () {
BI.nextTick(function () {// 收起时自动调整宽度
self.trigger.refreshPlaceHolderWidth(0);
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
@ -68333,6 +68432,25 @@ exports.Model = Model;
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) {
@ -68420,26 +68538,6 @@ exports.Model = Model;
// 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) {
var old = BI.Loader.prototype[name];
BI.Loader.prototype[name] = function () {

2
dist/fineui_without_jquery_polyfill.js.map vendored

File diff suppressed because one or more lines are too long

39
dist/fix/fix.compact.ie.js vendored

@ -11,6 +11,25 @@
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) {
@ -89,26 +108,6 @@
// 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) {
var old = BI.Loader.prototype[name];
BI.Loader.prototype[name] = function () {

39
dist/fix/fix.compact.js vendored

@ -11,6 +11,25 @@
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) {
@ -98,26 +117,6 @@
// 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) {
var old = BI.Loader.prototype[name];
BI.Loader.prototype[name] = function () {

2
dist/font.css vendored

File diff suppressed because one or more lines are too long

BIN
dist/font/iconfont.eot vendored

Binary file not shown.

15
dist/font/iconfont.svg vendored

@ -20,6 +20,12 @@ Created by iconfont
/>
<missing-glyph />
<glyph glyph-name="CombinedShape" unicode="&#59446;" d="M620.032 853.248l6.656-1.109333c84.48-21.930667 161.450667-67.584 222.122667-132.010667 12.8-13.568 14.592-34.474667 4.437333-50.176a82.005333 82.005333 0 0 1-2.56-84.906667 77.226667 77.226667 0 0 1 72.789333-40.021333 38.912 38.912 0 0 0 40.106667-29.098667 496.810667 496.810667 0 0 0 0-263.765333 39.338667 39.338667 0 0 0-40.106667-29.184 76.629333 76.629333 0 0 1-72.789333-40.106667 81.92 81.92 0 0 1 2.56-84.736c10.24-15.786667 8.362667-36.693333-4.437333-50.346666a465.322667 465.322667 0 0 0-222.122667-131.925334 38.741333 38.741333 0 0 0-44.544 21.162667 77.653333 77.653333 0 0 1-70.144 44.714667 77.653333 77.653333 0 0 1-70.144-44.714667 38.656 38.656 0 0 0-44.544-21.077333A465.066667 465.066667 0 0 0 175.189333 47.786667 41.045333 41.045333 0 0 0 170.666667 98.048a81.92 81.92 0 0 1 2.56 84.821333 77.738667 77.738667 0 0 1-72.704 40.106667 39.082667 39.082667 0 0 0-40.106667 29.184A494.336 494.336 0 0 0 42.666667 384c0 44.544 5.973333 88.917333 17.749333 131.84a38.656 38.656 0 0 0 40.106667 29.184 77.312 77.312 0 0 1 72.704 40.106667A81.92 81.92 0 0 1 170.666667 669.866667a41.045333 41.045333 0 0 0 4.522666 50.261333A465.664 465.664 0 0 0 397.312 852.138667c17.834667 4.608 36.437333-4.266667 44.544-21.162667A77.653333 77.653333 0 0 1 512 786.176a77.653333 77.653333 0 0 1 70.144 44.8 38.741333 38.741333 0 0 0 44.544 21.162667z m12.8-94.464a152.064 152.064 0 0 0-241.749333 0c-50.517333-17.066667-97.109333-44.8-136.704-81.322667a162.133333 162.133333 0 0 0-10.24-137.386666 153.6 153.6 0 0 0-110.677334-77.738667 412.842667 412.842667 0 0 1 0-162.56 153.6 153.6 0 0 0 110.677334-77.738667 162.133333 162.133333 0 0 0 10.24-137.386666 383.146667 383.146667 0 0 1 136.704-81.322667 152.149333 152.149333 0 0 0 241.749333 0 382.976 382.976 0 0 1 136.789333 81.322667 162.048 162.048 0 0 0 10.24 137.386666 153.514667 153.514667 0 0 0 110.677334 77.738667 410.794667 410.794667 0 0 1 0 162.56 153.6 153.6 0 0 0-110.677334 77.653333 162.133333 162.133333 0 0 0-10.24 137.472 382.634667 382.634667 0 0 1-136.789333 81.322667zM512 554.666667a170.666667 170.666667 0 1 0 0-341.333334 170.666667 170.666667 0 0 0 0 341.333334z m0-85.333334a85.333333 85.333333 0 1 1 0-170.666666 85.333333 85.333333 0 0 1 0 170.666666z" horiz-adv-x="1024" />
<glyph glyph-name="liekuandengfen-yidengfen" unicode="&#59444;" d="M800 320a224 224 0 1 0 0-448 224 224 0 0 0 0 448z m73.92-104.832l-3.84-4.352-115.264-158.464-52.288 63.936-4.032 4.096a32 32 0 0 1-48.768-39.872l3.2-4.8 78.592-96 4.352-4.352a32 32 0 0 1 42.24 1.216l4.096 4.608 139.648 192 3.008 4.928a32 32 0 0 1-50.944 37.12zM96 704a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576a32 32 0 0 0 32 32zM512 704a32 32 0 0 0 32-32v-443.968a286.72 286.72 0 0 1-30.272-163.84L512 64a32 32 0 0 0-32 32v576A32 32 0 0 0 512 704zM400 576v-384h-192V576h192z m416 0v-192.448a286.72 286.72 0 0 1-192.064-59.584L624 576h192z m112 128a32 32 0 0 0 32-32v-336.512a286.976 286.976 0 0 1-63.936 32.128L896 672a32 32 0 0 0 32 32z" horiz-adv-x="1024" />
<glyph glyph-name="Tabzujian" unicode="&#59443;" d="M213.333333 469.333333h597.333334v-341.333333H213.333333zM170.666667 725.333333h170.666666a42.666667 42.666667 0 0 0 42.666667-42.666666v-128H128V682.666667a42.666667 42.666667 0 0 0 42.666667 42.666666zM469.333333 725.333333h128a42.666667 42.666667 0 0 0 42.666667-42.666666v-85.333334h-213.333333V682.666667a42.666667 42.666667 0 0 0 42.666666 42.666666zM725.333333 725.333333h128a42.666667 42.666667 0 0 0 42.666667-42.666666v-85.333334h-213.333333V682.666667a42.666667 42.666667 0 0 0 42.666666 42.666666zM341.333333 725.333333a42.666667 42.666667 0 0 0 42.666667-42.666666v-128h512v-426.666667a85.333333 85.333333 0 0 0-85.333333-85.333333H213.333333a85.333333 85.333333 0 0 0-85.333333 85.333333V682.666667a42.666667 42.666667 0 0 0 42.666667 42.666666h170.666666z m512-213.333333H170.666667v-384a42.666667 42.666667 0 0 1 37.674666-42.368L213.333333 85.333333h597.333334a42.666667 42.666667 0 0 1 42.368 37.674667L853.333333 128V512z m-42.666666-42.666667v-341.333333H213.333333v341.333333h597.333334z m-213.333334 256a42.666667 42.666667 0 0 0 42.666667-42.666666v-85.333334h-213.333333V682.666667a42.666667 42.666667 0 0 0 42.666666 42.666666h128z m256 0a42.666667 42.666667 0 0 0 42.666667-42.666666v-85.333334h-213.333333V682.666667a42.666667 42.666667 0 0 0 42.666666 42.666666h128z" horiz-adv-x="1024" />
@ -371,7 +377,7 @@ Created by iconfont
<glyph glyph-name="queshizhitianchong" unicode="&#59330;" d="M960 704h-64V768H64v-768h832v64h64v-64a64 64 0 0 0-64-64H64a64 64 0 0 0-64 64V768a64 64 0 0 0 64 64h832a64 64 0 0 0 64-64v-64zM226.496 170.49599999999998V504L128 484.992v61.056l119.232 24.192h52.992v-399.744H226.496z m149.12 0v67.968c150.336 119.808 188.352 165.888 188.352 215.424 0 48.384-32.832 61.632-74.88 61.632-25.92 0-55.296-3.456-88.128-13.248v61.056C430.336 571.9680000000001 464.896 576 501.76 576c84.672 0 135.936-35.712 135.936-113.472 0-67.968-27.648-111.168-148.608-207.36l-24.768-19.584v-4.608h185.472v-60.48H375.616z m436.608-5.76a476.16 476.16 0 0 0-91.008 7.488v62.784c30.528-6.912 57.024-9.792 87.552-9.792 51.84 0 92.736 13.248 92.736 61.632 0 47.808-37.44 61.632-103.68 61.632h-31.104v55.872h30.528c60.48 0 96.768 17.28 96.768 59.328 0 39.744-28.224 52.992-77.184 52.992-23.616 0-55.872-4.608-78.912-11.52V564.48c19.008 6.336 54.144 11.52 86.976 11.52 86.976 0 140.544-28.8 140.544-107.712 0-46.08-22.464-73.728-66.816-88.128v-3.456c52.416-9.792 77.184-43.776 77.184-94.464 0-78.336-54.72-117.504-163.584-117.504z" horiz-adv-x="1024" />
<glyph glyph-name="xinshouyindao" unicode="&#59329;" d="M512 832a448 448 0 1 0 0-896A448 448 0 0 0 512 832z m0-688a48 48 0 1 1 0-96 48 48 0 0 1 0 96z m0 550.144a206.08 206.08 0 0 1-206.72-205.376v-0.064c0-22.656 18.432-41.088 41.28-41.088a41.216 41.216 0 0 1 41.408 41.088C387.968 556.8 443.52 611.9680000000001 512 611.9680000000001c68.48 0 124.032-55.168 124.032-123.264A123.648 123.648 0 0 0 512 365.44000000000005a41.216 41.216 0 0 1-41.344-41.024v-82.304c0-22.656 18.56-40.96 41.344-40.96a41.152 41.152 0 0 1 41.344 40.96V287.36a205.824 205.824 0 0 1 165.44 201.344c0 113.472-92.608 205.44-206.784 205.44z" horiz-adv-x="1024" />
<glyph glyph-name="xinshouyindao" unicode="&#59329;" d="M512 800a416 416 0 1 0 0-832 416 416 0 0 0 0 832z m-6.4-569.6c-12.8 0-25.6-6.4-38.4-12.8-6.4-12.8-12.8-25.6-12.8-38.4 0-19.2 0-25.6 12.8-38.4 12.8-6.4 25.6-12.8 38.4-12.8 12.8 0 25.6 6.4 38.4 12.8 6.4 12.8 12.8 25.6 12.8 38.4 0 19.2 0 32-12.8 38.4-12.8 6.4-25.6 12.8-38.4 12.8zM518.4 640c-51.2 0-89.6-12.8-121.6-44.8-32-32-44.8-70.4-44.8-121.6h76.8c0 32 6.4 57.6 19.2 70.4 12.8 19.2 32 32 64 32 25.6 0 51.2-6.4 64-19.2 12.8-12.8 19.2-32 19.2-57.6 0-19.2-6.4-32-19.2-51.2l-19.2-19.2c-38.4-38.4-70.4-70.4-76.8-89.6-6.4-12.8-12.8-38.4-12.8-64v-12.8h76.8v12.8c0 19.2 6.4 38.4 12.8 51.2 6.4 12.8 12.8 25.6 32 32l57.6 57.6c19.2 19.2 25.6 51.2 25.6 83.2 0 44.8-19.2 76.8-44.8 102.4-25.6 25.6-64 38.4-108.8 38.4z" horiz-adv-x="1024" />
<glyph glyph-name="gou" unicode="&#59328;" d="M1222.434595 874.025514L514.490811 365.152865a110.702703 110.702703 0 0 0-126.311784-2.048l-225.28 151.109189a103.119568 103.119568 0 0 1-130.629189-12.92454 95.647135 95.647135 0 0 1-7.001946-126.920649l349.322378-439.406703a110.702703 110.702703 0 0 1 165.168433-9.132973l811.727567 816.819892a85.600865 85.600865 0 0 1 0 120.665946 99.798486 99.798486 0 0 1-129.024 10.710487z" horiz-adv-x="1383" />
@ -803,7 +809,10 @@ Created by iconfont
<glyph glyph-name="pingtairizhi" unicode="&#59278;" d="M896 544v128h-160v-32.128a32 32 0 1 0-64 0V672h-320v-32.128a32 32 0 1 0-64 0V672H128v-128h768z m0-64H128v-448h768v448z m-544 256h320V768a32 32 0 1 0 64 0v-32H896a64 64 0 0 0 64-64v-640a64 64 0 0 0-64-64H128a64 64 0 0 0-64 64v640a64 64 0 0 0 64 64h160V768a32 32 0 0 0 64 0v-32zM256 319.67999999999995a32 32 0 0 0 0 64h512a32 32 0 1 0 0-64H256z m0-192a32 32 0 1 0 0 64h320a32 32 0 0 0 0-64H256z" horiz-adv-x="1024" />
<glyph glyph-name="liekuandengfen" unicode="&#59277;" d="M248.256 384l128.64-128.64a32 32 0 0 0-45.248-45.312L150.656 391.104a32 32 0 0 0 0 45.248l180.992 180.992a32 32 0 1 0 45.248-45.248L252.8 448h523.008l-124.096 124.16a32 32 0 0 0 45.248 45.184l181.056-180.992a32 32 0 0 0 0-45.248l-181.056-181.056a32 32 0 1 0-45.248 45.312L780.288 384H248.32zM96 704a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576a32 32 0 0 0 32 32z m832 0a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576a32 32 0 0 0 32 32z" horiz-adv-x="1024" />
<glyph glyph-name="liekuandengfen" unicode="&#59277;" d="M96 704a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576a32 32 0 0 0 32 32z m832 0a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576a32 32 0 0 0 32 32z m-320 0a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576a32 32 0 0 0 32 32zM208 576H499.2v-384H208V576z m512 0h96v-384h-96V576z" horiz-adv-x="1024" />
<glyph glyph-name="liekuandengfen-copy" unicode="&#59445;" d="M96 704a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576a32 32 0 0 0 32 32z m112-128h192v-384h-192V576zM928 704a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576a32 32 0 0 0 32 32zM512 704a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576A32 32 0 0 0 512 704z m304-128v-384h-192V576h192z" horiz-adv-x="1024" />
<glyph glyph-name="yibiaoban" unicode="&#59274;" d="M213.333333 789.333333h426.666667a21.333333 21.333333 0 0 0 21.333333-21.333333v-170.666667a64 64 0 0 1 64-64h170.666667a21.333333 21.333333 0 0 0 21.333333-21.333333v-426.666667a106.666667 106.666667 0 0 0-106.666666-106.666666H213.333333a106.666667 106.666667 0 0 0-106.666666 106.666666V682.666667a106.666667 106.666667 0 0 0 106.666666 106.666666z m527.082667-36.416l140.501333-140.501333A21.333333 21.333333 0 0 0 865.834667 576H768a64 64 0 0 0-64 64V737.834667a21.333333 21.333333 0 0 0 36.416 15.082666zM330.666667 554.666667a32 32 0 1 1-64 0v-405.333334a32 32 0 0 1 64 0V554.666667z m213.333333-106.666667a32 32 0 1 1-64 0v-298.666667a32 32 0 0 1 64 0V448z m213.333333-106.666667a32 32 0 0 1-64 0v-192a32 32 0 0 1 64 0v192z" horiz-adv-x="1024" />
@ -1664,7 +1673,7 @@ Created by iconfont
<glyph glyph-name="normal10" unicode="&#59076;" d="M224 656v96a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64v-96H896a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64h96z m64 0h448v96h-448v-96zM384 496a32 32 0 0 0 64 0v-352a32 32 0 1 0-64 0v352z m192 0a32 32 0 0 0 64 0v-352a32 32 0 1 0-64 0v352z m224 32a32 32 0 0 0 32-32v-480a64 64 0 0 0-64-64H256a64 64 0 0 0-64 64v480a32 32 0 0 0 64 0v-480h512v480a32 32 0 0 0 32 32z" horiz-adv-x="1024" />
<glyph glyph-name="normal11" unicode="&#59077;" d="M480 658.24L308.864 487.104a32 32 0 0 0-45.312 45.248l226.304 226.304a31.872 31.872 0 0 0 45.248 0l226.304-226.304a32 32 0 1 0-45.248-45.248L544 659.2v-436.352a32 32 0 0 0-64 0V658.24zM192 63.615999999999985h640v224a32 32 0 1 0 64 0v-256a31.872 31.872 0 0 0-32-32h-704a31.872 31.872 0 0 0-32 32v256a32 32 0 0 0 64 0v-224z" horiz-adv-x="1024" />
<glyph glyph-name="normal11" unicode="&#59077;" d="M864 319.616a32 32 0 0 0 32-32v-256a31.872 31.872 0 0 0-32-32h-704a31.872 31.872 0 0 0-32 32v256a32 32 0 0 0 64 0v-224h640v224a32 32 0 0 0 32 32zM512.512 768c8.192 0 16.32-3.136 22.592-9.344l226.304-226.304a32 32 0 1 0-45.248-45.248L544 659.2v-436.352a32 32 0 0 0-64 0V658.24L308.864 487.104a32 32 0 0 0-45.312 45.248l226.304 226.304A31.872 31.872 0 0 0 512.512 768z" horiz-adv-x="1024" />
<glyph glyph-name="normal12" unicode="&#59078;" d="M284.16 510.784l29.888 117.632C339.2 727.6800000000001 428.608 800 531.136 800c45.312 0 87.808-6.016 127.424-18.048-0.128-64 0-8.96 0-64A640.448 640.448 0 0 1 531.2 736c-73.28 0-137.152-52.352-155.136-123.328L350.208 510.72h90.24c7.104 0 12.8-5.76 12.8-12.8v-38.4a12.8 12.8 0 0 0-12.8-12.8H334.08l-104.192-410.88a96 96 0 0 0-93.056-72.32H70.4v64h66.368a32 32 0 0 1 31.04 24.064l100.16 395.136H146.112a12.8 12.8 0 0 0-12.8 12.8v38.4c0 7.04 5.76 12.8 12.8 12.8H284.16z m454.016-129.152l102.912 120.192a25.6 25.6 0 0 0 19.456 8.96h85.888a6.4 6.4 0 0 0 6.4-6.4v-51.2a6.4 6.4 0 0 0-6.4-6.4h-56.448a25.6 25.6 0 0 1-19.456-8.96l-101.888-119.04 70.272-145.024a25.6 25.6 0 0 1 23.04-14.4h40.512a6.4 6.4 0 0 0 6.4-6.4v-51.2a6.4 6.4 0 0 0-6.4-6.4h-80.64a25.6 25.6 0 0 0-23.04 14.4l-75.52 155.968-138.24-161.408a25.6 25.6 0 0 0-19.52-8.96H456.96a6.4 6.4 0 0 0-6.4 6.4v51.2a6.4 6.4 0 0 0 6.4 6.4h79.168a25.6 25.6 0 0 1 19.456 8.96l137.216 160.256-50.304 103.744a25.6 25.6 0 0 1-23.04 14.464H523.712a6.4 6.4 0 0 0-6.4 6.4v51.2a6.4 6.4 0 0 0 6.4 6.4h135.808a25.6 25.6 0 0 0 23.04-14.464l55.616-114.688z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 360 KiB

After

Width:  |  Height:  |  Size: 363 KiB

BIN
dist/font/iconfont.ttf vendored

Binary file not shown.

BIN
dist/font/iconfont.woff vendored

Binary file not shown.

BIN
dist/font/iconfont.woff2 vendored

Binary file not shown.

2
dist/utils.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-11-16 12:50:27 */
/*! time: 2020-11-16 17:10:38 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

217
hooks.html

@ -0,0 +1,217 @@
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css"/>
<script src="./dist/fineui.js"></script>
</head>
<body>
<div id="wrapper"></div>
<script>
var Model = BI.inherit(Fix.Model, {
state: function () {
return {
expand: false,
showClearAll: false,
hasUndo: false,
hasRedo: false
};
},
computed: {
expandText: function () {
return this.model.expand ? "expand" : "not-expand";
},
clearAllText: function () {
return this.model.showClearAll ? "showClearAll" : "not-showClearAll";
},
undoText: function () {
return this.model.hasUndo ? "hasUndo" : "not-hasUndo";
},
redoText: function () {
return this.model.hasRedo ? "hasRedo" : "not-hasRedo";
}
},
actions: {
setExpand: function () {
this.model.expand = !this.model.expand;
},
setClearAll: function () {
this.model.showClearAll = !this.model.showClearAll;
},
setUndo: function () {
this.model.hasUndo = !this.model.hasUndo;
},
setRedo: function () {
this.model.hasRedo = !this.model.hasRedo;
}
}
});
BI.model("demo.model", Model);
function expandFunction () {
var button;
var store = BI.useStore(function () {
return BI.Models.getModel("demo.model");
});
BI.onBeforeMount(function () {
});
BI.onMounted(function () {
});
BI.onBeforeUnmount(function () {
});
BI.onUnmounted(function () {
});
BI.watch("expandText", function (val) {
button.setText(val);
});
return function () {
return {
type: "bi.button",
ref: function (_ref) {
button = _ref;
},
text: store.model.expandText,
handler: function () {
store.setExpand();
}
};
};
}
function clearAllFunction () {
var button;
var store = BI.useStore(function () {
return BI.Models.getModel("demo.model");
});
BI.onBeforeMount(function () {
});
BI.onMounted(function () {
});
BI.onBeforeUnmount(function () {
});
BI.onUnmounted(function () {
});
BI.watch("clearAllText", function (val) {
button.setText(val);
});
return function () {
return {
type: "bi.button",
ref: function (_ref) {
button = _ref;
},
text: store.model.clearAllText,
handler: function () {
store.setClearAll();
}
};
};
}
function undoFunction () {
var button;
var store = BI.useStore(function () {
return BI.Models.getModel("demo.model");
});
BI.onBeforeMount(function () {
});
BI.onMounted(function () {
});
BI.onBeforeUnmount(function () {
});
BI.onUnmounted(function () {
});
BI.watch("undoText", function (val) {
button.setText(val);
});
return function () {
return {
type: "bi.button",
ref: function (_ref) {
button = _ref;
},
text: store.model.undoText,
handler: function () {
store.setUndo();
}
};
};
}
function redoFunction () {
var button;
var store = BI.useStore(function () {
return BI.Models.getModel("demo.model");
});
BI.onBeforeMount(function () {
});
BI.onMounted(function () {
});
BI.onBeforeUnmount(function () {
});
BI.onUnmounted(function () {
});
BI.watch("redoText", function (val) {
button.setText(val);
});
return function () {
return {
type: "bi.button",
ref: function (_ref) {
button = _ref;
},
text: store.model.redoText,
handler: function () {
store.setRedo();
}
};
};
}
var Widget = BI.inherit(BI.Widget, {
setup: function () {
var expandComponent = expandFunction();
var clearAllComponent = clearAllFunction();
var undoComponent = undoFunction();
var redoComponent = redoFunction();
return function () {
return {
type: "bi.vertical",
items: [expandComponent(), clearAllComponent(), undoComponent(), redoComponent()]
};
};
}
});
BI.shortcut("demo.hooks", Widget);
BI.createWidget({
type: "bi.absolute",
items: [{
el: {
type: "demo.hooks"
},
top: 100,
left: 100
}],
element: "#wrapper"
});
</script>
</body>
</html>

2
package.json

@ -1,6 +1,6 @@
{
"name": "fineui",
"version": "2.0.20201116125158",
"version": "2.0.20201116171157",
"description": "fineui",
"main": "dist/fineui.min.js",
"types": "dist/lib/index.d.ts",

85
src/core/widget.js

@ -7,6 +7,15 @@
*/
!(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, {
_defaultConfig: function () {
return BI.extend(BI.Widget.superclass._defaultConfig.apply(this), {
@ -28,7 +37,11 @@
// 覆盖父类的_constructor方法,widget不走ob的生命周期
_constructor: function () {
// do nothing
if (this.setup) {
pushTarget(this);
this.render = this.setup();
popTarget();
}
},
_lazyConstructor: function () {
@ -84,10 +97,10 @@
_render: function () {
this.__asking = false;
this.beforeCreate && this.beforeCreate();
callLifeHook(this, "beforeCreate");
this._initElement();
this._initEffects();
this.created && this.created();
callLifeHook(this, "created");
},
/**
@ -172,11 +185,6 @@
_initElement: function () {
var self = this;
var els = this.render && this.render();
if (!els) {
pushTarget(this);
els = this.setup && this.setup();
popTarget();
}
if (BI.isPlainObject(els)) {
els = [els];
}
@ -210,7 +218,7 @@
if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) {
return false;
}
lifeHook !== false && this.beforeMount && this.beforeMount();
lifeHook !== false && callLifeHook(this, "beforeMount");
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
@ -218,7 +226,7 @@
!self.isValid() && widget._setValid(false);
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);
predicate && predicate(this);
return true;
@ -457,7 +465,7 @@
},
__d: function () {
this.beforeDestroy && this.beforeDestroy();
callLifeHook(this, "beforeDestroy");
this.beforeDestroy = null;
BI.each(this._children, function (i, widget) {
widget && widget._unMount && widget._unMount();
@ -465,7 +473,7 @@
this._children = {};
this._parent = null;
this._isMounted = false;
this.destroyed && this.destroyed();
callLifeHook(this, "destroyed");
this.destroyed = null;
},
@ -526,24 +534,69 @@
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) {
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) {
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) {
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) {
if (current) {
current.destroyed = destroyed;
if (!current.destroyed) {
current.destroyed = [];
} else if (!BI.isArray(current.destroyed)) {
current.destroyed = [current.destroyed];
}
current.destroyed.push(destroyed);
}
};

Loading…
Cancel
Save