Browse Source

BI-34367 布局拖字段问题

es6
windy 6 years ago
parent
commit
558f882cc6
  1. 201
      dist/bundle.ie.js
  2. 62
      dist/bundle.ie.min.js
  3. 201
      dist/bundle.js
  4. 62
      dist/bundle.min.js
  5. 201
      dist/core.js
  6. 201
      dist/fineui.ie.js
  7. 62
      dist/fineui.ie.min.js
  8. 201
      dist/fineui.js
  9. 62
      dist/fineui.min.js
  10. 199
      dist/fineui_without_jquery_polyfill.js
  11. 2
      dist/utils.min.js
  12. 2
      src/core/platform/web/config.js
  13. 98
      src/core/wrapper/layout/adapt/adapt.center.js
  14. 101
      src/core/wrapper/layout/adapt/adapt.vertical.js

201
dist/bundle.ie.js vendored

@ -19023,7 +19023,7 @@ BI.prepares.push(function () {
return _isSupprtFlex; return _isSupprtFlex;
}; };
BI.Plugin.registerWidget("bi.horizontal", function (ob) { BI.Plugin.registerWidget("bi.horizontal", function (ob) {
if (!BI.isIE() && isSupportFlex()) { if (!BI.isIE() && isSupportFlex() && ob.items && ob.items.length <= 1) {
return BI.extend(ob, {type: "bi.flex_horizontal"}); return BI.extend(ob, {type: "bi.flex_horizontal"});
} }
return ob; return ob;
@ -30415,6 +30415,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-center-adapt-layout", baseCls: "bi-center-adapt-layout",
columnSize: [], columnSize: [],
scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -30424,92 +30425,33 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.CenterAdaptLayout.superclass.render.apply(this, arguments); BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ return {
position: "relative", type: "bi.horizontal",
width: "100%", verticalAlign: BI.VerticalAlign.Middle,
height: "100%", horizontalAlign: BI.HorizontalAlign.Center,
"white-space": "nowrap", columnSize: o.columnSize,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", items: o.items,
"border-collapse": "separate" ref: function (_ref) {
}); self.layout = _ref;
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); },
this.$tr.appendTo(this.$table); hgap: o.hgap,
this.populate(this.options.items); vgap: o.vgap,
}, lgap: o.lgap,
rgap: o.rgap,
_addElement: function (i, item) { tgap: o.tgap,
var o = this.options; bgap: o.bgap
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",
tagName: "td",
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",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
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.$tr.append(frag);
this.element.append(this.$table);
}, },
resize: function () { resize: function () {
// console.log("center_adapt布局不需要resize"); // console.log("center_adapt布局不需要resize");
}, },
_getWrapper: function () {
return this.$tr;
},
populate: function (items) { populate: function (items) {
BI.CenterAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/** BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/**
@ -30889,7 +30831,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
props: { props: {
baseCls: "bi-vertical-adapt-layout", baseCls: "bi-vertical-adapt-layout",
columnSize: [], columnSize: [],
horizontalAlign: BI.HorizontalAlign.Left, scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -30897,85 +30839,27 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
tgap: 0, tgap: 0,
bgap: 0 bgap: 0
}, },
render: function () { render: function () {
var self = this, o = this.options;
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments); BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options; return {
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ type: "bi.horizontal",
position: "relative", verticalAlign: BI.VerticalAlign.Middle,
width: o.horizontalAlign === BI.HorizontalAlign.Stretch ? "100%" : "auto", horizontalAlign: BI.HorizontalAlign.Left,
height: "100%", columnSize: o.columnSize,
"white-space": "nowrap", items: o.items,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", ref: function (_ref) {
"border-collapse": "separate" self.layout = _ref;
}); },
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); hgap: o.hgap,
this.$tr.appendTo(this.$table); vgap: o.vgap,
this.populate(this.options.items); lgap: o.lgap,
}, rgap: o.rgap,
tgap: o.tgap,
_addElement: function (i, item) { bgap: o.bgap
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",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
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.$tr.append(frag);
this.element.append(this.$table);
},
_getWrapper: function () {
return this.$tr;
}, },
resize: function () { resize: function () {
@ -30983,8 +30867,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
BI.VerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/** BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/**

62
dist/bundle.ie.min.js vendored

File diff suppressed because one or more lines are too long

201
dist/bundle.js vendored

@ -19023,7 +19023,7 @@ BI.prepares.push(function () {
return _isSupprtFlex; return _isSupprtFlex;
}; };
BI.Plugin.registerWidget("bi.horizontal", function (ob) { BI.Plugin.registerWidget("bi.horizontal", function (ob) {
if (!BI.isIE() && isSupportFlex()) { if (!BI.isIE() && isSupportFlex() && ob.items && ob.items.length <= 1) {
return BI.extend(ob, {type: "bi.flex_horizontal"}); return BI.extend(ob, {type: "bi.flex_horizontal"});
} }
return ob; return ob;
@ -30415,6 +30415,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-center-adapt-layout", baseCls: "bi-center-adapt-layout",
columnSize: [], columnSize: [],
scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -30424,92 +30425,33 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.CenterAdaptLayout.superclass.render.apply(this, arguments); BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ return {
position: "relative", type: "bi.horizontal",
width: "100%", verticalAlign: BI.VerticalAlign.Middle,
height: "100%", horizontalAlign: BI.HorizontalAlign.Center,
"white-space": "nowrap", columnSize: o.columnSize,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", items: o.items,
"border-collapse": "separate" ref: function (_ref) {
}); self.layout = _ref;
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); },
this.$tr.appendTo(this.$table); hgap: o.hgap,
this.populate(this.options.items); vgap: o.vgap,
}, lgap: o.lgap,
rgap: o.rgap,
_addElement: function (i, item) { tgap: o.tgap,
var o = this.options; bgap: o.bgap
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",
tagName: "td",
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",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
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.$tr.append(frag);
this.element.append(this.$table);
}, },
resize: function () { resize: function () {
// console.log("center_adapt布局不需要resize"); // console.log("center_adapt布局不需要resize");
}, },
_getWrapper: function () {
return this.$tr;
},
populate: function (items) { populate: function (items) {
BI.CenterAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/** BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/**
@ -30889,7 +30831,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
props: { props: {
baseCls: "bi-vertical-adapt-layout", baseCls: "bi-vertical-adapt-layout",
columnSize: [], columnSize: [],
horizontalAlign: BI.HorizontalAlign.Left, scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -30897,85 +30839,27 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
tgap: 0, tgap: 0,
bgap: 0 bgap: 0
}, },
render: function () { render: function () {
var self = this, o = this.options;
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments); BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options; return {
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ type: "bi.horizontal",
position: "relative", verticalAlign: BI.VerticalAlign.Middle,
width: o.horizontalAlign === BI.HorizontalAlign.Stretch ? "100%" : "auto", horizontalAlign: BI.HorizontalAlign.Left,
height: "100%", columnSize: o.columnSize,
"white-space": "nowrap", items: o.items,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", ref: function (_ref) {
"border-collapse": "separate" self.layout = _ref;
}); },
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); hgap: o.hgap,
this.$tr.appendTo(this.$table); vgap: o.vgap,
this.populate(this.options.items); lgap: o.lgap,
}, rgap: o.rgap,
tgap: o.tgap,
_addElement: function (i, item) { bgap: o.bgap
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",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
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.$tr.append(frag);
this.element.append(this.$table);
},
_getWrapper: function () {
return this.$tr;
}, },
resize: function () { resize: function () {
@ -30983,8 +30867,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
BI.VerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/** BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/**

62
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

201
dist/core.js vendored

@ -19023,7 +19023,7 @@ BI.prepares.push(function () {
return _isSupprtFlex; return _isSupprtFlex;
}; };
BI.Plugin.registerWidget("bi.horizontal", function (ob) { BI.Plugin.registerWidget("bi.horizontal", function (ob) {
if (!BI.isIE() && isSupportFlex()) { if (!BI.isIE() && isSupportFlex() && ob.items && ob.items.length <= 1) {
return BI.extend(ob, {type: "bi.flex_horizontal"}); return BI.extend(ob, {type: "bi.flex_horizontal"});
} }
return ob; return ob;
@ -30415,6 +30415,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-center-adapt-layout", baseCls: "bi-center-adapt-layout",
columnSize: [], columnSize: [],
scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -30424,92 +30425,33 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.CenterAdaptLayout.superclass.render.apply(this, arguments); BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ return {
position: "relative", type: "bi.horizontal",
width: "100%", verticalAlign: BI.VerticalAlign.Middle,
height: "100%", horizontalAlign: BI.HorizontalAlign.Center,
"white-space": "nowrap", columnSize: o.columnSize,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", items: o.items,
"border-collapse": "separate" ref: function (_ref) {
}); self.layout = _ref;
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); },
this.$tr.appendTo(this.$table); hgap: o.hgap,
this.populate(this.options.items); vgap: o.vgap,
}, lgap: o.lgap,
rgap: o.rgap,
_addElement: function (i, item) { tgap: o.tgap,
var o = this.options; bgap: o.bgap
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",
tagName: "td",
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",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
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.$tr.append(frag);
this.element.append(this.$table);
}, },
resize: function () { resize: function () {
// console.log("center_adapt布局不需要resize"); // console.log("center_adapt布局不需要resize");
}, },
_getWrapper: function () {
return this.$tr;
},
populate: function (items) { populate: function (items) {
BI.CenterAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/** BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/**
@ -30889,7 +30831,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
props: { props: {
baseCls: "bi-vertical-adapt-layout", baseCls: "bi-vertical-adapt-layout",
columnSize: [], columnSize: [],
horizontalAlign: BI.HorizontalAlign.Left, scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -30897,85 +30839,27 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
tgap: 0, tgap: 0,
bgap: 0 bgap: 0
}, },
render: function () { render: function () {
var self = this, o = this.options;
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments); BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options; return {
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ type: "bi.horizontal",
position: "relative", verticalAlign: BI.VerticalAlign.Middle,
width: o.horizontalAlign === BI.HorizontalAlign.Stretch ? "100%" : "auto", horizontalAlign: BI.HorizontalAlign.Left,
height: "100%", columnSize: o.columnSize,
"white-space": "nowrap", items: o.items,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", ref: function (_ref) {
"border-collapse": "separate" self.layout = _ref;
}); },
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); hgap: o.hgap,
this.$tr.appendTo(this.$table); vgap: o.vgap,
this.populate(this.options.items); lgap: o.lgap,
}, rgap: o.rgap,
tgap: o.tgap,
_addElement: function (i, item) { bgap: o.bgap
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",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
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.$tr.append(frag);
this.element.append(this.$table);
},
_getWrapper: function () {
return this.$tr;
}, },
resize: function () { resize: function () {
@ -30983,8 +30867,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
BI.VerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/** BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/**

201
dist/fineui.ie.js vendored

@ -19265,7 +19265,7 @@ BI.prepares.push(function () {
return _isSupprtFlex; return _isSupprtFlex;
}; };
BI.Plugin.registerWidget("bi.horizontal", function (ob) { BI.Plugin.registerWidget("bi.horizontal", function (ob) {
if (!BI.isIE() && isSupportFlex()) { if (!BI.isIE() && isSupportFlex() && ob.items && ob.items.length <= 1) {
return BI.extend(ob, {type: "bi.flex_horizontal"}); return BI.extend(ob, {type: "bi.flex_horizontal"});
} }
return ob; return ob;
@ -30657,6 +30657,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-center-adapt-layout", baseCls: "bi-center-adapt-layout",
columnSize: [], columnSize: [],
scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -30666,92 +30667,33 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.CenterAdaptLayout.superclass.render.apply(this, arguments); BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ return {
position: "relative", type: "bi.horizontal",
width: "100%", verticalAlign: BI.VerticalAlign.Middle,
height: "100%", horizontalAlign: BI.HorizontalAlign.Center,
"white-space": "nowrap", columnSize: o.columnSize,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", items: o.items,
"border-collapse": "separate" ref: function (_ref) {
}); self.layout = _ref;
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); },
this.$tr.appendTo(this.$table); hgap: o.hgap,
this.populate(this.options.items); vgap: o.vgap,
}, lgap: o.lgap,
rgap: o.rgap,
_addElement: function (i, item) { tgap: o.tgap,
var o = this.options; bgap: o.bgap
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",
tagName: "td",
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",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
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.$tr.append(frag);
this.element.append(this.$table);
}, },
resize: function () { resize: function () {
// console.log("center_adapt布局不需要resize"); // console.log("center_adapt布局不需要resize");
}, },
_getWrapper: function () {
return this.$tr;
},
populate: function (items) { populate: function (items) {
BI.CenterAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/** BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/**
@ -31131,7 +31073,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
props: { props: {
baseCls: "bi-vertical-adapt-layout", baseCls: "bi-vertical-adapt-layout",
columnSize: [], columnSize: [],
horizontalAlign: BI.HorizontalAlign.Left, scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -31139,85 +31081,27 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
tgap: 0, tgap: 0,
bgap: 0 bgap: 0
}, },
render: function () { render: function () {
var self = this, o = this.options;
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments); BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options; return {
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ type: "bi.horizontal",
position: "relative", verticalAlign: BI.VerticalAlign.Middle,
width: o.horizontalAlign === BI.HorizontalAlign.Stretch ? "100%" : "auto", horizontalAlign: BI.HorizontalAlign.Left,
height: "100%", columnSize: o.columnSize,
"white-space": "nowrap", items: o.items,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", ref: function (_ref) {
"border-collapse": "separate" self.layout = _ref;
}); },
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); hgap: o.hgap,
this.$tr.appendTo(this.$table); vgap: o.vgap,
this.populate(this.options.items); lgap: o.lgap,
}, rgap: o.rgap,
tgap: o.tgap,
_addElement: function (i, item) { bgap: o.bgap
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",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
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.$tr.append(frag);
this.element.append(this.$table);
},
_getWrapper: function () {
return this.$tr;
}, },
resize: function () { resize: function () {
@ -31225,8 +31109,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
BI.VerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/** BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/**

62
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

201
dist/fineui.js vendored

@ -19265,7 +19265,7 @@ BI.prepares.push(function () {
return _isSupprtFlex; return _isSupprtFlex;
}; };
BI.Plugin.registerWidget("bi.horizontal", function (ob) { BI.Plugin.registerWidget("bi.horizontal", function (ob) {
if (!BI.isIE() && isSupportFlex()) { if (!BI.isIE() && isSupportFlex() && ob.items && ob.items.length <= 1) {
return BI.extend(ob, {type: "bi.flex_horizontal"}); return BI.extend(ob, {type: "bi.flex_horizontal"});
} }
return ob; return ob;
@ -30657,6 +30657,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-center-adapt-layout", baseCls: "bi-center-adapt-layout",
columnSize: [], columnSize: [],
scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -30666,92 +30667,33 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.CenterAdaptLayout.superclass.render.apply(this, arguments); BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ return {
position: "relative", type: "bi.horizontal",
width: "100%", verticalAlign: BI.VerticalAlign.Middle,
height: "100%", horizontalAlign: BI.HorizontalAlign.Center,
"white-space": "nowrap", columnSize: o.columnSize,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", items: o.items,
"border-collapse": "separate" ref: function (_ref) {
}); self.layout = _ref;
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); },
this.$tr.appendTo(this.$table); hgap: o.hgap,
this.populate(this.options.items); vgap: o.vgap,
}, lgap: o.lgap,
rgap: o.rgap,
_addElement: function (i, item) { tgap: o.tgap,
var o = this.options; bgap: o.bgap
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",
tagName: "td",
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",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
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.$tr.append(frag);
this.element.append(this.$table);
}, },
resize: function () { resize: function () {
// console.log("center_adapt布局不需要resize"); // console.log("center_adapt布局不需要resize");
}, },
_getWrapper: function () {
return this.$tr;
},
populate: function (items) { populate: function (items) {
BI.CenterAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/** BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/**
@ -31131,7 +31073,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
props: { props: {
baseCls: "bi-vertical-adapt-layout", baseCls: "bi-vertical-adapt-layout",
columnSize: [], columnSize: [],
horizontalAlign: BI.HorizontalAlign.Left, scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -31139,85 +31081,27 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
tgap: 0, tgap: 0,
bgap: 0 bgap: 0
}, },
render: function () { render: function () {
var self = this, o = this.options;
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments); BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options; return {
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ type: "bi.horizontal",
position: "relative", verticalAlign: BI.VerticalAlign.Middle,
width: o.horizontalAlign === BI.HorizontalAlign.Stretch ? "100%" : "auto", horizontalAlign: BI.HorizontalAlign.Left,
height: "100%", columnSize: o.columnSize,
"white-space": "nowrap", items: o.items,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", ref: function (_ref) {
"border-collapse": "separate" self.layout = _ref;
}); },
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); hgap: o.hgap,
this.$tr.appendTo(this.$table); vgap: o.vgap,
this.populate(this.options.items); lgap: o.lgap,
}, rgap: o.rgap,
tgap: o.tgap,
_addElement: function (i, item) { bgap: o.bgap
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",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
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.$tr.append(frag);
this.element.append(this.$table);
},
_getWrapper: function () {
return this.$tr;
}, },
resize: function () { resize: function () {
@ -31225,8 +31109,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
BI.VerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/** BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/**

62
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

199
dist/fineui_without_jquery_polyfill.js vendored

@ -19426,6 +19426,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-center-adapt-layout", baseCls: "bi-center-adapt-layout",
columnSize: [], columnSize: [],
scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -19435,92 +19436,33 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.CenterAdaptLayout.superclass.render.apply(this, arguments); BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ return {
position: "relative", type: "bi.horizontal",
width: "100%", verticalAlign: BI.VerticalAlign.Middle,
height: "100%", horizontalAlign: BI.HorizontalAlign.Center,
"white-space": "nowrap", columnSize: o.columnSize,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", items: o.items,
"border-collapse": "separate" ref: function (_ref) {
}); self.layout = _ref;
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); },
this.$tr.appendTo(this.$table); hgap: o.hgap,
this.populate(this.options.items); vgap: o.vgap,
}, lgap: o.lgap,
rgap: o.rgap,
_addElement: function (i, item) { tgap: o.tgap,
var o = this.options; bgap: o.bgap
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",
tagName: "td",
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",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
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.$tr.append(frag);
this.element.append(this.$table);
}, },
resize: function () { resize: function () {
// console.log("center_adapt布局不需要resize"); // console.log("center_adapt布局不需要resize");
}, },
_getWrapper: function () {
return this.$tr;
},
populate: function (items) { populate: function (items) {
BI.CenterAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/** BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/**
@ -19900,7 +19842,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
props: { props: {
baseCls: "bi-vertical-adapt-layout", baseCls: "bi-vertical-adapt-layout",
columnSize: [], columnSize: [],
horizontalAlign: BI.HorizontalAlign.Left, scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -19908,85 +19850,27 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
tgap: 0, tgap: 0,
bgap: 0 bgap: 0
}, },
render: function () { render: function () {
var self = this, o = this.options;
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments); BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options; return {
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ type: "bi.horizontal",
position: "relative", verticalAlign: BI.VerticalAlign.Middle,
width: o.horizontalAlign === BI.HorizontalAlign.Stretch ? "100%" : "auto", horizontalAlign: BI.HorizontalAlign.Left,
height: "100%", columnSize: o.columnSize,
"white-space": "nowrap", items: o.items,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", ref: function (_ref) {
"border-collapse": "separate" self.layout = _ref;
}); },
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); hgap: o.hgap,
this.$tr.appendTo(this.$table); vgap: o.vgap,
this.populate(this.options.items); lgap: o.lgap,
}, rgap: o.rgap,
tgap: o.tgap,
_addElement: function (i, item) { bgap: o.bgap
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",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
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.$tr.append(frag);
this.element.append(this.$table);
},
_getWrapper: function () {
return this.$tr;
}, },
resize: function () { resize: function () {
@ -19994,8 +19878,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
BI.VerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/** BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/**

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

2
src/core/platform/web/config.js

@ -9,7 +9,7 @@ BI.prepares.push(function () {
return _isSupprtFlex; return _isSupprtFlex;
}; };
BI.Plugin.registerWidget("bi.horizontal", function (ob) { BI.Plugin.registerWidget("bi.horizontal", function (ob) {
if (!BI.isIE() && isSupportFlex()) { if (!BI.isIE() && isSupportFlex() && ob.items && ob.items.length <= 1) {
return BI.extend(ob, {type: "bi.flex_horizontal"}); return BI.extend(ob, {type: "bi.flex_horizontal"});
} }
return ob; return ob;

98
src/core/wrapper/layout/adapt/adapt.center.js

@ -8,6 +8,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-center-adapt-layout", baseCls: "bi-center-adapt-layout",
columnSize: [], columnSize: [],
scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -17,92 +18,33 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.CenterAdaptLayout.superclass.render.apply(this, arguments); BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ return {
position: "relative", type: "bi.horizontal",
width: "100%", verticalAlign: BI.VerticalAlign.Middle,
height: "100%", horizontalAlign: BI.HorizontalAlign.Center,
"white-space": "nowrap", columnSize: o.columnSize,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", items: o.items,
"border-collapse": "separate" ref: function (_ref) {
}); self.layout = _ref;
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); },
this.$tr.appendTo(this.$table); hgap: o.hgap,
this.populate(this.options.items); vgap: o.vgap,
}, lgap: o.lgap,
rgap: o.rgap,
_addElement: function (i, item) { tgap: o.tgap,
var o = this.options; bgap: o.bgap
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",
tagName: "td",
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",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
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.$tr.append(frag);
this.element.append(this.$table);
}, },
resize: function () { resize: function () {
// console.log("center_adapt布局不需要resize"); // console.log("center_adapt布局不需要resize");
}, },
_getWrapper: function () {
return this.$tr;
},
populate: function (items) { populate: function (items) {
BI.CenterAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout); BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);

101
src/core/wrapper/layout/adapt/adapt.vertical.js

@ -7,7 +7,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
props: { props: {
baseCls: "bi-vertical-adapt-layout", baseCls: "bi-vertical-adapt-layout",
columnSize: [], columnSize: [],
horizontalAlign: BI.HorizontalAlign.Left, scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -15,85 +15,27 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
tgap: 0, tgap: 0,
bgap: 0 bgap: 0
}, },
render: function () { render: function () {
var self = this, o = this.options;
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments); BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options; return {
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ type: "bi.horizontal",
position: "relative", verticalAlign: BI.VerticalAlign.Middle,
width: o.horizontalAlign === BI.HorizontalAlign.Stretch ? "100%" : "auto", horizontalAlign: BI.HorizontalAlign.Left,
height: "100%", columnSize: o.columnSize,
"white-space": "nowrap", items: o.items,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", ref: function (_ref) {
"border-collapse": "separate" self.layout = _ref;
}); },
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); hgap: o.hgap,
this.$tr.appendTo(this.$table); vgap: o.vgap,
this.populate(this.options.items); lgap: o.lgap,
}, rgap: o.rgap,
tgap: o.tgap,
_addElement: function (i, item) { bgap: o.bgap
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",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
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.$tr.append(frag);
this.element.append(this.$table);
},
_getWrapper: function () {
return this.$tr;
}, },
resize: function () { resize: function () {
@ -101,8 +43,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
BI.VerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout); BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);
Loading…
Cancel
Save