Browse Source

Pull request #2472: 无JIRA任务 node家族

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit '5f9214c9ad9072c003c1de742f0b07d14e4be8a6':
  node家族
es6
guy 3 years ago
parent
commit
697897441b
  1. 54
      src/base/single/button/node/icontexticonnode.js
  2. 34
      src/base/single/button/node/icontextnode.js
  3. 26
      src/base/single/button/node/texticonnode.js

54
src/base/single/button/node/icontexticonnode.js

@ -25,9 +25,23 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, {
}, },
render: function () { render: function () {
var o = this.options, c = this._const; var self = this, o = this.options;
this.text = BI.createWidget({
return {
type: "bi.vertical_adapt",
columnSize: [o.leftIconWrapperWidth || o.height, "fill", o.rightIconWrapperWidth || o.height],
items: [{
type: "bi.icon_label",
cls: o.iconCls1,
width: o.leftIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}, {
type: "bi.label", type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
textAlign: "left", textAlign: "left",
hgap: o.textHgap, hgap: o.textHgap,
vgap: o.textVgap, vgap: o.textVgap,
@ -37,43 +51,15 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, {
value: o.value, value: o.value,
keyword: o.keyword, keyword: o.keyword,
height: o.height height: o.height
}); }, {
var icon1 = BI.createWidget({
type: "bi.icon_label",
cls: o.iconCls1,
width: o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
var blank = BI.createWidget({
type: "bi.layout",
width: o.height,
height: o.height
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.icon_label", type: "bi.icon_label",
cls: o.iconCls2, cls: o.iconCls2,
width: o.height, width: o.rightIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth, iconWidth: o.iconWidth,
iconHeight: o.iconHeight iconHeight: o.iconHeight
},
top: 0,
bottom: 0,
right: 0
}] }]
}); };
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", icon1, this.text, blank)
}))));
}, },
doClick: function () { doClick: function () {

34
src/base/single/button/node/icontextnode.js

@ -24,9 +24,23 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, {
}, },
render: function () { render: function () {
var o = this.options, c = this._const; var self = this, o = this.options;
this.text = BI.createWidget({
return {
type: "bi.vertical_adapt",
columnSize: [o.iconWrapperWidth || o.height, "fill"],
items: [{
type: "bi.icon_label",
cls: o.iconCls,
width: o.iconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}, {
type: "bi.label", type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
cls: "list-item-text", cls: "list-item-text",
textAlign: "left", textAlign: "left",
hgap: o.textHgap, hgap: o.textHgap,
@ -37,20 +51,8 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, {
value: o.value, value: o.value,
keyword: o.keyword, keyword: o.keyword,
height: o.height height: o.height
}); }]
this.icon = BI.createWidget({ };
type: "bi.icon_label",
width: o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", this.icon, this.text)
}))));
}, },
doClick: function () { doClick: function () {

26
src/base/single/button/node/texticonnode.js

@ -23,9 +23,16 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, {
}, },
render: function () { render: function () {
var o = this.options, c = this._const; var self = this, o = this.options;
this.text = BI.createWidget({
return {
type: "bi.vertical_adapt",
columnSize: ["fill", o.iconWrapperWidth || o.height],
items: [{
type: "bi.label", type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
cls: "list-item-text", cls: "list-item-text",
textAlign: "left", textAlign: "left",
hgap: o.textHgap, hgap: o.textHgap,
@ -36,20 +43,15 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, {
value: o.value, value: o.value,
keyword: o.keyword, keyword: o.keyword,
height: o.height height: o.height
}); }, {
this.icon = BI.createWidget({
type: "bi.icon_label", type: "bi.icon_label",
width: o.height, cls: o.iconCls,
width: o.iconWrapperWidth || o.height,
height: o.height, height: o.height,
iconWidth: o.iconWidth, iconWidth: o.iconWidth,
iconHeight: o.iconHeight iconHeight: o.iconHeight
}); }]
};
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", this.text, this.icon)
}))));
}, },
doClick: function () { doClick: function () {

Loading…
Cancel
Save