forked from fanruan/fineui
Browse Source
Merge in VISUAL/fineui from ~JOKER.WANG/fineui:es6 to es6 * commit '7d86ad53c162248503f839fbfcd947aabafccba9': KERNEL-14069 refactor: 删除无用代码 KERNEL-14069 refactor: case/layer、linearsegment、list es6化es6
Joker.Wang-王顺
2 years ago
11 changed files with 413 additions and 380 deletions
@ -0,0 +1,4 @@
|
||||
export { MultiPopupView } from "./layer.multipopup"; |
||||
export { PopupPanel } from "./layer.panel"; |
||||
export { ListPane } from "./pane.list"; |
||||
export { Panel } from "./panel"; |
@ -0,0 +1,2 @@
|
||||
export { LinearSegmentButton } from "./button.linear.segment"; |
||||
export { LinearSegment } from "./linear.segment"; |
@ -1,60 +1,62 @@
|
||||
BI.LinearSegment = BI.inherit(BI.Widget, { |
||||
|
||||
props: { |
||||
baseCls: "bi-linear-segment", |
||||
items: [], |
||||
height: 30 |
||||
}, |
||||
import { shortcut, Widget, createItems, makeArrayByArray } from "@/core"; |
||||
|
||||
render: function () { |
||||
var self = this, o = this.options; |
||||
@shortcut() |
||||
export class LinearSegment extends Widget { |
||||
static xtype = "bi.linear_segment" |
||||
|
||||
props = { baseCls:"bi-linear-segment", items:[], height:30 }; |
||||
|
||||
|
||||
|
||||
render () { |
||||
const o = this.options; |
||||
|
||||
return { |
||||
type: "bi.button_group", |
||||
items: [BI.createItems(o.items, { |
||||
items: [createItems(o.items, { |
||||
type: "bi.linear_segment_button", |
||||
height: o.height |
||||
height: o.height, |
||||
})], |
||||
layouts: [{ |
||||
type: "bi.table", |
||||
columnSize: BI.makeArrayByArray(o.items, "fill"), |
||||
columnSize: makeArrayByArray(o.items, "fill"), |
||||
}], |
||||
value: o.value, |
||||
listeners: [{ |
||||
eventName: "__EVENT_CHANGE__", |
||||
action: function () { |
||||
self.fireEvent("__EVENT_CHANGE__", arguments); |
||||
} |
||||
action () { |
||||
this.fireEvent("__EVENT_CHANGE__", arguments); |
||||
}, |
||||
}, { |
||||
eventName: "EVENT_CHANGE", |
||||
action: function () { |
||||
self.fireEvent("EVENT_CHANGE"); |
||||
} |
||||
action () { |
||||
this.fireEvent("EVENT_CHANGE"); |
||||
}, |
||||
}], |
||||
ref: function () { |
||||
self.buttonGroup = this; |
||||
} |
||||
ref: _ref => { |
||||
this.buttonGroup = _ref; |
||||
}, |
||||
}; |
||||
}, |
||||
} |
||||
|
||||
setValue: function (v) { |
||||
setValue (v) { |
||||
this.buttonGroup.setValue(v); |
||||
}, |
||||
} |
||||
|
||||
setEnabledValue: function (v) { |
||||
setEnabledValue (v) { |
||||
this.buttonGroup.setEnabledValue(v); |
||||
}, |
||||
|
||||
} |
||||
|
||||
getValue: function () { |
||||
getValue () { |
||||
return this.buttonGroup.getValue(); |
||||
}, |
||||
} |
||||
|
||||
populate: function (buttons) { |
||||
var o = this.options; |
||||
this.buttonGroup.populate([BI.createItems(buttons, { |
||||
populate (buttons) { |
||||
const o = this.options; |
||||
this.buttonGroup.populate([createItems(buttons, { |
||||
type: "bi.linear_segment_button", |
||||
height: o.height |
||||
})]) |
||||
}, |
||||
}); |
||||
BI.shortcut("bi.linear_segment", BI.LinearSegment); |
||||
height: o.height, |
||||
})]); |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue