2020-02-03 21:22:14 +08:00
|
|
|
import SingleSelectHeaderComponent from "select-kit/components/select-kit/single-select-header";
|
|
|
|
import { computed } from "@ember/object";
|
|
|
|
import { readOnly } from "@ember/object/computed";
|
2017-11-21 18:53:09 +08:00
|
|
|
|
2020-02-03 21:22:14 +08:00
|
|
|
export default SingleSelectHeaderComponent.extend({
|
2017-11-21 18:53:09 +08:00
|
|
|
layoutName:
|
|
|
|
"select-kit/templates/components/dropdown-select-box/dropdown-select-box-header",
|
2020-02-03 21:22:14 +08:00
|
|
|
classNames: ["btn-default", "dropdown-select-box-header"],
|
2017-11-21 18:53:09 +08:00
|
|
|
tagName: "button",
|
|
|
|
classNameBindings: ["btnClassName"],
|
2020-02-03 21:22:14 +08:00
|
|
|
showFullTitle: readOnly("selectKit.options.showFullTitle"),
|
|
|
|
attributeBindings: ["buttonType:type"],
|
|
|
|
buttonType: "button",
|
2017-11-21 18:53:09 +08:00
|
|
|
|
2020-02-03 21:22:14 +08:00
|
|
|
btnClassName: computed("showFullTitle", function() {
|
|
|
|
return `btn ${this.showFullTitle ? "btn-icon-text" : "no-text btn-icon"}`;
|
|
|
|
})
|
2017-11-21 18:53:09 +08:00
|
|
|
});
|