forked from fanruan/fineui
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 { 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, { |
||||||
|
type: LinearSegmentButton.xtype, |
||||||
height: o.height, |
height: o.height, |
||||||
})], |
}) |
||||||
layouts: [{ |
], |
||||||
type: "bi.table", |
layouts: [ |
||||||
|
{ |
||||||
|
type: TableLayout.xtype, |
||||||
columnSize: makeArrayByArray(o.items, "fill"), |
columnSize: makeArrayByArray(o.items, "fill"), |
||||||
}], |
} |
||||||
|
], |
||||||
value: o.value, |
value: o.value, |
||||||
listeners: [{ |
listeners: [ |
||||||
|
{ |
||||||
eventName: "__EVENT_CHANGE__", |
eventName: "__EVENT_CHANGE__", |
||||||
action: (...args) => { |
action: (...args) => { |
||||||
this.fireEvent("__EVENT_CHANGE__", ...args); |
this.fireEvent("__EVENT_CHANGE__", ...args); |
||||||
}, |
}, |
||||||
}, { |
}, |
||||||
|
{ |
||||||
eventName: "EVENT_CHANGE", |
eventName: "EVENT_CHANGE", |
||||||
action: () => { |
action: () => { |
||||||
this.fireEvent("EVENT_CHANGE"); |
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, { |
||||||
|
type: LinearSegmentButton.xtype, |
||||||
height: o.height, |
height: o.height, |
||||||
})]); |
}) |
||||||
|
]); |
||||||
} |
} |
||||||
} |
} |
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue