2017-11-21 18:53:09 +08:00
|
|
|
import SingleSelectComponent from "select-kit/components/single-select";
|
2019-11-08 05:38:28 +08:00
|
|
|
import { on } from "discourse-common/utils/decorators";
|
2017-11-21 18:53:09 +08:00
|
|
|
|
|
|
|
export default SingleSelectComponent.extend({
|
|
|
|
pluginApiIdentifiers: ["dropdown-select-box"],
|
|
|
|
classNames: "dropdown-select-box",
|
|
|
|
verticalOffset: 3,
|
|
|
|
fullWidthOnMobile: true,
|
|
|
|
filterable: false,
|
|
|
|
autoFilterable: false,
|
|
|
|
headerComponent: "dropdown-select-box/dropdown-select-box-header",
|
|
|
|
rowComponent: "dropdown-select-box/dropdown-select-box-row",
|
|
|
|
showFullTitle: true,
|
|
|
|
allowInitialValueMutation: false,
|
|
|
|
|
2019-05-10 23:12:10 +08:00
|
|
|
@on("didUpdateAttrs", "init")
|
2017-11-21 18:53:09 +08:00
|
|
|
_setDropdownSelectBoxComponentOptions() {
|
2019-05-27 16:15:39 +08:00
|
|
|
this.headerComponentOptions.setProperties({
|
|
|
|
showFullTitle: this.showFullTitle
|
2017-11-21 18:53:09 +08:00
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
didClickOutside() {
|
2019-05-27 16:15:39 +08:00
|
|
|
if (!this.isExpanded) return;
|
2017-11-21 18:53:09 +08:00
|
|
|
this.close();
|
|
|
|
},
|
|
|
|
|
|
|
|
didSelect() {
|
2019-01-19 17:05:51 +08:00
|
|
|
this._super(...arguments);
|
2017-11-21 18:53:09 +08:00
|
|
|
this.close();
|
|
|
|
}
|
|
|
|
});
|