Browse Source

Merge pull request #828 in VISUAL/fineui from ~WINDY/fineui:master to master

* commit '3f9149df849f8348831f755acf4bd0e6beb88c6b':
  update
  无JIRA任务 textAlign: center的label换行左对齐
  BI-39432 && label加了个接口
master
windy 6 years ago
parent
commit
2d9c44a640
  1. 7
      dist/base.js
  2. 10
      dist/bundle.ie.js
  3. 26
      dist/bundle.ie.min.js
  4. 10
      dist/bundle.js
  5. 26
      dist/bundle.min.js
  6. 3
      dist/core.js
  7. 25
      dist/demo.js
  8. 10
      dist/fineui.ie.js
  9. 26
      dist/fineui.ie.min.js
  10. 10
      dist/fineui.js
  11. 26
      dist/fineui.min.js
  12. 10
      dist/fineui_without_jquery_polyfill.js
  13. 2
      dist/utils.min.js
  14. 7
      src/base/single/label/label.js
  15. 3
      src/core/controller/controller.tooltips.js

7
dist/base.js vendored

@ -10830,6 +10830,7 @@ BI.Label = 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) {
if (BI.isNumber(o.height) && o.height > 0) {
@ -10853,6 +10854,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.textWidth;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -10900,6 +10902,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -10971,6 +10974,8 @@ BI.Label = BI.inherit(BI.Single, {
this.element.css({
"line-height": o.height + "px"
});
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));
@ -10998,6 +11003,8 @@ BI.Label = BI.inherit(BI.Single, {
});
return;
}
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));

10
dist/bundle.ie.js vendored

@ -17256,7 +17256,8 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
if (x + tooltip.element.outerWidth() > BI.Widget._renderEngine.createElement("body").outerWidth()) {
x -= tooltip.element.outerWidth() + 15;
}
if (y + tooltip.element.outerHeight() > BI.Widget._renderEngine.createElement("body").outerHeight()) {
var bodyHeight = BI.Widget._renderEngine.createElement("body").outerHeight();
if (y + tooltip.element.outerHeight() > bodyHeight || top + tooltip.element.outerHeight() > bodyHeight) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {
@ -45925,6 +45926,7 @@ BI.Label = 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) {
if (BI.isNumber(o.height) && o.height > 0) {
@ -45948,6 +45950,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.textWidth;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -45995,6 +45998,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -46066,6 +46070,8 @@ BI.Label = BI.inherit(BI.Single, {
this.element.css({
"line-height": o.height + "px"
});
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));
@ -46093,6 +46099,8 @@ BI.Label = BI.inherit(BI.Single, {
});
return;
}
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));

26
dist/bundle.ie.min.js vendored

File diff suppressed because one or more lines are too long

10
dist/bundle.js vendored

@ -17256,7 +17256,8 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
if (x + tooltip.element.outerWidth() > BI.Widget._renderEngine.createElement("body").outerWidth()) {
x -= tooltip.element.outerWidth() + 15;
}
if (y + tooltip.element.outerHeight() > BI.Widget._renderEngine.createElement("body").outerHeight()) {
var bodyHeight = BI.Widget._renderEngine.createElement("body").outerHeight();
if (y + tooltip.element.outerHeight() > bodyHeight || top + tooltip.element.outerHeight() > bodyHeight) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {
@ -46329,6 +46330,7 @@ BI.Label = 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) {
if (BI.isNumber(o.height) && o.height > 0) {
@ -46352,6 +46354,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.textWidth;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -46399,6 +46402,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -46470,6 +46474,8 @@ BI.Label = BI.inherit(BI.Single, {
this.element.css({
"line-height": o.height + "px"
});
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));
@ -46497,6 +46503,8 @@ BI.Label = BI.inherit(BI.Single, {
});
return;
}
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));

26
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

3
dist/core.js vendored

