refac
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
export let inputClassName = 'w-full text-sm py-0.5 bg-transparent';
|
export let inputClassName = 'w-full text-sm py-0.5 bg-transparent';
|
||||||
export let showButtonClassName = 'pl-1.5 transition bg-transparent';
|
export let showButtonClassName = 'pl-1.5 transition bg-transparent';
|
||||||
export let screenReader = true;
|
export let screenReader = true;
|
||||||
|
export let autocomplete = 'off';
|
||||||
|
|
||||||
let show = false;
|
let show = false;
|
||||||
</script>
|
</script>
|
||||||
@@ -25,13 +26,10 @@
|
|||||||
class={`${inputClassName} ${show ? '' : 'password'} ${($settings?.highContrastMode ?? false) ? 'placeholder:text-gray-700 dark:placeholder:text-gray-100' : ' outline-hidden placeholder:text-gray-300 dark:placeholder:text-gray-600'}`}
|
class={`${inputClassName} ${show ? '' : 'password'} ${($settings?.highContrastMode ?? false) ? 'placeholder:text-gray-700 dark:placeholder:text-gray-100' : ' outline-hidden placeholder:text-gray-300 dark:placeholder:text-gray-600'}`}
|
||||||
{placeholder}
|
{placeholder}
|
||||||
type={type === 'password' && !show ? 'password' : 'text'}
|
type={type === 'password' && !show ? 'password' : 'text'}
|
||||||
{value}
|
bind:value
|
||||||
required={required && !readOnly}
|
required={required && !readOnly}
|
||||||
disabled={readOnly}
|
disabled={readOnly}
|
||||||
on:change={(e) => {
|
{autocomplete}
|
||||||
value = e.target.value;
|
|
||||||
}}
|
|
||||||
autocomplete="off"
|
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
class={showButtonClassName}
|
class={showButtonClassName}
|
||||||
|
|||||||
Reference in New Issue
Block a user