From 7cbcf6fe9bb21691bbcd0ee475c4ad6ab71a2ec3 Mon Sep 17 00:00:00 2001 From: Allan Mariucci Carvalho Date: Sun, 17 Sep 2023 18:50:45 -0300 Subject: [PATCH] finished changes on select input --- README.md | 20 ++++++++++ package.json | 2 +- .../Form/SelectableInput/Options.vue | 9 ++++- .../Form/SelectableInput/SearchInput.vue | 13 +++++- .../SelectableInput/SearchNoResultsFound.vue | 40 +++++++++++++++++++ resources/js/Components/Icons/FacePensive.vue | 9 +++++ 6 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 resources/js/Components/Form/SelectableInput/SearchNoResultsFound.vue create mode 100644 resources/js/Components/Icons/FacePensive.vue diff --git a/README.md b/README.md index e0ab4fc..f3aaa0b 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,26 @@ export default { > you must call this plugin first. +Insert VueJS plugin + +```js +import Vue from 'vue'; +import Laravuewind from 'laravuewind'; + +createInertiaApp({ + //... + setup({ el, App, props, plugin }) { + return createApp({ render: () => h(App, props) }) + .use(plugin) + .use(Laravuewind) // <- this one + .use(ZiggyVue, Ziggy) + .mount(el); + }, + //... +}); +``` + + ### Form components #### InputGroup diff --git a/package.json b/package.json index fde77f3..0396891 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "laravuewind", - "version": "0.1.0-alpha.2", + "version": "0.1.0-alpha.3", "description": "A Laravel VueJs Toolkit built with TailwindCSS", "main": "resources/js/index.ts", "directories": { diff --git a/resources/js/Components/Form/SelectableInput/Options.vue b/resources/js/Components/Form/SelectableInput/Options.vue index 6e257cb..9aa14a5 100644 --- a/resources/js/Components/Form/SelectableInput/Options.vue +++ b/resources/js/Components/Form/SelectableInput/Options.vue @@ -8,6 +8,11 @@ v-if="searchable" v-model="search" :theme="theme"/> + + + + :placeholder="$lvw.translate('form.select.searchPlaceholder')" /> @@ -29,6 +30,16 @@ export default defineComponent({ } } }, + mounted() { + this.focus(); + }, + methods: { + focus() { + setTimeout(() => { + (this.$refs.searchInput as HTMLInputElement).focus(); + }, 300); + } + } }) diff --git a/resources/js/Components/Form/SelectableInput/SearchNoResultsFound.vue b/resources/js/Components/Form/SelectableInput/SearchNoResultsFound.vue new file mode 100644 index 0000000..6cd49c7 --- /dev/null +++ b/resources/js/Components/Form/SelectableInput/SearchNoResultsFound.vue @@ -0,0 +1,40 @@ + + + + + \ No newline at end of file diff --git a/resources/js/Components/Icons/FacePensive.vue b/resources/js/Components/Icons/FacePensive.vue new file mode 100644 index 0000000..a1a6d99 --- /dev/null +++ b/resources/js/Components/Icons/FacePensive.vue @@ -0,0 +1,9 @@ + + + \ No newline at end of file