|
|
|
import { shortcut, Widget, extend } from "../../../core";
|
|
|
|
|
|
|
|
@shortcut()
|
|
|
|
export class Instruction extends Widget {
|
|
|
|
static xtype = "bi.instruction";
|
|
|
|
|
|
|
|
_defaultConfig() {
|
|
|
|
const conf = super._defaultConfig(...arguments);
|
|
|
|
return extend(conf, {
|
|
|
|
baseCls: (conf.baseCls || "") + " bi-instruction",
|
|
|
|
height: 20,
|
|
|
|
level: "error",
|
|
|
|
textAlign: "left",
|
|
|
|
whiteSpace: "nowrap",
|
|
|
|
hgap: 5
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const { level, textAlign, whiteSpace, height, hgap, rgap, lgap, vgap, text, keyword, value, py } = this.options;
|
|
|
|
|
|
|
|
return {
|
|
|
|
type: "bi.label",
|
|
|
|
ref: (_ref) => {
|
|
|
|
this.text = _ref;
|
|
|
|
},
|
|
|
|
cls: "instruction-" + level,
|
|
|
|
textAlign,
|
|
|
|
whiteSpace,
|
|
|
|
textHeight: height,
|
|
|
|
height,
|
|
|
|
hgap,
|
|
|
|
rgap,
|
|
|
|
lgap,
|
|
|
|
vgap,
|
|
|
|
text,
|
|
|
|
keyword,
|
|
|
|
value,
|
|
|
|
py
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
doRedMark() {
|
|
|
|
this.text.doRedMark.apply(this.text, arguments);
|
|
|
|
}
|
|
|
|
|
|
|
|
unRedMark() {
|
|
|
|
this.text.unRedMark.apply(this.text, arguments);
|
|
|
|
}
|
|
|
|
|
|
|
|
doHighLight() {
|
|
|
|
this.text.doHighLight.apply(this.text, arguments);
|
|
|
|
}
|
|
|
|
|
|
|
|
unHighLight() {
|
|
|
|
this.text.unHighLight.apply(this.text, arguments);
|
|
|
|
}
|
|
|
|
|
|
|
|
setText(v) {
|
|
|
|
this.options.text = v;
|
|
|
|
this.text.setText(v);
|
|
|
|
}
|
|
|
|
|
|
|
|
getText() {
|
|
|
|
return this.options.text;
|
|
|
|
}
|
|
|
|
|
|
|
|
setStyle(css) {
|
|
|
|
this.text.setStyle(css);
|
|
|
|
}
|
|
|
|
|
|
|
|
setValue(v) {
|
|
|
|
this.text.setValue(v);
|
|
|
|
}
|
|
|
|
|
|
|
|
getValue() {
|
|
|
|
this.text.getValue();
|
|
|
|
}
|
|
|
|
}
|