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

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

18 lines
754 B
JavaScript
Raw Normal View History

import { computed } from "@ember/object";
import { and, reads } from "@ember/object/computed";
import { classNames } from "@ember-decorators/component";
import SingleSelectHeaderComponent from "select-kit/components/select-kit/single-select-header";
@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;
@computed("selectKit.isExpanded", "caretUpIcon", "caretDownIcon")
get caretIcon() {
return this.selectKit.isExpanded ? this.caretUpIcon : this.caretDownIcon;
}
}