mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-10-31 13:28:18 +00:00
35 lines
910 B
Svelte
35 lines
910 B
Svelte
<script lang="ts">
|
|
import { translateIfAvailable as translate } from "@vrtmrz/livesync-commonlib/compat/common/i18n";
|
|
|
|
type Props = {
|
|
value: string;
|
|
name?: string;
|
|
placeholder?: string;
|
|
disabled?: boolean;
|
|
required?: boolean;
|
|
};
|
|
let {
|
|
value = $bindable(),
|
|
name = "password",
|
|
placeholder = "Enter your password",
|
|
disabled = false,
|
|
required = false,
|
|
}: Props = $props();
|
|
let showPassword = $state(false);
|
|
const type = $derived.by(() => (showPassword ? "text" : "password"));
|
|
const translatedPlaceholder = $derived.by(() => translate(placeholder));
|
|
</script>
|
|
|
|
<input
|
|
{type}
|
|
{name}
|
|
placeholder={translatedPlaceholder}
|
|
bind:value
|
|
{disabled}
|
|
{required}
|
|
spellcheck="false"
|
|
autocorrect="off"
|
|
autocapitalize="off"
|
|
/>
|
|
<input type="checkbox" bind:checked={showPassword} />
|