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.

87 lines
2.1 KiB

import { BasicButton } from "../../../base/single/button/button.basic";
import { shortcut, extend, createWidget } from "../../../core";
@shortcut()
export class IconTreeLeafItem extends BasicButton {
static xtype = "bi.icon_tree_leaf_item";
_defaultConfig() {
return extend(super._defaultConfig(...arguments), {
8 years ago
extraCls: "bi-icon-tree-leaf-item bi-list-item-active",
logic: {
dynamic: false,
8 years ago
},
6 years ago
height: 24,
8 years ago
iconWidth: 16,
iconHeight: 16,
iconCls: "",
7 years ago
});
}
8 years ago
_init() {
super._init(...arguments);
const o = this.options;
8 years ago
const icon = createWidget({
8 years ago
type: "bi.center_adapt",
width: 24,
8 years ago
cls: o.iconCls,
items: [{
type: "bi.icon",
width: o.iconWidth,
height: o.iconHeight,
}],
8 years ago
});
this.text = createWidget({
8 years ago
type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword,
8 years ago
});
const type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
const items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
width: 16,
el: icon,
8 years ago
}, {
el: this.text,
8 years ago
});
createWidget(extend({
element: this,
}, BI.LogicFactory.createLogic(type, extend(o.logic, {
items,
hgap: 5,
8 years ago
}))));
}
8 years ago
doRedMark() {
this.text.doRedMark(...arguments);
}
8 years ago
unRedMark() {
this.text.unRedMark(...arguments);
}
8 years ago
doHighLight() {
this.text.doHighLight(...arguments);
}
8 years ago
unHighLight() {
this.text.unHighLight(...arguments);
}
8 years ago
getId() {
8 years ago
return this.options.id;
}
8 years ago
getPId() {
8 years ago
return this.options.pId;
}
}