export htmlattributes as props where possible
This commit is contained in:
@@ -27,7 +27,8 @@
|
||||
fitViewOptions,
|
||||
children,
|
||||
before,
|
||||
after
|
||||
after,
|
||||
...rest
|
||||
}: ControlsProps = $props();
|
||||
|
||||
const store = useStore();
|
||||
@@ -74,6 +75,7 @@
|
||||
data-testid="svelte-flow__controls"
|
||||
aria-label={ariaLabel ?? 'Svelte Flow controls'}
|
||||
{style}
|
||||
{...rest}
|
||||
>
|
||||
{#if before}
|
||||
{@render before()}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Snippet } from 'svelte';
|
||||
import type { ClassValue, HTMLButtonAttributes } from 'svelte/elements';
|
||||
import type { ClassValue, HTMLAttributes, HTMLButtonAttributes } from 'svelte/elements';
|
||||
import type { PanelPosition } from '@xyflow/system';
|
||||
|
||||
import type { FitViewOptions } from '$lib/types';
|
||||
@@ -29,7 +29,7 @@ export type ControlsProps = {
|
||||
before?: Snippet;
|
||||
after?: Snippet;
|
||||
fitViewOptions?: FitViewOptions;
|
||||
};
|
||||
} & HTMLAttributes<HTMLDivElement>;
|
||||
|
||||
export type ControlButtonProps = HTMLButtonAttributes & {
|
||||
class?: ClassValue;
|
||||
|
||||
Reference in New Issue
Block a user