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";
|
2021-09-24 11:52:07 -04:00
|
|
|
import I18n from "I18n";
|
2018-01-15 05:55:16 -05:00
|
|
|
|
|
|
|
export default DropdownSelectBoxComponent.extend({
|
|
|
|
classNames: ["period-chooser"],
|
2020-09-11 14:53:44 -04:00
|
|
|
classNameBindings: ["showPeriods::hidden"],
|
2019-11-08 11:32:20 -05:00
|
|
|
content: oneWay("site.periods"),
|
2020-02-03 08:22:14 -05:00
|
|
|
value: readOnly("period"),
|
|
|
|
valueProperty: null,
|
|
|
|
nameProperty: null,
|
2020-09-11 14:53:44 -04:00
|
|
|
showPeriods: true,
|
2020-02-03 08:22:14 -05:00
|
|
|
|
|
|
|
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",
|
2021-05-20 02:00:45 -04:00
|
|
|
customStyle: true,
|
2020-02-03 08:22:14 -05:00
|
|
|
headerComponent: "period-chooser/period-chooser-header",
|
2021-09-24 11:52:07 -04:00
|
|
|
headerAriaLabel: I18n.t("period_chooser.aria_label"),
|
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
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|