Skip to content

Commit 2f5385d

Browse files
authored
Emit paste event on paste (#3)
* 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
1 parent 75e70ec commit 2f5385d

File tree

11 files changed

+242
-102
lines changed

11 files changed

+242
-102
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.14.0 - 25 Sep 2022
2+
- Update docs with event examples
3+
- Emit paste event from input
4+
15
## 2.13.0 - 22 Sep 2022
26
- Update npm dependencies and replace node-sass by dart-sass
37
- Update/vuepress dart sass

docs/.vuepress/components/APIExample.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
export default {
2727
name: "APIExample",
2828
components: {VueBootstrapAutocomplete},
29-
data(){
29+
data() {
3030
return {
3131
query: '',
3232
selecteduser: null,
@@ -35,7 +35,7 @@
3535
},
3636
3737
methods: {
38-
lookupUser: debounce(function(){
38+
lookupUser: debounce(function() {
3939
// in practice this action should be debounced
4040
fetch(`https://api.github.com/search/users?q=${this.query}`)
4141
.then(response => {

docs/.vuepress/components/CustomSuggestion.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
export default {
4343
name: "APIExample",
4444
components: {VueBootstrapAutocomplete},
45-
data(){
45+
data() {
4646
return {
4747
query: '',
4848
selecteduser: null,
@@ -51,7 +51,7 @@
5151
},
5252
5353
methods: {
54-
lookupUser: debounce(function(){
54+
lookupUser: debounce(function() {
5555
// in practice this action should be debounced
5656
fetch(`https://api.github.com/search/users?q=${this.query}`)
5757
.then(response => {
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<template>
2+
<div>
3+
<div class="pl-1 pb-2 pt-3">Selected Country: {{ query }}</div>
4+
<vue-bootstrap-autocomplete
5+
class="mb-4"
6+
:data="[
7+
'Canada',
8+
'United Kingdom',
9+
'United States',
10+
'Mexico',
11+
'Netherlands',
12+
]"
13+
v-model="query"
14+
showOnFocus
15+
placeholder="Choose a country"
16+
@blur="() => onEvent('blur')"
17+
@focus="() => onEvent('focus')"
18+
@hit="() => onEvent('hit')"
19+
@input="() => onEvent('input')"
20+
@keyup="() => onEvent('keyup')"
21+
@paste="() => onEvent('paste')"
22+
/>
23+
</div>
24+
</template>
25+
26+
<script>
27+
import "bootstrap-vue/dist/bootstrap-vue.css";
28+
import VueBootstrapAutocomplete from "../../../src/components/VueBootstrapAutocomplete";
29+
30+
export default {
31+
name: "EventsDemo",
32+
components: { VueBootstrapAutocomplete },
33+
data() {
34+
return {
35+
query: "",
36+
};
37+
},
38+
methods: {
39+
onEvent(event) {
40+
this.$bvToast.toast(event, {
41+
title: "Event emitted",
42+
autoHideDelay: 5000,
43+
variant: "info",
44+
solid: true,
45+
});
46+
},
47+
},
48+
};
49+
</script>
50+
51+
<style lang="scss">
52+
@import "bootstrap/scss/bootstrap.scss";
53+
</style>

docs/.vuepress/components/HomePageDemo.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<div>
33
<div class="pl-1 pb-2 pt-3">Selected Country: {{query}}</div>
44
<vue-bootstrap-autocomplete
5+
class="mb-4"
56
:data="['Canada', 'United Kingdom', 'United States', 'Mexico', 'Netherlands']"
67
v-model="query"
78
showOnFocus
@@ -17,7 +18,7 @@
1718
export default {
1819
name: "HomePageDemo",
1920
components: {VueBootstrapAutocomplete},
20-
data(){
21+
data() {
2122
return {
2223
query: ''
2324
}

docs/.vuepress/enhanceApp.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { ToastPlugin } from "bootstrap-vue";
2+
3+
export default ({ Vue, options, router, siteData, isServer }) => {
4+
Vue.use(ToastPlugin);
5+
};

0 commit comments

Comments
 (0)