mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 03:23:43 +08:00
22 lines
870 B
Plaintext
22 lines
870 B
Plaintext
|
import SelectKitHeaderComponent from "select-kit/components/select-kit/select-kit-header";
|
||
|
import { default as computed } from "ember-addons/ember-computed-decorators";
|
||
|
|
||
|
export default SelectKitHeaderComponent.extend({
|
||
|
layoutName: "select-kit/templates/components/combo-box/combo-box-header",
|
||
|
classNames: "combo-box-header",
|
||
|
|
||
|
clearable: Ember.computed.alias("options.clearable"),
|
||
|
caretUpIcon: Ember.computed.alias("options.caretUpIcon"),
|
||
|
caretDownIcon: Ember.computed.alias("options.caretDownIcon"),
|
||
|
|
||
|
@computed("isExpanded", "caretUpIcon", "caretDownIcon")
|
||
|
caretIcon(isExpanded, caretUpIcon, caretDownIcon) {
|
||
|
return isExpanded === true ? caretUpIcon : caretDownIcon;
|
||
|
},
|
||
|
|
||
|
@computed("clearable", "computedContent.hasSelection")
|
||
|
shouldDisplayClearableButton(clearable, hasSelection) {
|
||
|
return clearable === true && hasSelection === true;
|
||
|
}
|
||
|
});
|