2020-09-13 17:19:01 +00:00
|
|
|
<template>
|
|
|
|
<div role="dialog" class="emoji-dialog">
|
|
|
|
<header class="emoji-dialog--header" role="menu">
|
|
|
|
<ul>
|
|
|
|
<li
|
|
|
|
v-for="category in Object.keys(emojis)"
|
|
|
|
:key="category"
|
|
|
|
@click="changeCategory(category)"
|
|
|
|
>
|
|
|
|
<button
|
2022-04-21 05:57:28 +00:00
|
|
|
v-dompurify-html="emojis[category][0]"
|
2020-09-13 17:19:01 +00:00
|
|
|
class="emoji--item"
|
2022-10-11 19:59:28 +00:00
|
|
|
:class="{ active: selectedKey === category }"
|
2020-09-13 17:19:01 +00:00
|
|
|
@click="changeCategory(category)"
|
|
|
|
/>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</header>
|
2022-10-11 19:59:28 +00:00
|
|
|
<h5 class="emoji-category--title">
|
|
|
|
{{ selectedKey }}
|
|
|
|
</h5>
|
2020-09-13 17:19:01 +00:00
|
|
|
<div class="emoji--row">
|
|
|
|
<button
|
|
|
|
v-for="emoji in emojis[selectedKey]"
|
|
|
|
:key="emoji"
|
2022-04-21 05:57:28 +00:00
|
|
|
v-dompurify-html="emoji"
|
2020-09-13 17:19:01 +00:00
|
|
|
class="emoji--item"
|
|
|
|
track-by="$index"
|
|
|
|
@click="onClick(emoji)"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import emojis from './emojis.json';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
onClick: {
|
|
|
|
type: Function,
|
|
|
|
default: () => {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
selectedKey: 'Smileys & Emotion',
|
|
|
|
emojis,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
changeCategory(category) {
|
|
|
|
this.selectedKey = category;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
/**
|
|
|
|
* All the units used below are pixels due to variable name conflict in widget and dashboard
|
|
|
|
**/
|
|
|
|
@import '~dashboard/assets/scss/variables';
|
|
|
|
@import '~dashboard/assets/scss/mixins';
|
|
|
|
|
|
|
|
$space-smaller: 4px;
|
|
|
|
$space-small: 8px;
|
|
|
|
$space-slab: 12px;
|
|
|
|
$space-normal: 16px;
|
|
|
|
$space-two: 20px;
|
|
|
|
$space-medium: 24px;
|
|
|
|
|
2022-10-11 19:59:28 +00:00
|
|
|
$font-size-tiny: 12px;
|
2020-09-13 17:19:01 +00:00
|
|
|
$font-size-small: 14px;
|
|
|
|
$font-size-default: 16px;
|
|
|
|
$font-size-medium: 18px;
|
|
|
|
|
2022-10-11 19:59:28 +00:00
|
|
|
$color-bg: #ebf0f5;
|
|
|
|
|
2020-09-13 17:19:01 +00:00
|
|
|
.emoji-dialog {
|
|
|
|
@include elegant-card;
|
|
|
|
background: $color-white;
|
|
|
|
border-radius: $space-small;
|
|
|
|
box-sizing: content-box;
|
|
|
|
position: absolute;
|
|
|
|
right: 0;
|
2022-10-11 19:59:28 +00:00
|
|
|
top: -220px;
|
|
|
|
width: 332px;
|
2021-01-13 12:36:25 +00:00
|
|
|
z-index: 1;
|
2020-09-13 17:19:01 +00:00
|
|
|
|
|
|
|
&::before {
|
|
|
|
@include arrow(bottom, $color-white, $space-slab);
|
|
|
|
bottom: -$space-slab;
|
|
|
|
position: absolute;
|
|
|
|
right: $space-two;
|
|
|
|
}
|
|
|
|
|
|
|
|
.emoji--item {
|
|
|
|
cursor: pointer;
|
|
|
|
background: transparent;
|
|
|
|
border: 0;
|
|
|
|
font-size: $font-size-medium;
|
2022-10-11 19:59:28 +00:00
|
|
|
height: $space-medium;
|
|
|
|
border-radius: $space-smaller;
|
2020-09-13 17:19:01 +00:00
|
|
|
margin: 0;
|
2022-10-11 19:59:28 +00:00
|
|
|
padding: 0 $space-smaller;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background: $color-bg;
|
|
|
|
}
|
2020-09-13 17:19:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.emoji--row {
|
2022-10-11 19:59:28 +00:00
|
|
|
display: flex;
|
2020-09-13 17:19:01 +00:00
|
|
|
box-sizing: border-box;
|
2022-10-11 19:59:28 +00:00
|
|
|
height: 200px;
|
2020-09-13 17:19:01 +00:00
|
|
|
overflow-y: auto;
|
2022-10-11 19:59:28 +00:00
|
|
|
padding: $space-smaller;
|
|
|
|
flex-wrap: wrap;
|
2020-09-13 17:19:01 +00:00
|
|
|
|
|
|
|
.emoji--item {
|
|
|
|
margin: $space-smaller;
|
|
|
|
line-height: 1.5;
|
|
|
|
}
|
|
|
|
}
|
2022-10-11 19:59:28 +00:00
|
|
|
}
|
2020-09-13 17:19:01 +00:00
|
|
|
|
2022-10-11 19:59:28 +00:00
|
|
|
.emoji-category--title {
|
|
|
|
color: $color-heading;
|
|
|
|
font-size: $font-size-small;
|
|
|
|
font-weight: 500;
|
|
|
|
line-height: 1.5;
|
|
|
|
margin: 0;
|
|
|
|
padding: $space-smaller $space-small;
|
|
|
|
margin-top: $space-smaller;
|
|
|
|
text-transform: capitalize;
|
2020-09-13 17:19:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.emoji-dialog--header {
|
2022-10-11 19:59:28 +00:00
|
|
|
background-color: $color-bg;
|
2020-09-13 17:19:01 +00:00
|
|
|
border-top-left-radius: $space-small;
|
|
|
|
border-top-right-radius: $space-small;
|
|
|
|
padding: 0 $space-smaller;
|
|
|
|
|
|
|
|
ul {
|
|
|
|
display: flex;
|
|
|
|
list-style: none;
|
2021-10-04 04:49:44 +00:00
|
|
|
overflow: auto;
|
2020-09-13 17:19:01 +00:00
|
|
|
margin: 0;
|
2022-10-11 19:59:28 +00:00
|
|
|
padding: $space-smaller 0;
|
2020-09-13 17:19:01 +00:00
|
|
|
|
|
|
|
> li {
|
|
|
|
align-items: center;
|
|
|
|
cursor: pointer;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
2022-10-11 19:59:28 +00:00
|
|
|
padding: $space-smaller;
|
2020-09-13 17:19:01 +00:00
|
|
|
}
|
|
|
|
|
2022-10-11 19:59:28 +00:00
|
|
|
li .active {
|
2020-09-13 17:19:01 +00:00
|
|
|
background: $color-white;
|
2022-10-11 19:59:28 +00:00
|
|
|
}
|
|
|
|
.emoji--item {
|
|
|
|
font-size: $font-size-small;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background: $color-bg;
|
|
|
|
}
|
2020-09-13 17:19:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|