2023-10-11 02:38:59 +08:00
|
|
|
import { computed } from "@ember/object";
|
2020-02-03 21:22:14 +08:00
|
|
|
import { and, reads } from "@ember/object/computed";
|
2024-08-23 19:17:07 +08:00
|
|
|
import { classNames } from "@ember-decorators/component";
|
2020-02-03 21:22:14 +08:00
|
|
|
import SingleSelectHeaderComponent from "select-kit/components/select-kit/single-select-header";
|
2017-11-21 18:53:09 +08:00
|
|
|
|
2024-08-23 19:17:07 +08:00
|
|
|
@classNames("combo-box-header")
|
|
|
|
export default class ComboBoxHeader extends SingleSelectHeaderComponent {
|
|
|
|
@reads("selectKit.options.clearable") clearable;
|
|
|
|
@reads("selectKit.options.caretUpIcon") caretUpIcon;
|
|
|
|
@reads("selectKit.options.caretDownIcon") caretDownIcon;
|
|
|
|
@and("clearable", "value") shouldDisplayClearableButton;
|
2017-11-21 18:53:09 +08:00
|
|
|
|
2024-08-23 19:17:07 +08:00
|
|
|
@computed("selectKit.isExpanded", "caretUpIcon", "caretDownIcon")
|
|
|
|
get caretIcon() {
|
|
|
|
return this.selectKit.isExpanded ? this.caretUpIcon : this.caretDownIcon;
|
|
|
|
}
|
|
|
|
}
|