diff options
| author | Adam Soltys <[email protected]> | 2024-11-07 21:16:25 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-11-08 09:27:40 -0800 |
| commit | 2b0f8339666dfa99e4db8a12b5effffaec9776f0 (patch) | |
| tree | 0253780c569998b6c1a5f43026586e94916c3fee /src/components/Pinpad.svelte | |
| parent | e3d1a7817f70237d70c1ca5a790bab7eac2ff86c (diff) | |
| download | coinos-ui-2b0f8339666dfa99e4db8a12b5effffaec9776f0.tar.gz coinos-ui-2b0f8339666dfa99e4db8a12b5effffaec9776f0.zip | |
svelte 5
Diffstat (limited to 'src/components/Pinpad.svelte')
| -rw-r--r-- | src/components/Pinpad.svelte | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/components/Pinpad.svelte b/src/components/Pinpad.svelte index d61dd2a0..93f31d08 100644 --- a/src/components/Pinpad.svelte +++ b/src/components/Pinpad.svelte @@ -1,11 +1,12 @@ <script> + import { preventDefault, stopPropagation } from 'svelte/legacy'; + import Left from "$comp/Left.svelte"; import Icon from "$comp/Icon.svelte"; import { focus, post, warning } from "$lib/utils"; import { t } from "$lib/translations"; - export let v; - export let cancel; + let { v = $bindable(), cancel } = $props(); let arrow = "<"; let loading = false; @@ -33,7 +34,7 @@ } }; - let hide = true; + let hide = $state(true); </script> <label @@ -41,7 +42,7 @@ > {#if hide} <input - on:keydown={validate} + onkeydown={validate} use:focus bind:value={v} type="password" @@ -50,7 +51,7 @@ /> {:else} <input - on:keydown={validate} + onkeydown={validate} use:focus bind:value={v} class="clean text-center !text-5xl !w-96 block" @@ -61,9 +62,9 @@ <iconify-icon icon={hide ? "ph:eye-slash-bold" : "ph:eye-bold"} width="32" - on:click|stopPropagation|preventDefault={() => (hide = !hide)} + onclick={stopPropagation(preventDefault(() => (hide = !hide)))} class="cursor-pointer" - /> +></iconify-icon> </label> <div class="grid grid-cols-3 gap-2 w-[300px] mx-auto grayscale"> @@ -72,7 +73,7 @@ <button type="button" class="btn" - on:click|stopPropagation|preventDefault={() => handleInput(value)} + onclick={stopPropagation(preventDefault(() => handleInput(value)))} > <Left /> </button> @@ -80,7 +81,7 @@ <button type="button" class="btn" - on:click|stopPropagation|preventDefault={() => handleInput(value)} + onclick={stopPropagation(preventDefault(() => handleInput(value)))} >{value}</button > {/if} |
