|
|
|
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), {
|
|
|
|
extraCls: "bi-icon-tree-leaf-item bi-list-item-active",
|
|
|
|
logic: {
|
|
|
|
dynamic: false,
|
|
|
|
},
|
|
|
|
height: 24,
|
|
|
|
iconWidth: 16,
|
|
|
|
iconHeight: 16,
|
|
|
|
iconCls: "",
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
_init() {
|
|
|
|
super._init(...arguments);
|
|
|
|
const o = this.options;
|
|
|
|
|
|
|
|
const icon = createWidget({
|
|
|
|
type: "bi.center_adapt",
|
|
|
|
width: 24,
|
|
|
|
cls: o.iconCls,
|
|
|
|
items: [{
|
|
|
|
type: "bi.icon",
|
|
|
|
width: o.iconWidth,
|
|
|
|
height: o.iconHeight,
|
|
|
|
}],
|
|
|
|
});
|
|
|
|
|
|
|
|
this.text = createWidget({
|
|
|
|
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,
|
|
|
|
});
|
|
|
|
const type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
|
|
|
|
const items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
|
|
|
|
width: 16,
|
|
|
|
el: icon,
|
|
|
|
}, {
|
|
|
|
el: this.text,
|
|
|
|
});
|
|
|
|
createWidget(extend({
|
|
|
|
element: this,
|
|
|
|
}, BI.LogicFactory.createLogic(type, extend(o.logic, {
|
|
|
|
items,
|
|
|
|
hgap: 5,
|
|
|
|
}))));
|
|
|
|
}
|
|
|
|
|
|
|
|
doRedMark() {
|
|
|
|
this.text.doRedMark(...arguments);
|
|
|
|
}
|
|
|
|
|
|
|
|
unRedMark() {
|
|
|
|
this.text.unRedMark(...arguments);
|
|
|
|
}
|
|
|
|
|
|
|
|
doHighLight() {
|
|
|
|
this.text.doHighLight(...arguments);
|
|
|
|
}
|
|
|
|
|
|
|
|
unHighLight() {
|
|
|
|
this.text.unHighLight(...arguments);
|
|
|
|
}
|
|
|
|
|
|
|
|
getId() {
|
|
|
|
return this.options.id;
|
|
|
|
}
|
|
|
|
|
|
|
|
getPId() {
|
|
|
|
return this.options.pId;
|
|
|
|
}
|
|
|
|
}
|