From f67d929dce4976a2029d2e8ae0b8b664323522a6 Mon Sep 17 00:00:00 2001 From: Paulo Antonio Leandro Florentino de Carvalho Date: Sat, 6 May 2023 01:05:32 -0300 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20component=20inputSea?= =?UTF-8?q?rch,=20now=20use=20the=20x=20to=20clean=20input=20val?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit in achievement page was an input without type search, the update make a new type of input and improve a11y --- src/components/Input.svelte | 12 +++++++ src/components/InputSearch.svelte | 51 +++++++++++++++++++++++++++++ src/routes/achievement/index.svelte | 23 +++++-------- 3 files changed, 72 insertions(+), 14 deletions(-) create mode 100644 src/components/InputSearch.svelte diff --git a/src/components/Input.svelte b/src/components/Input.svelte index 142500099..82c83e1af 100644 --- a/src/components/Input.svelte +++ b/src/components/Input.svelte @@ -44,8 +44,20 @@ {pattern} on:change on:input={handleInput} + on:focus={() => { dispatch('focus'); }} + on:blur={() => { dispatch('blur'); }} class={`w-full ${ icon ? 'pl-12' : 'pl-4' } min-h-full pr-4 text-white placeholder-gray-500 leading-none bg-transparent border-none focus:outline-none`} /> + + \ No newline at end of file diff --git a/src/components/InputSearch.svelte b/src/components/InputSearch.svelte new file mode 100644 index 000000000..289b44fe3 --- /dev/null +++ b/src/components/InputSearch.svelte @@ -0,0 +1,51 @@ + + +
+ { dispatch('input'); }} + on:focus={validateInputButtonCancel} + on:blur={validateInputButtonCancel} + bind:value={value} + /> + {#if showInputButtonCancel} + + {/if} +
diff --git a/src/routes/achievement/index.svelte b/src/routes/achievement/index.svelte index 181d8a1a0..60822a590 100644 --- a/src/routes/achievement/index.svelte +++ b/src/routes/achievement/index.svelte @@ -6,7 +6,7 @@ import { locale, t } from 'svelte-i18n'; import { onMount, tick } from 'svelte'; import debounce from 'lodash.debounce'; - import { mdiFilter, mdiOpenInNew } from '@mdi/js'; + import { mdiFilter, mdiOpenInNew, mdiClose } from '@mdi/js'; import Check from '../../components/Check.svelte'; import Checkbox from '../../components/Checkbox.svelte'; @@ -14,6 +14,7 @@ import { readSave, updateSave, fromRemote } from '../../stores/saveManager'; import Button from '../../components/Button.svelte'; import Icon from '../../components/Icon.svelte'; + import InputSearch from '../../components/InputSearch.svelte'; import Select from '../../components/Select.svelte'; import { pushToast } from '../../stores/toast'; import Ad from '../../components/Ad.svelte'; @@ -405,19 +406,12 @@ {#if showFilter} -
-
- -
+
+