paricafe/packages/client/src/components/emoji-picker-dialog.vue

77 lines
1.5 KiB
Vue
Raw Normal View History

<template>
2021-11-28 05:07:37 -06:00
<MkPopup ref="popup" v-slot="{ point, close }" :manual-showing="manualShowing" :src="src" :front="true" @click="close()" @opening="opening" @close="$emit('close')" @closed="$emit('closed')">
2021-11-19 04:36:12 -06:00
<MkEmojiPicker ref="picker" class="ryghynhb _popup _shadow" :class="{ pointer: point === 'top' }" :show-pinned="showPinned" :as-reaction-picker="asReactionPicker" @chosen="chosen"/>
2021-08-07 22:19:10 -05:00
</MkPopup>
</template>
<script lang="ts">
import { defineComponent, markRaw } from 'vue';
2021-11-11 11:02:25 -06:00
import MkPopup from '@/components/ui/popup.vue';
import MkEmojiPicker from '@/components/emoji-picker.vue';
export default defineComponent({
components: {
2021-08-07 22:19:10 -05:00
MkPopup,
MkEmojiPicker,
},
props: {
2021-02-27 10:09:59 -06:00
manualShowing: {
type: Boolean,
required: false,
default: null,
},
src: {
required: false
},
showPinned: {
required: false,
default: true
},
asReactionPicker: {
required: false
},
},
2021-08-07 22:19:10 -05:00
emits: ['done', 'close', 'closed'],
data() {
return {
};
},
methods: {
chosen(emoji: any) {
this.$emit('done', emoji);
2021-08-07 22:19:10 -05:00
this.$refs.popup.close();
},
opening() {
this.$refs.picker.reset();
this.$refs.picker.focus();
}
}
});
</script>
<style lang="scss" scoped>
2021-08-09 04:01:12 -05:00
.ryghynhb {
&.pointer {
&:before {
--size: 8px;
content: '';
display: block;
position: absolute;
top: calc(0px - (var(--size) * 2));
left: 0;
right: 0;
width: 0;
margin: auto;
border: solid var(--size) transparent;
border-bottom-color: var(--popup);
}
}
}
</style>