Browse Source

icon_text_item族

es6
guy 2 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 () {
var o = this.options, c = this._const;
var blank = BI.createWidget({
var self = this, o = this.options;
return {
type: "bi.vertical_adapt",
columnSize: [o.blankWidth, o.leftIconWrapperWidth || o.height, o.rightIconWrapperWidth || o.height, "fill"],
items: [{
type: "bi.layout",
width: o.blankWidth,
height: o.height
});
this.text = BI.createWidget({
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.icon_label",
cls: o.iconCls2,
width: o.rightIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}, {
type: "bi.label",
cls: "list-item-text",
ref: function (_ref) {
self.text = _ref;
},
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
@ -45,27 +63,8 @@ BI.BlankIconIconTextItem = BI.inherit(BI.BasicButton, {
value: o.value,
keyword: o.keyword,
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 () {

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

@ -28,9 +28,26 @@ BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
var self = this, o = this.options;
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",
ref: function (_ref) {
self.text = _ref;
},
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
@ -40,45 +57,15 @@ BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, {
value: o.value,
keyword: o.keyword,
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",
cls: o.iconCls2,
width: o.height,
width: o.rightIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
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 () {

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

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

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

@ -27,9 +27,23 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
var self = this, o = this.options;
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",
ref: function (_ref) {
self.text = _ref;
},
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
@ -39,43 +53,15 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, {
value: o.value,
keyword: o.keyword,
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",
cls: o.iconCls2,
width: o.rightIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
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 () {

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

@ -27,9 +27,23 @@ BI.IconTextItem = BI.inherit(BI.BasicButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
var self = this, o = this.options;
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",
ref: function (_ref) {
self.text = _ref;
},
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
@ -40,21 +54,8 @@ BI.IconTextItem = BI.inherit(BI.BasicButton, {
value: o.value,
keyword: o.keyword,
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 () {

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

@ -15,6 +15,7 @@ BI.TextIconItem = BI.inherit(BI.BasicButton, {
logic: {
dynamic: false
},
iconWrapperWidth: null,
iconHeight: null,
iconWidth: null,
iconCls: "",
@ -26,9 +27,16 @@ BI.TextIconItem = BI.inherit(BI.BasicButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
var self = this, o = this.options;
return {
type: "bi.vertical_adapt",
columnSize: ["fill", o.iconWrapperWidth || o.height],
items: [{
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
@ -39,21 +47,15 @@ BI.TextIconItem = BI.inherit(BI.BasicButton, {
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon = BI.createWidget({
}, {
type: "bi.icon_label",
cls: o.iconCls,
width: o.height,
width: o.iconWrapperWidth || 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.text, this.icon)
}))));
}]
};
},
doClick: function () {

Loading…
Cancel
Save