Browse Source

Merge pull request #956 in VISUAL/fineui from ~DAILER/fineui:master to master

* commit '4a2e6914ce943d61ade96371741b62d9c7833abc':
  KERNEL-748 feat: fineui的html、htmlLabel控件代码优化.
  build
  build
  KERNEL-748 feat: fineui的html、htmlLabel控件代码优化. 去掉bi.html 的mouted 之后setText逻辑. 去除label和htmllabel的重复代码.
es6
guy 6 years ago
parent
commit
28327959ff
  1. 508
      dist/2.0/fineui.ie.js
  2. 60
      dist/2.0/fineui.ie.min.js
  3. 508
      dist/2.0/fineui.js
  4. 60
      dist/2.0/fineui.min.js
  5. 508
      dist/base.js
  6. 508
      dist/bundle.ie.js
  7. 60
      dist/bundle.ie.min.js
  8. 508
      dist/bundle.js
  9. 60
      dist/bundle.min.js
  10. 508
      dist/fineui.ie.js
  11. 60
      dist/fineui.ie.min.js
  12. 508
      dist/fineui.js
  13. 60
      dist/fineui.min.js
  14. 508
      dist/fineui_without_jquery_polyfill.js
  15. 2
      dist/utils.min.js
  16. 38
      src/base/single/html/html.js
  17. 370
      src/base/single/label/abstract.label.js
  18. 350
      src/base/single/label/html.label.js
  19. 349
      src/base/single/label/label.js
  20. 34
      src/base/single/text.js

508
dist/2.0/fineui.ie.js vendored

