2021-08-23 16:44:19 +08:00
|
|
|
import { computed } from "@ember/object";
|
|
|
|
import { reads } from "@ember/object/computed";
|
2024-08-23 19:17:07 +08:00
|
|
|
import {
|
|
|
|
attributeBindings,
|
|
|
|
classNames,
|
|
|
|
tagName,
|
|
|
|
} from "@ember-decorators/component";
|
2023-10-11 02:38:59 +08:00
|
|
|
import SelectKitHeaderComponent from "select-kit/components/select-kit/select-kit-header";
|
2017-10-20 03:51:08 +08:00
|
|
|
|
2024-08-23 19:17:07 +08:00
|
|
|
@tagName("summary")
|
|
|
|
@classNames("multi-select-header")
|
|
|
|
@attributeBindings("ariaLabel:aria-label")
|
|
|
|
export default class MultiSelectHeader extends SelectKitHeaderComponent {
|
|
|
|
@reads("selectKit.options.caretUpIcon") caretUpIcon;
|
|
|
|
@reads("selectKit.options.caretDownIcon") caretDownIcon;
|
|
|
|
@reads("selectKit.options.headerAriaLabel") ariaLabel;
|
2023-05-02 21:10:53 +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;
|
|
|
|
}
|
|
|
|
}
|