Lib: Add extraclass field to Button component
This commit is contained in:
@ -36,6 +36,9 @@
|
|||||||
|
|
||||||
/** Should the button have a shadow? */
|
/** Should the button have a shadow? */
|
||||||
shadow?: boolean;
|
shadow?: boolean;
|
||||||
|
|
||||||
|
/** Additional classes to insert */
|
||||||
|
extraclass?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
@ -48,6 +51,7 @@
|
|||||||
activate_href = false,
|
activate_href = false,
|
||||||
trigger_popup = { event: "click", target: "invalid" },
|
trigger_popup = { event: "click", target: "invalid" },
|
||||||
shadow = false,
|
shadow = false,
|
||||||
|
extraclass = "",
|
||||||
...restProps
|
...restProps
|
||||||
}: ButtonProps = $props();
|
}: ButtonProps = $props();
|
||||||
</script>
|
</script>
|
||||||
@ -61,7 +65,7 @@
|
|||||||
? `variant-filled-${color}`
|
? `variant-filled-${color}`
|
||||||
: ''} {width} {activate ? 'btn-hover' : ''} {activate_href && is_at_path(href)
|
: ''} {width} {activate ? 'btn-hover' : ''} {activate_href && is_at_path(href)
|
||||||
? 'btn-hover'
|
? 'btn-hover'
|
||||||
: ''} {shadow ? 'shadow' : ''}"
|
: ''} {shadow ? 'shadow' : ''} {extraclass}"
|
||||||
draggable="false"
|
draggable="false"
|
||||||
{...restProps}>{@render children()}</button
|
{...restProps}>{@render children()}</button
|
||||||
>
|
>
|
||||||
@ -71,7 +75,7 @@
|
|||||||
type={submit ? "submit" : "button"}
|
type={submit ? "submit" : "button"}
|
||||||
class="btn select-none px-2 py-2 {color ? `variant-filled-${color}` : ''} {width} {activate
|
class="btn select-none px-2 py-2 {color ? `variant-filled-${color}` : ''} {width} {activate
|
||||||
? 'btn-hover'
|
? 'btn-hover'
|
||||||
: ''} {shadow ? 'shadow' : ''}"
|
: ''} {shadow ? 'shadow' : ''} {extraclass}"
|
||||||
draggable="false"
|
draggable="false"
|
||||||
use:popup={trigger_popup}
|
use:popup={trigger_popup}
|
||||||
{...restProps}>{@render children()}</button
|
{...restProps}>{@render children()}</button
|
||||||
|
Reference in New Issue
Block a user