feat(svelte): add functions to useSvelteFlow
This commit is contained in:
@@ -2,17 +2,18 @@
|
||||
import cc from 'classcat';
|
||||
import type { PanelProps } from './types';
|
||||
|
||||
interface $$Props extends PanelProps {}
|
||||
type $$Props = PanelProps;
|
||||
|
||||
export let position: $$Props['position'] = 'top-right';
|
||||
export let style: $$Props['style'] = '';
|
||||
export let style: $$Props['style'] = undefined;
|
||||
|
||||
let className: $$Props['class'] = undefined;
|
||||
export { className as class };
|
||||
|
||||
$: positionClasses = `${position}`.split('-');
|
||||
</script>
|
||||
|
||||
<div class={cc(['svelte-flow__panel', className, ...positionClasses])} {style}>
|
||||
<div class={cc(['svelte-flow__panel', className, ...positionClasses])} {style} {...$$restProps}>
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import type { PanelPosition } from '@reactflow/system';
|
||||
import type { HTMLAttributes } from 'svelte/elements';
|
||||
|
||||
export type PanelProps = {
|
||||
export type PanelProps = HTMLAttributes<HTMLDivElement> & {
|
||||
'data-testid'?: string;
|
||||
position?: PanelPosition;
|
||||
style?: string;
|
||||
class?: string;
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
bind:this={domNode}
|
||||
style={style}
|
||||
class={cc(['svelte-flow', className])}
|
||||
data-testid="rf__wrapper"
|
||||
data-testid="svelte-flow__wrapper"
|
||||
on:dragover
|
||||
on:drop
|
||||
{...$$restProps}
|
||||
|
||||
Reference in New Issue
Block a user