2018-01-15 18:55:16 +08:00
|
|
|
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
|
2018-03-22 18:29:55 +08:00
|
|
|
import computed from "ember-addons/ember-computed-decorators";
|
2018-01-15 18:55:16 +08:00
|
|
|
|
|
|
|
export default DropdownSelectBoxComponent.extend({
|
|
|
|
classNames: ["period-chooser"],
|
|
|
|
rowComponent: "period-chooser/period-chooser-row",
|
|
|
|
headerComponent: "period-chooser/period-chooser-header",
|
|
|
|
content: Ember.computed.alias("site.periods"),
|
|
|
|
value: Ember.computed.alias("period"),
|
|
|
|
isHidden: Ember.computed.alias("showPeriods"),
|
|
|
|
|
2018-03-22 18:29:55 +08:00
|
|
|
@computed("isExpanded")
|
|
|
|
caretIcon(isExpanded) {
|
|
|
|
return isExpanded ? "caret-up" : "caret-down";
|
|
|
|
},
|
|
|
|
|
2018-01-15 18:55:16 +08:00
|
|
|
actions: {
|
|
|
|
onSelect() {
|
|
|
|
this.sendAction("action", this.get("computedValue"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|