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.
 
 
 

81 lines
2.1 KiB

import { NodeButton } from "../../../base/single/button/button.node";
import { shortcut, extend, createWidget } from "../../../core";
/**
* Created by roy on 15/10/16.
*/
@shortcut()
export class ArrowNode extends NodeButton {
static xtype = "bi.arrow_group_node";
_defaultConfig() {
const conf = super._defaultConfig(arguments);
return extend(conf, {
baseCls: `${conf.baseCls || ""} bi-arrow-group-node bi-list-item`,
id: "",
pId: "",
open: false,
height: 24,
iconWrapperWidth: 16,
});
}
render() {
const o = this.options;
this.checkbox = createWidget({
type: "bi.arrow_group_node_checkbox",
expandIcon: o.expandIcon,
collapseIcon: o.collapseIcon,
});
return {
type: "bi.vertical_adapt",
columnSize: [o.iconWrapperWidth || o.height, "fill"],
items: [this.checkbox, {
el: {
type: "bi.label",
ref: _ref => {
this.text = _ref;
},
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap || o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword,
},
}],
};
}
doRedMark() {
this.text.doRedMark(...arguments);
}
unRedMark() {
this.text.unRedMark(...arguments);
}
doClick() {
super.doClick.apply(this, arguments);
this.checkbox.setSelected(this.isOpened());
}
setText(text) {
super.setText.apply(this, arguments);
this.text.setText(text);
}
setOpened(v) {
super.setOpened.apply(this, arguments);
this.checkbox.setSelected(v);
}
}