@ -38415,24 +38415,22 @@ BI.Single = BI.inherit(BI.Widget, {
* @extends BI.Single
*/
BI.Text = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Text.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
});
props: {
baseCls: "bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
},
render: function () {
@ -47332,22 +47330,21 @@ BI.shortcut("bi.textarea_editor", BI.TextAreaEditor);/**
* @extends BI.Single
*/
BI.Html = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Html.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: ""
});
props: {
baseCls: "bi-html",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
highLight: false
},
render: function () {
@ -47403,16 +47400,15 @@ BI.Html = BI.inherit(BI.Single, {
} else {
this.text = this;
}
},
mounted: function () {
var o = this.options;
if (BI.isKey(o.text)) {
this.setText(o.text);
} else if (BI.isKey(o.value)) {
this.setText(o.value);
}
if (o.highLight) {
this.doHighLight();
}
},
doHighLight: function () {
@ -48681,14 +48677,14 @@ BI.Radio = BI.inherit(BI.BasicButton, {
BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
BI.shortcut("bi.radio", BI.Radio);/**
* Created by GUY on 2015/6/26.
* Created by dailer on 2019/6/19.
*/
BI.HtmlLabel = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.HtmlLabel.superclass._defaultConfig.apply(this, arguments);
BI.AbstractLabel = BI.inherit(BI.Single, {
_defaultConfig: function (props) {
var conf = BI.AbstractLabel.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
@ -48699,24 +48695,28 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
rgap: 0,
tgap: 0,
bgap: 0,
text: ""
text: "",
highLight: false
});
},
_createJson: function () {
var o = this.options;
return {
type: "bi.html",
type: "bi.text",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value
value: o.value,
py: o.py,
keyword: o.keyword,
highLight: o.highLight
};
},
_init: function () {
BI.HtmlLabel.superclass._init.apply(this, arguments);
BI.AbstractLabel.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
@ -48728,6 +48728,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
@ -48757,7 +48758,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (o.whiteSpace == "normal") {
if (o.whiteSpace == "normal") { // 1.3
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
@ -48775,10 +48776,11 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -48790,7 +48792,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
}));
return;
}
BI.extend(json, {
BI.extend(json, { // 1.5
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
@ -48808,7 +48810,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { // 1.6
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
@ -48822,7 +48824,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (o.whiteSpace == "normal") {
if (o.whiteSpace == "normal") { // 1.7
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
@ -48840,10 +48842,11 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -48881,7 +48884,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
BI.createWidget({
type: adaptLayout,
height: o.height,
@ -48895,7 +48898,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
BI.createWidget({
BI.createWidget({ // 2.2
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -48913,7 +48916,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 2.3
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -48931,7 +48934,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({
BI.createWidget({ // 2.4
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -48949,7 +48952,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({
BI.createWidget({ // 2.5
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -48973,7 +48976,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, {
this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this,
hgap: o.hgap,
vgap: o.vgap,
@ -49003,13 +49006,12 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
},
_setEnable: function (enable) {
BI.HtmlLabel.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.element.removeClass("base-disabled disabled");
} else if (enable === false) {
this.element.addClass("base-disabled disabled");
}
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
@ -49034,14 +49036,35 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
},
setValue: function (v) {
BI.HtmlLabel.superclass.setValue.apply(this, arguments);
BI.AbstractLabel.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.HtmlLabel.superclass.populate.apply(this, arguments);
BI.AbstractLabel.superclass.populate.apply(this, arguments);
}
});/**
* Created by GUY on 2015/6/26.
*/
BI.HtmlLabel = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-html-label"
},
_createJson: function () {
var o = this.options;
return {
type: "bi.html",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value
};
}
});
@ -49090,26 +49113,12 @@ BI.shortcut("bi.icon_label", BI.IconLabel);/**
* Created by GUY on 2015/6/26.
*/
BI.Label = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Label.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
textHeight: null,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
keyword: "",
highLight: false
});
BI.Label = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-label",
py: "",
keyword: ""
},
_createJson: function () {
@ -49127,335 +49136,12 @@ BI.Label = BI.inherit(BI.Single, {
};
},
_init: function () {
BI.Label.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
} else {
this._createNotCenterEl();
}
},
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 1.1
BI.createWidget({
type: "bi.center_adapt",
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 1.2
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.3
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, { // 1.5
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
maxWidth: "100%"
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { // 1.6
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.7
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: true,
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: "bi.center_adapt",
element: this,
items: [this.text]
});
},
_createNotCenterEl: function () {
var o = this.options;
var adaptLayout = o.textAlign === "right" ? "bi.right_vertical_adapt" : "bi.vertical_adapt";
var json = this._createJson();
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
BI.createWidget({
type: adaptLayout,
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 2.2
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 2.3
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({ // 2.4
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [{
el: (this.text = BI.createWidget(json))
}]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({ // 2.5
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: adaptLayout,
element: this,
items: [this.text]
});
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
setText: function (v) {
this.options.text = v;
this.text.setText(v);
},
getText: function () {
return this.options.text;
},
setStyle: function (css) {
this.text.setStyle(css);
},
setValue: function (v) {
BI.Label.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.Label.superclass.populate.apply(this, arguments);
}
});

60
dist/2.0/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

508
dist/2.0/fineui.js vendored

@ -38819,24 +38819,22 @@ BI.Single = BI.inherit(BI.Widget, {
* @extends BI.Single
*/
BI.Text = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Text.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
});
props: {
baseCls: "bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
},
render: function () {
@ -47736,22 +47734,21 @@ BI.shortcut("bi.textarea_editor", BI.TextAreaEditor);/**
* @extends BI.Single
*/
BI.Html = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Html.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: ""
});
props: {
baseCls: "bi-html",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
highLight: false
},
render: function () {
@ -47807,16 +47804,15 @@ BI.Html = BI.inherit(BI.Single, {
} else {
this.text = this;
}
},
mounted: function () {
var o = this.options;
if (BI.isKey(o.text)) {
this.setText(o.text);
} else if (BI.isKey(o.value)) {
this.setText(o.value);
}
if (o.highLight) {
this.doHighLight();
}
},
doHighLight: function () {
@ -49085,14 +49081,14 @@ BI.Radio = BI.inherit(BI.BasicButton, {
BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
BI.shortcut("bi.radio", BI.Radio);/**
* Created by GUY on 2015/6/26.
* Created by dailer on 2019/6/19.
*/
BI.HtmlLabel = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.HtmlLabel.superclass._defaultConfig.apply(this, arguments);
BI.AbstractLabel = BI.inherit(BI.Single, {
_defaultConfig: function (props) {
var conf = BI.AbstractLabel.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
@ -49103,24 +49099,28 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
rgap: 0,
tgap: 0,
bgap: 0,
text: ""
text: "",
highLight: false
});
},
_createJson: function () {
var o = this.options;
return {
type: "bi.html",
type: "bi.text",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value
value: o.value,
py: o.py,
keyword: o.keyword,
highLight: o.highLight
};
},
_init: function () {
BI.HtmlLabel.superclass._init.apply(this, arguments);
BI.AbstractLabel.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
@ -49132,6 +49132,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
@ -49161,7 +49162,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (o.whiteSpace == "normal") {
if (o.whiteSpace == "normal") { // 1.3
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
@ -49179,10 +49180,11 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -49194,7 +49196,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
}));
return;
}
BI.extend(json, {
BI.extend(json, { // 1.5
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
@ -49212,7 +49214,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { // 1.6
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
@ -49226,7 +49228,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (o.whiteSpace == "normal") {
if (o.whiteSpace == "normal") { // 1.7
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
@ -49244,10 +49246,11 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -49285,7 +49288,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
BI.createWidget({
type: adaptLayout,
height: o.height,
@ -49299,7 +49302,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
BI.createWidget({
BI.createWidget({ // 2.2
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -49317,7 +49320,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 2.3
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -49335,7 +49338,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({
BI.createWidget({ // 2.4
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -49353,7 +49356,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({
BI.createWidget({ // 2.5
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -49377,7 +49380,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, {
this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this,
hgap: o.hgap,
vgap: o.vgap,
@ -49407,13 +49410,12 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
},
_setEnable: function (enable) {
BI.HtmlLabel.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.element.removeClass("base-disabled disabled");
} else if (enable === false) {
this.element.addClass("base-disabled disabled");
}
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
@ -49438,14 +49440,35 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
},
setValue: function (v) {
BI.HtmlLabel.superclass.setValue.apply(this, arguments);
BI.AbstractLabel.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.HtmlLabel.superclass.populate.apply(this, arguments);
BI.AbstractLabel.superclass.populate.apply(this, arguments);
}
});/**
* Created by GUY on 2015/6/26.
*/
BI.HtmlLabel = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-html-label"
},
_createJson: function () {
var o = this.options;
return {
type: "bi.html",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value
};
}
});
@ -49494,26 +49517,12 @@ BI.shortcut("bi.icon_label", BI.IconLabel);/**
* Created by GUY on 2015/6/26.
*/
BI.Label = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Label.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
textHeight: null,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
keyword: "",
highLight: false
});
BI.Label = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-label",
py: "",
keyword: ""
},
_createJson: function () {
@ -49531,335 +49540,12 @@ BI.Label = BI.inherit(BI.Single, {
};
},
_init: function () {
BI.Label.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
} else {
this._createNotCenterEl();
}
},
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 1.1
BI.createWidget({
type: "bi.center_adapt",
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 1.2
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.3
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, { // 1.5
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
maxWidth: "100%"
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { // 1.6
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.7
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: true,
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: "bi.center_adapt",
element: this,
items: [this.text]
});
},
_createNotCenterEl: function () {
var o = this.options;
var adaptLayout = o.textAlign === "right" ? "bi.right_vertical_adapt" : "bi.vertical_adapt";
var json = this._createJson();
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
BI.createWidget({
type: adaptLayout,
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 2.2
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 2.3
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({ // 2.4
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [{
el: (this.text = BI.createWidget(json))
}]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({ // 2.5
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: adaptLayout,
element: this,
items: [this.text]
});
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
setText: function (v) {
this.options.text = v;
this.text.setText(v);
},
getText: function () {
return this.options.text;
},
setStyle: function (css) {
this.text.setStyle(css);
},
setValue: function (v) {
BI.Label.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.Label.superclass.populate.apply(this, arguments);
}
});

60
dist/2.0/fineui.min.js vendored

File diff suppressed because one or more lines are too long

508
dist/base.js vendored

@ -531,24 +531,22 @@ BI.Single = BI.inherit(BI.Widget, {
* @extends BI.Single
*/
BI.Text = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Text.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
});
props: {
baseCls: "bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
},
render: function () {
@ -9448,22 +9446,21 @@ BI.shortcut("bi.textarea_editor", BI.TextAreaEditor);/**
* @extends BI.Single
*/
BI.Html = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Html.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: ""
});
props: {
baseCls: "bi-html",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
highLight: false
},
render: function () {
@ -9519,16 +9516,15 @@ BI.Html = BI.inherit(BI.Single, {
} else {
this.text = this;
}
},
mounted: function () {
var o = this.options;
if (BI.isKey(o.text)) {
this.setText(o.text);
} else if (BI.isKey(o.value)) {
this.setText(o.value);
}
if (o.highLight) {
this.doHighLight();
}
},
doHighLight: function () {
@ -10797,14 +10793,14 @@ BI.Radio = BI.inherit(BI.BasicButton, {
BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
BI.shortcut("bi.radio", BI.Radio);/**
* Created by GUY on 2015/6/26.
* Created by dailer on 2019/6/19.
*/
BI.HtmlLabel = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.HtmlLabel.superclass._defaultConfig.apply(this, arguments);
BI.AbstractLabel = BI.inherit(BI.Single, {
_defaultConfig: function (props) {
var conf = BI.AbstractLabel.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
@ -10815,24 +10811,28 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
rgap: 0,
tgap: 0,
bgap: 0,
text: ""
text: "",
highLight: false
});
},
_createJson: function () {
var o = this.options;
return {
type: "bi.html",
type: "bi.text",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value
value: o.value,
py: o.py,
keyword: o.keyword,
highLight: o.highLight
};
},
_init: function () {
BI.HtmlLabel.superclass._init.apply(this, arguments);
BI.AbstractLabel.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
@ -10844,6 +10844,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
@ -10873,7 +10874,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (o.whiteSpace == "normal") {
if (o.whiteSpace == "normal") { // 1.3
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
@ -10891,10 +10892,11 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -10906,7 +10908,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
}));
return;
}
BI.extend(json, {
BI.extend(json, { // 1.5
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
@ -10924,7 +10926,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { // 1.6
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
@ -10938,7 +10940,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (o.whiteSpace == "normal") {
if (o.whiteSpace == "normal") { // 1.7
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
@ -10956,10 +10958,11 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -10997,7 +11000,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
BI.createWidget({
type: adaptLayout,
height: o.height,
@ -11011,7 +11014,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
BI.createWidget({
BI.createWidget({ // 2.2
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -11029,7 +11032,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 2.3
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -11047,7 +11050,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({
BI.createWidget({ // 2.4
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -11065,7 +11068,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({
BI.createWidget({ // 2.5
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -11089,7 +11092,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, {
this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this,
hgap: o.hgap,
vgap: o.vgap,
@ -11119,13 +11122,12 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
},
_setEnable: function (enable) {
BI.HtmlLabel.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.element.removeClass("base-disabled disabled");
} else if (enable === false) {
this.element.addClass("base-disabled disabled");
}
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
@ -11150,14 +11152,35 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
},
setValue: function (v) {
BI.HtmlLabel.superclass.setValue.apply(this, arguments);
BI.AbstractLabel.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.HtmlLabel.superclass.populate.apply(this, arguments);
BI.AbstractLabel.superclass.populate.apply(this, arguments);
}
});/**
* Created by GUY on 2015/6/26.
*/
BI.HtmlLabel = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-html-label"
},
_createJson: function () {
var o = this.options;
return {
type: "bi.html",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value
};
}
});
@ -11206,26 +11229,12 @@ BI.shortcut("bi.icon_label", BI.IconLabel);/**
* Created by GUY on 2015/6/26.
*/
BI.Label = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Label.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
textHeight: null,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
keyword: "",
highLight: false
});
BI.Label = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-label",
py: "",
keyword: ""
},
_createJson: function () {
@ -11243,335 +11252,12 @@ BI.Label = BI.inherit(BI.Single, {
};
},
_init: function () {
BI.Label.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
} else {
this._createNotCenterEl();
}
},
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 1.1
BI.createWidget({
type: "bi.center_adapt",
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 1.2
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.3
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, { // 1.5
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
maxWidth: "100%"
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { // 1.6
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.7
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: true,
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: "bi.center_adapt",
element: this,
items: [this.text]
});
},
_createNotCenterEl: function () {
var o = this.options;
var adaptLayout = o.textAlign === "right" ? "bi.right_vertical_adapt" : "bi.vertical_adapt";
var json = this._createJson();
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
BI.createWidget({
type: adaptLayout,
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 2.2
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 2.3
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({ // 2.4
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [{
el: (this.text = BI.createWidget(json))
}]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({ // 2.5
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: adaptLayout,
element: this,
items: [this.text]
});
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
setText: function (v) {
this.options.text = v;
this.text.setText(v);
},
getText: function () {
return this.options.text;
},
setStyle: function (css) {
this.text.setStyle(css);
},
setValue: function (v) {
BI.Label.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.Label.superclass.populate.apply(this, arguments);
}
});

508
dist/bundle.ie.js vendored

@ -38415,24 +38415,22 @@ BI.Single = BI.inherit(BI.Widget, {
* @extends BI.Single
*/
BI.Text = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Text.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
});
props: {
baseCls: "bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
},
render: function () {
@ -47332,22 +47330,21 @@ BI.shortcut("bi.textarea_editor", BI.TextAreaEditor);/**
* @extends BI.Single
*/
BI.Html = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Html.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: ""
});
props: {
baseCls: "bi-html",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
highLight: false
},
render: function () {
@ -47403,16 +47400,15 @@ BI.Html = BI.inherit(BI.Single, {
} else {
this.text = this;
}
},
mounted: function () {
var o = this.options;
if (BI.isKey(o.text)) {
this.setText(o.text);
} else if (BI.isKey(o.value)) {
this.setText(o.value);
}
if (o.highLight) {
this.doHighLight();
}
},
doHighLight: function () {
@ -48681,14 +48677,14 @@ BI.Radio = BI.inherit(BI.BasicButton, {
BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
BI.shortcut("bi.radio", BI.Radio);/**
* Created by GUY on 2015/6/26.
* Created by dailer on 2019/6/19.
*/
BI.HtmlLabel = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.HtmlLabel.superclass._defaultConfig.apply(this, arguments);
BI.AbstractLabel = BI.inherit(BI.Single, {
_defaultConfig: function (props) {
var conf = BI.AbstractLabel.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
@ -48699,24 +48695,28 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
rgap: 0,
tgap: 0,
bgap: 0,
text: ""
text: "",
highLight: false
});
},
_createJson: function () {
var o = this.options;
return {
type: "bi.html",
type: "bi.text",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value
value: o.value,
py: o.py,
keyword: o.keyword,
highLight: o.highLight
};
},
_init: function () {
BI.HtmlLabel.superclass._init.apply(this, arguments);
BI.AbstractLabel.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
@ -48728,6 +48728,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
@ -48757,7 +48758,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (o.whiteSpace == "normal") {
if (o.whiteSpace == "normal") { // 1.3
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
@ -48775,10 +48776,11 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -48790,7 +48792,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
}));
return;
}
BI.extend(json, {
BI.extend(json, { // 1.5
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
@ -48808,7 +48810,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { // 1.6
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
@ -48822,7 +48824,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (o.whiteSpace == "normal") {
if (o.whiteSpace == "normal") { // 1.7
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
@ -48840,10 +48842,11 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -48881,7 +48884,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
BI.createWidget({
type: adaptLayout,
height: o.height,
@ -48895,7 +48898,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
BI.createWidget({
BI.createWidget({ // 2.2
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -48913,7 +48916,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 2.3
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -48931,7 +48934,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({
BI.createWidget({ // 2.4
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -48949,7 +48952,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({
BI.createWidget({ // 2.5
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -48973,7 +48976,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, {
this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this,
hgap: o.hgap,
vgap: o.vgap,
@ -49003,13 +49006,12 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
},
_setEnable: function (enable) {
BI.HtmlLabel.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.element.removeClass("base-disabled disabled");
} else if (enable === false) {
this.element.addClass("base-disabled disabled");
}
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
@ -49034,14 +49036,35 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
},
setValue: function (v) {
BI.HtmlLabel.superclass.setValue.apply(this, arguments);
BI.AbstractLabel.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.HtmlLabel.superclass.populate.apply(this, arguments);
BI.AbstractLabel.superclass.populate.apply(this, arguments);
}
});/**
* Created by GUY on 2015/6/26.
*/
BI.HtmlLabel = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-html-label"
},
_createJson: function () {
var o = this.options;
return {
type: "bi.html",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value
};
}
});
@ -49090,26 +49113,12 @@ BI.shortcut("bi.icon_label", BI.IconLabel);/**
* Created by GUY on 2015/6/26.
*/
BI.Label = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Label.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
textHeight: null,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
keyword: "",
highLight: false
});
BI.Label = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-label",
py: "",
keyword: ""
},
_createJson: function () {
@ -49127,335 +49136,12 @@ BI.Label = BI.inherit(BI.Single, {
};
},
_init: function () {
BI.Label.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
} else {
this._createNotCenterEl();
}
},
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 1.1
BI.createWidget({
type: "bi.center_adapt",
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 1.2
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.3
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, { // 1.5
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
maxWidth: "100%"
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { // 1.6
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.7
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: true,
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: "bi.center_adapt",
element: this,
items: [this.text]
});
},
_createNotCenterEl: function () {
var o = this.options;
var adaptLayout = o.textAlign === "right" ? "bi.right_vertical_adapt" : "bi.vertical_adapt";
var json = this._createJson();
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
BI.createWidget({
type: adaptLayout,
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 2.2
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 2.3
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({ // 2.4
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [{
el: (this.text = BI.createWidget(json))
}]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({ // 2.5
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: adaptLayout,
element: this,
items: [this.text]
});
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
setText: function (v) {
this.options.text = v;
this.text.setText(v);
},
getText: function () {
return this.options.text;
},
setStyle: function (css) {
this.text.setStyle(css);
},
setValue: function (v) {
BI.Label.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.Label.superclass.populate.apply(this, arguments);
}
});

60
dist/bundle.ie.min.js vendored

File diff suppressed because one or more lines are too long

508
dist/bundle.js vendored

@ -38819,24 +38819,22 @@ BI.Single = BI.inherit(BI.Widget, {
* @extends BI.Single
*/
BI.Text = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Text.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
});
props: {
baseCls: "bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
},
render: function () {
@ -47736,22 +47734,21 @@ BI.shortcut("bi.textarea_editor", BI.TextAreaEditor);/**
* @extends BI.Single
*/
BI.Html = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Html.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: ""
});
props: {
baseCls: "bi-html",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
highLight: false
},
render: function () {
@ -47807,16 +47804,15 @@ BI.Html = BI.inherit(BI.Single, {
} else {
this.text = this;
}
},
mounted: function () {
var o = this.options;
if (BI.isKey(o.text)) {
this.setText(o.text);
} else if (BI.isKey(o.value)) {
this.setText(o.value);
}
if (o.highLight) {
this.doHighLight();
}
},
doHighLight: function () {
@ -49085,14 +49081,14 @@ BI.Radio = BI.inherit(BI.BasicButton, {
BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
BI.shortcut("bi.radio", BI.Radio);/**
* Created by GUY on 2015/6/26.
* Created by dailer on 2019/6/19.
*/
BI.HtmlLabel = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.HtmlLabel.superclass._defaultConfig.apply(this, arguments);
BI.AbstractLabel = BI.inherit(BI.Single, {
_defaultConfig: function (props) {
var conf = BI.AbstractLabel.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
@ -49103,24 +49099,28 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
rgap: 0,
tgap: 0,
bgap: 0,
text: ""
text: "",
highLight: false
});
},
_createJson: function () {
var o = this.options;
return {
type: "bi.html",
type: "bi.text",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value
value: o.value,
py: o.py,
keyword: o.keyword,
highLight: o.highLight
};
},
_init: function () {
BI.HtmlLabel.superclass._init.apply(this, arguments);
BI.AbstractLabel.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
@ -49132,6 +49132,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
@ -49161,7 +49162,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (o.whiteSpace == "normal") {
if (o.whiteSpace == "normal") { // 1.3
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
@ -49179,10 +49180,11 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -49194,7 +49196,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
}));
return;
}
BI.extend(json, {
BI.extend(json, { // 1.5
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
@ -49212,7 +49214,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { // 1.6
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
@ -49226,7 +49228,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (o.whiteSpace == "normal") {
if (o.whiteSpace == "normal") { // 1.7
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
@ -49244,10 +49246,11 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -49285,7 +49288,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
BI.createWidget({
type: adaptLayout,
height: o.height,
@ -49299,7 +49302,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
BI.createWidget({
BI.createWidget({ // 2.2
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -49317,7 +49320,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 2.3
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -49335,7 +49338,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({
BI.createWidget({ // 2.4
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -49353,7 +49356,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({
BI.createWidget({ // 2.5
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -49377,7 +49380,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, {
this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this,
hgap: o.hgap,
vgap: o.vgap,
@ -49407,13 +49410,12 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
},
_setEnable: function (enable) {
BI.HtmlLabel.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.element.removeClass("base-disabled disabled");
} else if (enable === false) {
this.element.addClass("base-disabled disabled");
}
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
@ -49438,14 +49440,35 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
},
setValue: function (v) {
BI.HtmlLabel.superclass.setValue.apply(this, arguments);
BI.AbstractLabel.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.HtmlLabel.superclass.populate.apply(this, arguments);
BI.AbstractLabel.superclass.populate.apply(this, arguments);
}
});/**
* Created by GUY on 2015/6/26.
*/
BI.HtmlLabel = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-html-label"
},
_createJson: function () {
var o = this.options;
return {
type: "bi.html",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value
};
}
});
@ -49494,26 +49517,12 @@ BI.shortcut("bi.icon_label", BI.IconLabel);/**
* Created by GUY on 2015/6/26.
*/
BI.Label = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Label.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
textHeight: null,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
keyword: "",
highLight: false
});
BI.Label = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-label",
py: "",
keyword: ""
},
_createJson: function () {
@ -49531,335 +49540,12 @@ BI.Label = BI.inherit(BI.Single, {
};
},
_init: function () {
BI.Label.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
} else {
this._createNotCenterEl();
}
},
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 1.1
BI.createWidget({
type: "bi.center_adapt",
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 1.2
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.3
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, { // 1.5
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
maxWidth: "100%"
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { // 1.6
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.7
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: true,
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: "bi.center_adapt",
element: this,
items: [this.text]
});
},
_createNotCenterEl: function () {
var o = this.options;
var adaptLayout = o.textAlign === "right" ? "bi.right_vertical_adapt" : "bi.vertical_adapt";
var json = this._createJson();
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
BI.createWidget({
type: adaptLayout,
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 2.2
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 2.3
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({ // 2.4
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [{
el: (this.text = BI.createWidget(json))
}]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({ // 2.5
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: adaptLayout,
element: this,
items: [this.text]
});
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
setText: function (v) {
this.options.text = v;
this.text.setText(v);
},
getText: function () {
return this.options.text;
},
setStyle: function (css) {
this.text.setStyle(css);
},
setValue: function (v) {
BI.Label.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.Label.superclass.populate.apply(this, arguments);
}
});

60
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

508
dist/fineui.ie.js vendored

@ -38660,24 +38660,22 @@ BI.Single = BI.inherit(BI.Widget, {
* @extends BI.Single
*/
BI.Text = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Text.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
});
props: {
baseCls: "bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
},
render: function () {
@ -47577,22 +47575,21 @@ BI.shortcut("bi.textarea_editor", BI.TextAreaEditor);/**
* @extends BI.Single
*/
BI.Html = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Html.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: ""
});
props: {
baseCls: "bi-html",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
highLight: false
},
render: function () {
@ -47648,16 +47645,15 @@ BI.Html = BI.inherit(BI.Single, {
} else {
this.text = this;
}
},
mounted: function () {
var o = this.options;
if (BI.isKey(o.text)) {
this.setText(o.text);
} else if (BI.isKey(o.value)) {
this.setText(o.value);
}
if (o.highLight) {
this.doHighLight();
}
},
doHighLight: function () {
@ -48926,14 +48922,14 @@ BI.Radio = BI.inherit(BI.BasicButton, {
BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
BI.shortcut("bi.radio", BI.Radio);/**
* Created by GUY on 2015/6/26.
* Created by dailer on 2019/6/19.
*/
BI.HtmlLabel = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.HtmlLabel.superclass._defaultConfig.apply(this, arguments);
BI.AbstractLabel = BI.inherit(BI.Single, {
_defaultConfig: function (props) {
var conf = BI.AbstractLabel.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
@ -48944,24 +48940,28 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
rgap: 0,
tgap: 0,
bgap: 0,
text: ""
text: "",
highLight: false
});
},
_createJson: function () {
var o = this.options;
return {
type: "bi.html",
type: "bi.text",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value
value: o.value,
py: o.py,
keyword: o.keyword,
highLight: o.highLight
};
},
_init: function () {
BI.HtmlLabel.superclass._init.apply(this, arguments);
BI.AbstractLabel.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
@ -48973,6 +48973,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
@ -49002,7 +49003,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (o.whiteSpace == "normal") {
if (o.whiteSpace == "normal") { // 1.3
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
@ -49020,10 +49021,11 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -49035,7 +49037,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
}));
return;
}
BI.extend(json, {
BI.extend(json, { // 1.5
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
@ -49053,7 +49055,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { // 1.6
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
@ -49067,7 +49069,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (o.whiteSpace == "normal") {
if (o.whiteSpace == "normal") { // 1.7
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
@ -49085,10 +49087,11 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -49126,7 +49129,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
BI.createWidget({
type: adaptLayout,
height: o.height,
@ -49140,7 +49143,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
BI.createWidget({
BI.createWidget({ // 2.2
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -49158,7 +49161,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 2.3
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -49176,7 +49179,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({
BI.createWidget({ // 2.4
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -49194,7 +49197,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({
BI.createWidget({ // 2.5
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -49218,7 +49221,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, {
this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this,
hgap: o.hgap,
vgap: o.vgap,
@ -49248,13 +49251,12 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
},
_setEnable: function (enable) {
BI.HtmlLabel.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.element.removeClass("base-disabled disabled");
} else if (enable === false) {
this.element.addClass("base-disabled disabled");
}
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
@ -49279,14 +49281,35 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
},
setValue: function (v) {
BI.HtmlLabel.superclass.setValue.apply(this, arguments);
BI.AbstractLabel.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.HtmlLabel.superclass.populate.apply(this, arguments);
BI.AbstractLabel.superclass.populate.apply(this, arguments);
}
});/**
* Created by GUY on 2015/6/26.
*/
BI.HtmlLabel = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-html-label"
},
_createJson: function () {
var o = this.options;
return {
type: "bi.html",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value
};
}
});
@ -49335,26 +49358,12 @@ BI.shortcut("bi.icon_label", BI.IconLabel);/**
* Created by GUY on 2015/6/26.
*/
BI.Label = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Label.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
textHeight: null,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
keyword: "",
highLight: false
});
BI.Label = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-label",
py: "",
keyword: ""
},
_createJson: function () {
@ -49372,335 +49381,12 @@ BI.Label = BI.inherit(BI.Single, {
};
},
_init: function () {
BI.Label.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
} else {
this._createNotCenterEl();
}
},
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 1.1
BI.createWidget({
type: "bi.center_adapt",
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 1.2
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.3
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, { // 1.5
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
maxWidth: "100%"
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { // 1.6
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.7
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: true,
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: "bi.center_adapt",
element: this,
items: [this.text]
});
},
_createNotCenterEl: function () {
var o = this.options;
var adaptLayout = o.textAlign === "right" ? "bi.right_vertical_adapt" : "bi.vertical_adapt";
var json = this._createJson();
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
BI.createWidget({
type: adaptLayout,
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 2.2
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 2.3
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({ // 2.4
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [{
el: (this.text = BI.createWidget(json))
}]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({ // 2.5
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: adaptLayout,
element: this,
items: [this.text]
});
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
setText: function (v) {
this.options.text = v;
this.text.setText(v);
},
getText: function () {
return this.options.text;
},
setStyle: function (css) {
this.text.setStyle(css);
},
setValue: function (v) {
BI.Label.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.Label.superclass.populate.apply(this, arguments);
}
});

60
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

508
dist/fineui.js vendored

@ -39064,24 +39064,22 @@ BI.Single = BI.inherit(BI.Widget, {
* @extends BI.Single
*/
BI.Text = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Text.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
});
props: {
baseCls: "bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
},
render: function () {
@ -47981,22 +47979,21 @@ BI.shortcut("bi.textarea_editor", BI.TextAreaEditor);/**
* @extends BI.Single
*/
BI.Html = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Html.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: ""
});
props: {
baseCls: "bi-html",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
highLight: false
},
render: function () {
@ -48052,16 +48049,15 @@ BI.Html = BI.inherit(BI.Single, {
} else {
this.text = this;
}
},
mounted: function () {
var o = this.options;
if (BI.isKey(o.text)) {
this.setText(o.text);
} else if (BI.isKey(o.value)) {
this.setText(o.value);
}
if (o.highLight) {
this.doHighLight();
}
},
doHighLight: function () {
@ -49330,14 +49326,14 @@ BI.Radio = BI.inherit(BI.BasicButton, {
BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
BI.shortcut("bi.radio", BI.Radio);/**
* Created by GUY on 2015/6/26.
* Created by dailer on 2019/6/19.
*/
BI.HtmlLabel = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.HtmlLabel.superclass._defaultConfig.apply(this, arguments);
BI.AbstractLabel = BI.inherit(BI.Single, {
_defaultConfig: function (props) {
var conf = BI.AbstractLabel.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
@ -49348,24 +49344,28 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
rgap: 0,
tgap: 0,
bgap: 0,
text: ""
text: "",
highLight: false
});
},
_createJson: function () {
var o = this.options;
return {
type: "bi.html",
type: "bi.text",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value
value: o.value,
py: o.py,
keyword: o.keyword,
highLight: o.highLight
};
},
_init: function () {
BI.HtmlLabel.superclass._init.apply(this, arguments);
BI.AbstractLabel.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
@ -49377,6 +49377,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
@ -49406,7 +49407,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (o.whiteSpace == "normal") {
if (o.whiteSpace == "normal") { // 1.3
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
@ -49424,10 +49425,11 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -49439,7 +49441,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
}));
return;
}
BI.extend(json, {
BI.extend(json, { // 1.5
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
@ -49457,7 +49459,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { // 1.6
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
@ -49471,7 +49473,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (o.whiteSpace == "normal") {
if (o.whiteSpace == "normal") { // 1.7
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
@ -49489,10 +49491,11 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -49530,7 +49533,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
BI.createWidget({
type: adaptLayout,
height: o.height,
@ -49544,7 +49547,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
BI.createWidget({
BI.createWidget({ // 2.2
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -49562,7 +49565,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 2.3
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -49580,7 +49583,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({
BI.createWidget({ // 2.4
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -49598,7 +49601,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({
BI.createWidget({ // 2.5
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -49622,7 +49625,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, {
this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this,
hgap: o.hgap,
vgap: o.vgap,
@ -49652,13 +49655,12 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
},
_setEnable: function (enable) {
BI.HtmlLabel.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.element.removeClass("base-disabled disabled");
} else if (enable === false) {
this.element.addClass("base-disabled disabled");
}
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
@ -49683,14 +49685,35 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
},
setValue: function (v) {
BI.HtmlLabel.superclass.setValue.apply(this, arguments);
BI.AbstractLabel.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.HtmlLabel.superclass.populate.apply(this, arguments);
BI.AbstractLabel.superclass.populate.apply(this, arguments);
}
});/**
* Created by GUY on 2015/6/26.
*/
BI.HtmlLabel = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-html-label"
},
_createJson: function () {
var o = this.options;
return {
type: "bi.html",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value
};
}
});
@ -49739,26 +49762,12 @@ BI.shortcut("bi.icon_label", BI.IconLabel);/**
* Created by GUY on 2015/6/26.
*/
BI.Label = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Label.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
textHeight: null,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
keyword: "",
highLight: false
});
BI.Label = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-label",
py: "",
keyword: ""
},
_createJson: function () {
@ -49776,335 +49785,12 @@ BI.Label = BI.inherit(BI.Single, {
};
},
_init: function () {
BI.Label.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
} else {
this._createNotCenterEl();
}
},
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 1.1
BI.createWidget({
type: "bi.center_adapt",
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 1.2
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.3
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, { // 1.5
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
maxWidth: "100%"
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { // 1.6
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.7
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: true,
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: "bi.center_adapt",
element: this,
items: [this.text]
});
},
_createNotCenterEl: function () {
var o = this.options;
var adaptLayout = o.textAlign === "right" ? "bi.right_vertical_adapt" : "bi.vertical_adapt";
var json = this._createJson();
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
BI.createWidget({
type: adaptLayout,
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 2.2
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 2.3
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({ // 2.4
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [{
el: (this.text = BI.createWidget(json))
}]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({ // 2.5
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: adaptLayout,
element: this,
items: [this.text]
});
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
setText: function (v) {
this.options.text = v;
this.text.setText(v);
},
getText: function () {
return this.options.text;
},
setStyle: function (css) {
this.text.setStyle(css);
},
setValue: function (v) {
BI.Label.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.Label.superclass.populate.apply(this, arguments);
}
});

60
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

508
dist/fineui_without_jquery_polyfill.js vendored

@ -27442,24 +27442,22 @@ BI.Single = BI.inherit(BI.Widget, {
* @extends BI.Single
*/
BI.Text = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Text.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
});
props: {
baseCls: "bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
},
render: function () {
@ -35107,22 +35105,21 @@ BI.shortcut("bi.textarea_editor", BI.TextAreaEditor);/**
* @extends BI.Single
*/
BI.Html = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Html.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: ""
});
props: {
baseCls: "bi-html",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
highLight: false
},
render: function () {
@ -35178,16 +35175,15 @@ BI.Html = BI.inherit(BI.Single, {
} else {
this.text = this;
}
},
mounted: function () {
var o = this.options;
if (BI.isKey(o.text)) {
this.setText(o.text);
} else if (BI.isKey(o.value)) {
this.setText(o.value);
}
if (o.highLight) {
this.doHighLight();
}
},
doHighLight: function () {
@ -35831,14 +35827,14 @@ BI.Radio = BI.inherit(BI.BasicButton, {
BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
BI.shortcut("bi.radio", BI.Radio);/**
* Created by GUY on 2015/6/26.
* Created by dailer on 2019/6/19.
*/
BI.HtmlLabel = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.HtmlLabel.superclass._defaultConfig.apply(this, arguments);
BI.AbstractLabel = BI.inherit(BI.Single, {
_defaultConfig: function (props) {
var conf = BI.AbstractLabel.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
@ -35849,24 +35845,28 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
rgap: 0,
tgap: 0,
bgap: 0,
text: ""
text: "",
highLight: false
});
},
_createJson: function () {
var o = this.options;
return {
type: "bi.html",
type: "bi.text",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value
value: o.value,
py: o.py,
keyword: o.keyword,
highLight: o.highLight
};
},
_init: function () {
BI.HtmlLabel.superclass._init.apply(this, arguments);
BI.AbstractLabel.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
@ -35878,6 +35878,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
@ -35907,7 +35908,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (o.whiteSpace == "normal") {
if (o.whiteSpace == "normal") { // 1.3
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
@ -35925,10 +35926,11 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -35940,7 +35942,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
}));
return;
}
BI.extend(json, {
BI.extend(json, { // 1.5
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
@ -35958,7 +35960,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { // 1.6
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
@ -35972,7 +35974,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (o.whiteSpace == "normal") {
if (o.whiteSpace == "normal") { // 1.7
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
@ -35990,10 +35992,11 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -36031,7 +36034,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
BI.createWidget({
type: adaptLayout,
height: o.height,
@ -36045,7 +36048,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
BI.createWidget({
BI.createWidget({ // 2.2
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -36063,7 +36066,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (BI.isNumber(o.height) && o.height > 0) { // 2.3
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
@ -36081,7 +36084,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({
BI.createWidget({ // 2.4
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -36099,7 +36102,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({
BI.createWidget({ // 2.5
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -36123,7 +36126,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, {
this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this,
hgap: o.hgap,
vgap: o.vgap,
@ -36153,13 +36156,12 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
});
},
_setEnable: function (enable) {
BI.HtmlLabel.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.element.removeClass("base-disabled disabled");
} else if (enable === false) {
this.element.addClass("base-disabled disabled");
}
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
@ -36184,14 +36186,35 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
},
setValue: function (v) {
BI.HtmlLabel.superclass.setValue.apply(this, arguments);
BI.AbstractLabel.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.HtmlLabel.superclass.populate.apply(this, arguments);
BI.AbstractLabel.superclass.populate.apply(this, arguments);
}
});/**
* Created by GUY on 2015/6/26.
*/
BI.HtmlLabel = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-html-label"
},
_createJson: function () {
var o = this.options;
return {
type: "bi.html",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value
};
}
});
@ -36240,26 +36263,12 @@ BI.shortcut("bi.icon_label", BI.IconLabel);/**
* Created by GUY on 2015/6/26.
*/
BI.Label = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Label.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
textHeight: null,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
keyword: "",
highLight: false
});
BI.Label = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-label",
py: "",
keyword: ""
},
_createJson: function () {
@ -36277,335 +36286,12 @@ BI.Label = BI.inherit(BI.Single, {
};
},
_init: function () {
BI.Label.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
} else {
this._createNotCenterEl();
}
},
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 1.1
BI.createWidget({
type: "bi.center_adapt",
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 1.2
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.3
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, { // 1.5
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
maxWidth: "100%"
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { // 1.6
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.7
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: true,
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: "bi.center_adapt",
element: this,
items: [this.text]
});
},
_createNotCenterEl: function () {
var o = this.options;
var adaptLayout = o.textAlign === "right" ? "bi.right_vertical_adapt" : "bi.vertical_adapt";
var json = this._createJson();
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
BI.createWidget({
type: adaptLayout,
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 2.2
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 2.3
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({ // 2.4
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [{
el: (this.text = BI.createWidget(json))
}]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({ // 2.5
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: adaptLayout,
element: this,
items: [this.text]
});
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
setText: function (v) {
this.options.text = v;
this.text.setText(v);
},
getText: function () {
return this.options.text;
},
setStyle: function (css) {
this.text.setStyle(css);
},
setValue: function (v) {
BI.Label.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.Label.superclass.populate.apply(this, arguments);
}
});

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

38
src/base/single/html/html.js

@ -4,22 +4,21 @@
* @extends BI.Single
*/
BI.Html = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Html.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: ""
});
props: {
baseCls: "bi-html",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
highLight: false
},
render: function () {
@ -75,16 +74,15 @@ BI.Html = BI.inherit(BI.Single, {
} else {
this.text = this;
}
},
mounted: function () {
var o = this.options;
if (BI.isKey(o.text)) {
this.setText(o.text);
} else if (BI.isKey(o.value)) {
this.setText(o.value);
}
if (o.highLight) {
this.doHighLight();
}
},
doHighLight: function () {

370
src/base/single/label/abstract.label.js

@ -0,0 +1,370 @@
/**
* Created by dailer on 2019/6/19.
*/
BI.AbstractLabel = BI.inherit(BI.Single, {
_defaultConfig: function (props) {
var conf = BI.AbstractLabel.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
textHeight: null,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
highLight: false
});
},
_createJson: function () {
var o = this.options;
return {
type: "bi.text",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword,
highLight: o.highLight
};
},
_init: function () {
BI.AbstractLabel.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
} else {
this._createNotCenterEl();
}
},
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 1.1
BI.createWidget({
type: "bi.center_adapt",
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 1.2
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.3
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, { // 1.5
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
maxWidth: "100%"
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { // 1.6
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.7
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: true,
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: "bi.center_adapt",
element: this,
items: [this.text]
});
},
_createNotCenterEl: function () {
var o = this.options;
var adaptLayout = o.textAlign === "right" ? "bi.right_vertical_adapt" : "bi.vertical_adapt";
var json = this._createJson();
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
BI.createWidget({
type: adaptLayout,
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 2.2
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 2.3
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({ // 2.4
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [{
el: (this.text = BI.createWidget(json))
}]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({ // 2.5
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: adaptLayout,
element: this,
items: [this.text]
});
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
setText: function (v) {
this.options.text = v;
this.text.setText(v);
},
getText: function () {
return this.options.text;
},
setStyle: function (css) {
this.text.setStyle(css);
},
setValue: function (v) {
BI.AbstractLabel.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.AbstractLabel.superclass.populate.apply(this, arguments);
}
});

350
src/base/single/label/html.label.js

@ -2,23 +2,10 @@
* Created by GUY on 2015/6/26.
*/
BI.HtmlLabel = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.HtmlLabel.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
textHeight: null,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: ""
});
BI.HtmlLabel = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-html-label"
},
_createJson: function () {
@ -31,335 +18,6 @@ BI.HtmlLabel = BI.inherit(BI.Single, {
text: o.text,
value: o.value
};
},
_init: function () {
BI.HtmlLabel.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
} else {
this._createNotCenterEl();
}
},
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 1.1
BI.createWidget({
type: "bi.center_adapt",
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 1.2
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") {
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
this.element.css({
"line-height": o.height + "px"
});
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
maxWidth: "100%"
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") {
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: true,
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
this.element.css({
"line-height": o.height + "px"
});
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: "bi.center_adapt",
element: this,
items: [this.text]
});
},
_createNotCenterEl: function () {
var o = this.options;
var adaptLayout = o.textAlign === "right" ? "bi.right_vertical_adapt" : "bi.vertical_adapt";
var json = this._createJson();
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) {
BI.createWidget({
type: adaptLayout,
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [{
el: (this.text = BI.createWidget(json))
}]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: adaptLayout,
element: this,
items: [this.text]
});
},
_setEnable: function (enable) {
BI.HtmlLabel.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.element.removeClass("base-disabled disabled");
} else if (enable === false) {
this.element.addClass("base-disabled disabled");
}
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
setText: function (v) {
this.options.text = v;
this.text.setText(v);
},
getText: function () {
return this.options.text;
},
setStyle: function (css) {
this.text.setStyle(css);
},
setValue: function (v) {
BI.HtmlLabel.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.HtmlLabel.superclass.populate.apply(this, arguments);
}
});

349
src/base/single/label/label.js

@ -2,26 +2,12 @@
* Created by GUY on 2015/6/26.
*/
BI.Label = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Label.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
textHeight: null,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
keyword: "",
highLight: false
});
BI.Label = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-label",
py: "",
keyword: ""
},
_createJson: function () {
@ -39,335 +25,12 @@ BI.Label = BI.inherit(BI.Single, {
};
},
_init: function () {
BI.Label.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
} else {
this._createNotCenterEl();
}
},
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 1.1
BI.createWidget({
type: "bi.center_adapt",
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 1.2
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.3
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, { // 1.5
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
maxWidth: "100%"
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { // 1.6
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.7
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: true,
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: "bi.center_adapt",
element: this,
items: [this.text]
});
},
_createNotCenterEl: function () {
var o = this.options;
var adaptLayout = o.textAlign === "right" ? "bi.right_vertical_adapt" : "bi.vertical_adapt";
var json = this._createJson();
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
BI.createWidget({
type: adaptLayout,
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 2.2
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 2.3
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({ // 2.4
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [{
el: (this.text = BI.createWidget(json))
}]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({ // 2.5
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: adaptLayout,
element: this,
items: [this.text]
});
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
setText: function (v) {
this.options.text = v;
this.text.setText(v);
},
getText: function () {
return this.options.text;
},
setStyle: function (css) {
this.text.setStyle(css);
},
setValue: function (v) {
BI.Label.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.Label.superclass.populate.apply(this, arguments);
}
});

34
src/base/single/text.js

@ -4,24 +4,22 @@
* @extends BI.Single
*/
BI.Text = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Text.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
});
props: {
baseCls: "bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
},
render: function () {

Loading…
Cancel
Save