feat(svelte): add fitViewOptions for Controls closes #4201
This commit is contained in:
@@ -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 & {
|
||||
|
||||
Reference in New Issue
Block a user