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: { |
import { shortcut, Widget, createItems, makeArrayByArray } from "@/core"; |
||||||
baseCls: "bi-linear-segment", |
|
||||||
items: [], |
@shortcut() |
||||||
height: 30 |
export class LinearSegment extends Widget { |
||||||
}, |
static xtype = "bi.linear_segment" |
||||||
|
|
||||||
|
props = { baseCls:"bi-linear-segment", items:[], height:30 }; |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
render () { |
||||||
|
const o = this.options; |
||||||
|
|
||||||
render: function () { |
|
||||||
var self = this, o = this.options; |
|
||||||
return { |
return { |
||||||
type: "bi.button_group", |
type: "bi.button_group", |
||||||
items: [BI.createItems(o.items, { |
items: [createItems(o.items, { |
||||||
type: "bi.linear_segment_button", |
type: "bi.linear_segment_button", |
||||||
height: o.height |
height: o.height, |
||||||
})], |
})], |
||||||
layouts: [{ |
layouts: [{ |
||||||
type: "bi.table", |
type: "bi.table", |
||||||
columnSize: BI.makeArrayByArray(o.items, "fill"), |
columnSize: makeArrayByArray(o.items, "fill"), |
||||||
}], |
}], |
||||||
value: o.value, |
value: o.value, |
||||||
listeners: [{ |
listeners: [{ |
||||||
eventName: "__EVENT_CHANGE__", |
eventName: "__EVENT_CHANGE__", |
||||||
action: function () { |
action () { |
||||||
self.fireEvent("__EVENT_CHANGE__", arguments); |
this.fireEvent("__EVENT_CHANGE__", arguments); |
||||||
} |
}, |
||||||
}, { |
}, { |
||||||
eventName: "EVENT_CHANGE", |
eventName: "EVENT_CHANGE", |
||||||
action: function () { |
action () { |
||||||
self.fireEvent("EVENT_CHANGE"); |
this.fireEvent("EVENT_CHANGE"); |
||||||
} |
}, |
||||||
}], |
}], |
||||||
ref: function () { |
ref: _ref => { |
||||||
self.buttonGroup = this; |
this.buttonGroup = _ref; |
||||||
} |
}, |
||||||
}; |
}; |
||||||
}, |
} |
||||||
|
|
||||||
setValue: function (v) { |
setValue (v) { |
||||||
this.buttonGroup.setValue(v); |
this.buttonGroup.setValue(v); |
||||||
}, |
} |
||||||
|
|
||||||
setEnabledValue: function (v) { |
setEnabledValue (v) { |
||||||
this.buttonGroup.setEnabledValue(v); |
this.buttonGroup.setEnabledValue(v); |
||||||
}, |
} |
||||||
|
|
||||||
|
|
||||||
getValue: function () { |
getValue () { |
||||||
return this.buttonGroup.getValue(); |
return this.buttonGroup.getValue(); |
||||||
}, |
} |
||||||
|
|
||||||
populate: function (buttons) { |
populate (buttons) { |
||||||
var o = this.options; |
const o = this.options; |
||||||
this.buttonGroup.populate([BI.createItems(buttons, { |
this.buttonGroup.populate([createItems(buttons, { |
||||||
type: "bi.linear_segment_button", |
type: "bi.linear_segment_button", |
||||||
height: o.height |
height: o.height, |
||||||
})]) |
})]); |
||||||
}, |
} |
||||||
}); |
} |
||||||
BI.shortcut("bi.linear_segment", BI.LinearSegment); |
|
||||||
|
Loading…
Reference in new issue