-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
made the secret key file upload somewhat functional
- Loading branch information
Showing
3 changed files
with
107 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import Root from "./input.svelte"; | ||
import File from "./input-file.svelte"; | ||
|
||
export { | ||
Root, | ||
File, | ||
// | ||
Root as Input, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<script lang="ts"> | ||
import type { HTMLInputAttributes } from "svelte/elements"; | ||
import { cn } from "$lib/utils.js"; | ||
let { | ||
class: className, | ||
/** | ||
* Ignored. | ||
*/ | ||
type = "file", | ||
// Events | ||
onblur, | ||
onchange, | ||
onclick, | ||
onfocus, | ||
onkeydown, | ||
onkeyup, | ||
onmouseover, | ||
onmouseenter, | ||
onmouseleave, | ||
onmousemove, | ||
onpaste, | ||
oninput, | ||
onwheel, | ||
...rest | ||
}: HTMLInputAttributes = $props(); | ||
</script> | ||
|
||
<!-- | ||
@component | ||
This bloody thing only exists because `$bindable` causes svelte to reset | ||
the value to it's current value on every state change which triggers a | ||
DOMException. | ||
Damn you Rich Harris. | ||
--> | ||
|
||
<input | ||
class={cn( | ||
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", | ||
className, | ||
)} | ||
type="file" | ||
|
||
ondragenter={(ev) => { | ||
ev.stopPropagation(); | ||
ev.preventDefault(); | ||
}} | ||
|
||
ondragexit={(ev) => { | ||
ev.stopPropagation(); | ||
ev.preventDefault(); | ||
}} | ||
|
||
{onblur} | ||
{onchange} | ||
{onclick} | ||
{onfocus} | ||
{onkeydown} | ||
{onkeyup} | ||
{onmouseover} | ||
{onmouseenter} | ||
{onmouseleave} | ||
{onmousemove} | ||
{onpaste} | ||
{oninput} | ||
{onwheel} | ||
{...rest} | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters