Skip to content

Commit

Permalink
Emit paste event on paste (#3)
Browse files Browse the repository at this point in the history
* Emit paste event on paste

Related to #1 #2

* Add paste event to reference.md

* Show events in toast as example

* Format examples

* Update package version and changelog
  • Loading branch information
drikusroor authored Sep 25, 2022
1 parent 75e70ec commit 2f5385d
Show file tree
Hide file tree
Showing 11 changed files with 242 additions and 102 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.14.0 - 25 Sep 2022
- Update docs with event examples
- Emit paste event from input

## 2.13.0 - 22 Sep 2022
- Update npm dependencies and replace node-sass by dart-sass
- Update/vuepress dart sass
Expand Down
4 changes: 2 additions & 2 deletions docs/.vuepress/components/APIExample.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
export default {
name: "APIExample",
components: {VueBootstrapAutocomplete},
data(){
data() {
return {
query: '',
selecteduser: null,
Expand All @@ -35,7 +35,7 @@
},
methods: {
lookupUser: debounce(function(){
lookupUser: debounce(function() {
// in practice this action should be debounced
fetch(`https://api.github.com/search/users?q=${this.query}`)
.then(response => {
Expand Down
4 changes: 2 additions & 2 deletions docs/.vuepress/components/CustomSuggestion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
export default {
name: "APIExample",
components: {VueBootstrapAutocomplete},
data(){
data() {
return {
query: '',
selecteduser: null,
Expand All @@ -51,7 +51,7 @@
},
methods: {
lookupUser: debounce(function(){
lookupUser: debounce(function() {
// in practice this action should be debounced
fetch(`https://api.github.com/search/users?q=${this.query}`)
.then(response => {
Expand Down
53 changes: 53 additions & 0 deletions docs/.vuepress/components/EventsDemo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<template>
<div>
<div class="pl-1 pb-2 pt-3">Selected Country: {{ query }}</div>
<vue-bootstrap-autocomplete
class="mb-4"
:data="[
'Canada',
'United Kingdom',
'United States',
'Mexico',
'Netherlands',
]"
v-model="query"
showOnFocus
placeholder="Choose a country"
@blur="() => onEvent('blur')"
@focus="() => onEvent('focus')"
@hit="() => onEvent('hit')"
@input="() => onEvent('input')"
@keyup="() => onEvent('keyup')"
@paste="() => onEvent('paste')"
/>
</div>
</template>

<script>
import "bootstrap-vue/dist/bootstrap-vue.css";
import VueBootstrapAutocomplete from "../../../src/components/VueBootstrapAutocomplete";
export default {
name: "EventsDemo",
components: { VueBootstrapAutocomplete },
data() {
return {
query: "",
};
},
methods: {
onEvent(event) {
this.$bvToast.toast(event, {
title: "Event emitted",
autoHideDelay: 5000,
variant: "info",
solid: true,
});
},
},
};
</script>

<style lang="scss">
@import "bootstrap/scss/bootstrap.scss";
</style>
3 changes: 2 additions & 1 deletion docs/.vuepress/components/HomePageDemo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<div>
<div class="pl-1 pb-2 pt-3">Selected Country: {{query}}</div>
<vue-bootstrap-autocomplete
class="mb-4"
:data="['Canada', 'United Kingdom', 'United States', 'Mexico', 'Netherlands']"
v-model="query"
showOnFocus
Expand All @@ -17,7 +18,7 @@
export default {
name: "HomePageDemo",
components: {VueBootstrapAutocomplete},
data(){
data() {
return {
query: ''
}
Expand Down
5 changes: 5 additions & 0 deletions docs/.vuepress/enhanceApp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { ToastPlugin } from "bootstrap-vue";

export default ({ Vue, options, router, siteData, isServer }) => {
Vue.use(ToastPlugin);
};
Loading

0 comments on commit 2f5385d

Please sign in to comment.