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