Browse Source

Merge pull request #742 in VISUAL/fineui from ~GUY/fineui:master to master

* commit '25c08b12b40d490eeaa987da161d129e4869aced':
  update
  update
es6
guy 6 years ago
parent
commit
22bba5079f
  1. 119
      dist/bundle.ie.js
  2. 64
      dist/bundle.ie.min.js
  3. 119
      dist/bundle.js
  4. 64
      dist/bundle.min.js
  5. 119
      dist/core.js
  6. 25
      dist/demo.js
  7. 119
      dist/fineui.ie.js
  8. 64
      dist/fineui.ie.min.js
  9. 119
      dist/fineui.js
  10. 64
      dist/fineui.min.js
  11. 119
      dist/fineui_without_jquery_polyfill.js
  12. 18
      dist/utils.js
  13. 4
      dist/utils.min.js
  14. 18
      src/core/inject.js
  15. 2
      src/core/shortcut.js

119
dist/bundle.ie.js vendored

@ -12207,7 +12207,7 @@ if (!_global.BI) {
};
})();(function () {
var kv = {};
BI.shortcut = function (xtype, cls) {
BI.shortcut = BI.component = function (xtype, cls) {
if (kv[xtype] != null) {
_global.console && console.error("shortcut:[" + xtype + "] has been registed");
}
@ -18382,6 +18382,14 @@ _.extend(BI, {
return location;
}
});(function () {
var moduleInjection = {};
BI.module = function (xtype, cls) {
if (moduleInjection[xtype] != null) {
_global.console && console.error("module:[" + xtype + "] has been registed");
}
moduleInjection[xtype] = cls;
};
var constantInjection = {};
BI.constant = function (xtype, cls) {
if (constantInjection[xtype] != null) {
@ -18474,6 +18482,16 @@ _.extend(BI, {
points[type][action][after ? "after" : "before"].push(pointFn);
};
BI.Modules = {
getModule: function (type) {
if(!moduleInjection[type]){
_global.console && console.error("module:[" + type + "] does not exists");
return false;
}
return moduleInjection[type];
}
};
BI.Constants = {
getConstant: function (type) {
return constantInjection[type];
@ -31244,105 +31262,6 @@ BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, {
}
});
BI.shortcut("bi.inline_vertical_adapt", BI.InlineVerticalAdaptLayout);/**
* 自适应水平和垂直方向都居中容器
* @class BI.TableCenterAdaptLayout
* @extends BI.Layout
*/
BI.TableCenterAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.TableCenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-table-center-adapt-layout",
columnSize: [],
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.TableCenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<div>").css({
position: "relative",
display: "table",
width: "100%",
height: "100%",
"white-space": "nowrap"
});
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
td.element.css({"max-width": o.columnSize[i]});
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
display: "table-cell",
"vertical-align": "middle",
margin: "0",
padding: "0",
height: "100%"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$table.append(frag);
this.element.append(this.$table);
},
resize: function () {
// console.log("center_adapt布局不需要resize");
},
populate: function (items) {
BI.TableCenterAdaptLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.table_center_adapt", BI.TableCenterAdaptLayout);/**
*自适应水平和垂直方向都居中容器
* Created by GUY on 2016/12/2.
*

64
dist/bundle.ie.min.js vendored

File diff suppressed because one or more lines are too long

119
dist/bundle.js vendored

@ -12207,7 +12207,7 @@ if (!_global.BI) {
};
})();(function () {
var kv = {};
BI.shortcut = function (xtype, cls) {
BI.shortcut = BI.component = function (xtype, cls) {
if (kv[xtype] != null) {
_global.console && console.error("shortcut:[" + xtype + "] has been registed");
}
@ -18382,6 +18382,14 @@ _.extend(BI, {
return location;
}
});(function () {
var moduleInjection = {};
BI.module = function (xtype, cls) {
if (moduleInjection[xtype] != null) {
_global.console && console.error("module:[" + xtype + "] has been registed");
}
moduleInjection[xtype] = cls;
};
var constantInjection = {};
BI.constant = function (xtype, cls) {
if (constantInjection[xtype] != null) {
@ -18474,6 +18482,16 @@ _.extend(BI, {
points[type][action][after ? "after" : "before"].push(pointFn);
};
BI.Modules = {
getModule: function (type) {
if(!moduleInjection[type]){
_global.console && console.error("module:[" + type + "] does not exists");
return false;
}
return moduleInjection[type];
}
};
BI.Constants = {
getConstant: function (type) {
return constantInjection[type];
@ -31244,105 +31262,6 @@ BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, {
}
});
BI.shortcut("bi.inline_vertical_adapt", BI.InlineVerticalAdaptLayout);/**
* 自适应水平和垂直方向都居中容器
* @class BI.TableCenterAdaptLayout
* @extends BI.Layout
*/
BI.TableCenterAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.TableCenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-table-center-adapt-layout",
columnSize: [],
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.TableCenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<div>").css({
position: "relative",
display: "table",
width: "100%",
height: "100%",
"white-space": "nowrap"
});
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
td.element.css({"max-width": o.columnSize[i]});
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
display: "table-cell",
"vertical-align": "middle",
margin: "0",
padding: "0",
height: "100%"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$table.append(frag);
this.element.append(this.$table);
},
resize: function () {
// console.log("center_adapt布局不需要resize");
},
populate: function (items) {
BI.TableCenterAdaptLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.table_center_adapt", BI.TableCenterAdaptLayout);/**
*自适应水平和垂直方向都居中容器
* Created by GUY on 2016/12/2.
*

64
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

119
dist/core.js vendored

@ -12207,7 +12207,7 @@ if (!_global.BI) {
};
})();(function () {
var kv = {};
BI.shortcut = function (xtype, cls) {
BI.shortcut = BI.component = function (xtype, cls) {
if (kv[xtype] != null) {
_global.console && console.error("shortcut:[" + xtype + "] has been registed");
}
@ -18382,6 +18382,14 @@ _.extend(BI, {
return location;
}
});(function () {
var moduleInjection = {};
BI.module = function (xtype, cls) {
if (moduleInjection[xtype] != null) {
_global.console && console.error("module:[" + xtype + "] has been registed");
}
moduleInjection[xtype] = cls;
};
var constantInjection = {};
BI.constant = function (xtype, cls) {
if (constantInjection[xtype] != null) {
@ -18474,6 +18482,16 @@ _.extend(BI, {
points[type][action][after ? "after" : "before"].push(pointFn);
};
BI.Modules = {
getModule: function (type) {
if(!moduleInjection[type]){
_global.console && console.error("module:[" + type + "] does not exists");
return false;
}
return moduleInjection[type];
}
};
BI.Constants = {
getConstant: function (type) {
return constantInjection[type];
@ -31244,105 +31262,6 @@ BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, {
}
});
BI.shortcut("bi.inline_vertical_adapt", BI.InlineVerticalAdaptLayout);/**
* 自适应水平和垂直方向都居中容器
* @class BI.TableCenterAdaptLayout
* @extends BI.Layout
*/
BI.TableCenterAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.TableCenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-table-center-adapt-layout",
columnSize: [],
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.TableCenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<div>").css({
position: "relative",
display: "table",
width: "100%",
height: "100%",
"white-space": "nowrap"
});
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
td.element.css({"max-width": o.columnSize[i]});
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
display: "table-cell",
"vertical-align": "middle",
margin: "0",
padding: "0",
height: "100%"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$table.append(frag);
this.element.append(this.$table);
},
resize: function () {
// console.log("center_adapt布局不需要resize");
},
populate: function (items) {
BI.TableCenterAdaptLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.table_center_adapt", BI.TableCenterAdaptLayout);/**
*自适应水平和垂直方向都居中容器
* Created by GUY on 2016/12/2.
*

25
dist/demo.js vendored

@ -6041,30 +6041,7 @@ Demo.HtapeLayout = BI.inherit(BI.Widget, {
};
}
});
BI.shortcut("demo.htape", Demo.HtapeLayout);Demo.InlineVerticalLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-absolute"
},
render: function () {
return {
type: "bi.inline_vertical_adapt",
items: [{
type: "bi.label",
text: "绝对布局",
cls: "layout-bg1",
width: 300,
height: 200
}, {
type: "bi.label",
text: "绝对布局",
cls: "layout-bg1",
width: 300,
height: 100
}]
};
}
});
BI.shortcut("demo.inline_vertical", Demo.InlineVerticalLayout);/**
BI.shortcut("demo.htape", Demo.HtapeLayout);/**
* Created by User on 2017/3/22.
*/
Demo.LeftRightVerticalAdaptLayout = BI.inherit(BI.Widget, {

119
dist/fineui.ie.js vendored

@ -12449,7 +12449,7 @@ if (!_global.BI) {
};
})();(function () {
var kv = {};
BI.shortcut = function (xtype, cls) {
BI.shortcut = BI.component = function (xtype, cls) {
if (kv[xtype] != null) {
_global.console && console.error("shortcut:[" + xtype + "] has been registed");
}
@ -18624,6 +18624,14 @@ _.extend(BI, {
return location;
}
});(function () {
var moduleInjection = {};
BI.module = function (xtype, cls) {
if (moduleInjection[xtype] != null) {
_global.console && console.error("module:[" + xtype + "] has been registed");
}
moduleInjection[xtype] = cls;
};
var constantInjection = {};
BI.constant = function (xtype, cls) {
if (constantInjection[xtype] != null) {
@ -18716,6 +18724,16 @@ _.extend(BI, {
points[type][action][after ? "after" : "before"].push(pointFn);
};
BI.Modules = {
getModule: function (type) {
if(!moduleInjection[type]){
_global.console && console.error("module:[" + type + "] does not exists");
return false;
}
return moduleInjection[type];
}
};
BI.Constants = {
getConstant: function (type) {
return constantInjection[type];
@ -31486,105 +31504,6 @@ BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, {
}
});
BI.shortcut("bi.inline_vertical_adapt", BI.InlineVerticalAdaptLayout);/**
* 自适应水平和垂直方向都居中容器
* @class BI.TableCenterAdaptLayout
* @extends BI.Layout
*/
BI.TableCenterAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.TableCenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-table-center-adapt-layout",
columnSize: [],
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.TableCenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<div>").css({
position: "relative",
display: "table",
width: "100%",
height: "100%",
"white-space": "nowrap"
});
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
td.element.css({"max-width": o.columnSize[i]});
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
display: "table-cell",
"vertical-align": "middle",
margin: "0",
padding: "0",
height: "100%"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$table.append(frag);
this.element.append(this.$table);
},
resize: function () {
// console.log("center_adapt布局不需要resize");
},
populate: function (items) {
BI.TableCenterAdaptLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.table_center_adapt", BI.TableCenterAdaptLayout);/**
*自适应水平和垂直方向都居中容器
* Created by GUY on 2016/12/2.
*

64
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

119
dist/fineui.js vendored

@ -12449,7 +12449,7 @@ if (!_global.BI) {
};
})();(function () {
var kv = {};
BI.shortcut = function (xtype, cls) {
BI.shortcut = BI.component = function (xtype, cls) {
if (kv[xtype] != null) {
_global.console && console.error("shortcut:[" + xtype + "] has been registed");
}
@ -18624,6 +18624,14 @@ _.extend(BI, {
return location;
}
});(function () {
var moduleInjection = {};
BI.module = function (xtype, cls) {
if (moduleInjection[xtype] != null) {
_global.console && console.error("module:[" + xtype + "] has been registed");
}
moduleInjection[xtype] = cls;
};
var constantInjection = {};
BI.constant = function (xtype, cls) {
if (constantInjection[xtype] != null) {
@ -18716,6 +18724,16 @@ _.extend(BI, {
points[type][action][after ? "after" : "before"].push(pointFn);
};
BI.Modules = {
getModule: function (type) {
if(!moduleInjection[type]){
_global.console && console.error("module:[" + type + "] does not exists");
return false;
}
return moduleInjection[type];
}
};
BI.Constants = {
getConstant: function (type) {
return constantInjection[type];
@ -31486,105 +31504,6 @@ BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, {
}
});
BI.shortcut("bi.inline_vertical_adapt", BI.InlineVerticalAdaptLayout);/**
* 自适应水平和垂直方向都居中容器
* @class BI.TableCenterAdaptLayout
* @extends BI.Layout
*/
BI.TableCenterAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.TableCenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-table-center-adapt-layout",
columnSize: [],
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.TableCenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<div>").css({
position: "relative",
display: "table",
width: "100%",
height: "100%",
"white-space": "nowrap"
});
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
td.element.css({"max-width": o.columnSize[i]});
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
display: "table-cell",
"vertical-align": "middle",
margin: "0",
padding: "0",
height: "100%"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$table.append(frag);
this.element.append(this.$table);
},
resize: function () {
// console.log("center_adapt布局不需要resize");
},
populate: function (items) {
BI.TableCenterAdaptLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.table_center_adapt", BI.TableCenterAdaptLayout);/**
*自适应水平和垂直方向都居中容器
* Created by GUY on 2016/12/2.
*

64
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

119
dist/fineui_without_jquery_polyfill.js vendored

@ -12207,7 +12207,7 @@ if (!_global.BI) {
};
})();(function () {
var kv = {};
BI.shortcut = function (xtype, cls) {
BI.shortcut = BI.component = function (xtype, cls) {
if (kv[xtype] != null) {
_global.console && console.error("shortcut:[" + xtype + "] has been registed");
}
@ -18128,6 +18128,14 @@ _.extend(BI, {
return location;
}
});(function () {
var moduleInjection = {};
BI.module = function (xtype, cls) {
if (moduleInjection[xtype] != null) {
_global.console && console.error("module:[" + xtype + "] has been registed");
}
moduleInjection[xtype] = cls;
};
var constantInjection = {};
BI.constant = function (xtype, cls) {
if (constantInjection[xtype] != null) {
@ -18220,6 +18228,16 @@ _.extend(BI, {
points[type][action][after ? "after" : "before"].push(pointFn);
};
BI.Modules = {
getModule: function (type) {
if(!moduleInjection[type]){
_global.console && console.error("module:[" + type + "] does not exists");
return false;
}
return moduleInjection[type];
}
};
BI.Constants = {
getConstant: function (type) {
return constantInjection[type];
@ -20255,105 +20273,6 @@ BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, {
}
});
BI.shortcut("bi.inline_vertical_adapt", BI.InlineVerticalAdaptLayout);/**
* 自适应水平和垂直方向都居中容器
* @class BI.TableCenterAdaptLayout
* @extends BI.Layout
*/
BI.TableCenterAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.TableCenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-table-center-adapt-layout",
columnSize: [],
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.TableCenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<div>").css({
position: "relative",
display: "table",
width: "100%",
height: "100%",
"white-space": "nowrap"
});
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
td.element.css({"max-width": o.columnSize[i]});
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
display: "table-cell",
"vertical-align": "middle",
margin: "0",
padding: "0",
height: "100%"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$table.append(frag);
this.element.append(this.$table);
},
resize: function () {
// console.log("center_adapt布局不需要resize");
},
populate: function (items) {
BI.TableCenterAdaptLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.table_center_adapt", BI.TableCenterAdaptLayout);/**
*自适应水平和垂直方向都居中容器
* Created by GUY on 2016/12/2.
*

18
dist/utils.js vendored

@ -13336,6 +13336,14 @@ if (!_global.BI) {
};
})();
(function () {
var moduleInjection = {};
BI.module = function (xtype, cls) {
if (moduleInjection[xtype] != null) {
_global.console && console.error("module:[" + xtype + "] has been registed");
}
moduleInjection[xtype] = cls;
};
var constantInjection = {};
BI.constant = function (xtype, cls) {
if (constantInjection[xtype] != null) {
@ -13428,6 +13436,16 @@ if (!_global.BI) {
points[type][action][after ? "after" : "before"].push(pointFn);
};
BI.Modules = {
getModule: function (type) {
if(!moduleInjection[type]){
_global.console && console.error("module:[" + type + "] does not exists");
return false;
}
return moduleInjection[type];
}
};
BI.Constants = {
getConstant: function (type) {
return constantInjection[type];

4
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

18
src/core/inject.js

@ -1,4 +1,12 @@
(function () {
var moduleInjection = {};
BI.module = function (xtype, cls) {
if (moduleInjection[xtype] != null) {
_global.console && console.error("module:[" + xtype + "] has been registed");
}
moduleInjection[xtype] = cls;
};
var constantInjection = {};
BI.constant = function (xtype, cls) {
if (constantInjection[xtype] != null) {
@ -91,6 +99,16 @@
points[type][action][after ? "after" : "before"].push(pointFn);
};
BI.Modules = {
getModule: function (type) {
if(!moduleInjection[type]){
_global.console && console.error("module:[" + type + "] does not exists");
return false;
}
return moduleInjection[type];
}
};
BI.Constants = {
getConstant: function (type) {
return constantInjection[type];

2
src/core/shortcut.js

@ -1,6 +1,6 @@
(function () {
var kv = {};
BI.shortcut = function (xtype, cls) {
BI.shortcut = BI.component = function (xtype, cls) {
if (kv[xtype] != null) {
_global.console && console.error("shortcut:[" + xtype + "] has been registed");
}

Loading…
Cancel
Save