@ -17256,7 +17256,8 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
if (x + tooltip.element.outerWidth() > BI.Widget._renderEngine.createElement("body").outerWidth()) {
x -= tooltip.element.outerWidth() + 15;
}
if (y + tooltip.element.outerHeight() > BI.Widget._renderEngine.createElement("body").outerHeight()) {
var bodyHeight = BI.Widget._renderEngine.createElement("body").outerHeight();
if (y + tooltip.element.outerHeight() > bodyHeight || top + tooltip.element.outerHeight() > bodyHeight) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {

25
dist/demo.js vendored

@ -6158,7 +6158,30 @@ Demo.HtapeLayout = BI.inherit(BI.Widget, {
};
}
});
BI.shortcut("demo.htape", Demo.HtapeLayout);/**
BI.shortcut("demo.htape", Demo.HtapeLayout);Demo.InlineVerticalLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-absolute"
},
render: function () {
return {
type: "bi.inline_vertical_adapt",
items: [{
type: "bi.label",
text: "绝对布局",
cls: "layout-bg1",
width: 300,
height: 200
}, {
type: "bi.label",
text: "绝对布局",
cls: "layout-bg1",
width: 300,
height: 100
}]
};
}
});
BI.shortcut("demo.inline_vertical", Demo.InlineVerticalLayout);/**
* Created by User on 2017/3/22.
*/
Demo.LeftRightVerticalAdaptLayout = BI.inherit(BI.Widget, {

10
dist/fineui.ie.js vendored

@ -17501,7 +17501,8 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
if (x + tooltip.element.outerWidth() > BI.Widget._renderEngine.createElement("body").outerWidth()) {
x -= tooltip.element.outerWidth() + 15;
}
if (y + tooltip.element.outerHeight() > BI.Widget._renderEngine.createElement("body").outerHeight()) {
var bodyHeight = BI.Widget._renderEngine.createElement("body").outerHeight();
if (y + tooltip.element.outerHeight() > bodyHeight || top + tooltip.element.outerHeight() > bodyHeight) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {
@ -46170,6 +46171,7 @@ BI.Label = 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) {
if (BI.isNumber(o.height) && o.height > 0) {
@ -46193,6 +46195,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.textWidth;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -46240,6 +46243,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -46311,6 +46315,8 @@ BI.Label = BI.inherit(BI.Single, {
this.element.css({
"line-height": o.height + "px"
});
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));
@ -46338,6 +46344,8 @@ BI.Label = BI.inherit(BI.Single, {
});
return;
}
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));

26
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

10
dist/fineui.js vendored

@ -17501,7 +17501,8 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
if (x + tooltip.element.outerWidth() > BI.Widget._renderEngine.createElement("body").outerWidth()) {
x -= tooltip.element.outerWidth() + 15;
}
if (y + tooltip.element.outerHeight() > BI.Widget._renderEngine.createElement("body").outerHeight()) {
var bodyHeight = BI.Widget._renderEngine.createElement("body").outerHeight();
if (y + tooltip.element.outerHeight() > bodyHeight || top + tooltip.element.outerHeight() > bodyHeight) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {
@ -46574,6 +46575,7 @@ BI.Label = 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) {
if (BI.isNumber(o.height) && o.height > 0) {
@ -46597,6 +46599,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.textWidth;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -46644,6 +46647,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -46715,6 +46719,8 @@ BI.Label = BI.inherit(BI.Single, {
this.element.css({
"line-height": o.height + "px"
});
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));
@ -46742,6 +46748,8 @@ BI.Label = BI.inherit(BI.Single, {
});
return;
}
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));

26
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

10
dist/fineui_without_jquery_polyfill.js vendored

@ -17002,7 +17002,8 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
if (x + tooltip.element.outerWidth() > BI.Widget._renderEngine.createElement("body").outerWidth()) {
x -= tooltip.element.outerWidth() + 15;
}
if (y + tooltip.element.outerHeight() > BI.Widget._renderEngine.createElement("body").outerHeight()) {
var bodyHeight = BI.Widget._renderEngine.createElement("body").outerHeight();
if (y + tooltip.element.outerHeight() > bodyHeight || top + tooltip.element.outerHeight() > bodyHeight) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {
@ -33556,6 +33557,7 @@ BI.Label = 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) {
if (BI.isNumber(o.height) && o.height > 0) {
@ -33579,6 +33581,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.textWidth;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -33626,6 +33629,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -33697,6 +33701,8 @@ BI.Label = BI.inherit(BI.Single, {
this.element.css({
"line-height": o.height + "px"
});
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));
@ -33724,6 +33730,8 @@ BI.Label = BI.inherit(BI.Single, {
});
return;
}
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

7
src/base/single/label/label.js

@ -51,6 +51,7 @@ BI.Label = 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) {
if (BI.isNumber(o.height) && o.height > 0) {
@ -74,6 +75,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.textWidth;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -121,6 +123,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -192,6 +195,8 @@ BI.Label = BI.inherit(BI.Single, {
this.element.css({
"line-height": o.height + "px"
});
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));
@ -219,6 +224,8 @@ BI.Label = BI.inherit(BI.Single, {
});
return;
}
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));

3
src/core/controller/controller.tooltips.js

@ -92,7 +92,8 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
if (x + tooltip.element.outerWidth() > BI.Widget._renderEngine.createElement("body").outerWidth()) {
x -= tooltip.element.outerWidth() + 15;
}
if (y + tooltip.element.outerHeight() > BI.Widget._renderEngine.createElement("body").outerHeight()) {
var bodyHeight = BI.Widget._renderEngine.createElement("body").outerHeight();
if (y + tooltip.element.outerHeight() > bodyHeight || top + tooltip.element.outerHeight() > bodyHeight) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {

Loading…
Cancel
Save