2021-07-13 12:22:39 -04:00
|
|
|
import { computed } from "@ember/object";
|
2021-07-08 03:46:21 -04:00
|
|
|
import ComboBoxComponent from "select-kit/components/combo-box";
|
|
|
|
|
|
|
|
export default ComboBoxComponent.extend({
|
|
|
|
pluginApiIdentifiers: ["flair-chooser"],
|
|
|
|
classNames: ["flair-chooser"],
|
|
|
|
|
|
|
|
selectKitOptions: {
|
|
|
|
selectedNameComponent: "selected-flair",
|
|
|
|
},
|
|
|
|
|
|
|
|
modifyComponentForRow() {
|
|
|
|
return "flair-row";
|
|
|
|
},
|
2021-07-13 12:22:39 -04:00
|
|
|
|
|
|
|
selectedContent: computed(
|
|
|
|
"value",
|
|
|
|
"content.[]",
|
|
|
|
"selectKit.noneItem",
|
|
|
|
function () {
|
|
|
|
const content = (this.content || []).findBy(
|
|
|
|
this.selectKit.valueProperty,
|
|
|
|
this.value
|
|
|
|
);
|
|
|
|
|
|
|
|
if (content) {
|
|
|
|
return this.selectKit.modifySelection(content);
|
|
|
|
} else {
|
|
|
|
return this.selectKit.noneItem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
),
|
2021-07-08 03:46:21 -04:00
|
|
|
});
|