2021-08-23 16:44:19 +08:00
|
|
|
import { computed } from "@ember/object";
|
|
|
|
import { reads } from "@ember/object/computed";
|
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
|
|
|
|
2017-11-21 18:53:09 +08:00
|
|
|
export default SelectKitHeaderComponent.extend({
|
2021-08-23 16:44:19 +08:00
|
|
|
tagName: "summary",
|
2020-02-03 21:22:14 +08:00
|
|
|
classNames: ["multi-select-header"],
|
2021-09-21 23:19:49 +08:00
|
|
|
attributeBindings: ["ariaLabel:aria-label"],
|
2021-08-23 16:44:19 +08:00
|
|
|
caretUpIcon: reads("selectKit.options.caretUpIcon"),
|
|
|
|
caretDownIcon: reads("selectKit.options.caretDownIcon"),
|
2021-09-21 23:19:49 +08:00
|
|
|
ariaLabel: reads("selectKit.options.headerAriaLabel"),
|
2023-05-02 21:10:53 +08:00
|
|
|
|
2021-08-23 16:44:19 +08:00
|
|
|
caretIcon: computed(
|
|
|
|
"selectKit.isExpanded",
|
|
|
|
"caretUpIcon",
|
|
|
|
"caretDownIcon",
|
|
|
|
function () {
|
|
|
|
return this.selectKit.isExpanded ? this.caretUpIcon : this.caretDownIcon;
|
2020-09-15 15:39:12 +08:00
|
|
|
}
|
2021-08-23 16:44:19 +08:00
|
|
|
),
|
2017-10-20 03:51:08 +08:00
|
|
|
});
|