fineui是帆软报表和BI产品线所使用的前端框架。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

104 lines
2.7 KiB

import { NodeButton } from "../button.node"
import { extend, shortcut } from "../../../../core"
/**
* guy
* Created by GUY on 2015/9/9.
* @class IconTextIconNode
* @extends NodeButton
*/
@shortcut()
export class IconTextIconNode extends NodeButton {
static xtype = "bi.icon_text_icon_node";
static EVENT_CHANGE = "EVENT_CHANGE";
_defaultConfig() {
const conf = super._defaultConfig(arguments);
return extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-text-icon-node",
iconCls1: "close-ha-font",
iconCls2: "close-ha-font",
iconHeight: null,
iconWidth: null,
textHgap: 0,
textVgap: 0,
textLgap: 0,
textRgap: 0,
});
}
render() {
const 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,
}, {
el: {
type: "bi.label",
ref: (_ref) => {
this.text = _ref;
},
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height,
},
}, {
type: "bi.icon_label",
cls: o.iconCls2,
width: o.rightIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight,
}],
};
}
doClick() {
super.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(IconTextIconNode.EVENT_CHANGE, this.getValue(), this);
}
}
doRedMark() {
this.text.doRedMark.apply(this.text, arguments);
}
unRedMark() {
this.text.unRedMark.apply(this.text, arguments);
}
setValue() {
if (!this.isReadOnly()) {
this.text.setValue.apply(this.text, arguments);
}
}
getValue() {
return this.text.getValue();
}
setText() {
this.text.setText.apply(this.text, arguments);
}
getText() {
return this.text.getText();
}
}