Browse Source

Merge branch 'master' of ssh://code.fineres.com:7999/~claire.tang/fineui

es6
Tangjinxia 4 years ago
parent
commit
4a69619984
  1. 4
      changelog.md
  2. 103
      dev.html
  3. 2
      dist/2.0/fineui.css
  4. 4
      dist/2.0/fineui.ie.min.js
  5. 2
      dist/2.0/fineui.ie.min.js.map
  6. 205
      dist/2.0/fineui.js
  7. 2
      dist/2.0/fineui.js.map
  8. 2
      dist/2.0/fineui.min.css
  9. 4
      dist/2.0/fineui.min.js
  10. 2
      dist/2.0/fineui.min.js.map
  11. 2
      dist/2.0/fineui_without_normalize.css
  12. 2
      dist/2.0/fineui_without_normalize.min.css
  13. 2
      dist/core.css
  14. 205
      dist/core.js
  15. 2
      dist/core.js.map
  16. 2
      dist/demo.css
  17. 205
      dist/demo.js
  18. 2
      dist/demo.js.map
  19. 2
      dist/fineui.css
  20. 4
      dist/fineui.ie.min.js
  21. 2
      dist/fineui.ie.min.js.map
  22. 205
      dist/fineui.js
  23. 2
      dist/fineui.js.map
  24. 2
      dist/fineui.min.css
  25. 4
      dist/fineui.min.js
  26. 2
      dist/fineui.min.js.map
  27. 191
      dist/fineui_without_jquery_polyfill.js
  28. 2
      dist/fineui_without_jquery_polyfill.js.map
  29. 73
      dist/fix/fix.compact.ie.js
  30. 73
      dist/fix/fix.compact.js
  31. 2
      dist/font.css
  32. BIN
      dist/font/iconfont.eot
  33. 6
      dist/font/iconfont.svg
  34. BIN
      dist/font/iconfont.ttf
  35. BIN
      dist/font/iconfont.woff
  36. BIN
      dist/font/iconfont.woff2
  37. 2
      dist/resource.css
  38. 9
      dist/utils.js
  39. 2
      dist/utils.js.map
  40. 4
      dist/utils.min.js
  41. 2
      dist/utils.min.js.map
  42. 2
      package.json
  43. 5
      src/base/single/button/button.basic.js
  44. 6
      src/base/single/button/buttons/button.js
  45. 4
      src/base/single/single.js
  46. 8
      src/case/colorchooser/colorchooser.js
  47. 4
      src/case/colorchooser/colorchooser.trigger.js
  48. 2
      src/case/colorchooser/colorchooser.trigger.long.js
  49. 7
      src/core/ob.js
  50. 74
      src/core/widget.js
  51. 17
      src/core/wrapper/layout.js

4
changelog.md

@ -1,4 +1,8 @@
# 更新日志
2.0(2021-02)
- 增加updateModel属性,可以配置自动模式,自动watch属性并响应变化
- 增加beforeRender生命周期函数
2.0(2021-01)
- 修改了日期下拉面板中的当前时间按钮的交互效果
- 新增年区间和年季度区间控件

103
dev.html

@ -0,0 +1,103 @@
<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="http://localhost:9001/fineui.js"></script>
</head>
<body>
<div id="wrapper"></div>
<script>
var Model = BI.inherit(Fix.Model, {
state: function () {
return {
expand: false
};
},
childContext: ["text"],
computed: {
text: function () {
return this.model.expand ? "text-yes" : "text-not";
}
},
actions: {
toggle: function () {
this.model.expand = !this.model.expand;
}
}
});
BI.model("demo.model", Model);
var ChildModel = BI.inherit(Fix.Model, {
context: ["text"]
});
BI.model("demo.child_model", ChildModel);
var Child = BI.inherit(BI.Widget, {
props: {
updateMode: "auto"
},
setup: function () {
var store = BI.useStore(function () {
return BI.Models.getModel("demo.child_model");
});
return {
render: function () {
return {
type: "bi.vertical",
items: [{
type: "bi.button",
text: store.model.text
}, {
type: "bi.label",
text: store.model.text
}]
};
}
};
}
});
BI.shortcut("demo.child", Child);
var Widget = BI.inherit(BI.Widget, {
props: {
updateMode: "auto"
},
setup: function () {
var store = BI.useStore(function () {
return BI.Models.getModel("demo.model");
});
setInterval(function () {
store.toggle();
}, 1000);
return function () {
return {
type: "bi.vertical",
vgap: 20,
items: [{
type: "demo.child"
}, {
type: "demo.child"
}]
};
};
}
});
BI.shortcut("demo.parent", Widget);
BI.createWidget({
type: "bi.absolute",
items: [{
el: {
type: "demo.parent"
},
top: 100,
left: 100
}],
element: "#wrapper"
});
</script>
</body>
</html>

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

