Skip to content

Commit

Permalink
ADD: TwemojiTextarea now extends on TwemojiPicker slots
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinfaveri committed May 10, 2020
1 parent d8dd9de commit 6b6f39e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
4 changes: 4 additions & 0 deletions docs/docs/changelog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ title: 'Changelog'

# Changelog

## 5.7.2

- Added a Vue slot which enables the usage of TwemojiPicker as a headless component when using TwemojiTextarea component

## 5.7.1
- Fixes ESM build

Expand Down
3 changes: 1 addition & 2 deletions docs/docs/twemoji-picker-api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ The HTMLElement provided for the slot will be DOM element which will trigger the
:emojiData="emojiDataAll"
:emojiGroups="emojiGroups"
>
<template v-slot:twemoji-picker-button
>
<template v-slot:twemoji-picker-button>
<button>OMG A HEADLESS COMPONENT</button>
</template>
</twemoji-picker>
Expand Down
4 changes: 4 additions & 0 deletions docs/docs/twemoji-textarea-api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ This method adds a text to the textarea. The text parameter will then be sanitiz

This method cleans the textarea.

## Slots

- This component inherits all Twemoji Picker slots. You can check them [here](/docs/twemoji-picker-api/#slots).

## Styling

The component doesn't enforce CSS rules using `!important` so you can easily overwrite its default style.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kevinfaguiar/vue-twemoji-picker",
"version": "5.7.1",
"version": "5.7.2",
"main": "dist/vue-twemoji-picker.umd.min.js",
"module": "dist/vue-twemoji-picker.esm.min.js",
"unpkg": "dist/vue-twemoji-picker.min.js",
Expand Down
5 changes: 3 additions & 2 deletions src/components/Sandbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
:recentEmojisFeat="true"
recentEmojisStorage="none"
:searchEmojisFeat="true"
placeholder="Textarea Placeholder"
placeholder="Textarea Placeholders"
:maxlength="100"
@isContentOverflowed="isContentOverflowed"
ref="twemojiTextareaRef"
Expand All @@ -36,7 +36,8 @@
pickerWidth="#idTextarea"
:randomEmojiArray="randomEmojiArray"
:emojiPickerDisabled="emojiPickerDisabled"
></twemoji-textarea>
>
</twemoji-textarea>
<button @click="onClickTest">Working Test</button>
</div>
<div>
Expand Down
6 changes: 5 additions & 1 deletion src/components/TwemojiTextarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
@emojiUnicodeAdded="emojiUnicodeAdded"
@emojiImgAdded="emojiImgAdded"
:pickerPaddingOffset="pickerPaddingOffset"
></twemoji-picker>
>
<template v-for="(_, slotName) in $slots" v-slot:[slotName]>
<slot :name="slotName" />
</template>
</twemoji-picker>

<div
ref="twemojiTextarea"
Expand Down

0 comments on commit 6b6f39e

Please sign in to comment.