Browse Source

auto upgrade version to 2.0.20201011234152

es6
data 4 years ago
parent
commit
73b9ef4eef
  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. 210
      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. 210
      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. 210
      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. 210
      dist/fineui_without_jquery_polyfill.js
  26. 2
      dist/fineui_without_jquery_polyfill.js.map
  27. 2
      dist/font.css
  28. 2
      dist/utils.js
  29. 2
      dist/utils.min.js
  30. 2
      package.json

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

210
dist/2.0/fineui.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-10-10 17:40:22 */ /*! time: 2020-10-11 23:40:24 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
@ -13580,6 +13580,7 @@ module.exports = function (exec) {
if (!this._constructed) { if (!this._constructed) {
this._constructed = true; this._constructed = true;
this._init(); this._init();
this._initRef();
} }
}, },
@ -13726,7 +13727,7 @@ module.exports = function (exec) {
} }
if (BI.isArray(els)) { if (BI.isArray(els)) {
BI.each(els, function (i, el) { BI.each(els, function (i, el) {
BI.createWidget(el, { BI._lazyCreateWidget(el, {
element: self element: self
}); });
}); });
@ -13882,7 +13883,9 @@ module.exports = function (exec) {
throw new Error("name has already been existed"); throw new Error("name has already been existed");
} }
widget._setParent && widget._setParent(this); widget._setParent && widget._setParent(this);
BI.Widget.pushContext(widget);
widget._lazyConstructor(); widget._lazyConstructor();
BI.Widget.popContext();
widget.on(BI.Events.DESTROY, function () { widget.on(BI.Events.DESTROY, function () {
BI.remove(self._children, this); BI.remove(self._children, this);
}); });
@ -14050,36 +14053,51 @@ module.exports = function (exec) {
this.purgeListeners(); this.purgeListeners();
} }
}); });
var context = null; var context = null, current = null;
var contextStack = []; var contextStack = [], currentStack = [];
function pushTarget (_context) { BI.Widget.pushContext = function (_context) {
if (context) contextStack.push(context); if (context) contextStack.push(context);
BI.Widget.current = context = _context; BI.Widget.context = context = _context;
};
BI.Widget.popContext = function () {
BI.Widget.context = context = contextStack.pop();
if (contextStack.length <= 0) {
BI.Widget.context = context = null;
}
};
function pushTarget (_current) {
if (current) currentStack.push(current);
BI.Widget.current = current = _current;
} }
function popTarget () { function popTarget () {
BI.Widget.current = context = contextStack.pop(); BI.Widget.current = current = currentStack.pop();
if (currentStack.length <= 0) {
BI.Widget.current = current = null;
}
} }
BI.onBeforeMount = function (beforeMount) { BI.onBeforeMount = function (beforeMount) {
if (context) { if (current) {
context.beforeMount = beforeMount; current.beforeMount = beforeMount;
} }
}; };
BI.onMounted = function (mounted) { BI.onMounted = function (mounted) {
if (context) { if (current) {
context.mounted = mounted; current.mounted = mounted;
} }
}; };
BI.onBeforeUnmount = function (beforeDestroy) { BI.onBeforeUnmount = function (beforeDestroy) {
if (context) { if (current) {
context.beforeDestroy = beforeDestroy; current.beforeDestroy = beforeDestroy;
} }
}; };
BI.onUnmounted = function (destroyed) { BI.onUnmounted = function (destroyed) {
if (context) { if (current) {
context.destroyed = destroyed; current.destroyed = destroyed;
} }
}; };
@ -14157,7 +14175,7 @@ module.exports = function (exec) {
}; };
// 根据配置属性生成widget // 根据配置属性生成widget
var createWidget = function (config) { var createWidget = function (config, lazy) {
var cls = kv[config.type]; var cls = kv[config.type];
if (!cls) { if (!cls) {
@ -14165,17 +14183,17 @@ module.exports = function (exec) {
} }
var widget = new cls(); var widget = new cls();
BI.Widget.pushContext(widget);
widget._initProps(config); widget._initProps(config);
widget._initRoot(); widget._initRoot();
widget._initRef(); if (!lazy || config.element || config.root) {
// if (config.element || config.root) { widget._lazyConstructor();
widget._lazyConstructor(); }
// } BI.Widget.popContext();
return widget; return widget;
}; };
BI.createWidget = BI.createWidget || function (item, options, context) { BI.createWidget = BI.createWidget || function (item, options, context, lazy) {
// 先把准备环境准备好 // 先把准备环境准备好
BI.init(); BI.init();
var el, w; var el, w;
@ -14203,7 +14221,7 @@ module.exports = function (exec) {
BI.Plugin.getObject(el.type, this); BI.Plugin.getObject(el.type, this);
} }
}]); }]);
return w.type === el.type ? createWidget(w) : BI.createWidget(BI.extend({}, item, {type: w.type}, options)); return w.type === el.type ? createWidget(w, lazy) : BI.createWidget(BI.extend({}, item, {type: w.type}), options, context, lazy);
} }
if (item.el && (item.el.type || options.type)) { if (item.el && (item.el.type || options.type)) {
el = BI.extend({}, options, item.el); el = BI.extend({}, options, item.el);
@ -14214,7 +14232,7 @@ module.exports = function (exec) {
BI.Plugin.getObject(el.type, this); BI.Plugin.getObject(el.type, this);
} }
}]); }]);
return w.type === el.type ? createWidget(w) : BI.createWidget(BI.extend({}, item, {type: w.type}, options)); return w.type === el.type ? createWidget(w, lazy) : BI.createWidget(BI.extend({}, item, {type: w.type}), options, context, lazy);
} }
if (BI.isWidget(item.el)) { if (BI.isWidget(item.el)) {
return item.el; return item.el;
@ -14222,6 +14240,10 @@ module.exports = function (exec) {
throw new Error("无法根据item创建组件"); throw new Error("无法根据item创建组件");
}; };
BI._lazyCreateWidget = BI._lazyCreateWidget || function (item, options, context) {
return BI.createWidget(item, options, context, true);
};
BI.createElement = BI.createElement || function () { BI.createElement = BI.createElement || function () {
var widget = BI.createWidget.apply(this, arguments); var widget = BI.createWidget.apply(this, arguments);
return widget.element; return widget.element;
@ -14633,7 +14655,7 @@ BI.Layout = BI.inherit(BI.Widget, {
_addElement: function (i, item, context) { _addElement: function (i, item, context) {
var self = this, w; var self = this, w;
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
w = BI.createWidget(item, context); w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () { w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) { BI.each(self._children, function (name, child) {
if (child === w) { if (child === w) {
@ -17943,9 +17965,9 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
var td; var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({ td = BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
width: width, width: width,
items: [w] items: [w]
@ -18176,7 +18198,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
delete self._children[i]; delete self._children[i];
} }
}); });
BI.createWidget({ BI._lazyCreateWidget({
type: "bi.horizontal_auto", type: "bi.horizontal_auto",
element: this, element: this,
items: [this.left] items: [this.left]
@ -18185,7 +18207,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
_addElement: function (i, item) { _addElement: function (i, item) {
var self = this, o = this.options; var self = this, o = this.options;
this.left = BI.createWidget({ this.left = BI._lazyCreateWidget({
type: "bi.vertical", type: "bi.vertical",
items: [item], items: [item],
hgap: o.hgap, hgap: o.hgap,
@ -18196,7 +18218,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
rgap: o.rgap rgap: o.rgap
}); });
this.container = BI.createWidget({ this.container = BI._lazyCreateWidget({
type: "bi.left", type: "bi.left",
element: this, element: this,
items: [this.left] items: [this.left]
@ -18212,6 +18234,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.horizontal_float", BI.FloatHorizontalLayout); BI.shortcut("bi.horizontal_float", BI.FloatHorizontalLayout);
/***/ }), /***/ }),
/* 337 */ /* 337 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -19464,7 +19487,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
if (item != null) { if (item != null) {
if (item.el) { if (item.el) {
if (!this.hasWidget(this.getName() + "north")) { if (!this.hasWidget(this.getName() + "north")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "north", w); this.addWidget(this.getName() + "north", w);
} }
this.getWidgetByName(this.getName() + "north").element.height(item.height) this.getWidgetByName(this.getName() + "north").element.height(item.height)
@ -19484,7 +19507,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
if (item != null) { if (item != null) {
if (item.el) { if (item.el) {
if (!this.hasWidget(this.getName() + "south")) { if (!this.hasWidget(this.getName() + "south")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "south", w); this.addWidget(this.getName() + "south", w);
} }
this.getWidgetByName(this.getName() + "south").element.height(item.height) this.getWidgetByName(this.getName() + "south").element.height(item.height)
@ -19504,7 +19527,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
if (item != null) { if (item != null) {
if (item.el) { if (item.el) {
if (!this.hasWidget(this.getName() + "west")) { if (!this.hasWidget(this.getName() + "west")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "west", w); this.addWidget(this.getName() + "west", w);
} }
this.getWidgetByName(this.getName() + "west").element.width(item.width) this.getWidgetByName(this.getName() + "west").element.width(item.width)
@ -19524,7 +19547,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
if (item != null) { if (item != null) {
if (item.el) { if (item.el) {
if (!this.hasWidget(this.getName() + "east")) { if (!this.hasWidget(this.getName() + "east")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "east", w); this.addWidget(this.getName() + "east", w);
} }
this.getWidgetByName(this.getName() + "east").element.width(item.width) this.getWidgetByName(this.getName() + "east").element.width(item.width)
@ -19543,7 +19566,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
item = regions["center"]; item = regions["center"];
if (item != null) { if (item != null) {
if (!this.hasWidget(this.getName() + "center")) { if (!this.hasWidget(this.getName() + "center")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "center", w); this.addWidget(this.getName() + "center", w);
} }
this.getWidgetByName(this.getName() + "center").element this.getWidgetByName(this.getName() + "center").element
@ -19562,6 +19585,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.border", BI.BorderLayout); BI.shortcut("bi.border", BI.BorderLayout);
/***/ }), /***/ }),
/* 353 */ /* 353 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -19596,7 +19620,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
if (!self.hasWidget(item.cardName)) { if (!self.hasWidget(item.cardName)) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.on(BI.Events.DESTROY, function () { w.on(BI.Events.DESTROY, function () {
var index = BI.findIndex(o.items, function (i, tItem) { var index = BI.findIndex(o.items, function (i, tItem) {
return tItem.cardName == item.cardName; return tItem.cardName == item.cardName;
@ -19666,7 +19690,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
if (this.isCardExisted(cardName)) { if (this.isCardExisted(cardName)) {
throw new Error("cardName is already exist"); throw new Error("cardName is already exist");
} }
var widget = BI.createWidget(cardItem, this); var widget = BI._lazyCreateWidget(cardItem, this);
widget.element.css({ widget.element.css({
position: "relative", position: "relative",
top: "0", top: "0",
@ -19776,6 +19800,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.card", BI.CardLayout); BI.shortcut("bi.card", BI.CardLayout);
/***/ }), /***/ }),
/* 354 */ /* 354 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -19961,7 +19986,7 @@ BI.DivisionLayout = BI.inherit(BI.Layout, {
throw new Error("item be required"); throw new Error("item be required");
} }
if (!this.hasWidget(this.getName() + i + "_" + j)) { if (!this.hasWidget(this.getName() + i + "_" + j)) {
var w = BI.createWidget(map[i][j]); var w = BI._lazyCreateWidget(map[i][j]);
this.addWidget(this.getName() + i + "_" + j, w); this.addWidget(this.getName() + i + "_" + j, w);
} else { } else {
w = this.getWidgetByName(this.getName() + i + "_" + j); w = this.getWidgetByName(this.getName() + i + "_" + j);
@ -20007,6 +20032,7 @@ BI.DivisionLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.division", BI.DivisionLayout); BI.shortcut("bi.division", BI.DivisionLayout);
/***/ }), /***/ }),
/* 356 */ /* 356 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -20262,16 +20288,16 @@ BI.GridLayout = BI.inherit(BI.Layout, {
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (BI.isArray(item)) { if (BI.isArray(item)) {
BI.each(item, function (j, el) { BI.each(item, function (j, el) {
els[i][j] = BI.createWidget(el); els[i][j] = BI._lazyCreateWidget(el);
}); });
return; return;
} }
els[item.row][item.column] = BI.createWidget(item); els[item.row][item.column] = BI._lazyCreateWidget(item);
}); });
for (var i = 0; i < rows; i++) { for (var i = 0; i < rows; i++) {
for (var j = 0; j < columns; j++) { for (var j = 0; j < columns; j++) {
if (!els[i][j]) { if (!els[i][j]) {
els[i][j] = BI.createWidget({ els[i][j] = BI._lazyCreateWidget({
type: "bi.layout" type: "bi.layout"
}); });
} }
@ -20298,6 +20324,7 @@ BI.GridLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.grid", BI.GridLayout); BI.shortcut("bi.grid", BI.GridLayout);
/***/ }), /***/ }),
/* 358 */ /* 358 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -20345,9 +20372,9 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
var td; var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({position: "relative", margin: "0px auto"}); w.element.css({position: "relative", margin: "0px auto"});
td = BI.createWidget({ td = BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
tagName: "td", tagName: "td",
attributes: { attributes: {
@ -20728,7 +20755,7 @@ BI.TableLayout = BI.inherit(BI.Layout, {
right: right <= 1 ? right * 100 + "%" : right right: right <= 1 ? right * 100 + "%" : right
}, arr[i])); }, arr[i]));
} }
var w = BI.createWidget({ var w = BI._lazyCreateWidget({
type: "bi.absolute", type: "bi.absolute",
height: BI.isArray(o.rowSize) ? o.rowSize[this.rows] : o.rowSize, height: BI.isArray(o.rowSize) ? o.rowSize[this.rows] : o.rowSize,
items: abs items: abs
@ -20766,6 +20793,7 @@ BI.TableLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.table", BI.TableLayout); BI.shortcut("bi.table", BI.TableLayout);
/***/ }), /***/ }),
/* 362 */ /* 362 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -20819,7 +20847,7 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
items = BI.compact(items); items = BI.compact(items);
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (!self.hasWidget(self.getName() + i + "")) { if (!self.hasWidget(self.getName() + i + "")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
self.addWidget(self.getName() + i + "", w); self.addWidget(self.getName() + i + "", w);
} else { } else {
w = self.getWidgetByName(self.getName() + i + ""); w = self.getWidgetByName(self.getName() + i + "");
@ -20932,7 +20960,7 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
items = BI.compact(items); items = BI.compact(items);
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (!self.hasWidget(self.getName() + i + "")) { if (!self.hasWidget(self.getName() + i + "")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
self.addWidget(self.getName() + i + "", w); self.addWidget(self.getName() + i + "", w);
} else { } else {
w = self.getWidgetByName(self.getName() + i + ""); w = self.getWidgetByName(self.getName() + i + "");
@ -20990,6 +21018,7 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.vtape", BI.VTapeLayout); BI.shortcut("bi.vtape", BI.VTapeLayout);
/***/ }), /***/ }),
/* 363 */ /* 363 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -21073,13 +21102,13 @@ BI.TdLayout = BI.inherit(BI.Layout, {
} }
} }
var tr = BI.createWidget({ var tr = BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
tagName: "tr" tagName: "tr"
}); });
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
var w = BI.createWidget(arr[i]); var w = BI._lazyCreateWidget(arr[i]);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
if (arr[i].lgap) { if (arr[i].lgap) {
w.element.css({"margin-left": arr[i].lgap + "px"}); w.element.css({"margin-left": arr[i].lgap + "px"});
@ -21094,7 +21123,7 @@ BI.TdLayout = BI.inherit(BI.Layout, {
w.element.css({"margin-bottom": arr[i].bgap + "px"}); w.element.css({"margin-bottom": arr[i].bgap + "px"});
} }
first(w, this.rows++, i); first(w, this.rows++, i);
var td = BI.createWidget({ var td = BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
attributes: { attributes: {
width: o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i] width: o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]
@ -21141,6 +21170,7 @@ BI.TdLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.td", BI.TdLayout); BI.shortcut("bi.td", BI.TdLayout);
/***/ }), /***/ }),
/* 364 */ /* 364 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -21309,7 +21339,7 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
throw new Error("item be required"); throw new Error("item be required");
} }
if (!this.hasWidget(this.getName() + i + "_" + j)) { if (!this.hasWidget(this.getName() + i + "_" + j)) {
var w = BI.createWidget(o.items[i][j]); var w = BI._lazyCreateWidget(o.items[i][j]);
w.element.css({position: "absolute"}); w.element.css({position: "absolute"});
this.addWidget(this.getName() + i + "_" + j, w); this.addWidget(this.getName() + i + "_" + j, w);
} }
@ -21404,6 +21434,7 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.window", BI.WindowLayout); BI.shortcut("bi.window", BI.WindowLayout);
/***/ }), /***/ }),
/* 366 */ /* 366 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -21434,7 +21465,7 @@ BI.CenterLayout = BI.inherit(BI.Layout, {
list.push({ list.push({
column: i, column: i,
row: 0, row: 0,
el: BI.createWidget({ el: BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "") cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")
}) })
@ -21442,7 +21473,7 @@ BI.CenterLayout = BI.inherit(BI.Layout, {
}); });
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
left: o.hgap + o.lgap, left: o.hgap + o.lgap,
@ -21485,6 +21516,7 @@ BI.CenterLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.center", BI.CenterLayout); BI.shortcut("bi.center", BI.CenterLayout);
/***/ }), /***/ }),
/* 367 */ /* 367 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -21511,7 +21543,7 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, {
var self = this, o = this.options, items = o.items; var self = this, o = this.options, items = o.items;
var list = [], width = 100 / items.length; var list = [], width = 100 / items.length;
BI.each(items, function (i) { BI.each(items, function (i) {
var widget = BI.createWidget({ var widget = BI._lazyCreateWidget({
type: "bi.default" type: "bi.default"
}); });
widget.element.addClass("center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")).css({ widget.element.addClass("center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")).css({
@ -21524,7 +21556,7 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
left: o.hgap + o.lgap, left: o.hgap + o.lgap,
@ -21565,6 +21597,7 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.float_center", BI.FloatCenterLayout); BI.shortcut("bi.float_center", BI.FloatCenterLayout);
/***/ }), /***/ }),
/* 368 */ /* 368 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -21594,7 +21627,7 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, {
list.push({ list.push({
column: i, column: i,
row: 0, row: 0,
el: BI.createWidget({ el: BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "") cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")
}) })
@ -21602,7 +21635,7 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
left: o.hgap + o.lgap, left: o.hgap + o.lgap,
@ -21644,6 +21677,7 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.horizontal_center", BI.HorizontalCenterLayout); BI.shortcut("bi.horizontal_center", BI.HorizontalCenterLayout);
/***/ }), /***/ }),
/* 369 */ /* 369 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -21674,7 +21708,7 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, {
list.push({ list.push({
column: 0, column: 0,
row: i, row: i,
el: BI.createWidget({ el: BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "") cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")
}) })
@ -21682,7 +21716,7 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
left: o.hgap + o.lgap, left: o.hgap + o.lgap,
@ -21724,6 +21758,7 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.vertical_center", BI.VerticalCenterLayout); BI.shortcut("bi.vertical_center", BI.VerticalCenterLayout);
/***/ }), /***/ }),
/* 370 */ /* 370 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -90885,18 +90920,9 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
function popTarget () { function popTarget () {
Fix.Model.target = target = targetStack.pop(); Fix.Model.target = target = targetStack.pop();
} if (targetStack.length <= 0) {
Fix.Model.target = target = null;
var context = null; }
var contextStack = [];
function pushContext (_context) {
if (context) contextStack.push(context);
Fix.Model.context = context = _context;
}
function popContext () {
Fix.Model.context = context = contextStack.pop();
} }
var oldWatch = Fix.watch; var oldWatch = Fix.watch;
@ -90924,7 +90950,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
if (target != null) { if (target != null) {
return target; return target;
} }
widget = widget || context; widget = widget || BI.Widget.context;
var p = widget; var p = widget;
while (p) { while (p) {
if (p instanceof Fix.Model || p.store || p.__cacheStore) { if (p instanceof Fix.Model || p.store || p.__cacheStore) {
@ -90941,25 +90967,25 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
} }
} }
var _create = BI.createWidget; // var _create = BI.createWidget;
BI.createWidget = function (item, options, context) { // BI.createWidget = function (item, options, context) {
var pushed = false; // var pushed = false;
if (BI.isWidget(options)) { // if (BI.isWidget(options)) {
pushContext(options); // pushContext(options);
pushed = true; // pushed = true;
} else if (context != null) { // } else if (context != null) {
pushContext(context); // pushContext(context);
pushed = true; // pushed = true;
} // }
var result = _create.apply(this, arguments); // var result = _create.apply(this, arguments);
// try { // // try {
// var result = _create.apply(this, arguments); // // var result = _create.apply(this, arguments);
// } catch (e) { // // } catch (e) {
// console.error(e); // // console.error(e);
// } // // }
pushed && popContext(); // pushed && popContext();
return result; // return result;
}; // };
BI.watch = function (watch, handler) { BI.watch = function (watch, handler) {
if (BI.Widget.current) { if (BI.Widget.current) {
@ -90984,13 +91010,13 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
_.each(["populate", "addItems", "prependItems"], function (name) { _.each(["populate", "addItems", "prependItems"], function (name) {
var old = BI.Loader.prototype[name]; var old = BI.Loader.prototype[name];
BI.Loader.prototype[name] = function () { BI.Loader.prototype[name] = function () {
pushContext(this); BI.Widget.pushContext(this);
try { try {
var result = old.apply(this, arguments); var result = old.apply(this, arguments);
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
popContext(); BI.Widget.popContext();
return result; return result;
}; };
}); });

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

210
dist/demo.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-10-10 17:40:22 */ /*! time: 2020-10-11 23:40:24 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
@ -13580,6 +13580,7 @@ module.exports = function (exec) {
if (!this._constructed) { if (!this._constructed) {
this._constructed = true; this._constructed = true;
this._init(); this._init();
this._initRef();
} }
}, },
@ -13726,7 +13727,7 @@ module.exports = function (exec) {
} }
if (BI.isArray(els)) { if (BI.isArray(els)) {
BI.each(els, function (i, el) { BI.each(els, function (i, el) {
BI.createWidget(el, { BI._lazyCreateWidget(el, {
element: self element: self
}); });
}); });
@ -13882,7 +13883,9 @@ module.exports = function (exec) {
throw new Error("name has already been existed"); throw new Error("name has already been existed");
} }
widget._setParent && widget._setParent(this); widget._setParent && widget._setParent(this);
BI.Widget.pushContext(widget);
widget._lazyConstructor(); widget._lazyConstructor();
BI.Widget.popContext();
widget.on(BI.Events.DESTROY, function () { widget.on(BI.Events.DESTROY, function () {
BI.remove(self._children, this); BI.remove(self._children, this);
}); });
@ -14050,36 +14053,51 @@ module.exports = function (exec) {
this.purgeListeners(); this.purgeListeners();
} }
}); });
var context = null; var context = null, current = null;
var contextStack = []; var contextStack = [], currentStack = [];
function pushTarget (_context) { BI.Widget.pushContext = function (_context) {
if (context) contextStack.push(context); if (context) contextStack.push(context);
BI.Widget.current = context = _context; BI.Widget.context = context = _context;
};
BI.Widget.popContext = function () {
BI.Widget.context = context = contextStack.pop();
if (contextStack.length <= 0) {
BI.Widget.context = context = null;
}
};
function pushTarget (_current) {
if (current) currentStack.push(current);
BI.Widget.current = current = _current;
} }
function popTarget () { function popTarget () {
BI.Widget.current = context = contextStack.pop(); BI.Widget.current = current = currentStack.pop();
if (currentStack.length <= 0) {
BI.Widget.current = current = null;
}
} }
BI.onBeforeMount = function (beforeMount) { BI.onBeforeMount = function (beforeMount) {
if (context) { if (current) {
context.beforeMount = beforeMount; current.beforeMount = beforeMount;
} }
}; };
BI.onMounted = function (mounted) { BI.onMounted = function (mounted) {
if (context) { if (current) {
context.mounted = mounted; current.mounted = mounted;
} }
}; };
BI.onBeforeUnmount = function (beforeDestroy) { BI.onBeforeUnmount = function (beforeDestroy) {
if (context) { if (current) {
context.beforeDestroy = beforeDestroy; current.beforeDestroy = beforeDestroy;
} }
}; };
BI.onUnmounted = function (destroyed) { BI.onUnmounted = function (destroyed) {
if (context) { if (current) {
context.destroyed = destroyed; current.destroyed = destroyed;
} }
}; };
@ -14157,7 +14175,7 @@ module.exports = function (exec) {
}; };
// 根据配置属性生成widget // 根据配置属性生成widget
var createWidget = function (config) { var createWidget = function (config, lazy) {
var cls = kv[config.type]; var cls = kv[config.type];
if (!cls) { if (!cls) {
@ -14165,17 +14183,17 @@ module.exports = function (exec) {
} }
var widget = new cls(); var widget = new cls();
BI.Widget.pushContext(widget);
widget._initProps(config); widget._initProps(config);
widget._initRoot(); widget._initRoot();
widget._initRef(); if (!lazy || config.element || config.root) {
// if (config.element || config.root) { widget._lazyConstructor();
widget._lazyConstructor(); }
// } BI.Widget.popContext();
return widget; return widget;
}; };
BI.createWidget = BI.createWidget || function (item, options, context) { BI.createWidget = BI.createWidget || function (item, options, context, lazy) {
// 先把准备环境准备好 // 先把准备环境准备好
BI.init(); BI.init();
var el, w; var el, w;
@ -14203,7 +14221,7 @@ module.exports = function (exec) {
BI.Plugin.getObject(el.type, this); BI.Plugin.getObject(el.type, this);
} }
}]); }]);
return w.type === el.type ? createWidget(w) : BI.createWidget(BI.extend({}, item, {type: w.type}, options)); return w.type === el.type ? createWidget(w, lazy) : BI.createWidget(BI.extend({}, item, {type: w.type}), options, context, lazy);
} }
if (item.el && (item.el.type || options.type)) { if (item.el && (item.el.type || options.type)) {
el = BI.extend({}, options, item.el); el = BI.extend({}, options, item.el);
@ -14214,7 +14232,7 @@ module.exports = function (exec) {
BI.Plugin.getObject(el.type, this); BI.Plugin.getObject(el.type, this);
} }
}]); }]);
return w.type === el.type ? createWidget(w) : BI.createWidget(BI.extend({}, item, {type: w.type}, options)); return w.type === el.type ? createWidget(w, lazy) : BI.createWidget(BI.extend({}, item, {type: w.type}), options, context, lazy);
} }
if (BI.isWidget(item.el)) { if (BI.isWidget(item.el)) {
return item.el; return item.el;
@ -14222,6 +14240,10 @@ module.exports = function (exec) {
throw new Error("无法根据item创建组件"); throw new Error("无法根据item创建组件");
}; };
BI._lazyCreateWidget = BI._lazyCreateWidget || function (item, options, context) {
return BI.createWidget(item, options, context, true);
};
BI.createElement = BI.createElement || function () { BI.createElement = BI.createElement || function () {
var widget = BI.createWidget.apply(this, arguments); var widget = BI.createWidget.apply(this, arguments);
return widget.element; return widget.element;
@ -14633,7 +14655,7 @@ BI.Layout = BI.inherit(BI.Widget, {
_addElement: function (i, item, context) { _addElement: function (i, item, context) {
var self = this, w; var self = this, w;
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
w = BI.createWidget(item, context); w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () { w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) { BI.each(self._children, function (name, child) {
if (child === w) { if (child === w) {
@ -17943,9 +17965,9 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
var td; var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({ td = BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
width: width, width: width,
items: [w] items: [w]
@ -18176,7 +18198,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
delete self._children[i]; delete self._children[i];
} }
}); });
BI.createWidget({ BI._lazyCreateWidget({
type: "bi.horizontal_auto", type: "bi.horizontal_auto",
element: this, element: this,
items: [this.left] items: [this.left]
@ -18185,7 +18207,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
_addElement: function (i, item) { _addElement: function (i, item) {
var self = this, o = this.options; var self = this, o = this.options;
this.left = BI.createWidget({ this.left = BI._lazyCreateWidget({
type: "bi.vertical", type: "bi.vertical",
items: [item], items: [item],
hgap: o.hgap, hgap: o.hgap,
@ -18196,7 +18218,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
rgap: o.rgap rgap: o.rgap
}); });
this.container = BI.createWidget({ this.container = BI._lazyCreateWidget({
type: "bi.left", type: "bi.left",
element: this, element: this,
items: [this.left] items: [this.left]
@ -18212,6 +18234,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.horizontal_float", BI.FloatHorizontalLayout); BI.shortcut("bi.horizontal_float", BI.FloatHorizontalLayout);
/***/ }), /***/ }),
/* 337 */ /* 337 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -19464,7 +19487,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
if (item != null) { if (item != null) {
if (item.el) { if (item.el) {
if (!this.hasWidget(this.getName() + "north")) { if (!this.hasWidget(this.getName() + "north")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "north", w); this.addWidget(this.getName() + "north", w);
} }
this.getWidgetByName(this.getName() + "north").element.height(item.height) this.getWidgetByName(this.getName() + "north").element.height(item.height)
@ -19484,7 +19507,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
if (item != null) { if (item != null) {
if (item.el) { if (item.el) {
if (!this.hasWidget(this.getName() + "south")) { if (!this.hasWidget(this.getName() + "south")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "south", w); this.addWidget(this.getName() + "south", w);
} }
this.getWidgetByName(this.getName() + "south").element.height(item.height) this.getWidgetByName(this.getName() + "south").element.height(item.height)
@ -19504,7 +19527,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
if (item != null) { if (item != null) {
if (item.el) { if (item.el) {
if (!this.hasWidget(this.getName() + "west")) { if (!this.hasWidget(this.getName() + "west")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "west", w); this.addWidget(this.getName() + "west", w);
} }
this.getWidgetByName(this.getName() + "west").element.width(item.width) this.getWidgetByName(this.getName() + "west").element.width(item.width)
@ -19524,7 +19547,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
if (item != null) { if (item != null) {
if (item.el) { if (item.el) {
if (!this.hasWidget(this.getName() + "east")) { if (!this.hasWidget(this.getName() + "east")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "east", w); this.addWidget(this.getName() + "east", w);
} }
this.getWidgetByName(this.getName() + "east").element.width(item.width) this.getWidgetByName(this.getName() + "east").element.width(item.width)
@ -19543,7 +19566,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
item = regions["center"]; item = regions["center"];
if (item != null) { if (item != null) {
if (!this.hasWidget(this.getName() + "center")) { if (!this.hasWidget(this.getName() + "center")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "center", w); this.addWidget(this.getName() + "center", w);
} }
this.getWidgetByName(this.getName() + "center").element this.getWidgetByName(this.getName() + "center").element
@ -19562,6 +19585,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.border", BI.BorderLayout); BI.shortcut("bi.border", BI.BorderLayout);
/***/ }), /***/ }),
/* 353 */ /* 353 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -19596,7 +19620,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
if (!self.hasWidget(item.cardName)) { if (!self.hasWidget(item.cardName)) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.on(BI.Events.DESTROY, function () { w.on(BI.Events.DESTROY, function () {
var index = BI.findIndex(o.items, function (i, tItem) { var index = BI.findIndex(o.items, function (i, tItem) {
return tItem.cardName == item.cardName; return tItem.cardName == item.cardName;
@ -19666,7 +19690,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
if (this.isCardExisted(cardName)) { if (this.isCardExisted(cardName)) {
throw new Error("cardName is already exist"); throw new Error("cardName is already exist");
} }
var widget = BI.createWidget(cardItem, this); var widget = BI._lazyCreateWidget(cardItem, this);
widget.element.css({ widget.element.css({
position: "relative", position: "relative",
top: "0", top: "0",
@ -19776,6 +19800,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.card", BI.CardLayout); BI.shortcut("bi.card", BI.CardLayout);
/***/ }), /***/ }),
/* 354 */ /* 354 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -19961,7 +19986,7 @@ BI.DivisionLayout = BI.inherit(BI.Layout, {
throw new Error("item be required"); throw new Error("item be required");
} }
if (!this.hasWidget(this.getName() + i + "_" + j)) { if (!this.hasWidget(this.getName() + i + "_" + j)) {
var w = BI.createWidget(map[i][j]); var w = BI._lazyCreateWidget(map[i][j]);
this.addWidget(this.getName() + i + "_" + j, w); this.addWidget(this.getName() + i + "_" + j, w);
} else { } else {
w = this.getWidgetByName(this.getName() + i + "_" + j); w = this.getWidgetByName(this.getName() + i + "_" + j);
@ -20007,6 +20032,7 @@ BI.DivisionLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.division", BI.DivisionLayout); BI.shortcut("bi.division", BI.DivisionLayout);
/***/ }), /***/ }),
/* 356 */ /* 356 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -20262,16 +20288,16 @@ BI.GridLayout = BI.inherit(BI.Layout, {
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (BI.isArray(item)) { if (BI.isArray(item)) {
BI.each(item, function (j, el) { BI.each(item, function (j, el) {
els[i][j] = BI.createWidget(el); els[i][j] = BI._lazyCreateWidget(el);
}); });
return; return;
} }
els[item.row][item.column] = BI.createWidget(item); els[item.row][item.column] = BI._lazyCreateWidget(item);
}); });
for (var i = 0; i < rows; i++) { for (var i = 0; i < rows; i++) {
for (var j = 0; j < columns; j++) { for (var j = 0; j < columns; j++) {
if (!els[i][j]) { if (!els[i][j]) {
els[i][j] = BI.createWidget({ els[i][j] = BI._lazyCreateWidget({
type: "bi.layout" type: "bi.layout"
}); });
} }
@ -20298,6 +20324,7 @@ BI.GridLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.grid", BI.GridLayout); BI.shortcut("bi.grid", BI.GridLayout);
/***/ }), /***/ }),
/* 358 */ /* 358 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -20345,9 +20372,9 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
var td; var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({position: "relative", margin: "0px auto"}); w.element.css({position: "relative", margin: "0px auto"});
td = BI.createWidget({ td = BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
tagName: "td", tagName: "td",
attributes: { attributes: {
@ -20728,7 +20755,7 @@ BI.TableLayout = BI.inherit(BI.Layout, {
right: right <= 1 ? right * 100 + "%" : right right: right <= 1 ? right * 100 + "%" : right
}, arr[i])); }, arr[i]));
} }
var w = BI.createWidget({ var w = BI._lazyCreateWidget({
type: "bi.absolute", type: "bi.absolute",
height: BI.isArray(o.rowSize) ? o.rowSize[this.rows] : o.rowSize, height: BI.isArray(o.rowSize) ? o.rowSize[this.rows] : o.rowSize,
items: abs items: abs
@ -20766,6 +20793,7 @@ BI.TableLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.table", BI.TableLayout); BI.shortcut("bi.table", BI.TableLayout);
/***/ }), /***/ }),
/* 362 */ /* 362 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -20819,7 +20847,7 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
items = BI.compact(items); items = BI.compact(items);
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (!self.hasWidget(self.getName() + i + "")) { if (!self.hasWidget(self.getName() + i + "")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
self.addWidget(self.getName() + i + "", w); self.addWidget(self.getName() + i + "", w);
} else { } else {
w = self.getWidgetByName(self.getName() + i + ""); w = self.getWidgetByName(self.getName() + i + "");
@ -20932,7 +20960,7 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
items = BI.compact(items); items = BI.compact(items);
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (!self.hasWidget(self.getName() + i + "")) { if (!self.hasWidget(self.getName() + i + "")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
self.addWidget(self.getName() + i + "", w); self.addWidget(self.getName() + i + "", w);
} else { } else {
w = self.getWidgetByName(self.getName() + i + ""); w = self.getWidgetByName(self.getName() + i + "");
@ -20990,6 +21018,7 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.vtape", BI.VTapeLayout); BI.shortcut("bi.vtape", BI.VTapeLayout);
/***/ }), /***/ }),
/* 363 */ /* 363 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -21073,13 +21102,13 @@ BI.TdLayout = BI.inherit(BI.Layout, {
} }
} }
var tr = BI.createWidget({ var tr = BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
tagName: "tr" tagName: "tr"
}); });
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
var w = BI.createWidget(arr[i]); var w = BI._lazyCreateWidget(arr[i]);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
if (arr[i].lgap) { if (arr[i].lgap) {
w.element.css({"margin-left": arr[i].lgap + "px"}); w.element.css({"margin-left": arr[i].lgap + "px"});
@ -21094,7 +21123,7 @@ BI.TdLayout = BI.inherit(BI.Layout, {
w.element.css({"margin-bottom": arr[i].bgap + "px"}); w.element.css({"margin-bottom": arr[i].bgap + "px"});
} }
first(w, this.rows++, i); first(w, this.rows++, i);
var td = BI.createWidget({ var td = BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
attributes: { attributes: {
width: o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i] width: o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]
@ -21141,6 +21170,7 @@ BI.TdLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.td", BI.TdLayout); BI.shortcut("bi.td", BI.TdLayout);
/***/ }), /***/ }),
/* 364 */ /* 364 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -21309,7 +21339,7 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
throw new Error("item be required"); throw new Error("item be required");
} }
if (!this.hasWidget(this.getName() + i + "_" + j)) { if (!this.hasWidget(this.getName() + i + "_" + j)) {
var w = BI.createWidget(o.items[i][j]); var w = BI._lazyCreateWidget(o.items[i][j]);
w.element.css({position: "absolute"}); w.element.css({position: "absolute"});
this.addWidget(this.getName() + i + "_" + j, w); this.addWidget(this.getName() + i + "_" + j, w);
} }
@ -21404,6 +21434,7 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.window", BI.WindowLayout); BI.shortcut("bi.window", BI.WindowLayout);
/***/ }), /***/ }),
/* 366 */ /* 366 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -21434,7 +21465,7 @@ BI.CenterLayout = BI.inherit(BI.Layout, {
list.push({ list.push({
column: i, column: i,
row: 0, row: 0,
el: BI.createWidget({ el: BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "") cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")
}) })
@ -21442,7 +21473,7 @@ BI.CenterLayout = BI.inherit(BI.Layout, {
}); });
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
left: o.hgap + o.lgap, left: o.hgap + o.lgap,
@ -21485,6 +21516,7 @@ BI.CenterLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.center", BI.CenterLayout); BI.shortcut("bi.center", BI.CenterLayout);
/***/ }), /***/ }),
/* 367 */ /* 367 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -21511,7 +21543,7 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, {
var self = this, o = this.options, items = o.items; var self = this, o = this.options, items = o.items;
var list = [], width = 100 / items.length; var list = [], width = 100 / items.length;
BI.each(items, function (i) { BI.each(items, function (i) {
var widget = BI.createWidget({ var widget = BI._lazyCreateWidget({
type: "bi.default" type: "bi.default"
}); });
widget.element.addClass("center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")).css({ widget.element.addClass("center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")).css({
@ -21524,7 +21556,7 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
left: o.hgap + o.lgap, left: o.hgap + o.lgap,
@ -21565,6 +21597,7 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.float_center", BI.FloatCenterLayout); BI.shortcut("bi.float_center", BI.FloatCenterLayout);
/***/ }), /***/ }),
/* 368 */ /* 368 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -21594,7 +21627,7 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, {
list.push({ list.push({
column: i, column: i,
row: 0, row: 0,
el: BI.createWidget({ el: BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "") cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")
}) })
@ -21602,7 +21635,7 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
left: o.hgap + o.lgap, left: o.hgap + o.lgap,
@ -21644,6 +21677,7 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.horizontal_center", BI.HorizontalCenterLayout); BI.shortcut("bi.horizontal_center", BI.HorizontalCenterLayout);
/***/ }), /***/ }),
/* 369 */ /* 369 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -21674,7 +21708,7 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, {
list.push({ list.push({
column: 0, column: 0,
row: i, row: i,
el: BI.createWidget({ el: BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "") cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")
}) })
@ -21682,7 +21716,7 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
left: o.hgap + o.lgap, left: o.hgap + o.lgap,
@ -21724,6 +21758,7 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.vertical_center", BI.VerticalCenterLayout); BI.shortcut("bi.vertical_center", BI.VerticalCenterLayout);
/***/ }), /***/ }),
/* 370 */ /* 370 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -90885,18 +90920,9 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
function popTarget () { function popTarget () {
Fix.Model.target = target = targetStack.pop(); Fix.Model.target = target = targetStack.pop();
} if (targetStack.length <= 0) {
Fix.Model.target = target = null;
var context = null; }
var contextStack = [];
function pushContext (_context) {
if (context) contextStack.push(context);
Fix.Model.context = context = _context;
}
function popContext () {
Fix.Model.context = context = contextStack.pop();
} }
var oldWatch = Fix.watch; var oldWatch = Fix.watch;
@ -90924,7 +90950,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
if (target != null) { if (target != null) {
return target; return target;
} }
widget = widget || context; widget = widget || BI.Widget.context;
var p = widget; var p = widget;
while (p) { while (p) {
if (p instanceof Fix.Model || p.store || p.__cacheStore) { if (p instanceof Fix.Model || p.store || p.__cacheStore) {
@ -90941,25 +90967,25 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
} }
} }
var _create = BI.createWidget; // var _create = BI.createWidget;
BI.createWidget = function (item, options, context) { // BI.createWidget = function (item, options, context) {
var pushed = false; // var pushed = false;
if (BI.isWidget(options)) { // if (BI.isWidget(options)) {
pushContext(options); // pushContext(options);
pushed = true; // pushed = true;
} else if (context != null) { // } else if (context != null) {
pushContext(context); // pushContext(context);
pushed = true; // pushed = true;
} // }
var result = _create.apply(this, arguments); // var result = _create.apply(this, arguments);
// try { // // try {
// var result = _create.apply(this, arguments); // // var result = _create.apply(this, arguments);
// } catch (e) { // // } catch (e) {
// console.error(e); // // console.error(e);
// } // // }
pushed && popContext(); // pushed && popContext();
return result; // return result;
}; // };
BI.watch = function (watch, handler) { BI.watch = function (watch, handler) {
if (BI.Widget.current) { if (BI.Widget.current) {
@ -90984,13 +91010,13 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
_.each(["populate", "addItems", "prependItems"], function (name) { _.each(["populate", "addItems", "prependItems"], function (name) {
var old = BI.Loader.prototype[name]; var old = BI.Loader.prototype[name];
BI.Loader.prototype[name] = function () { BI.Loader.prototype[name] = function () {
pushContext(this); BI.Widget.pushContext(this);
try { try {
var result = old.apply(this, arguments); var result = old.apply(this, arguments);
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
popContext(); BI.Widget.popContext();
return result; return result;
}; };
}); });

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

210
dist/fineui.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-10-10 17:40:22 */ /*! time: 2020-10-11 23:40:24 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
@ -13580,6 +13580,7 @@ module.exports = function (exec) {
if (!this._constructed) { if (!this._constructed) {
this._constructed = true; this._constructed = true;
this._init(); this._init();
this._initRef();
} }
}, },
@ -13726,7 +13727,7 @@ module.exports = function (exec) {
} }
if (BI.isArray(els)) { if (BI.isArray(els)) {
BI.each(els, function (i, el) { BI.each(els, function (i, el) {
BI.createWidget(el, { BI._lazyCreateWidget(el, {
element: self element: self
}); });
}); });
@ -13882,7 +13883,9 @@ module.exports = function (exec) {
throw new Error("name has already been existed"); throw new Error("name has already been existed");
} }
widget._setParent && widget._setParent(this); widget._setParent && widget._setParent(this);
BI.Widget.pushContext(widget);
widget._lazyConstructor(); widget._lazyConstructor();
BI.Widget.popContext();
widget.on(BI.Events.DESTROY, function () { widget.on(BI.Events.DESTROY, function () {
BI.remove(self._children, this); BI.remove(self._children, this);
}); });
@ -14050,36 +14053,51 @@ module.exports = function (exec) {
this.purgeListeners(); this.purgeListeners();
} }
}); });
var context = null; var context = null, current = null;
var contextStack = []; var contextStack = [], currentStack = [];
function pushTarget (_context) { BI.Widget.pushContext = function (_context) {
if (context) contextStack.push(context); if (context) contextStack.push(context);
BI.Widget.current = context = _context; BI.Widget.context = context = _context;
};
BI.Widget.popContext = function () {
BI.Widget.context = context = contextStack.pop();
if (contextStack.length <= 0) {
BI.Widget.context = context = null;
}
};
function pushTarget (_current) {
if (current) currentStack.push(current);
BI.Widget.current = current = _current;
} }
function popTarget () { function popTarget () {
BI.Widget.current = context = contextStack.pop(); BI.Widget.current = current = currentStack.pop();
if (currentStack.length <= 0) {
BI.Widget.current = current = null;
}
} }
BI.onBeforeMount = function (beforeMount) { BI.onBeforeMount = function (beforeMount) {
if (context) { if (current) {
context.beforeMount = beforeMount; current.beforeMount = beforeMount;
} }
}; };
BI.onMounted = function (mounted) { BI.onMounted = function (mounted) {
if (context) { if (current) {
context.mounted = mounted; current.mounted = mounted;
} }
}; };
BI.onBeforeUnmount = function (beforeDestroy) { BI.onBeforeUnmount = function (beforeDestroy) {
if (context) { if (current) {
context.beforeDestroy = beforeDestroy; current.beforeDestroy = beforeDestroy;
} }
}; };
BI.onUnmounted = function (destroyed) { BI.onUnmounted = function (destroyed) {
if (context) { if (current) {
context.destroyed = destroyed; current.destroyed = destroyed;
} }
}; };
@ -14157,7 +14175,7 @@ module.exports = function (exec) {
}; };
// 根据配置属性生成widget // 根据配置属性生成widget
var createWidget = function (config) { var createWidget = function (config, lazy) {
var cls = kv[config.type]; var cls = kv[config.type];
if (!cls) { if (!cls) {
@ -14165,17 +14183,17 @@ module.exports = function (exec) {
} }
var widget = new cls(); var widget = new cls();
BI.Widget.pushContext(widget);
widget._initProps(config); widget._initProps(config);
widget._initRoot(); widget._initRoot();
widget._initRef(); if (!lazy || config.element || config.root) {
// if (config.element || config.root) { widget._lazyConstructor();
widget._lazyConstructor(); }
// } BI.Widget.popContext();
return widget; return widget;
}; };
BI.createWidget = BI.createWidget || function (item, options, context) { BI.createWidget = BI.createWidget || function (item, options, context, lazy) {
// 先把准备环境准备好 // 先把准备环境准备好
BI.init(); BI.init();
var el, w; var el, w;
@ -14203,7 +14221,7 @@ module.exports = function (exec) {
BI.Plugin.getObject(el.type, this); BI.Plugin.getObject(el.type, this);
} }
}]); }]);
return w.type === el.type ? createWidget(w) : BI.createWidget(BI.extend({}, item, {type: w.type}, options)); return w.type === el.type ? createWidget(w, lazy) : BI.createWidget(BI.extend({}, item, {type: w.type}), options, context, lazy);
} }
if (item.el && (item.el.type || options.type)) { if (item.el && (item.el.type || options.type)) {
el = BI.extend({}, options, item.el); el = BI.extend({}, options, item.el);
@ -14214,7 +14232,7 @@ module.exports = function (exec) {
BI.Plugin.getObject(el.type, this); BI.Plugin.getObject(el.type, this);
} }
}]); }]);
return w.type === el.type ? createWidget(w) : BI.createWidget(BI.extend({}, item, {type: w.type}, options)); return w.type === el.type ? createWidget(w, lazy) : BI.createWidget(BI.extend({}, item, {type: w.type}), options, context, lazy);
} }
if (BI.isWidget(item.el)) { if (BI.isWidget(item.el)) {
return item.el; return item.el;
@ -14222,6 +14240,10 @@ module.exports = function (exec) {
throw new Error("无法根据item创建组件"); throw new Error("无法根据item创建组件");
}; };
BI._lazyCreateWidget = BI._lazyCreateWidget || function (item, options, context) {
return BI.createWidget(item, options, context, true);
};
BI.createElement = BI.createElement || function () { BI.createElement = BI.createElement || function () {
var widget = BI.createWidget.apply(this, arguments); var widget = BI.createWidget.apply(this, arguments);
return widget.element; return widget.element;
@ -14633,7 +14655,7 @@ BI.Layout = BI.inherit(BI.Widget, {
_addElement: function (i, item, context) { _addElement: function (i, item, context) {
var self = this, w; var self = this, w;
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
w = BI.createWidget(item, context); w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () { w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) { BI.each(self._children, function (name, child) {
if (child === w) { if (child === w) {
@ -17943,9 +17965,9 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
var td; var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({ td = BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
width: width, width: width,
items: [w] items: [w]
@ -18176,7 +18198,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
delete self._children[i]; delete self._children[i];
} }
}); });
BI.createWidget({ BI._lazyCreateWidget({
type: "bi.horizontal_auto", type: "bi.horizontal_auto",
element: this, element: this,
items: [this.left] items: [this.left]
@ -18185,7 +18207,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
_addElement: function (i, item) { _addElement: function (i, item) {
var self = this, o = this.options; var self = this, o = this.options;
this.left = BI.createWidget({ this.left = BI._lazyCreateWidget({
type: "bi.vertical", type: "bi.vertical",
items: [item], items: [item],
hgap: o.hgap, hgap: o.hgap,
@ -18196,7 +18218,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
rgap: o.rgap rgap: o.rgap
}); });
this.container = BI.createWidget({ this.container = BI._lazyCreateWidget({
type: "bi.left", type: "bi.left",
element: this, element: this,
items: [this.left] items: [this.left]
@ -18212,6 +18234,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.horizontal_float", BI.FloatHorizontalLayout); BI.shortcut("bi.horizontal_float", BI.FloatHorizontalLayout);
/***/ }), /***/ }),
/* 337 */ /* 337 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -19464,7 +19487,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
if (item != null) { if (item != null) {
if (item.el) { if (item.el) {
if (!this.hasWidget(this.getName() + "north")) { if (!this.hasWidget(this.getName() + "north")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "north", w); this.addWidget(this.getName() + "north", w);
} }
this.getWidgetByName(this.getName() + "north").element.height(item.height) this.getWidgetByName(this.getName() + "north").element.height(item.height)
@ -19484,7 +19507,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
if (item != null) { if (item != null) {
if (item.el) { if (item.el) {
if (!this.hasWidget(this.getName() + "south")) { if (!this.hasWidget(this.getName() + "south")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "south", w); this.addWidget(this.getName() + "south", w);
} }
this.getWidgetByName(this.getName() + "south").element.height(item.height) this.getWidgetByName(this.getName() + "south").element.height(item.height)
@ -19504,7 +19527,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
if (item != null) { if (item != null) {
if (item.el) { if (item.el) {
if (!this.hasWidget(this.getName() + "west")) { if (!this.hasWidget(this.getName() + "west")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "west", w); this.addWidget(this.getName() + "west", w);
} }
this.getWidgetByName(this.getName() + "west").element.width(item.width) this.getWidgetByName(this.getName() + "west").element.width(item.width)
@ -19524,7 +19547,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
if (item != null) { if (item != null) {
if (item.el) { if (item.el) {
if (!this.hasWidget(this.getName() + "east")) { if (!this.hasWidget(this.getName() + "east")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "east", w); this.addWidget(this.getName() + "east", w);
} }
this.getWidgetByName(this.getName() + "east").element.width(item.width) this.getWidgetByName(this.getName() + "east").element.width(item.width)
@ -19543,7 +19566,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
item = regions["center"]; item = regions["center"];
if (item != null) { if (item != null) {
if (!this.hasWidget(this.getName() + "center")) { if (!this.hasWidget(this.getName() + "center")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "center", w); this.addWidget(this.getName() + "center", w);
} }
this.getWidgetByName(this.getName() + "center").element this.getWidgetByName(this.getName() + "center").element
@ -19562,6 +19585,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.border", BI.BorderLayout); BI.shortcut("bi.border", BI.BorderLayout);
/***/ }), /***/ }),
/* 353 */ /* 353 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -19596,7 +19620,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
if (!self.hasWidget(item.cardName)) { if (!self.hasWidget(item.cardName)) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.on(BI.Events.DESTROY, function () { w.on(BI.Events.DESTROY, function () {
var index = BI.findIndex(o.items, function (i, tItem) { var index = BI.findIndex(o.items, function (i, tItem) {
return tItem.cardName == item.cardName; return tItem.cardName == item.cardName;
@ -19666,7 +19690,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
if (this.isCardExisted(cardName)) { if (this.isCardExisted(cardName)) {
throw new Error("cardName is already exist"); throw new Error("cardName is already exist");
} }
var widget = BI.createWidget(cardItem, this); var widget = BI._lazyCreateWidget(cardItem, this);
widget.element.css({ widget.element.css({
position: "relative", position: "relative",
top: "0", top: "0",
@ -19776,6 +19800,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.card", BI.CardLayout); BI.shortcut("bi.card", BI.CardLayout);
/***/ }), /***/ }),
/* 354 */ /* 354 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -19961,7 +19986,7 @@ BI.DivisionLayout = BI.inherit(BI.Layout, {
throw new Error("item be required"); throw new Error("item be required");
} }
if (!this.hasWidget(this.getName() + i + "_" + j)) { if (!this.hasWidget(this.getName() + i + "_" + j)) {
var w = BI.createWidget(map[i][j]); var w = BI._lazyCreateWidget(map[i][j]);
this.addWidget(this.getName() + i + "_" + j, w); this.addWidget(this.getName() + i + "_" + j, w);
} else { } else {
w = this.getWidgetByName(this.getName() + i + "_" + j); w = this.getWidgetByName(this.getName() + i + "_" + j);
@ -20007,6 +20032,7 @@ BI.DivisionLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.division", BI.DivisionLayout); BI.shortcut("bi.division", BI.DivisionLayout);
/***/ }), /***/ }),
/* 356 */ /* 356 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -20262,16 +20288,16 @@ BI.GridLayout = BI.inherit(BI.Layout, {
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (BI.isArray(item)) { if (BI.isArray(item)) {
BI.each(item, function (j, el) { BI.each(item, function (j, el) {
els[i][j] = BI.createWidget(el); els[i][j] = BI._lazyCreateWidget(el);
}); });
return; return;
} }
els[item.row][item.column] = BI.createWidget(item); els[item.row][item.column] = BI._lazyCreateWidget(item);
}); });
for (var i = 0; i < rows; i++) { for (var i = 0; i < rows; i++) {
for (var j = 0; j < columns; j++) { for (var j = 0; j < columns; j++) {
if (!els[i][j]) { if (!els[i][j]) {
els[i][j] = BI.createWidget({ els[i][j] = BI._lazyCreateWidget({
type: "bi.layout" type: "bi.layout"
}); });
} }
@ -20298,6 +20324,7 @@ BI.GridLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.grid", BI.GridLayout); BI.shortcut("bi.grid", BI.GridLayout);
/***/ }), /***/ }),
/* 358 */ /* 358 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -20345,9 +20372,9 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
var td; var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({position: "relative", margin: "0px auto"}); w.element.css({position: "relative", margin: "0px auto"});
td = BI.createWidget({ td = BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
tagName: "td", tagName: "td",
attributes: { attributes: {
@ -20728,7 +20755,7 @@ BI.TableLayout = BI.inherit(BI.Layout, {
right: right <= 1 ? right * 100 + "%" : right right: right <= 1 ? right * 100 + "%" : right
}, arr[i])); }, arr[i]));
} }
var w = BI.createWidget({ var w = BI._lazyCreateWidget({
type: "bi.absolute", type: "bi.absolute",
height: BI.isArray(o.rowSize) ? o.rowSize[this.rows] : o.rowSize, height: BI.isArray(o.rowSize) ? o.rowSize[this.rows] : o.rowSize,
items: abs items: abs
@ -20766,6 +20793,7 @@ BI.TableLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.table", BI.TableLayout); BI.shortcut("bi.table", BI.TableLayout);
/***/ }), /***/ }),
/* 362 */ /* 362 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -20819,7 +20847,7 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
items = BI.compact(items); items = BI.compact(items);
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (!self.hasWidget(self.getName() + i + "")) { if (!self.hasWidget(self.getName() + i + "")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
self.addWidget(self.getName() + i + "", w); self.addWidget(self.getName() + i + "", w);
} else { } else {
w = self.getWidgetByName(self.getName() + i + ""); w = self.getWidgetByName(self.getName() + i + "");
@ -20932,7 +20960,7 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
items = BI.compact(items); items = BI.compact(items);
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (!self.hasWidget(self.getName() + i + "")) { if (!self.hasWidget(self.getName() + i + "")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
self.addWidget(self.getName() + i + "", w); self.addWidget(self.getName() + i + "", w);
} else { } else {
w = self.getWidgetByName(self.getName() + i + ""); w = self.getWidgetByName(self.getName() + i + "");
@ -20990,6 +21018,7 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.vtape", BI.VTapeLayout); BI.shortcut("bi.vtape", BI.VTapeLayout);
/***/ }), /***/ }),
/* 363 */ /* 363 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -21073,13 +21102,13 @@ BI.TdLayout = BI.inherit(BI.Layout, {
} }
} }
var tr = BI.createWidget({ var tr = BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
tagName: "tr" tagName: "tr"
}); });
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
var w = BI.createWidget(arr[i]); var w = BI._lazyCreateWidget(arr[i]);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
if (arr[i].lgap) { if (arr[i].lgap) {
w.element.css({"margin-left": arr[i].lgap + "px"}); w.element.css({"margin-left": arr[i].lgap + "px"});
@ -21094,7 +21123,7 @@ BI.TdLayout = BI.inherit(BI.Layout, {
w.element.css({"margin-bottom": arr[i].bgap + "px"}); w.element.css({"margin-bottom": arr[i].bgap + "px"});
} }
first(w, this.rows++, i); first(w, this.rows++, i);
var td = BI.createWidget({ var td = BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
attributes: { attributes: {
width: o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i] width: o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]
@ -21141,6 +21170,7 @@ BI.TdLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.td", BI.TdLayout); BI.shortcut("bi.td", BI.TdLayout);
/***/ }), /***/ }),
/* 364 */ /* 364 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -21309,7 +21339,7 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
throw new Error("item be required"); throw new Error("item be required");
} }
if (!this.hasWidget(this.getName() + i + "_" + j)) { if (!this.hasWidget(this.getName() + i + "_" + j)) {
var w = BI.createWidget(o.items[i][j]); var w = BI._lazyCreateWidget(o.items[i][j]);
w.element.css({position: "absolute"}); w.element.css({position: "absolute"});
this.addWidget(this.getName() + i + "_" + j, w); this.addWidget(this.getName() + i + "_" + j, w);
} }
@ -21404,6 +21434,7 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.window", BI.WindowLayout); BI.shortcut("bi.window", BI.WindowLayout);
/***/ }), /***/ }),
/* 366 */ /* 366 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -21434,7 +21465,7 @@ BI.CenterLayout = BI.inherit(BI.Layout, {
list.push({ list.push({
column: i, column: i,
row: 0, row: 0,
el: BI.createWidget({ el: BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "") cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")
}) })
@ -21442,7 +21473,7 @@ BI.CenterLayout = BI.inherit(BI.Layout, {
}); });
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
left: o.hgap + o.lgap, left: o.hgap + o.lgap,
@ -21485,6 +21516,7 @@ BI.CenterLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.center", BI.CenterLayout); BI.shortcut("bi.center", BI.CenterLayout);
/***/ }), /***/ }),
/* 367 */ /* 367 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -21511,7 +21543,7 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, {
var self = this, o = this.options, items = o.items; var self = this, o = this.options, items = o.items;
var list = [], width = 100 / items.length; var list = [], width = 100 / items.length;
BI.each(items, function (i) { BI.each(items, function (i) {
var widget = BI.createWidget({ var widget = BI._lazyCreateWidget({
type: "bi.default" type: "bi.default"
}); });
widget.element.addClass("center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")).css({ widget.element.addClass("center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")).css({
@ -21524,7 +21556,7 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
left: o.hgap + o.lgap, left: o.hgap + o.lgap,
@ -21565,6 +21597,7 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.float_center", BI.FloatCenterLayout); BI.shortcut("bi.float_center", BI.FloatCenterLayout);
/***/ }), /***/ }),
/* 368 */ /* 368 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -21594,7 +21627,7 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, {
list.push({ list.push({
column: i, column: i,
row: 0, row: 0,
el: BI.createWidget({ el: BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "") cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")
}) })
@ -21602,7 +21635,7 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
left: o.hgap + o.lgap, left: o.hgap + o.lgap,
@ -21644,6 +21677,7 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.horizontal_center", BI.HorizontalCenterLayout); BI.shortcut("bi.horizontal_center", BI.HorizontalCenterLayout);
/***/ }), /***/ }),
/* 369 */ /* 369 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -21674,7 +21708,7 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, {
list.push({ list.push({
column: 0, column: 0,
row: i, row: i,
el: BI.createWidget({ el: BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "") cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")
}) })
@ -21682,7 +21716,7 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
left: o.hgap + o.lgap, left: o.hgap + o.lgap,
@ -21724,6 +21758,7 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.vertical_center", BI.VerticalCenterLayout); BI.shortcut("bi.vertical_center", BI.VerticalCenterLayout);
/***/ }), /***/ }),
/* 370 */ /* 370 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -90855,18 +90890,9 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
function popTarget () { function popTarget () {
Fix.Model.target = target = targetStack.pop(); Fix.Model.target = target = targetStack.pop();
} if (targetStack.length <= 0) {
Fix.Model.target = target = null;
var context = null; }
var contextStack = [];
function pushContext (_context) {
if (context) contextStack.push(context);
Fix.Model.context = context = _context;
}
function popContext () {
Fix.Model.context = context = contextStack.pop();
} }
var oldWatch = Fix.watch; var oldWatch = Fix.watch;
@ -90894,7 +90920,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
if (target != null) { if (target != null) {
return target; return target;
} }
widget = widget || context; widget = widget || BI.Widget.context;
var p = widget; var p = widget;
while (p) { while (p) {
if (p instanceof Fix.Model || p.store || p.__cacheStore) { if (p instanceof Fix.Model || p.store || p.__cacheStore) {
@ -90911,25 +90937,25 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
} }
} }
var _create = BI.createWidget; // var _create = BI.createWidget;
BI.createWidget = function (item, options, context) { // BI.createWidget = function (item, options, context) {
var pushed = false; // var pushed = false;
if (BI.isWidget(options)) { // if (BI.isWidget(options)) {
pushContext(options); // pushContext(options);
pushed = true; // pushed = true;
} else if (context != null) { // } else if (context != null) {
pushContext(context); // pushContext(context);
pushed = true; // pushed = true;
} // }
var result = _create.apply(this, arguments); // var result = _create.apply(this, arguments);
// try { // // try {
// var result = _create.apply(this, arguments); // // var result = _create.apply(this, arguments);
// } catch (e) { // // } catch (e) {
// console.error(e); // // console.error(e);
// } // // }
pushed && popContext(); // pushed && popContext();
return result; // return result;
}; // };
BI.watch = function (watch, handler) { BI.watch = function (watch, handler) {
if (BI.Widget.current) { if (BI.Widget.current) {
@ -90954,13 +90980,13 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
_.each(["populate", "addItems", "prependItems"], function (name) { _.each(["populate", "addItems", "prependItems"], function (name) {
var old = BI.Loader.prototype[name]; var old = BI.Loader.prototype[name];
BI.Loader.prototype[name] = function () { BI.Loader.prototype[name] = function () {
pushContext(this); BI.Widget.pushContext(this);
try { try {
var result = old.apply(this, arguments); var result = old.apply(this, arguments);
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
popContext(); BI.Widget.popContext();
return result; return result;
}; };
}); });

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

210
dist/fineui_without_jquery_polyfill.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-10-10 17:40:22 */ /*! time: 2020-10-11 23:40:24 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
@ -9612,6 +9612,7 @@ BI.Req = {
if (!this._constructed) { if (!this._constructed) {
this._constructed = true; this._constructed = true;
this._init(); this._init();
this._initRef();
} }
}, },
@ -9758,7 +9759,7 @@ BI.Req = {
} }
if (BI.isArray(els)) { if (BI.isArray(els)) {
BI.each(els, function (i, el) { BI.each(els, function (i, el) {
BI.createWidget(el, { BI._lazyCreateWidget(el, {
element: self element: self
}); });
}); });
@ -9914,7 +9915,9 @@ BI.Req = {
throw new Error("name has already been existed"); throw new Error("name has already been existed");
} }
widget._setParent && widget._setParent(this); widget._setParent && widget._setParent(this);
BI.Widget.pushContext(widget);
widget._lazyConstructor(); widget._lazyConstructor();
BI.Widget.popContext();
widget.on(BI.Events.DESTROY, function () { widget.on(BI.Events.DESTROY, function () {
BI.remove(self._children, this); BI.remove(self._children, this);
}); });
@ -10082,36 +10085,51 @@ BI.Req = {
this.purgeListeners(); this.purgeListeners();
} }
}); });
var context = null; var context = null, current = null;
var contextStack = []; var contextStack = [], currentStack = [];
function pushTarget (_context) { BI.Widget.pushContext = function (_context) {
if (context) contextStack.push(context); if (context) contextStack.push(context);
BI.Widget.current = context = _context; BI.Widget.context = context = _context;
};
BI.Widget.popContext = function () {
BI.Widget.context = context = contextStack.pop();
if (contextStack.length <= 0) {
BI.Widget.context = context = null;
}
};
function pushTarget (_current) {
if (current) currentStack.push(current);
BI.Widget.current = current = _current;
} }
function popTarget () { function popTarget () {
BI.Widget.current = context = contextStack.pop(); BI.Widget.current = current = currentStack.pop();
if (currentStack.length <= 0) {
BI.Widget.current = current = null;
}
} }
BI.onBeforeMount = function (beforeMount) { BI.onBeforeMount = function (beforeMount) {
if (context) { if (current) {
context.beforeMount = beforeMount; current.beforeMount = beforeMount;
} }
}; };
BI.onMounted = function (mounted) { BI.onMounted = function (mounted) {
if (context) { if (current) {
context.mounted = mounted; current.mounted = mounted;
} }
}; };
BI.onBeforeUnmount = function (beforeDestroy) { BI.onBeforeUnmount = function (beforeDestroy) {
if (context) { if (current) {
context.beforeDestroy = beforeDestroy; current.beforeDestroy = beforeDestroy;
} }
}; };
BI.onUnmounted = function (destroyed) { BI.onUnmounted = function (destroyed) {
if (context) { if (current) {
context.destroyed = destroyed; current.destroyed = destroyed;
} }
}; };
@ -10189,7 +10207,7 @@ BI.Req = {
}; };
// 根据配置属性生成widget // 根据配置属性生成widget
var createWidget = function (config) { var createWidget = function (config, lazy) {
var cls = kv[config.type]; var cls = kv[config.type];
if (!cls) { if (!cls) {
@ -10197,17 +10215,17 @@ BI.Req = {
} }
var widget = new cls(); var widget = new cls();
BI.Widget.pushContext(widget);
widget._initProps(config); widget._initProps(config);
widget._initRoot(); widget._initRoot();
widget._initRef(); if (!lazy || config.element || config.root) {
// if (config.element || config.root) { widget._lazyConstructor();
widget._lazyConstructor(); }
// } BI.Widget.popContext();
return widget; return widget;
}; };
BI.createWidget = BI.createWidget || function (item, options, context) { BI.createWidget = BI.createWidget || function (item, options, context, lazy) {
// 先把准备环境准备好 // 先把准备环境准备好
BI.init(); BI.init();
var el, w; var el, w;
@ -10235,7 +10253,7 @@ BI.Req = {
BI.Plugin.getObject(el.type, this); BI.Plugin.getObject(el.type, this);
} }
}]); }]);
return w.type === el.type ? createWidget(w) : BI.createWidget(BI.extend({}, item, {type: w.type}, options)); return w.type === el.type ? createWidget(w, lazy) : BI.createWidget(BI.extend({}, item, {type: w.type}), options, context, lazy);
} }
if (item.el && (item.el.type || options.type)) { if (item.el && (item.el.type || options.type)) {
el = BI.extend({}, options, item.el); el = BI.extend({}, options, item.el);
@ -10246,7 +10264,7 @@ BI.Req = {
BI.Plugin.getObject(el.type, this); BI.Plugin.getObject(el.type, this);
} }
}]); }]);
return w.type === el.type ? createWidget(w) : BI.createWidget(BI.extend({}, item, {type: w.type}, options)); return w.type === el.type ? createWidget(w, lazy) : BI.createWidget(BI.extend({}, item, {type: w.type}), options, context, lazy);
} }
if (BI.isWidget(item.el)) { if (BI.isWidget(item.el)) {
return item.el; return item.el;
@ -10254,6 +10272,10 @@ BI.Req = {
throw new Error("无法根据item创建组件"); throw new Error("无法根据item创建组件");
}; };
BI._lazyCreateWidget = BI._lazyCreateWidget || function (item, options, context) {
return BI.createWidget(item, options, context, true);
};
BI.createElement = BI.createElement || function () { BI.createElement = BI.createElement || function () {
var widget = BI.createWidget.apply(this, arguments); var widget = BI.createWidget.apply(this, arguments);
return widget.element; return widget.element;
@ -10665,7 +10687,7 @@ BI.Layout = BI.inherit(BI.Widget, {
_addElement: function (i, item, context) { _addElement: function (i, item, context) {
var self = this, w; var self = this, w;
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
w = BI.createWidget(item, context); w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () { w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) { BI.each(self._children, function (name, child) {
if (child === w) { if (child === w) {
@ -13975,9 +13997,9 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
var td; var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({ td = BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
width: width, width: width,
items: [w] items: [w]
@ -14208,7 +14230,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
delete self._children[i]; delete self._children[i];
} }
}); });
BI.createWidget({ BI._lazyCreateWidget({
type: "bi.horizontal_auto", type: "bi.horizontal_auto",
element: this, element: this,
items: [this.left] items: [this.left]
@ -14217,7 +14239,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
_addElement: function (i, item) { _addElement: function (i, item) {
var self = this, o = this.options; var self = this, o = this.options;
this.left = BI.createWidget({ this.left = BI._lazyCreateWidget({
type: "bi.vertical", type: "bi.vertical",
items: [item], items: [item],
hgap: o.hgap, hgap: o.hgap,
@ -14228,7 +14250,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
rgap: o.rgap rgap: o.rgap
}); });
this.container = BI.createWidget({ this.container = BI._lazyCreateWidget({
type: "bi.left", type: "bi.left",
element: this, element: this,
items: [this.left] items: [this.left]
@ -14244,6 +14266,7 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.horizontal_float", BI.FloatHorizontalLayout); BI.shortcut("bi.horizontal_float", BI.FloatHorizontalLayout);
/***/ }), /***/ }),
/* 337 */ /* 337 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -15496,7 +15519,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
if (item != null) { if (item != null) {
if (item.el) { if (item.el) {
if (!this.hasWidget(this.getName() + "north")) { if (!this.hasWidget(this.getName() + "north")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "north", w); this.addWidget(this.getName() + "north", w);
} }
this.getWidgetByName(this.getName() + "north").element.height(item.height) this.getWidgetByName(this.getName() + "north").element.height(item.height)
@ -15516,7 +15539,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
if (item != null) { if (item != null) {
if (item.el) { if (item.el) {
if (!this.hasWidget(this.getName() + "south")) { if (!this.hasWidget(this.getName() + "south")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "south", w); this.addWidget(this.getName() + "south", w);
} }
this.getWidgetByName(this.getName() + "south").element.height(item.height) this.getWidgetByName(this.getName() + "south").element.height(item.height)
@ -15536,7 +15559,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
if (item != null) { if (item != null) {
if (item.el) { if (item.el) {
if (!this.hasWidget(this.getName() + "west")) { if (!this.hasWidget(this.getName() + "west")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "west", w); this.addWidget(this.getName() + "west", w);
} }
this.getWidgetByName(this.getName() + "west").element.width(item.width) this.getWidgetByName(this.getName() + "west").element.width(item.width)
@ -15556,7 +15579,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
if (item != null) { if (item != null) {
if (item.el) { if (item.el) {
if (!this.hasWidget(this.getName() + "east")) { if (!this.hasWidget(this.getName() + "east")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "east", w); this.addWidget(this.getName() + "east", w);
} }
this.getWidgetByName(this.getName() + "east").element.width(item.width) this.getWidgetByName(this.getName() + "east").element.width(item.width)
@ -15575,7 +15598,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
item = regions["center"]; item = regions["center"];
if (item != null) { if (item != null) {
if (!this.hasWidget(this.getName() + "center")) { if (!this.hasWidget(this.getName() + "center")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
this.addWidget(this.getName() + "center", w); this.addWidget(this.getName() + "center", w);
} }
this.getWidgetByName(this.getName() + "center").element this.getWidgetByName(this.getName() + "center").element
@ -15594,6 +15617,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.border", BI.BorderLayout); BI.shortcut("bi.border", BI.BorderLayout);
/***/ }), /***/ }),
/* 353 */ /* 353 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -15628,7 +15652,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
if (!self.hasWidget(item.cardName)) { if (!self.hasWidget(item.cardName)) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.on(BI.Events.DESTROY, function () { w.on(BI.Events.DESTROY, function () {
var index = BI.findIndex(o.items, function (i, tItem) { var index = BI.findIndex(o.items, function (i, tItem) {
return tItem.cardName == item.cardName; return tItem.cardName == item.cardName;
@ -15698,7 +15722,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
if (this.isCardExisted(cardName)) { if (this.isCardExisted(cardName)) {
throw new Error("cardName is already exist"); throw new Error("cardName is already exist");
} }
var widget = BI.createWidget(cardItem, this); var widget = BI._lazyCreateWidget(cardItem, this);
widget.element.css({ widget.element.css({
position: "relative", position: "relative",
top: "0", top: "0",
@ -15808,6 +15832,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.card", BI.CardLayout); BI.shortcut("bi.card", BI.CardLayout);
/***/ }), /***/ }),
/* 354 */ /* 354 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -15993,7 +16018,7 @@ BI.DivisionLayout = BI.inherit(BI.Layout, {
throw new Error("item be required"); throw new Error("item be required");
} }
if (!this.hasWidget(this.getName() + i + "_" + j)) { if (!this.hasWidget(this.getName() + i + "_" + j)) {
var w = BI.createWidget(map[i][j]); var w = BI._lazyCreateWidget(map[i][j]);
this.addWidget(this.getName() + i + "_" + j, w); this.addWidget(this.getName() + i + "_" + j, w);
} else { } else {
w = this.getWidgetByName(this.getName() + i + "_" + j); w = this.getWidgetByName(this.getName() + i + "_" + j);
@ -16039,6 +16064,7 @@ BI.DivisionLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.division", BI.DivisionLayout); BI.shortcut("bi.division", BI.DivisionLayout);
/***/ }), /***/ }),
/* 356 */ /* 356 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -16294,16 +16320,16 @@ BI.GridLayout = BI.inherit(BI.Layout, {
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (BI.isArray(item)) { if (BI.isArray(item)) {
BI.each(item, function (j, el) { BI.each(item, function (j, el) {
els[i][j] = BI.createWidget(el); els[i][j] = BI._lazyCreateWidget(el);
}); });
return; return;
} }
els[item.row][item.column] = BI.createWidget(item); els[item.row][item.column] = BI._lazyCreateWidget(item);
}); });
for (var i = 0; i < rows; i++) { for (var i = 0; i < rows; i++) {
for (var j = 0; j < columns; j++) { for (var j = 0; j < columns; j++) {
if (!els[i][j]) { if (!els[i][j]) {
els[i][j] = BI.createWidget({ els[i][j] = BI._lazyCreateWidget({
type: "bi.layout" type: "bi.layout"
}); });
} }
@ -16330,6 +16356,7 @@ BI.GridLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.grid", BI.GridLayout); BI.shortcut("bi.grid", BI.GridLayout);
/***/ }), /***/ }),
/* 358 */ /* 358 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -16377,9 +16404,9 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
var td; var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({position: "relative", margin: "0px auto"}); w.element.css({position: "relative", margin: "0px auto"});
td = BI.createWidget({ td = BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
tagName: "td", tagName: "td",
attributes: { attributes: {
@ -16760,7 +16787,7 @@ BI.TableLayout = BI.inherit(BI.Layout, {
right: right <= 1 ? right * 100 + "%" : right right: right <= 1 ? right * 100 + "%" : right
}, arr[i])); }, arr[i]));
} }
var w = BI.createWidget({ var w = BI._lazyCreateWidget({
type: "bi.absolute", type: "bi.absolute",
height: BI.isArray(o.rowSize) ? o.rowSize[this.rows] : o.rowSize, height: BI.isArray(o.rowSize) ? o.rowSize[this.rows] : o.rowSize,
items: abs items: abs
@ -16798,6 +16825,7 @@ BI.TableLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.table", BI.TableLayout); BI.shortcut("bi.table", BI.TableLayout);
/***/ }), /***/ }),
/* 362 */ /* 362 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -16851,7 +16879,7 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
items = BI.compact(items); items = BI.compact(items);
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (!self.hasWidget(self.getName() + i + "")) { if (!self.hasWidget(self.getName() + i + "")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
self.addWidget(self.getName() + i + "", w); self.addWidget(self.getName() + i + "", w);
} else { } else {
w = self.getWidgetByName(self.getName() + i + ""); w = self.getWidgetByName(self.getName() + i + "");
@ -16964,7 +16992,7 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
items = BI.compact(items); items = BI.compact(items);
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (!self.hasWidget(self.getName() + i + "")) { if (!self.hasWidget(self.getName() + i + "")) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
self.addWidget(self.getName() + i + "", w); self.addWidget(self.getName() + i + "", w);
} else { } else {
w = self.getWidgetByName(self.getName() + i + ""); w = self.getWidgetByName(self.getName() + i + "");
@ -17022,6 +17050,7 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.vtape", BI.VTapeLayout); BI.shortcut("bi.vtape", BI.VTapeLayout);
/***/ }), /***/ }),
/* 363 */ /* 363 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -17105,13 +17134,13 @@ BI.TdLayout = BI.inherit(BI.Layout, {
} }
} }
var tr = BI.createWidget({ var tr = BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
tagName: "tr" tagName: "tr"
}); });
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
var w = BI.createWidget(arr[i]); var w = BI._lazyCreateWidget(arr[i]);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
if (arr[i].lgap) { if (arr[i].lgap) {
w.element.css({"margin-left": arr[i].lgap + "px"}); w.element.css({"margin-left": arr[i].lgap + "px"});
@ -17126,7 +17155,7 @@ BI.TdLayout = BI.inherit(BI.Layout, {
w.element.css({"margin-bottom": arr[i].bgap + "px"}); w.element.css({"margin-bottom": arr[i].bgap + "px"});
} }
first(w, this.rows++, i); first(w, this.rows++, i);
var td = BI.createWidget({ var td = BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
attributes: { attributes: {
width: o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i] width: o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]
@ -17173,6 +17202,7 @@ BI.TdLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.td", BI.TdLayout); BI.shortcut("bi.td", BI.TdLayout);
/***/ }), /***/ }),
/* 364 */ /* 364 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -17341,7 +17371,7 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
throw new Error("item be required"); throw new Error("item be required");
} }
if (!this.hasWidget(this.getName() + i + "_" + j)) { if (!this.hasWidget(this.getName() + i + "_" + j)) {
var w = BI.createWidget(o.items[i][j]); var w = BI._lazyCreateWidget(o.items[i][j]);
w.element.css({position: "absolute"}); w.element.css({position: "absolute"});
this.addWidget(this.getName() + i + "_" + j, w); this.addWidget(this.getName() + i + "_" + j, w);
} }
@ -17436,6 +17466,7 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.window", BI.WindowLayout); BI.shortcut("bi.window", BI.WindowLayout);
/***/ }), /***/ }),
/* 366 */ /* 366 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -17466,7 +17497,7 @@ BI.CenterLayout = BI.inherit(BI.Layout, {
list.push({ list.push({
column: i, column: i,
row: 0, row: 0,
el: BI.createWidget({ el: BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "") cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")
}) })
@ -17474,7 +17505,7 @@ BI.CenterLayout = BI.inherit(BI.Layout, {
}); });
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
left: o.hgap + o.lgap, left: o.hgap + o.lgap,
@ -17517,6 +17548,7 @@ BI.CenterLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.center", BI.CenterLayout); BI.shortcut("bi.center", BI.CenterLayout);
/***/ }), /***/ }),
/* 367 */ /* 367 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -17543,7 +17575,7 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, {
var self = this, o = this.options, items = o.items; var self = this, o = this.options, items = o.items;
var list = [], width = 100 / items.length; var list = [], width = 100 / items.length;
BI.each(items, function (i) { BI.each(items, function (i) {
var widget = BI.createWidget({ var widget = BI._lazyCreateWidget({
type: "bi.default" type: "bi.default"
}); });
widget.element.addClass("center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")).css({ widget.element.addClass("center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")).css({
@ -17556,7 +17588,7 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
left: o.hgap + o.lgap, left: o.hgap + o.lgap,
@ -17597,6 +17629,7 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.float_center", BI.FloatCenterLayout); BI.shortcut("bi.float_center", BI.FloatCenterLayout);
/***/ }), /***/ }),
/* 368 */ /* 368 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -17626,7 +17659,7 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, {
list.push({ list.push({
column: i, column: i,
row: 0, row: 0,
el: BI.createWidget({ el: BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "") cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")
}) })
@ -17634,7 +17667,7 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
left: o.hgap + o.lgap, left: o.hgap + o.lgap,
@ -17676,6 +17709,7 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.horizontal_center", BI.HorizontalCenterLayout); BI.shortcut("bi.horizontal_center", BI.HorizontalCenterLayout);
/***/ }), /***/ }),
/* 369 */ /* 369 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -17706,7 +17740,7 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, {
list.push({ list.push({
column: 0, column: 0,
row: i, row: i,
el: BI.createWidget({ el: BI._lazyCreateWidget({
type: "bi.default", type: "bi.default",
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "") cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")
}) })
@ -17714,7 +17748,7 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
if (item) { if (item) {
var w = BI.createWidget(item); var w = BI._lazyCreateWidget(item);
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
left: o.hgap + o.lgap, left: o.hgap + o.lgap,
@ -17756,6 +17790,7 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, {
}); });
BI.shortcut("bi.vertical_center", BI.VerticalCenterLayout); BI.shortcut("bi.vertical_center", BI.VerticalCenterLayout);
/***/ }), /***/ }),
/* 370 */ /* 370 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -68053,18 +68088,9 @@ exports.Model = Model;
function popTarget () { function popTarget () {
Fix.Model.target = target = targetStack.pop(); Fix.Model.target = target = targetStack.pop();
} if (targetStack.length <= 0) {
Fix.Model.target = target = null;
var context = null; }
var contextStack = [];
function pushContext (_context) {
if (context) contextStack.push(context);
Fix.Model.context = context = _context;
}
function popContext () {
Fix.Model.context = context = contextStack.pop();
} }
var oldWatch = Fix.watch; var oldWatch = Fix.watch;
@ -68092,7 +68118,7 @@ exports.Model = Model;
if (target != null) { if (target != null) {
return target; return target;
} }
widget = widget || context; widget = widget || BI.Widget.context;
var p = widget; var p = widget;
while (p) { while (p) {
if (p instanceof Fix.Model || p.store || p.__cacheStore) { if (p instanceof Fix.Model || p.store || p.__cacheStore) {
@ -68109,25 +68135,25 @@ exports.Model = Model;
} }
} }
var _create = BI.createWidget; // var _create = BI.createWidget;
BI.createWidget = function (item, options, context) { // BI.createWidget = function (item, options, context) {
var pushed = false; // var pushed = false;
if (BI.isWidget(options)) { // if (BI.isWidget(options)) {
pushContext(options); // pushContext(options);
pushed = true; // pushed = true;
} else if (context != null) { // } else if (context != null) {
pushContext(context); // pushContext(context);
pushed = true; // pushed = true;
} // }
var result = _create.apply(this, arguments); // var result = _create.apply(this, arguments);
// try { // // try {
// var result = _create.apply(this, arguments); // // var result = _create.apply(this, arguments);
// } catch (e) { // // } catch (e) {
// console.error(e); // // console.error(e);
// } // // }
pushed && popContext(); // pushed && popContext();
return result; // return result;
}; // };
BI.watch = function (watch, handler) { BI.watch = function (watch, handler) {
if (BI.Widget.current) { if (BI.Widget.current) {
@ -68152,13 +68178,13 @@ exports.Model = Model;
_.each(["populate", "addItems", "prependItems"], function (name) { _.each(["populate", "addItems", "prependItems"], function (name) {
var old = BI.Loader.prototype[name]; var old = BI.Loader.prototype[name];
BI.Loader.prototype[name] = function () { BI.Loader.prototype[name] = function () {
pushContext(this); BI.Widget.pushContext(this);
try { try {
var result = old.apply(this, arguments); var result = old.apply(this, arguments);
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
popContext(); BI.Widget.popContext();
return result; return result;
}; };
}); });

2
dist/fineui_without_jquery_polyfill.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/font.css vendored

File diff suppressed because one or more lines are too long

2
dist/utils.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-10-10 17:40:22 */ /*! time: 2020-10-11 23:40:24 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

2
package.json

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

Loading…
Cancel
Save