2021-06-08 14:34:47 +03:00
|
|
|
import { mapGetters } from 'vuex'
|
|
|
|
|
|
2026-01-08 17:26:52 +02:00
|
|
|
import MentionLink from 'src/components/mention_link/mention_link.vue'
|
|
|
|
|
|
2021-08-15 02:41:53 +03:00
|
|
|
export const MENTIONS_LIMIT = 5
|
|
|
|
|
|
2021-06-08 14:34:47 +03:00
|
|
|
const MentionsLine = {
|
|
|
|
|
name: 'MentionsLine',
|
|
|
|
|
props: {
|
2021-06-10 12:08:31 +03:00
|
|
|
mentions: {
|
2021-06-08 14:34:47 +03:00
|
|
|
required: true,
|
2026-01-06 16:22:52 +02:00
|
|
|
type: Array,
|
|
|
|
|
},
|
2021-06-08 14:34:47 +03:00
|
|
|
},
|
|
|
|
|
data: () => ({ expanded: false }),
|
|
|
|
|
components: {
|
2026-01-06 16:22:52 +02:00
|
|
|
MentionLink,
|
2021-06-08 14:34:47 +03:00
|
|
|
},
|
|
|
|
|
computed: {
|
2026-01-06 16:22:52 +02:00
|
|
|
mentionsComputed() {
|
2021-08-15 02:41:53 +03:00
|
|
|
return this.mentions.slice(0, MENTIONS_LIMIT)
|
2021-06-08 14:34:47 +03:00
|
|
|
},
|
2026-01-06 16:22:52 +02:00
|
|
|
extraMentions() {
|
2021-08-15 02:41:53 +03:00
|
|
|
return this.mentions.slice(MENTIONS_LIMIT)
|
2021-06-08 14:34:47 +03:00
|
|
|
},
|
2026-01-06 16:22:52 +02:00
|
|
|
manyMentions() {
|
2021-06-08 14:34:47 +03:00
|
|
|
return this.extraMentions.length > 0
|
|
|
|
|
},
|
2026-01-06 16:22:52 +02:00
|
|
|
...mapGetters(['mergedConfig']),
|
2021-06-08 14:34:47 +03:00
|
|
|
},
|
|
|
|
|
methods: {
|
2026-01-06 16:22:52 +02:00
|
|
|
toggleShowMore() {
|
2021-06-08 14:34:47 +03:00
|
|
|
this.expanded = !this.expanded
|
2026-01-06 16:22:52 +02:00
|
|
|
},
|
|
|
|
|
},
|
2021-06-08 14:34:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default MentionsLine
|