Browse Source

icon_text_item族

es6
guy 3 years ago
parent
commit
432735f0e6
  1. 55
      src/base/single/button/listitem/blankiconicontextitem.js
  2. 57
      src/base/single/button/listitem/blankicontexticonitem.js
  3. 28
      src/base/single/button/listitem/blankicontextitem.js
  4. 50
      src/base/single/button/listitem/icontexticonitem.js
  5. 35
      src/base/single/button/listitem/icontextitem.js
  6. 26
      src/base/single/button/listitem/texticonitem.js

55
src/base/single/button/listitem/blankiconicontextitem.js

@ -27,15 +27,33 @@ BI.BlankIconIconTextItem = BI.inherit(BI.BasicButton, {
}, },
render: function () { render: function () {
var o = this.options, c = this._const; var self = this, o = this.options;
var blank = BI.createWidget({
return {
type: "bi.vertical_adapt",
columnSize: [o.blankWidth, o.leftIconWrapperWidth || o.height, o.rightIconWrapperWidth || o.height, "fill"],
items: [{
type: "bi.layout", type: "bi.layout",
width: o.blankWidth, width: o.blankWidth
height: o.height }, {
}); type: "bi.icon_label",
this.text = BI.createWidget({ cls: o.iconCls1,
width: o.leftIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}, {
type: "bi.icon_label",
cls: o.iconCls2,
width: o.rightIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}, {
type: "bi.label", type: "bi.label",
cls: "list-item-text", ref: function (_ref) {
self.text = _ref;
},
textAlign: "left", textAlign: "left",
hgap: o.textHgap, hgap: o.textHgap,
vgap: o.textVgap, vgap: o.textVgap,
@ -45,27 +63,8 @@ BI.BlankIconIconTextItem = BI.inherit(BI.BasicButton, {
value: o.value, value: o.value,
keyword: o.keyword, keyword: o.keyword,
height: o.height height: o.height
}); }]
this.icon1 = BI.createWidget({ };
type: "bi.icon_button",
cls: o.iconCls1,
forceNotSelected: true,
width: o.height,
height: o.height
});
this.icon2 = BI.createWidget({
type: "bi.icon_button",
cls: o.iconCls2,
forceNotSelected: true,
width: o.height,
height: o.height
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", blank, this.icon1, this.icon2, this.text)
}))));
}, },
doClick: function () { doClick: function () {

57
src/base/single/button/listitem/blankicontexticonitem.js

@ -28,9 +28,26 @@ BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, {
}, },
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.blankWidth, o.leftIconWrapperWidth || o.height, "fill", o.rightIconWrapperWidth || o.height],
items: [{
type: "bi.layout",
width: o.blankWidth
}, {
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,
@ -40,45 +57,15 @@ BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, {
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
});
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, 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", {
type: "bi.layout",
width: o.blankWidth
}, icon1, this.text, {
type: "bi.layout",
width: o.height
})
}))));
}, },
doClick: function () { doClick: function () {

28
src/base/single/button/listitem/blankicontextitem.js

@ -26,13 +26,19 @@ BI.BlankIconTextItem = BI.inherit(BI.BasicButton, {
}, },
render: function () { render: function () {
var o = this.options, c = this._const; var self = this, o = this.options;
var blank = BI.createWidget({
return {
type: "bi.vertical_adapt",
columnSize: [o.blankWidth, "fill", o.iconWrapperWidth || o.height],
items: [{
type: "bi.layout", type: "bi.layout",
width: o.blankWidth width: o.blankWidth
}); }, {
this.text = BI.createWidget({
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,
@ -43,21 +49,15 @@ BI.BlankIconTextItem = BI.inherit(BI.BasicButton, {
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",
cls: o.iconCls, cls: o.iconCls,
width: o.height, 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", blank, this.icon, this.text)
}))));
}, },
doClick: function () { doClick: function () {

50
src/base/single/button/listitem/icontexticonitem.js

@ -27,9 +27,23 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, {
}, },
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,
@ -39,43 +53,15 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, {
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.leftIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
var blank = BI.createWidget({
type: "bi.layout",
width: 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.rightIconWrapperWidth || o.height, width: o.rightIconWrapperWidth || o.height,
height: 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 () {

35
src/base/single/button/listitem/icontextitem.js

@ -27,9 +27,23 @@ BI.IconTextItem = BI.inherit(BI.BasicButton, {
}, },
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,
@ -40,21 +54,8 @@ BI.IconTextItem = BI.inherit(BI.BasicButton, {
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",
cls: o.iconCls,
width: o.iconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.icon, this.text)
}))));
}, },
doClick: function () { doClick: function () {

26
src/base/single/button/listitem/texticonitem.js

@ -15,6 +15,7 @@ BI.TextIconItem = BI.inherit(BI.BasicButton, {
logic: { logic: {
dynamic: false dynamic: false
}, },
iconWrapperWidth: null,
iconHeight: null, iconHeight: null,
iconWidth: null, iconWidth: null,
iconCls: "", iconCls: "",
@ -26,9 +27,16 @@ BI.TextIconItem = BI.inherit(BI.BasicButton, {
}, },
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,
@ -39,21 +47,15 @@ BI.TextIconItem = BI.inherit(BI.BasicButton, {
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",
cls: o.iconCls, cls: o.iconCls,
width: o.height, 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