feat(svelte): add fitViewOptions for Controls closes #4201

This commit is contained in:
moklick
2024-05-02 15:36:42 +02:00
parent 3b940ac5ae
commit f2f2c3cc2e
6 changed files with 18 additions and 9 deletions
@@ -26,6 +26,7 @@
export let ariaLabel: $$Props['aria-label'] = undefined;
export let style: $$Props['style'] = undefined;
export let orientation: $$Props['orientation'] = 'vertical';
export let fitViewOptions: $$Props['fitViewOptions'] = undefined;
let className: $$Props['class'] = '';
export { className as class };
@@ -63,7 +64,7 @@
};
const onFitViewHandler = () => {
fitView();
fitView(fitViewOptions);
};
const onToggleInteractivity = () => {
@@ -1,6 +1,8 @@
import type { HTMLButtonAttributes } from 'svelte/elements';
import type { PanelPosition } from '@xyflow/system';
import type { FitViewOptions } from '$lib/types';
export type ControlsProps = {
/** Position of the controls on the pane
* @example PanelPosition.TopLeft, PanelPosition.TopRight,
@@ -21,6 +23,7 @@ export type ControlsProps = {
style?: string;
class?: string;
orientation?: 'horizontal' | 'vertical';
fitViewOptions?: FitViewOptions;
};
export type ControlButtonProps = HTMLButtonAttributes & {