moved some widgets to elements

This commit is contained in:
Jan Prochazka
2021-03-06 08:09:29 +01:00
parent dcfd6ee1dc
commit 78d71602bf
20 changed files with 19 additions and 19 deletions

View File

@@ -0,0 +1,32 @@
<script lang="ts">
import keycodes from '../utility/keycodes';
export let placeholder;
export let value;
let domInput;
function handleKeyDown(e) {
if (e.keyCode == keycodes.escape) {
value = '';
}
}
</script>
<input
type="text"
{placeholder}
bind:value
on:keydown={handleKeyDown}
bind:this={domInput}
on:focus={e => domInput.select()}
/>
<style>
input {
flex: 1;
min-width: 10px;
width: 10px;
border: none;
}
</style>