discourse/app/assets/javascripts/select-kit/addon/components/watched-words.js
David Taylor d1cc60c435
DEV: Convert select-kit components to native class syntax (#28489)
Changes made using the ember-native-class-codemod, plus some manual tweaks
2024-08-23 12:17:07 +01:00

24 lines
737 B
JavaScript

import { computed } from "@ember/object";
import { classNames } from "@ember-decorators/component";
import { makeArray } from "discourse-common/lib/helpers";
import MultiSelectComponent from "select-kit/components/multi-select";
import {
pluginApiIdentifiers,
selectKitOptions,
} from "select-kit/components/select-kit";
@classNames("watched-word-input-field")
@selectKitOptions({
autoInsertNoneItem: false,
fullWidthOnMobile: true,
allowAny: true,
none: "admin.watched_words.form.words_or_phrases",
})
@pluginApiIdentifiers("watched-words")
export default class WatchedWords extends MultiSelectComponent {
@computed("value.[]")
get content() {
return makeArray(this.value).map((x) => this.defaultItem(x, x));
}
}