discourse/app/assets/javascripts/select-kit/addon/components/multi-select/multi-select-header.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
812 B
JavaScript
Raw Normal View History

import SelectKitHeaderComponent from "select-kit/components/select-kit/select-kit-header";
import layout from "select-kit/templates/components/multi-select/multi-select-header";
import { computed } from "@ember/object";
import { reads } from "@ember/object/computed";
2017-10-20 03:51:08 +08:00
export default SelectKitHeaderComponent.extend({
tagName: "summary",
classNames: ["multi-select-header"],
attributeBindings: ["ariaLabel:aria-label"],
layout,
2017-10-20 03:51:08 +08:00
caretUpIcon: reads("selectKit.options.caretUpIcon"),
caretDownIcon: reads("selectKit.options.caretDownIcon"),
ariaLabel: reads("selectKit.options.headerAriaLabel"),
caretIcon: computed(
"selectKit.isExpanded",
"caretUpIcon",
"caretDownIcon",
function () {
return this.selectKit.isExpanded ? this.caretUpIcon : this.caretDownIcon;
}
),
2017-10-20 03:51:08 +08:00
});