chore(svelte/selection): cleanup

This commit is contained in:
moklick
2025-10-28 15:46:50 +01:00
parent 3c609e0122
commit 072308f80e
2 changed files with 3 additions and 6 deletions
@@ -85,7 +85,7 @@
onkeydown={store.disableKeyboardA11y ? undefined : onkeydown} onkeydown={store.disableKeyboardA11y ? undefined : onkeydown}
bind:this={ref} bind:this={ref}
> >
<Selection width="100%" height="100%" x={0} y={0} class="svelte-flow__nodesselection-rect" /> <Selection width="100%" height="100%" x={0} y={0} />
</div> </div>
{/if} {/if}
@@ -1,5 +1,4 @@
<script lang="ts"> <script lang="ts">
import type { ClassValue } from 'svelte/elements';
import { toPxString } from '$lib/utils'; import { toPxString } from '$lib/utils';
let { let {
@@ -7,21 +6,19 @@
y = 0, y = 0,
width = 0, width = 0,
height = 0, height = 0,
isVisible = true, isVisible = true
...props
}: { }: {
x?: number; x?: number;
y?: number; y?: number;
width?: number | string; width?: number | string;
height?: number | string; height?: number | string;
isVisible?: boolean; isVisible?: boolean;
class?: ClassValue;
} = $props(); } = $props();
</script> </script>
{#if isVisible} {#if isVisible}
<div <div
class={['svelte-flow__selection', props.class]} class="svelte-flow__selection"
style:width={typeof width === 'string' ? width : toPxString(width)} style:width={typeof width === 'string' ? width : toPxString(width)}
style:height={typeof height === 'string' ? height : toPxString(height)} style:height={typeof height === 'string' ? height : toPxString(height)}
style:transform={`translate(${x}px, ${y}px)`} style:transform={`translate(${x}px, ${y}px)`}