forked from fanruan/demo-tabledata-redis
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.
42 lines
1.1 KiB
42 lines
1.1 KiB
5 years ago
|
import { shortcut } from '../../../../core/core';
|
||
|
import { MultiSelectItemXtype } from 'ui';
|
||
|
import { input } from './input.service';
|
||
|
|
||
|
@shortcut()
|
||
|
@input('boolean')
|
||
|
export class InputBoolean extends BI.Widget {
|
||
|
static xtype = 'plugin.report.json.components.parameter_input.boolean'
|
||
|
|
||
|
props = {
|
||
|
value: '',
|
||
|
}
|
||
|
|
||
|
input: any;
|
||
|
|
||
|
render() {
|
||
|
const { value } = this.options;
|
||
|
|
||
|
return {
|
||
|
type: MultiSelectItemXtype,
|
||
|
width: 80,
|
||
|
selected: !!value,
|
||
|
text: 'true',
|
||
|
ref: (_ref: any) => {
|
||
|
this.input = _ref;
|
||
|
},
|
||
|
listeners: [{
|
||
|
eventName: BI.TextEditor.EVENT_CHANGE,
|
||
|
action: () => {
|
||
|
const value = this.input.getValue();
|
||
|
this.fireEvent('EVENT_CHANGE', value);
|
||
|
},
|
||
|
}, {
|
||
|
eventName: BI.TextEditor.EVENT_FOCUS,
|
||
|
action: () => {
|
||
|
this.fireEvent('EVENT_FOCUS');
|
||
|
},
|
||
|
}],
|
||
|
};
|
||
|
}
|
||
|
}
|