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