akkoma-fe/src/components/emoji_picker/emoji_picker.vue

111 lines
2.9 KiB
Vue
Raw Normal View History

2019-03-29 15:49:32 +00:00
<template>
<div class="emoji-picker panel panel-default panel-body">
<div class="heading">
<span
class="emoji-tabs"
@wheel="onWheel"
ref="emoji-tabs"
>
<span
v-for="group in emojis"
:key="group.id"
class="emoji-tabs-item"
:class="{
active: activeGroupView === group.id,
disabled: group.emojis.length === 0
}"
:title="group.text"
@click.prevent="highlight(group.id)"
>
<span v-if="!group.first.imageUrl">{{ group.first.replacement }}</span>
<img
v-else
:src="group.first.imageUrl"
>
</span>
<span
v-if="stickerPickerEnabled"
class="stickers-tab-icon emoji-tabs-item"
:class="{active: showingStickers}"
:title="$t('emoji.stickers')"
@click.prevent="toggleStickers"
>
2020-10-20 21:31:16 +00:00
<FAIcon
icon="sticky-note"
fixed-width
/>
</span>
2019-07-28 21:10:43 +00:00
</span>
</div>
<div class="content">
2019-07-28 21:10:43 +00:00
<div
class="emoji-content"
:class="{hidden: showingStickers}"
2019-07-28 21:10:43 +00:00
>
<div class="emoji-search">
<input
v-model="keyword"
type="text"
class="form-control"
:placeholder="$t('emoji.search_emoji')"
@input="$event.target.composing = false"
>
</div>
2019-07-28 21:10:43 +00:00
<div
ref="emoji-groups"
class="emoji-groups"
:class="groupsScrolledClass"
@scroll="onScroll"
2019-07-28 21:10:43 +00:00
>
<div
v-for="group in emojisView"
:key="group.id"
class="emoji-group"
>
<h6
:ref="'group-' + group.id"
class="emoji-group-title"
2019-07-28 21:10:43 +00:00
>
{{ group.text }}
</h6>
<span
v-for="emoji in group.emojis"
:key="group.id + emoji.displayText"
:title="emoji.displayText"
class="emoji-item"
@click.stop.prevent="onEmoji(emoji)"
>
2019-09-12 16:15:22 +00:00
<span v-if="!emoji.imageUrl">{{ emoji.replacement }}</span>
<img
v-else
:src="emoji.imageUrl"
2019-09-12 16:15:22 +00:00
>
</span>
2019-11-08 19:35:58 +00:00
<span :ref="'group-end-' + group.id" />
</div>
2019-07-28 21:10:43 +00:00
</div>
<div
v-if="showKeepOpen"
class="keep-open"
>
<Checkbox v-model="keepOpen">
{{ $t('emoji.keep_open') }}
</Checkbox>
</div>
2019-03-29 16:48:52 +00:00
</div>
<div
v-if="showingStickers"
class="stickers-content"
>
<sticker-picker
@uploaded="onStickerUploaded"
@upload-failed="onStickerUploadFailed"
/>
</div>
2019-03-29 15:49:32 +00:00
</div>
</div>
2019-03-29 15:49:32 +00:00
</template>
2019-08-12 10:18:37 +00:00
<script src="./emoji_picker.js"></script>
<style lang="scss" src="./emoji_picker.scss"></style>