205
dist/2.0/fineui.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-3-1 14:10:42 */
/*! time: 2021-3-4 17:10:44 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -4905,6 +4905,9 @@ if (!_global.BI) {
// 获得一个当前对象的引用
_initRef: function () {
if (this.options.__ref) {
this.options.__ref.call(this, this);
}
if (this.options.ref) {
this.options.ref.call(this, this);
}
@ -4912,6 +4915,10 @@ if (!_global.BI) {
//释放当前对象
_purgeRef: function () {
if (this.options.__ref) {
this.options.__ref.call(null);
this.options.__ref = null;
}
if (this.options.ref) {
this.options.ref.call(null);
this.options.ref = null;
@ -13787,7 +13794,7 @@ module.exports = function (exec) {
*/
!(function () {
function callLifeHook(self, life) {
function callLifeHook (self, life) {
var hook = self.options[life] || self[life];
if (hook) {
var hooks = BI.isArray(hook) ? hook : [hook];
@ -13812,7 +13819,8 @@ module.exports = function (exec) {
baseCls: "",
extraCls: "",
cls: "",
css: null
css: null,
updateMode: "manual" // manual / auto
});
},
@ -13838,9 +13846,11 @@ module.exports = function (exec) {
}
},
// 生命周期函数
beforeInit: null,
// 生命周期函数
beforeRender: null,
beforeCreate: null,
created: null,
@ -13853,8 +13863,11 @@ module.exports = function (exec) {
shouldUpdate: null,
update: function () {
},
update: null,
beforeUpdate: null,
updated: null,
beforeDestroy: null,
@ -13870,14 +13883,24 @@ module.exports = function (exec) {
},
_initRender: function () {
var self = this;
function render () {
if (self.options.beforeRender || self.beforeRender) {
(self.options.beforeRender || self.beforeRender).call(self, BI.bind(self._render, self));
} else {
self._render();
}
}
if (this.options.beforeInit || this.beforeInit) {
this.__asking = true;
(this.options.beforeInit || this.beforeInit).call(this, BI.bind(this._render, this));
(this.options.beforeInit || this.beforeInit).call(this, render);
if (this.__asking === true) {
this.__async = true;
}
} else {
this._render();
render();
}
},
@ -14002,27 +14025,59 @@ module.exports = function (exec) {
* @returns {boolean}
* @private
*/
_mount: function (force, deep, lifeHook, predicate) {
_mount: function (force, deep, lifeHook, predicate, layer) {
var self = this;
if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) {
return false;
}
layer = layer || 0;
lifeHook !== false && callLifeHook(this, "beforeMount");
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(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, layer + 1);
});
this._mountChildren && this._mountChildren();
if (layer === 0) {
// 最后再统一执行生命周期
this.__afterMount(lifeHook, predicate);
}
return true;
},
__afterMount: function (lifeHook, predicate) {
if (this._isMounted) {
BI.each(this._children, function (i, widget) {
widget.__afterMount && widget.__afterMount(lifeHook, predicate);
});
lifeHook !== false && callLifeHook(this, "mounted");
this.fireEvent(BI.Events.MOUNT);
predicate && predicate(this);
return true;
}
},
_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 () {
return this._isMounted;
},
@ -14314,12 +14369,12 @@ module.exports = function (exec) {
BI.Widget.context = context = contextStack.pop();
};
function pushTarget(_current) {
function pushTarget (_current) {
if (current) currentStack.push(current);
BI.Widget.current = current = _current;
}
function popTarget() {
function popTarget () {
BI.Widget.current = current = currentStack.pop();
}
@ -15144,19 +15199,13 @@ BI.Layout = BI.inherit(BI.Widget, {
if (!child.shouldUpdate) {
return null;
}
return child.shouldUpdate(this._getOptions(item)) === true;
return child.shouldUpdate(this._getOptions(item));
},
updateItemAt: function (index, item) {
if (index < 0 || index > this.options.items.length - 1) {
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)];
delete this._children[this._getChildName(index)];
this.options.items.splice(index, 1);
@ -15243,7 +15292,14 @@ BI.Layout = BI.inherit(BI.Widget, {
patchItem: function (oldVnode, vnode, index) {
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);
}
},
@ -22481,6 +22537,7 @@ BI.Single = BI.inherit(BI.Widget, {
setValue: function (val) {
if (!this.options.readonly) {
this.options.value = val;
this.options.setValue && this.options.setValue(val);
}
},
@ -22494,8 +22551,9 @@ BI.Single = BI.inherit(BI.Widget, {
this.showTimeout = null;
}
BI.Tooltips.remove(this.getName());
},
}
});
BI.shortcut("bi.single", BI.Single);
/***/ }),
@ -23070,11 +23128,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
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) {
BI.BasicButton.superclass._setEnable.apply(this, arguments);
if (enable === true) {
@ -28571,7 +28624,6 @@ BI.shortcut("bi.image_button", BI.ImageButton);
/* 429 */
/***/ (function(module, exports) {
/**
* 文字类型的按钮
* @class BI.Button
@ -28617,7 +28669,10 @@ BI.Button = BI.inherit(BI.BasicButton, {
BI.Button.superclass._init.apply(this, arguments);
var o = this.options, self = this;
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) {
this.element.css({lineHeight: o.height / BI.pixRatio + BI.pixUnit});
} else {
@ -33936,7 +33991,8 @@ BI.IconTreeLeafItem = BI.inherit(BI.BasicButton, {
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py
py: o.py,
keyword: o.keyword
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
@ -93326,7 +93382,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-chooser bi-border",
baseCls: "bi-color-chooser",
value: "",
height: 24,
el: {},
@ -93335,8 +93391,6 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
_init: function () {
var self = this, o = this.options;
o.height -= 2;
BI.isNumeric(o.width) && (o.width -= 2);
BI.ColorChooser.superclass._init.apply(this, arguments);
o.value = o.value || "";
this.combo = BI.createWidget({
@ -93351,8 +93405,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
width: o.width,
height: o.height
width: o.width - 2,
height: o.height - 2
}, o.el),
popup: {
el: BI.extend({
@ -94103,8 +94157,8 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger",
height: 24
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border bi-focus-shadow",
height: 22
});
},
@ -94174,7 +94228,7 @@ BI.LongColorChooserTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
var conf = BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger",
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border bi-focus-shadow",
height: 24
});
},
@ -97906,6 +97960,77 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
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) {
if (childComponent.component instanceof BI.Layout) {
return; // 布局的过滤掉
}
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;
BI.Widget.prototype.__d = function () {
try {
@ -97929,7 +98054,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
delete this.__cacheStore;
};
_.each(["_mount"], function (name) {
_.each(["_mount", "__afterMount"], function (name) {
var old = BI.Widget.prototype[name];
old && (BI.Widget.prototype[name] = function () {
this.store && pushTarget(this.store);

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/core.css vendored

File diff suppressed because one or more lines are too long

205
dist/core.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-3-1 14:10:42 */
/*! time: 2021-3-4 17:10:44 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -4905,6 +4905,9 @@ if (!_global.BI) {
// 获得一个当前对象的引用
_initRef: function () {
if (this.options.__ref) {
this.options.__ref.call(this, this);
}
if (this.options.ref) {
this.options.ref.call(this, this);
}
@ -4912,6 +4915,10 @@ if (!_global.BI) {
//释放当前对象
_purgeRef: function () {
if (this.options.__ref) {
this.options.__ref.call(null);
this.options.__ref = null;
}
if (this.options.ref) {
this.options.ref.call(null);
this.options.ref = null;
@ -13787,7 +13794,7 @@ module.exports = function (exec) {
*/
!(function () {
function callLifeHook(self, life) {
function callLifeHook (self, life) {
var hook = self.options[life] || self[life];
if (hook) {
var hooks = BI.isArray(hook) ? hook : [hook];
@ -13812,7 +13819,8 @@ module.exports = function (exec) {
baseCls: "",
extraCls: "",
cls: "",
css: null
css: null,
updateMode: "manual" // manual / auto
});
},
@ -13838,9 +13846,11 @@ module.exports = function (exec) {
}
},
// 生命周期函数
beforeInit: null,
// 生命周期函数
beforeRender: null,
beforeCreate: null,
created: null,
@ -13853,8 +13863,11 @@ module.exports = function (exec) {
shouldUpdate: null,
update: function () {
},
update: null,
beforeUpdate: null,
updated: null,
beforeDestroy: null,
@ -13870,14 +13883,24 @@ module.exports = function (exec) {
},
_initRender: function () {
var self = this;
function render () {
if (self.options.beforeRender || self.beforeRender) {
(self.options.beforeRender || self.beforeRender).call(self, BI.bind(self._render, self));
} else {
self._render();
}
}
if (this.options.beforeInit || this.beforeInit) {
this.__asking = true;
(this.options.beforeInit || this.beforeInit).call(this, BI.bind(this._render, this));
(this.options.beforeInit || this.beforeInit).call(this, render);
if (this.__asking === true) {
this.__async = true;
}
} else {
this._render();
render();
}
},
@ -14002,27 +14025,59 @@ module.exports = function (exec) {
* @returns {boolean}
* @private
*/
_mount: function (force, deep, lifeHook, predicate) {
_mount: function (force, deep, lifeHook, predicate, layer) {
var self = this;
if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) {
return false;
}
layer = layer || 0;
lifeHook !== false && callLifeHook(this, "beforeMount");
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(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, layer + 1);
});
this._mountChildren && this._mountChildren();
if (layer === 0) {
// 最后再统一执行生命周期
this.__afterMount(lifeHook, predicate);
}
return true;
},
__afterMount: function (lifeHook, predicate) {
if (this._isMounted) {
BI.each(this._children, function (i, widget) {
widget.__afterMount && widget.__afterMount(lifeHook, predicate);
});
lifeHook !== false && callLifeHook(this, "mounted");
this.fireEvent(BI.Events.MOUNT);
predicate && predicate(this);
return true;
}
},
_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 () {
return this._isMounted;
},
@ -14314,12 +14369,12 @@ module.exports = function (exec) {
BI.Widget.context = context = contextStack.pop();
};
function pushTarget(_current) {
function pushTarget (_current) {
if (current) currentStack.push(current);
BI.Widget.current = current = _current;
}
function popTarget() {
function popTarget () {
BI.Widget.current = current = currentStack.pop();
}
@ -15144,19 +15199,13 @@ BI.Layout = BI.inherit(BI.Widget, {
if (!child.shouldUpdate) {
return null;
}
return child.shouldUpdate(this._getOptions(item)) === true;
return child.shouldUpdate(this._getOptions(item));
},
updateItemAt: function (index, item) {
if (index < 0 || index > this.options.items.length - 1) {
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)];
delete this._children[this._getChildName(index)];
this.options.items.splice(index, 1);
@ -15243,7 +15292,14 @@ BI.Layout = BI.inherit(BI.Widget, {
patchItem: function (oldVnode, vnode, index) {
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);
}
},
@ -22481,6 +22537,7 @@ BI.Single = BI.inherit(BI.Widget, {
setValue: function (val) {
if (!this.options.readonly) {
this.options.value = val;
this.options.setValue && this.options.setValue(val);
}
},
@ -22494,8 +22551,9 @@ BI.Single = BI.inherit(BI.Widget, {
this.showTimeout = null;
}
BI.Tooltips.remove(this.getName());
},
}
});
BI.shortcut("bi.single", BI.Single);
/***/ }),
@ -23070,11 +23128,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
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) {
BI.BasicButton.superclass._setEnable.apply(this, arguments);
if (enable === true) {
@ -28571,7 +28624,6 @@ BI.shortcut("bi.image_button", BI.ImageButton);
/* 429 */
/***/ (function(module, exports) {
/**
* 文字类型的按钮
* @class BI.Button
@ -28617,7 +28669,10 @@ BI.Button = BI.inherit(BI.BasicButton, {
BI.Button.superclass._init.apply(this, arguments);
var o = this.options, self = this;
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) {
this.element.css({lineHeight: o.height / BI.pixRatio + BI.pixUnit});
} else {
@ -33936,7 +33991,8 @@ BI.IconTreeLeafItem = BI.inherit(BI.BasicButton, {
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py
py: o.py,
keyword: o.keyword
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
@ -93326,7 +93382,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-chooser bi-border",
baseCls: "bi-color-chooser",
value: "",
height: 24,
el: {},
@ -93335,8 +93391,6 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
_init: function () {
var self = this, o = this.options;
o.height -= 2;
BI.isNumeric(o.width) && (o.width -= 2);
BI.ColorChooser.superclass._init.apply(this, arguments);
o.value = o.value || "";
this.combo = BI.createWidget({
@ -93351,8 +93405,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
width: o.width,
height: o.height
width: o.width - 2,
height: o.height - 2
}, o.el),
popup: {
el: BI.extend({
@ -94103,8 +94157,8 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger",
height: 24
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border bi-focus-shadow",
height: 22
});
},
@ -94174,7 +94228,7 @@ BI.LongColorChooserTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
var conf = BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger",
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border bi-focus-shadow",
height: 24
});
},
@ -97739,6 +97793,77 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
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) {
if (childComponent.component instanceof BI.Layout) {
return; // 布局的过滤掉
}
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;
BI.Widget.prototype.__d = function () {
try {
@ -97762,7 +97887,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
delete this.__cacheStore;
};
_.each(["_mount"], function (name) {
_.each(["_mount", "__afterMount"], function (name) {
var old = BI.Widget.prototype[name];
old && (BI.Widget.prototype[name] = function () {
this.store && pushTarget(this.store);

2
dist/core.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

205
dist/demo.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-3-1 14:10:42 */
/*! time: 2021-3-4 17:10:44 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -4905,6 +4905,9 @@ if (!_global.BI) {
// 获得一个当前对象的引用
_initRef: function () {
if (this.options.__ref) {
this.options.__ref.call(this, this);
}
if (this.options.ref) {
this.options.ref.call(this, this);
}
@ -4912,6 +4915,10 @@ if (!_global.BI) {
//释放当前对象
_purgeRef: function () {
if (this.options.__ref) {
this.options.__ref.call(null);
this.options.__ref = null;
}
if (this.options.ref) {
this.options.ref.call(null);
this.options.ref = null;
@ -13787,7 +13794,7 @@ module.exports = function (exec) {
*/
!(function () {
function callLifeHook(self, life) {
function callLifeHook (self, life) {
var hook = self.options[life] || self[life];
if (hook) {
var hooks = BI.isArray(hook) ? hook : [hook];
@ -13812,7 +13819,8 @@ module.exports = function (exec) {
baseCls: "",
extraCls: "",
cls: "",
css: null
css: null,
updateMode: "manual" // manual / auto
});
},
@ -13838,9 +13846,11 @@ module.exports = function (exec) {
}
},
// 生命周期函数
beforeInit: null,
// 生命周期函数
beforeRender: null,
beforeCreate: null,
created: null,
@ -13853,8 +13863,11 @@ module.exports = function (exec) {
shouldUpdate: null,
update: function () {
},
update: null,
beforeUpdate: null,
updated: null,
beforeDestroy: null,
@ -13870,14 +13883,24 @@ module.exports = function (exec) {
},
_initRender: function () {
var self = this;
function render () {
if (self.options.beforeRender || self.beforeRender) {
(self.options.beforeRender || self.beforeRender).call(self, BI.bind(self._render, self));
} else {
self._render();
}
}
if (this.options.beforeInit || this.beforeInit) {
this.__asking = true;
(this.options.beforeInit || this.beforeInit).call(this, BI.bind(this._render, this));
(this.options.beforeInit || this.beforeInit).call(this, render);
if (this.__asking === true) {
this.__async = true;
}
} else {
this._render();
render();
}
},
@ -14002,27 +14025,59 @@ module.exports = function (exec) {
* @returns {boolean}
* @private
*/
_mount: function (force, deep, lifeHook, predicate) {
_mount: function (force, deep, lifeHook, predicate, layer) {
var self = this;
if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) {
return false;
}
layer = layer || 0;
lifeHook !== false && callLifeHook(this, "beforeMount");
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(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, layer + 1);
});
this._mountChildren && this._mountChildren();
if (layer === 0) {
// 最后再统一执行生命周期
this.__afterMount(lifeHook, predicate);
}
return true;
},
__afterMount: function (lifeHook, predicate) {
if (this._isMounted) {
BI.each(this._children, function (i, widget) {
widget.__afterMount && widget.__afterMount(lifeHook, predicate);
});
lifeHook !== false && callLifeHook(this, "mounted");
this.fireEvent(BI.Events.MOUNT);
predicate && predicate(this);
return true;
}
},
_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 () {
return this._isMounted;
},
@ -14314,12 +14369,12 @@ module.exports = function (exec) {
BI.Widget.context = context = contextStack.pop();
};
function pushTarget(_current) {
function pushTarget (_current) {
if (current) currentStack.push(current);
BI.Widget.current = current = _current;
}
function popTarget() {
function popTarget () {
BI.Widget.current = current = currentStack.pop();
}
@ -15144,19 +15199,13 @@ BI.Layout = BI.inherit(BI.Widget, {
if (!child.shouldUpdate) {
return null;
}
return child.shouldUpdate(this._getOptions(item)) === true;
return child.shouldUpdate(this._getOptions(item));
},
updateItemAt: function (index, item) {
if (index < 0 || index > this.options.items.length - 1) {
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)];
delete this._children[this._getChildName(index)];
this.options.items.splice(index, 1);
@ -15243,7 +15292,14 @@ BI.Layout = BI.inherit(BI.Widget, {
patchItem: function (oldVnode, vnode, index) {
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);
}
},
@ -22481,6 +22537,7 @@ BI.Single = BI.inherit(BI.Widget, {
setValue: function (val) {
if (!this.options.readonly) {
this.options.value = val;
this.options.setValue && this.options.setValue(val);
}
},
@ -22494,8 +22551,9 @@ BI.Single = BI.inherit(BI.Widget, {
this.showTimeout = null;
}
BI.Tooltips.remove(this.getName());
},
}
});
BI.shortcut("bi.single", BI.Single);
/***/ }),
@ -23070,11 +23128,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
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) {
BI.BasicButton.superclass._setEnable.apply(this, arguments);
if (enable === true) {
@ -28571,7 +28624,6 @@ BI.shortcut("bi.image_button", BI.ImageButton);
/* 429 */
/***/ (function(module, exports) {
/**
* 文字类型的按钮
* @class BI.Button
@ -28617,7 +28669,10 @@ BI.Button = BI.inherit(BI.BasicButton, {
BI.Button.superclass._init.apply(this, arguments);
var o = this.options, self = this;
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) {
this.element.css({lineHeight: o.height / BI.pixRatio + BI.pixUnit});
} else {
@ -33936,7 +33991,8 @@ BI.IconTreeLeafItem = BI.inherit(BI.BasicButton, {
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py
py: o.py,
keyword: o.keyword
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
@ -93326,7 +93382,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-chooser bi-border",
baseCls: "bi-color-chooser",
value: "",
height: 24,
el: {},
@ -93335,8 +93391,6 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
_init: function () {
var self = this, o = this.options;
o.height -= 2;
BI.isNumeric(o.width) && (o.width -= 2);
BI.ColorChooser.superclass._init.apply(this, arguments);
o.value = o.value || "";
this.combo = BI.createWidget({
@ -93351,8 +93405,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
width: o.width,
height: o.height
width: o.width - 2,
height: o.height - 2
}, o.el),
popup: {
el: BI.extend({
@ -94103,8 +94157,8 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger",
height: 24
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border bi-focus-shadow",
height: 22
});
},
@ -94174,7 +94228,7 @@ BI.LongColorChooserTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
var conf = BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger",
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border bi-focus-shadow",
height: 24
});
},
@ -97906,6 +97960,77 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
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) {
if (childComponent.component instanceof BI.Layout) {
return; // 布局的过滤掉
}
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;
BI.Widget.prototype.__d = function () {
try {
@ -97929,7 +98054,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
delete this.__cacheStore;
};
_.each(["_mount"], function (name) {
_.each(["_mount", "__afterMount"], function (name) {
var old = BI.Widget.prototype[name];
old && (BI.Widget.prototype[name] = function () {
this.store && pushTarget(this.store);

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

205
dist/fineui.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-3-1 14:10:42 */
/*! time: 2021-3-4 17:10:44 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -4905,6 +4905,9 @@ if (!_global.BI) {
// 获得一个当前对象的引用
_initRef: function () {
if (this.options.__ref) {
this.options.__ref.call(this, this);
}
if (this.options.ref) {
this.options.ref.call(this, this);
}
@ -4912,6 +4915,10 @@ if (!_global.BI) {
//释放当前对象
_purgeRef: function () {
if (this.options.__ref) {
this.options.__ref.call(null);
this.options.__ref = null;
}
if (this.options.ref) {
this.options.ref.call(null);
this.options.ref = null;
@ -13787,7 +13794,7 @@ module.exports = function (exec) {
*/
!(function () {
function callLifeHook(self, life) {
function callLifeHook (self, life) {
var hook = self.options[life] || self[life];
if (hook) {
var hooks = BI.isArray(hook) ? hook : [hook];
@ -13812,7 +13819,8 @@ module.exports = function (exec) {
baseCls: "",
extraCls: "",
cls: "",
css: null
css: null,
updateMode: "manual" // manual / auto
});
},
@ -13838,9 +13846,11 @@ module.exports = function (exec) {
}
},
// 生命周期函数
beforeInit: null,
// 生命周期函数
beforeRender: null,
beforeCreate: null,
created: null,
@ -13853,8 +13863,11 @@ module.exports = function (exec) {
shouldUpdate: null,
update: function () {
},
update: null,
beforeUpdate: null,
updated: null,
beforeDestroy: null,
@ -13870,14 +13883,24 @@ module.exports = function (exec) {
},
_initRender: function () {
var self = this;
function render () {
if (self.options.beforeRender || self.beforeRender) {
(self.options.beforeRender || self.beforeRender).call(self, BI.bind(self._render, self));
} else {
self._render();
}
}
if (this.options.beforeInit || this.beforeInit) {
this.__asking = true;
(this.options.beforeInit || this.beforeInit).call(this, BI.bind(this._render, this));
(this.options.beforeInit || this.beforeInit).call(this, render);
if (this.__asking === true) {
this.__async = true;
}
} else {
this._render();
render();
}
},
@ -14002,27 +14025,59 @@ module.exports = function (exec) {
* @returns {boolean}
* @private
*/
_mount: function (force, deep, lifeHook, predicate) {
_mount: function (force, deep, lifeHook, predicate, layer) {
var self = this;
if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) {
return false;
}
layer = layer || 0;
lifeHook !== false && callLifeHook(this, "beforeMount");
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(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, layer + 1);
});
this._mountChildren && this._mountChildren();
if (layer === 0) {
// 最后再统一执行生命周期
this.__afterMount(lifeHook, predicate);
}
return true;
},
__afterMount: function (lifeHook, predicate) {
if (this._isMounted) {
BI.each(this._children, function (i, widget) {
widget.__afterMount && widget.__afterMount(lifeHook, predicate);
});
lifeHook !== false && callLifeHook(this, "mounted");
this.fireEvent(BI.Events.MOUNT);
predicate && predicate(this);
return true;
}
},
_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 () {
return this._isMounted;
},
@ -14314,12 +14369,12 @@ module.exports = function (exec) {
BI.Widget.context = context = contextStack.pop();
};
function pushTarget(_current) {
function pushTarget (_current) {
if (current) currentStack.push(current);
BI.Widget.current = current = _current;
}
function popTarget() {
function popTarget () {
BI.Widget.current = current = currentStack.pop();
}
@ -15144,19 +15199,13 @@ BI.Layout = BI.inherit(BI.Widget, {
if (!child.shouldUpdate) {
return null;
}
return child.shouldUpdate(this._getOptions(item)) === true;
return child.shouldUpdate(this._getOptions(item));
},
updateItemAt: function (index, item) {
if (index < 0 || index > this.options.items.length - 1) {
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)];
delete this._children[this._getChildName(index)];
this.options.items.splice(index, 1);
@ -15243,7 +15292,14 @@ BI.Layout = BI.inherit(BI.Widget, {
patchItem: function (oldVnode, vnode, index) {
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);
}
},
@ -22481,6 +22537,7 @@ BI.Single = BI.inherit(BI.Widget, {
setValue: function (val) {
if (!this.options.readonly) {
this.options.value = val;
this.options.setValue && this.options.setValue(val);
}
},
@ -22494,8 +22551,9 @@ BI.Single = BI.inherit(BI.Widget, {
this.showTimeout = null;
}
BI.Tooltips.remove(this.getName());
},
}
});
BI.shortcut("bi.single", BI.Single);
/***/ }),
@ -23070,11 +23128,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
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) {
BI.BasicButton.superclass._setEnable.apply(this, arguments);
if (enable === true) {
@ -28571,7 +28624,6 @@ BI.shortcut("bi.image_button", BI.ImageButton);
/* 429 */
/***/ (function(module, exports) {
/**
* 文字类型的按钮
* @class BI.Button
@ -28617,7 +28669,10 @@ BI.Button = BI.inherit(BI.BasicButton, {
BI.Button.superclass._init.apply(this, arguments);
var o = this.options, self = this;
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) {
this.element.css({lineHeight: o.height / BI.pixRatio + BI.pixUnit});
} else {
@ -33936,7 +33991,8 @@ BI.IconTreeLeafItem = BI.inherit(BI.BasicButton, {
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py
py: o.py,
keyword: o.keyword
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
@ -93326,7 +93382,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-chooser bi-border",
baseCls: "bi-color-chooser",
value: "",
height: 24,
el: {},
@ -93335,8 +93391,6 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
_init: function () {
var self = this, o = this.options;
o.height -= 2;
BI.isNumeric(o.width) && (o.width -= 2);
BI.ColorChooser.superclass._init.apply(this, arguments);
o.value = o.value || "";
this.combo = BI.createWidget({
@ -93351,8 +93405,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
width: o.width,
height: o.height
width: o.width - 2,
height: o.height - 2
}, o.el),
popup: {
el: BI.extend({
@ -94103,8 +94157,8 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger",
height: 24
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border bi-focus-shadow",
height: 22
});
},
@ -94174,7 +94228,7 @@ BI.LongColorChooserTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
var conf = BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger",
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border bi-focus-shadow",
height: 24
});
},
@ -97901,6 +97955,77 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
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) {
if (childComponent.component instanceof BI.Layout) {
return; // 布局的过滤掉
}
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;
BI.Widget.prototype.__d = function () {
try {
@ -97924,7 +98049,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
delete this.__cacheStore;
};
_.each(["_mount"], function (name) {
_.each(["_mount", "__afterMount"], function (name) {
var old = BI.Widget.prototype[name];
old && (BI.Widget.prototype[name] = function () {
this.store && pushTarget(this.store);

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

191
dist/fineui_without_jquery_polyfill.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-3-1 14:10:42 */
/*! time: 2021-3-4 17:10:44 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -2366,6 +2366,9 @@ if (!_global.BI) {
// 获得一个当前对象的引用
_initRef: function () {
if (this.options.__ref) {
this.options.__ref.call(this, this);
}
if (this.options.ref) {
this.options.ref.call(this, this);
}
@ -2373,6 +2376,10 @@ if (!_global.BI) {
//释放当前对象
_purgeRef: function () {
if (this.options.__ref) {
this.options.__ref.call(null);
this.options.__ref = null;
}
if (this.options.ref) {
this.options.ref.call(null);
this.options.ref = null;
@ -9809,7 +9816,7 @@ BI.Req = {
*/
!(function () {
function callLifeHook(self, life) {
function callLifeHook (self, life) {
var hook = self.options[life] || self[life];
if (hook) {
var hooks = BI.isArray(hook) ? hook : [hook];
@ -9834,7 +9841,8 @@ BI.Req = {
baseCls: "",
extraCls: "",
cls: "",
css: null
css: null,
updateMode: "manual" // manual / auto
});
},
@ -9860,9 +9868,11 @@ BI.Req = {
}
},
// 生命周期函数
beforeInit: null,
// 生命周期函数
beforeRender: null,
beforeCreate: null,
created: null,
@ -9875,8 +9885,11 @@ BI.Req = {
shouldUpdate: null,
update: function () {
},
update: null,
beforeUpdate: null,
updated: null,
beforeDestroy: null,
@ -9892,14 +9905,24 @@ BI.Req = {
},
_initRender: function () {
var self = this;
function render () {
if (self.options.beforeRender || self.beforeRender) {
(self.options.beforeRender || self.beforeRender).call(self, BI.bind(self._render, self));
} else {
self._render();
}
}
if (this.options.beforeInit || this.beforeInit) {
this.__asking = true;
(this.options.beforeInit || this.beforeInit).call(this, BI.bind(this._render, this));
(this.options.beforeInit || this.beforeInit).call(this, render);
if (this.__asking === true) {
this.__async = true;
}
} else {
this._render();
render();
}
},
@ -10024,27 +10047,59 @@ BI.Req = {
* @returns {boolean}
* @private
*/
_mount: function (force, deep, lifeHook, predicate) {
_mount: function (force, deep, lifeHook, predicate, layer) {
var self = this;
if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) {
return false;
}
layer = layer || 0;
lifeHook !== false && callLifeHook(this, "beforeMount");
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(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, layer + 1);
});
this._mountChildren && this._mountChildren();
if (layer === 0) {
// 最后再统一执行生命周期
this.__afterMount(lifeHook, predicate);
}
return true;
},
__afterMount: function (lifeHook, predicate) {
if (this._isMounted) {
BI.each(this._children, function (i, widget) {
widget.__afterMount && widget.__afterMount(lifeHook, predicate);
});
lifeHook !== false && callLifeHook(this, "mounted");
this.fireEvent(BI.Events.MOUNT);
predicate && predicate(this);
return true;
}
},
_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 () {
return this._isMounted;
},
@ -10336,12 +10391,12 @@ BI.Req = {
BI.Widget.context = context = contextStack.pop();
};
function pushTarget(_current) {
function pushTarget (_current) {
if (current) currentStack.push(current);
BI.Widget.current = current = _current;
}
function popTarget() {
function popTarget () {
BI.Widget.current = current = currentStack.pop();
}
@ -11166,19 +11221,13 @@ BI.Layout = BI.inherit(BI.Widget, {
if (!child.shouldUpdate) {
return null;
}
return child.shouldUpdate(this._getOptions(item)) === true;
return child.shouldUpdate(this._getOptions(item));
},
updateItemAt: function (index, item) {
if (index < 0 || index > this.options.items.length - 1) {
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)];
delete this._children[this._getChildName(index)];
this.options.items.splice(index, 1);
@ -11265,7 +11314,14 @@ BI.Layout = BI.inherit(BI.Widget, {
patchItem: function (oldVnode, vnode, index) {
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);
}
},
@ -18503,6 +18559,7 @@ BI.Single = BI.inherit(BI.Widget, {
setValue: function (val) {
if (!this.options.readonly) {
this.options.value = val;
this.options.setValue && this.options.setValue(val);
}
},
@ -18516,8 +18573,9 @@ BI.Single = BI.inherit(BI.Widget, {
this.showTimeout = null;
}
BI.Tooltips.remove(this.getName());
},
}
});
BI.shortcut("bi.single", BI.Single);
/***/ }),
@ -19092,11 +19150,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
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) {
BI.BasicButton.superclass._setEnable.apply(this, arguments);
if (enable === true) {
@ -24593,7 +24646,6 @@ BI.shortcut("bi.image_button", BI.ImageButton);
/* 429 */
/***/ (function(module, exports) {
/**
* 文字类型的按钮
* @class BI.Button
@ -24639,7 +24691,10 @@ BI.Button = BI.inherit(BI.BasicButton, {
BI.Button.superclass._init.apply(this, arguments);
var o = this.options, self = this;
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) {
this.element.css({lineHeight: o.height / BI.pixRatio + BI.pixUnit});
} else {
@ -29958,7 +30013,8 @@ BI.IconTreeLeafItem = BI.inherit(BI.BasicButton, {
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py
py: o.py,
keyword: o.keyword
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
@ -72788,6 +72844,77 @@ var _button = __webpack_require__(8);
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) {
if (childComponent.component instanceof BI.Layout) {
return; // 布局的过滤掉
}
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;
BI.Widget.prototype.__d = function () {
try {
@ -72811,7 +72938,7 @@ var _button = __webpack_require__(8);
delete this.__cacheStore;
};
_.each(["_mount"], function (name) {
_.each(["_mount", "__afterMount"], function (name) {
var old = BI.Widget.prototype[name];
old && (BI.Widget.prototype[name] = function () {
this.store && pushTarget(this.store);

2
dist/fineui_without_jquery_polyfill.js.map vendored

File diff suppressed because one or more lines are too long

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

@ -178,6 +178,77 @@
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) {
if (childComponent.component instanceof BI.Layout) {
return; // 布局的过滤掉
}
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;
BI.Widget.prototype.__d = function () {
unMount.apply(this, arguments);
@ -197,7 +268,7 @@
delete this.__cacheStore;
};
_.each(["_mount"], function (name) {
_.each(["_mount", "__afterMount"], function (name) {
var old = BI.Widget.prototype[name];
old && (BI.Widget.prototype[name] = function () {
this.store && pushTarget(this.store);

73
dist/fix/fix.compact.js vendored

@ -183,6 +183,77 @@
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) {
if (childComponent.component instanceof BI.Layout) {
return; // 布局的过滤掉
}
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;
BI.Widget.prototype.__d = function () {
try {
@ -206,7 +277,7 @@
delete this.__cacheStore;
};
_.each(["_mount"], function (name) {
_.each(["_mount", "__afterMount"], function (name) {
var old = BI.Widget.prototype[name];
old && (BI.Widget.prototype[name] = function () {
this.store && pushTarget(this.store);

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.

6
dist/font/iconfont.svg vendored

@ -20,6 +20,12 @@ Created by iconfont
/>
<missing-glyph />
<glyph glyph-name="dangjichuli" unicode="&#59466;" d="M169.923333 838.358271l186.257984-186.189757-11.666709-100.906798-100.906798-11.666709-186.257984 186.257984-20.740815-43.596649a375.381475 375.381475 0 0 1 73.343345-427.097061l12.417199-11.871388a375.108569 375.108569 0 0 1 340.244895-87.807336l11.803162 3.20664 172.817389-172.817389a185.712173 185.712173 0 0 1 262.671515 0l8.664749 9.278786a185.712173 185.712173 0 0 1-8.664749 253.392729L737.089127 421.222259l3.138413 11.803162A375.381475 375.381475 0 0 1 213.519982 859.23554l-43.528423-20.809043z m422.457668-100.770345a307.018654 307.018654 0 0 0 73.889157-315.205818l-6.754411-19.990326 202.154727-202.086501a117.485805 117.485805 0 0 0-166.199431-166.199432L493.384542 236.19235l-20.058552-6.686184a307.018654 307.018654 0 0 0-315.205819 73.889156l-10.711539 11.325578a307.155107 307.155107 0 0 0-69.932027 280.751502l2.933734 10.847993 138.363073-138.363074 187.281379 21.832438 21.764212 187.213153-138.363074 138.363073 10.916219 2.933734a307.155107 307.155107 0 0 0 292.008853-80.711793z" horiz-adv-x="1024" />
<glyph glyph-name="xingnengfankui" unicode="&#59465;" d="M128 352V128h160a30.72 30.72 0 0 0 17.408-5.888l0.512 0.768L448 27.52V96a32 32 0 0 0 32 32H896V352h64V128a64 64 0 0 0-64-64H512v-96c0-17.92-14.08-32-32-32-4.48 0-8.96 0.64-12.8 2.56a34.368 34.368 0 0 0-10.24 6.4L277.824 64H128a64 64 0 0 0-64 64V352h64z m336.512 306.112l1.536-5.44 60.288-302.08 95.36 171.072a32 32 0 0 0 54.208 2.688l2.88-5.12 60.16-133.12 68.48 82.432a32 32 0 0 0 18.944 11.072L832 480.128h128a32 32 0 0 0 5.76-63.488l-5.76-0.512h-113.024l-91.456-110.272a32 32 0 0 0-50.944 2.176l-2.816 5.056-55.168 121.984-106.624-191.552a32 32 0 0 0-57.728 3.776l-1.6 5.504-61.184 306.304-106.88-177.728a32 32 0 0 0-52.8-3.008l-3.2 5.248-41.792 83.776-29.312-38.656a32 32 0 0 0-19.584-12.096l-5.888-0.512H64a32 32 0 0 0-5.76 63.488L64 480.128h80.064l50.944 66.944a32 32 0 0 0 51.136-0.192l3.008-4.928 38.656-77.568 119.424 198.464a32 32 0 0 0 57.28-4.736zM896 832a64 64 0 0 0 64-64v-224h-64V768H128v-224H64V768a64 64 0 0 0 64 64h768z" horiz-adv-x="1024" />
<glyph glyph-name="beizhu" unicode="&#59463;" d="M809.152 800H214.848A119.232 119.232 0 0 1 96 681.152v-475.456c0-65.344 53.504-118.848 118.848-118.848h54.848l124.8-112.896c5.952-5.952 11.904-5.952 17.856-5.952 17.792 0 35.648 11.904 35.648 35.648v83.2h361.152a119.232 119.232 0 0 1 118.848 118.848V681.152A119.232 119.232 0 0 1 809.152 800z m59.392-594.304c0-35.648-23.744-59.392-59.392-59.392H448a53.952 53.952 0 0 1-41.6-17.856 53.952 53.952 0 0 1-17.856-41.6v-29.696l-77.248 71.296a64.192 64.192 0 0 1-41.6 17.856h-54.848c-35.648 0-59.392 23.744-59.392 59.392V681.152c0 35.648 23.744 59.392 59.392 59.392h594.304c35.648 0 59.392-23.744 59.392-59.392v-475.456zM720 562.304h-416c-17.856 0-29.696-11.904-29.696-29.76 0-17.792 11.84-29.696 29.696-29.696h416c17.856 0 29.696 11.904 29.696 29.696 0 17.856-11.84 29.76-29.696 29.76z m0-178.304h-416c-17.856 0-29.696-11.904-29.696-29.696 0-17.856 11.84-29.76 29.696-29.76h416c17.856 0 29.696 11.904 29.696 29.76 0 17.792-11.84 29.696-29.696 29.696z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 379 KiB

After

Width:  |  Height:  |  Size: 381 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/resource.css vendored

File diff suppressed because one or more lines are too long

9
dist/utils.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-3-1 14:10:42 */
/*! time: 2021-3-4 17:10:44 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -2085,6 +2085,9 @@ if (!_global.BI) {
// 获得一个当前对象的引用
_initRef: function () {
if (this.options.__ref) {
this.options.__ref.call(this, this);
}
if (this.options.ref) {
this.options.ref.call(this, this);
}
@ -2092,6 +2095,10 @@ if (!_global.BI) {
//释放当前对象
_purgeRef: function () {
if (this.options.__ref) {
this.options.__ref.call(null);
this.options.__ref = null;
}
if (this.options.ref) {
this.options.ref.call(null);
this.options.ref = null;

2
dist/utils.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/utils.min.js.map vendored

File diff suppressed because one or more lines are too long

2
package.json

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

5
src/base/single/button/button.basic.js

@ -389,11 +389,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
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) {
BI.BasicButton.superclass._setEnable.apply(this, arguments);
if (enable === true) {

6
src/base/single/button/buttons/button.js

@ -1,4 +1,3 @@
/**
* 文字类型的按钮
* @class BI.Button
@ -44,7 +43,10 @@ BI.Button = BI.inherit(BI.BasicButton, {
BI.Button.superclass._init.apply(this, arguments);
var o = this.options, self = this;
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) {
this.element.css({lineHeight: o.height / BI.pixRatio + BI.pixUnit});
} else {

4
src/base/single/single.js

@ -192,6 +192,7 @@ BI.Single = BI.inherit(BI.Widget, {
setValue: function (val) {
if (!this.options.readonly) {
this.options.value = val;
this.options.setValue && this.options.setValue(val);
}
},
@ -205,5 +206,6 @@ BI.Single = BI.inherit(BI.Widget, {
this.showTimeout = null;
}
BI.Tooltips.remove(this.getName());
},
}
});
BI.shortcut("bi.single", BI.Single);

8
src/case/colorchooser/colorchooser.js

@ -9,7 +9,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-chooser bi-border",
baseCls: "bi-color-chooser",
value: "",
height: 24,
el: {},
@ -18,8 +18,6 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
_init: function () {
var self = this, o = this.options;
o.height -= 2;
BI.isNumeric(o.width) && (o.width -= 2);
BI.ColorChooser.superclass._init.apply(this, arguments);
o.value = o.value || "";
this.combo = BI.createWidget({
@ -34,8 +32,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.trigger = _ref;
},
width: o.width,
height: o.height
width: o.width - 2,
height: o.height - 2
}, o.el),
popup: {
el: BI.extend({

4
src/case/colorchooser/colorchooser.trigger.js

@ -10,8 +10,8 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger",
height: 24
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border bi-focus-shadow",
height: 22
});
},

2
src/case/colorchooser/colorchooser.trigger.long.js

@ -10,7 +10,7 @@ BI.LongColorChooserTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
var conf = BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger",
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border bi-focus-shadow",
height: 24
});
},

7
src/core/ob.js

@ -72,6 +72,9 @@
// 获得一个当前对象的引用
_initRef: function () {
if (this.options.__ref) {
this.options.__ref.call(this, this);
}
if (this.options.ref) {
this.options.ref.call(this, this);
}
@ -79,6 +82,10 @@
//释放当前对象
_purgeRef: function () {
if (this.options.__ref) {
this.options.__ref.call(null);
this.options.__ref = null;
}
if (this.options.ref) {
this.options.ref.call(null);
this.options.ref = null;

74
src/core/widget.js

@ -7,7 +7,7 @@
*/
!(function () {
function callLifeHook(self, life) {
function callLifeHook (self, life) {
var hook = self.options[life] || self[life];
if (hook) {
var hooks = BI.isArray(hook) ? hook : [hook];
@ -32,7 +32,8 @@
baseCls: "",
extraCls: "",
cls: "",
css: null
css: null,
updateMode: "manual" // manual / auto
});
},
@ -58,9 +59,11 @@
}
},
// 生命周期函数
beforeInit: null,
// 生命周期函数
beforeRender: null,
beforeCreate: null,
created: null,
@ -73,8 +76,11 @@
shouldUpdate: null,
update: function () {
},
update: null,
beforeUpdate: null,
updated: null,
beforeDestroy: null,
@ -90,14 +96,24 @@
},
_initRender: function () {
var self = this;
function render () {
if (self.options.beforeRender || self.beforeRender) {
(self.options.beforeRender || self.beforeRender).call(self, BI.bind(self._render, self));
} else {
self._render();
}
}
if (this.options.beforeInit || this.beforeInit) {
this.__asking = true;
(this.options.beforeInit || this.beforeInit).call(this, BI.bind(this._render, this));
(this.options.beforeInit || this.beforeInit).call(this, render);
if (this.__asking === true) {
this.__async = true;
}
} else {
this._render();
render();
}
},
@ -222,27 +238,59 @@
* @returns {boolean}
* @private
*/
_mount: function (force, deep, lifeHook, predicate) {
_mount: function (force, deep, lifeHook, predicate, layer) {
var self = this;
if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) {
return false;
}
layer = layer || 0;
lifeHook !== false && callLifeHook(this, "beforeMount");
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(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, layer + 1);
});
this._mountChildren && this._mountChildren();
if (layer === 0) {
// 最后再统一执行生命周期
this.__afterMount(lifeHook, predicate);
}
return true;
},
__afterMount: function (lifeHook, predicate) {
if (this._isMounted) {
BI.each(this._children, function (i, widget) {
widget.__afterMount && widget.__afterMount(lifeHook, predicate);
});
lifeHook !== false && callLifeHook(this, "mounted");
this.fireEvent(BI.Events.MOUNT);
predicate && predicate(this);
return true;
}
},
_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 () {
return this._isMounted;
},
@ -534,12 +582,12 @@
BI.Widget.context = context = contextStack.pop();
};
function pushTarget(_current) {
function pushTarget (_current) {
if (current) currentStack.push(current);
BI.Widget.current = current = _current;
}
function popTarget() {
function popTarget () {
BI.Widget.current = current = currentStack.pop();
}

17
src/core/wrapper/layout.js

@ -268,19 +268,13 @@ BI.Layout = BI.inherit(BI.Widget, {
if (!child.shouldUpdate) {
return null;
}
return child.shouldUpdate(this._getOptions(item)) === true;
return child.shouldUpdate(this._getOptions(item));
},
updateItemAt: function (index, item) {
if (index < 0 || index > this.options.items.length - 1) {
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)];
delete this._children[this._getChildName(index)];
this.options.items.splice(index, 1);
@ -367,7 +361,14 @@ BI.Layout = BI.inherit(BI.Widget, {
patchItem: function (oldVnode, vnode, index) {
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);
}
},

Loading…
Cancel
Save