2020-02-03 08:22:14 -05:00
|
|
|
import { oneWay, readOnly } from "@ember/object/computed";
|
2018-01-15 05:55:16 -05:00
|
|
|
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
|
|
|
|
|
|
|
|
export default DropdownSelectBoxComponent.extend({
|
|
|
|
classNames: ["period-chooser"],
|
2019-11-08 11:32:20 -05:00
|
|
|
content: oneWay("site.periods"),
|
2020-02-03 08:22:14 -05:00
|
|
|
value: readOnly("period"),
|
|
|
|
isVisible: readOnly("showPeriods"),
|
|
|
|
valueProperty: null,
|
|
|
|
nameProperty: null,
|
|
|
|
|
|
|
|
modifyComponentForRow() {
|
|
|
|
return "period-chooser/period-chooser-row";
|
|
|
|
},
|
2018-01-15 05:55:16 -05:00
|
|
|
|
2020-02-03 08:22:14 -05:00
|
|
|
selectKitOptions: {
|
|
|
|
filterable: false,
|
|
|
|
autoFilterable: false,
|
|
|
|
fullDay: "fullDay",
|
|
|
|
headerComponent: "period-chooser/period-chooser-header"
|
2018-05-09 04:05:40 -04:00
|
|
|
},
|
|
|
|
|
2018-01-15 05:55:16 -05:00
|
|
|
actions: {
|
2020-02-03 08:22:14 -05:00
|
|
|
onChange(value) {
|
2019-01-10 05:06:01 -05:00
|
|
|
if (this.action) {
|
2020-02-03 08:22:14 -05:00
|
|
|
this.action(value);
|
|
|
|
} else {
|
|
|
|
this.attrs.onChange && this.attrs.onChange(value);
|
2019-01-10 05:06:01 -05:00
|
|
|
}
|
2018-01-15 05:55:16 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|