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