2020-02-03 14:22:14 +01:00
|
|
|
import { computed } from "@ember/object";
|
|
|
|
import { readOnly } from "@ember/object/computed";
|
2024-08-23 12:17:07 +01:00
|
|
|
import { classNameBindings, classNames } from "@ember-decorators/component";
|
2023-10-10 19:38:59 +01:00
|
|
|
import SingleSelectHeaderComponent from "select-kit/components/select-kit/single-select-header";
|
2017-11-21 11:53:09 +01:00
|
|
|
|
2024-08-23 12:17:07 +01:00
|
|
|
@classNames("dropdown-select-box-header")
|
|
|
|
@classNameBindings("btnClassName", "btnStyleClass", "btnCustomClasses")
|
|
|
|
export default class DropdownSelectBoxHeader extends SingleSelectHeaderComponent {
|
|
|
|
@readOnly("selectKit.options.showFullTitle") showFullTitle;
|
|
|
|
@readOnly("selectKit.options.customStyle") customStyle;
|
|
|
|
@readOnly("selectKit.options.btnCustomClasses") btnCustomClasses;
|
|
|
|
@readOnly("selectKit.options.caretUpIcon") caretUpIcon;
|
|
|
|
@readOnly("selectKit.options.caretDownIcon") caretDownIcon;
|
2017-11-21 11:53:09 +01:00
|
|
|
|
2024-08-23 12:17:07 +01:00
|
|
|
@computed("showFullTitle")
|
|
|
|
get btnClassName() {
|
2020-02-03 14:22:14 +01:00
|
|
|
return `btn ${this.showFullTitle ? "btn-icon-text" : "no-text btn-icon"}`;
|
2024-08-23 12:17:07 +01:00
|
|
|
}
|
2020-05-18 10:50:33 +02:00
|
|
|
|
2024-08-23 12:17:07 +01:00
|
|
|
@computed("customStyle")
|
|
|
|
get btnStyleClass() {
|
2021-05-20 02:00:45 -04:00
|
|
|
return `${this.customStyle ? "" : "btn-default"}`;
|
2024-08-23 12:17:07 +01:00
|
|
|
}
|
2020-05-18 10:50:33 +02:00
|
|
|
|
2024-08-23 12:17:07 +01:00
|
|
|
@computed("selectKit.isExpanded", "caretUpIcon", "caretDownIcon")
|
|
|
|
get caretIcon() {
|
|
|
|
return this.selectKit.isExpanded ? this.caretUpIcon : this.caretDownIcon;
|
|
|
|
}
|
|
|
|
}
|