|
|
|
@ -1,8 +1,15 @@
|
|
|
|
|
/** |
|
|
|
|
* Created by dailer on 2019/6/19. |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
BI.AbstractLabel = BI.inherit(BI.Single, { |
|
|
|
|
!(function () { |
|
|
|
|
var _isSupportFlex; |
|
|
|
|
var isSupportFlex = function () { |
|
|
|
|
if (_isSupportFlex == null) { |
|
|
|
|
_isSupportFlex = !!(BI.isSupportCss3 && BI.isSupportCss3("flex")); |
|
|
|
|
} |
|
|
|
|
return _isSupportFlex; |
|
|
|
|
}; |
|
|
|
|
BI.AbstractLabel = BI.inherit(BI.Single, { |
|
|
|
|
|
|
|
|
|
_defaultConfig: function (props) { |
|
|
|
|
var conf = BI.AbstractLabel.superclass._defaultConfig.apply(this, arguments); |
|
|
|
@ -203,7 +210,10 @@ BI.AbstractLabel = BI.inherit(BI.Single, {
|
|
|
|
|
|
|
|
|
|
_createNotCenterEl: function () { |
|
|
|
|
var o = this.options; |
|
|
|
|
var adaptLayout = o.textAlign === "right" ? "bi.right_vertical_adapt" : "bi.vertical_adapt"; |
|
|
|
|
var adaptLayout = "bi.vertical_adapt"; |
|
|
|
|
if (o.textAlign === "right" && (BI.isIE() || !isSupportFlex())) { |
|
|
|
|
adaptLayout = "bi.right_vertical_adapt"; |
|
|
|
|
} |
|
|
|
|
var json = this._createJson(); |
|
|
|
|
if (BI.isNumber(o.width) && o.width > 0) { |
|
|
|
|
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { |
|
|
|
@ -211,6 +221,7 @@ BI.AbstractLabel = BI.inherit(BI.Single, {
|
|
|
|
|
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
|
|
|
|
|
BI.createWidget({ |
|
|
|
|
type: adaptLayout, |
|
|
|
|
horizontalAlign: o.textAlign, |
|
|
|
|
height: o.height, |
|
|
|
|
scrollable: o.whiteSpace === "normal", |
|
|
|
|
element: this, |
|
|
|
@ -224,6 +235,7 @@ BI.AbstractLabel = BI.inherit(BI.Single, {
|
|
|
|
|
} |
|
|
|
|
BI.createWidget({ // 2.2
|
|
|
|
|
type: adaptLayout, |
|
|
|
|
horizontalAlign: o.textAlign, |
|
|
|
|
scrollable: o.whiteSpace === "normal", |
|
|
|
|
hgap: o.hgap, |
|
|
|
|
vgap: o.vgap, |
|
|
|
@ -260,6 +272,7 @@ BI.AbstractLabel = BI.inherit(BI.Single, {
|
|
|
|
|
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap; |
|
|
|
|
BI.createWidget({ // 2.4
|
|
|
|
|
type: adaptLayout, |
|
|
|
|
horizontalAlign: o.textAlign, |
|
|
|
|
scrollable: o.whiteSpace === "normal", |
|
|
|
|
hgap: o.hgap, |
|
|
|
|
vgap: o.vgap, |
|
|
|
@ -278,6 +291,7 @@ BI.AbstractLabel = BI.inherit(BI.Single, {
|
|
|
|
|
json.width = o.textWidth; |
|
|
|
|
BI.createWidget({ // 2.5
|
|
|
|
|
type: adaptLayout, |
|
|
|
|
horizontalAlign: o.textAlign, |
|
|
|
|
scrollable: o.whiteSpace === "normal", |
|
|
|
|
hgap: o.hgap, |
|
|
|
|
vgap: o.vgap, |
|
|
|
@ -325,6 +339,7 @@ BI.AbstractLabel = BI.inherit(BI.Single, {
|
|
|
|
|
})); |
|
|
|
|
BI.createWidget({ |
|
|
|
|
type: adaptLayout, |
|
|
|
|
horizontalAlign: o.textAlign, |
|
|
|
|
element: this, |
|
|
|
|
scrollable: o.whiteSpace === "normal", |
|
|
|
|
items: [this.text] |
|
|
|
@ -370,4 +385,5 @@ BI.AbstractLabel = BI.inherit(BI.Single, {
|
|
|
|
|
populate: function () { |
|
|
|
|
BI.AbstractLabel.superclass.populate.apply(this, arguments); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}()); |
|
|
|
|