2024-04-29 18:20:55 +08:00
|
|
|
import { computed } from "@ember/object";
|
2024-08-23 19:17:07 +08:00
|
|
|
import { classNames } from "@ember-decorators/component";
|
2024-04-29 18:20:55 +08:00
|
|
|
import { makeArray } from "discourse-common/lib/helpers";
|
|
|
|
import MultiSelectComponent from "select-kit/components/multi-select";
|
2024-08-23 19:17:07 +08:00
|
|
|
import {
|
|
|
|
pluginApiIdentifiers,
|
|
|
|
selectKitOptions,
|
|
|
|
} from "select-kit/components/select-kit";
|
2024-04-29 18:20:55 +08:00
|
|
|
|
2024-08-23 19:17:07 +08:00
|
|
|
@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 {
|
2024-04-29 18:20:55 +08:00
|
|
|
@computed("value.[]")
|
|
|
|
get content() {
|
|
|
|
return makeArray(this.value).map((x) => this.defaultItem(x, x));
|
2024-08-23 19:17:07 +08:00
|
|
|
}
|
|
|
|
}
|