2017-11-21 18:53:09 +08:00
|
|
|
import SingleSelectComponent from "select-kit/components/single-select";
|
2017-10-20 03:51:08 +08:00
|
|
|
import { on } from "ember-addons/ember-computed-decorators";
|
|
|
|
|
2017-11-21 18:53:09 +08:00
|
|
|
export default SingleSelectComponent.extend({
|
|
|
|
pluginApiIdentifiers: ["combo-box"],
|
2017-10-20 03:51:08 +08:00
|
|
|
classNames: "combobox combo-box",
|
|
|
|
autoFilterable: true,
|
|
|
|
headerComponent: "combo-box/combo-box-header",
|
|
|
|
|
|
|
|
caretUpIcon: "caret-up",
|
|
|
|
caretDownIcon: "caret-down",
|
|
|
|
clearable: false,
|
|
|
|
|
2017-11-21 18:53:09 +08:00
|
|
|
computeHeaderContent() {
|
|
|
|
let content = this.baseHeaderComputedContent();
|
|
|
|
content.hasSelection = this.get("hasSelection");
|
|
|
|
return content;
|
|
|
|
},
|
|
|
|
|
2017-10-20 03:51:08 +08:00
|
|
|
@on("didReceiveAttrs")
|
2017-10-20 21:41:00 +08:00
|
|
|
_setComboBoxOptions() {
|
2017-11-10 02:57:53 +08:00
|
|
|
this.get("headerComponentOptions").setProperties({
|
2017-10-20 03:51:08 +08:00
|
|
|
caretUpIcon: this.get("caretUpIcon"),
|
|
|
|
caretDownIcon: this.get("caretDownIcon"),
|
|
|
|
clearable: this.get("clearable"),
|
2017-11-10 02:57:53 +08:00
|
|
|
});
|
2017-10-20 03:51:08 +08:00
|
|
|
}
|
|
|
|
});
|