zsmj
2 years ago
308 changed files with 15062 additions and 12975 deletions
@ -0,0 +1,4 @@
|
||||
import * as fineui from "./index"; |
||||
import { shortcut, provider } from "@/core/5.inject"; |
||||
|
||||
Object.assign(BI, fineui, { shortcut, provider }); |
@ -1,62 +1,70 @@
|
||||
|
||||
import { shortcut, Widget, createItems, makeArrayByArray } from "@/core"; |
||||
import { ButtonGroup } from "@/base"; |
||||
import { LinearSegmentButton } from "./button.linear.segment"; |
||||
import { TableLayout, shortcut, Widget, createItems, makeArrayByArray } from "@/core"; |
||||
|
||||
@shortcut() |
||||
export class LinearSegment extends Widget { |
||||
static xtype = "bi.linear_segment" |
||||
|
||||
props = { baseCls:"bi-linear-segment", items:[], height:30 }; |
||||
|
||||
static xtype = "bi.linear_segment"; |
||||
|
||||
props = { baseCls: "bi-linear-segment", items: [], height: 30 }; |
||||
|
||||
render () { |
||||
render() { |
||||
const o = this.options; |
||||
|
||||
return { |
||||
type: "bi.button_group", |
||||
items: [createItems(o.items, { |
||||
type: "bi.linear_segment_button", |
||||
height: o.height, |
||||
})], |
||||
layouts: [{ |
||||
type: "bi.table", |
||||
columnSize: makeArrayByArray(o.items, "fill"), |
||||
}], |
||||
type: ButtonGroup.xtype, |
||||
items: [ |
||||
createItems(o.items, { |
||||
type: LinearSegmentButton.xtype, |
||||
height: o.height, |
||||
}) |
||||
], |
||||
layouts: [ |
||||
{ |
||||
type: TableLayout.xtype, |
||||
columnSize: makeArrayByArray(o.items, "fill"), |
||||
} |
||||
], |
||||
value: o.value, |
||||
listeners: [{ |
||||
eventName: "__EVENT_CHANGE__", |
||||
action: (...args) => { |
||||
this.fireEvent("__EVENT_CHANGE__", ...args); |
||||
}, |
||||
}, { |
||||
eventName: "EVENT_CHANGE", |
||||
action: () => { |
||||
this.fireEvent("EVENT_CHANGE"); |
||||
listeners: [ |
||||
{ |
||||
eventName: "__EVENT_CHANGE__", |
||||
action: (...args) => { |
||||
this.fireEvent("__EVENT_CHANGE__", ...args); |
||||
}, |
||||
}, |
||||
}], |
||||
{ |
||||
eventName: "EVENT_CHANGE", |
||||
action: () => { |
||||
this.fireEvent("EVENT_CHANGE"); |
||||
}, |
||||
} |
||||
], |
||||
ref: _ref => { |
||||
this.buttonGroup = _ref; |
||||
}, |
||||
}; |
||||
} |
||||
|
||||
setValue (v) { |
||||
setValue(v) { |
||||
this.buttonGroup.setValue(v); |
||||
} |
||||
|
||||
setEnabledValue (v) { |
||||
setEnabledValue(v) { |
||||
this.buttonGroup.setEnabledValue(v); |
||||
} |
||||
|
||||
getValue () { |
||||
getValue() { |
||||
return this.buttonGroup.getValue(); |
||||
} |
||||
|
||||
populate (buttons) { |
||||
populate(buttons) { |
||||
const o = this.options; |
||||
this.buttonGroup.populate([createItems(buttons, { |
||||
type: "bi.linear_segment_button", |
||||
height: o.height, |
||||
})]); |
||||
this.buttonGroup.populate([ |
||||
createItems(buttons, { |
||||
type: LinearSegmentButton.xtype, |
||||
height: o.height, |
||||
}) |
||||
]); |
||||
} |
||||
} |
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue