|
|
@ -81,7 +81,7 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
hgap: o.hgap, |
|
|
|
hgap: o.hgap, |
|
|
|
vgap: o.vgap, |
|
|
|
vgap: o.vgap, |
|
|
|
items: self.generateItems() |
|
|
|
items: self.generateItems(), |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// 如果 options 对应的属性为 true 则给元素添加 class
|
|
|
|
// 如果 options 对应的属性为 true 则给元素添加 class
|
|
|
@ -102,7 +102,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
// 由于button默认情况下有个边框,所以要主动算行高
|
|
|
|
// 由于button默认情况下有个边框,所以要主动算行高
|
|
|
|
var lineHeight, textHeight = o.textHeight; |
|
|
|
var lineHeight, textHeight = o.textHeight; |
|
|
|
var hasBorder = false |
|
|
|
var hasBorder = false; |
|
|
|
if (BI.isNumber(o.height)) { |
|
|
|
if (BI.isNumber(o.height)) { |
|
|
|
if (!isVertical(o.iconPosition)) { |
|
|
|
if (!isVertical(o.iconPosition)) { |
|
|
|
if (!(o.clear && o.block && o.light)) { |
|
|
|
if (!(o.clear && o.block && o.light)) { |
|
|
@ -121,12 +121,12 @@ |
|
|
|
|
|
|
|
|
|
|
|
var iconInvisible = !(o.loading || o.iconCls || o.icon || defaultRenderIcon); |
|
|
|
var iconInvisible = !(o.loading || o.iconCls || o.icon || defaultRenderIcon); |
|
|
|
|
|
|
|
|
|
|
|
var textWidth = o.textWidth; |
|
|
|
var maxTextWidth = Math.max(o.minWidth, o.width); |
|
|
|
if (BI.isNull(o.textWidth)) { |
|
|
|
maxTextWidth -= (o.hgap * 2 + o.iconGap); |
|
|
|
textWidth = (o.minWidth > 0 && o.width < o.minWidth) ? o.minWidth : o.width; |
|
|
|
// 减去图标水平占位宽度
|
|
|
|
textWidth -= (o.hgap * 2 + o.iconGap) |
|
|
|
maxTextWidth -= iconInvisible || isVertical(o.iconPosition) ? 0 : this._const.iconWidth; |
|
|
|
textWidth -= iconInvisible || isVertical(o.iconPosition) ? 0 : this._const.iconWidth |
|
|
|
var textWidth = BI.isNull(o.textWidth) ? maxTextWidth : Math.min(o.textWidth, maxTextWidth); |
|
|
|
} |
|
|
|
|
|
|
|
this.text = BI.createWidget({ |
|
|
|
this.text = BI.createWidget({ |
|
|
|
type: "bi.label", |
|
|
|
type: "bi.label", |
|
|
|
text: o.text, |
|
|
|
text: o.text, |
|
|
@ -140,7 +140,7 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (iconInvisible) { |
|
|
|
if (iconInvisible) { |
|
|
|
return [this.text] |
|
|
|
return [this.text]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this._iconRendered = true; |
|
|
|
this._iconRendered = true; |
|
|
|