chore: setup linting
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import type { NodeInstance, NodeInput } from "@nodarium/types";
|
||||
import { Input } from "@nodarium/ui";
|
||||
import type { GraphManager } from "../graph-manager.svelte";
|
||||
import type { NodeInput, NodeInstance } from '@nodarium/types';
|
||||
import { Input } from '@nodarium/ui';
|
||||
import type { GraphManager } from '../graph-manager.svelte';
|
||||
|
||||
type Props = {
|
||||
node: NodeInstance;
|
||||
@@ -16,17 +16,18 @@
|
||||
input,
|
||||
id,
|
||||
elementId = `input-${Math.random().toString(36).substring(7)}`,
|
||||
graph,
|
||||
graph
|
||||
}: Props = $props();
|
||||
|
||||
function getDefaultValue() {
|
||||
if (node?.props?.[id] !== undefined) return node?.props?.[id] as number;
|
||||
if ("value" in input && input?.value !== undefined)
|
||||
if ('value' in input && input?.value !== undefined) {
|
||||
return input?.value as number;
|
||||
if (input.type === "boolean") return 0;
|
||||
if (input.type === "float") return 0.5;
|
||||
if (input.type === "integer") return 0;
|
||||
if (input.type === "select") return 0;
|
||||
}
|
||||
if (input.type === 'boolean') return 0;
|
||||
if (input.type === 'float') return 0.5;
|
||||
if (input.type === 'integer') return 0;
|
||||
if (input.type === 'select') return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user