118 changed files with 4624 additions and 3507 deletions
@ -1,62 +1,70 @@ |
|||||||
|
import { ButtonGroup } from "@/base"; |
||||||
import { shortcut, Widget, createItems, makeArrayByArray } from "@/core"; |
import { LinearSegmentButton } from "./button.linear.segment"; |
||||||
|
import { TableLayout, shortcut, Widget, createItems, makeArrayByArray } from "@/core"; |
||||||
|
|
||||||
@shortcut() |
@shortcut() |
||||||
export class LinearSegment extends Widget { |
export class LinearSegment extends Widget { |
||||||
static xtype = "bi.linear_segment" |
static xtype = "bi.linear_segment"; |
||||||
|
|
||||||
props = { baseCls:"bi-linear-segment", items:[], height:30 }; |
|
||||||
|
|
||||||
|
|
||||||
|
props = { baseCls: "bi-linear-segment", items: [], height: 30 }; |
||||||
|
|
||||||
render () { |
render() { |
||||||
const o = this.options; |
const o = this.options; |
||||||
|
|
||||||
return { |
return { |
||||||
type: "bi.button_group", |
type: ButtonGroup.xtype, |
||||||
items: [createItems(o.items, { |
items: [ |
||||||
type: "bi.linear_segment_button", |
createItems(o.items, { |
||||||
height: o.height, |
type: LinearSegmentButton.xtype, |
||||||
})], |
height: o.height, |
||||||
layouts: [{ |
}) |
||||||
type: "bi.table", |
], |
||||||
columnSize: makeArrayByArray(o.items, "fill"), |
layouts: [ |
||||||
}], |
{ |
||||||
|
type: TableLayout.xtype, |
||||||
|
columnSize: makeArrayByArray(o.items, "fill"), |
||||||
|
} |
||||||
|
], |
||||||
value: o.value, |
value: o.value, |
||||||
listeners: [{ |
listeners: [ |
||||||
eventName: "__EVENT_CHANGE__", |
{ |
||||||
action: (...args) => { |
eventName: "__EVENT_CHANGE__", |
||||||
this.fireEvent("__EVENT_CHANGE__", ...args); |
action: (...args) => { |
||||||
}, |
this.fireEvent("__EVENT_CHANGE__", ...args); |
||||||
}, { |
}, |
||||||
eventName: "EVENT_CHANGE", |
|
||||||
action: () => { |
|
||||||
this.fireEvent("EVENT_CHANGE"); |
|
||||||
}, |
}, |
||||||
}], |
{ |
||||||
|
eventName: "EVENT_CHANGE", |
||||||
|
action: () => { |
||||||
|
this.fireEvent("EVENT_CHANGE"); |
||||||
|
}, |
||||||
|
} |
||||||
|
], |
||||||
ref: _ref => { |
ref: _ref => { |
||||||
this.buttonGroup = _ref; |
this.buttonGroup = _ref; |
||||||
}, |
}, |
||||||
}; |
}; |
||||||
} |
} |
||||||
|
|
||||||
setValue (v) { |
setValue(v) { |
||||||
this.buttonGroup.setValue(v); |
this.buttonGroup.setValue(v); |
||||||
} |
} |
||||||
|
|
||||||
setEnabledValue (v) { |
setEnabledValue(v) { |
||||||
this.buttonGroup.setEnabledValue(v); |
this.buttonGroup.setEnabledValue(v); |
||||||
} |
} |
||||||
|
|
||||||
getValue () { |
getValue() { |
||||||
return this.buttonGroup.getValue(); |
return this.buttonGroup.getValue(); |
||||||
} |
} |
||||||
|
|
||||||
populate (buttons) { |
populate(buttons) { |
||||||
const o = this.options; |
const o = this.options; |
||||||
this.buttonGroup.populate([createItems(buttons, { |
this.buttonGroup.populate([ |
||||||
type: "bi.linear_segment_button", |
createItems(buttons, { |
||||||
height: o.height, |
type: LinearSegmentButton.xtype, |
||||||
})]); |
height: o.height, |
||||||
|
}) |
||||||
|
]); |
||||||
} |
} |
||||||
} |
} |
||||||
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue