misc: Change the way buttons are handled
This commit is contained in:
1 parent
d8ac0d807a
commit
e243848e17
30 files changed
+215
-152
No files matched your search
@@ -3,26 +3,26 @@
|
||||
|
||||
export let label: string = ''
|
||||
export let type: 'text' | 'password' | 'email' | null | undefined = 'text'
|
||||
export let placeholder: string = ''
|
||||
export let value: string = ''
|
||||
export let maxlength: number = -1
|
||||
export let required = false
|
||||
export let id = ''
|
||||
export let pattern: string | undefined = undefined
|
||||
export let minlength: number = 0
|
||||
|
||||
function typeAction(node: Node) {
|
||||
// @ts-ignore
|
||||
node.type = type
|
||||
}
|
||||
|
||||
let clazz = ''
|
||||
export { clazz as class }
|
||||
|
||||
const dispatcher = createEventDispatcher()
|
||||
|
||||
let className = `
|
||||
${value.length != 0 ? 'invalid:border-red-400' : ''}
|
||||
w-full px-3 text-sm py-2.5 bg-white dark:bg-zinc-950
|
||||
border border-slate-300 dark:border-zinc-700 dark:focus:border-white
|
||||
focus:outline-none focus:border-black transition-colors rounded-md
|
||||
${$$props.class}
|
||||
`
|
||||
</script>
|
||||
|
||||
<label class="flex flex-col items-center {clazz}">
|
||||
<label class="flex flex-col items-center {$$props.class}">
|
||||
{#if label != ''}
|
||||
<span
|
||||
class="font-bold text-sm text-left mb-1 cursor-pointer w-max self-start"
|
||||
@@ -38,16 +38,8 @@
|
||||
bind:value
|
||||
on:keydown={(e) => dispatcher('keydown', e)}
|
||||
on:input={(e) => dispatcher('input', e)}
|
||||
{placeholder}
|
||||
{maxlength}
|
||||
{minlength}
|
||||
{pattern}
|
||||
{id}
|
||||
class="{value.length != 0
|
||||
? 'invalid:border-red-400'
|
||||
: ''} w-full px-3 text-sm py-2.5 bg-transparent
|
||||
border border-black/20 dark:border-white/20 dark:focus:border-white
|
||||
focus:outline-none focus:border-black transition-colors rounded-md {clazz}"
|
||||
{...$$restProps}
|
||||
class={className}
|
||||
{required}
|
||||
/>
|
||||
</label>
|
||||
Reference in new issue
Block a user