feat: add number propMeta on Playground
This commit is contained in:
parent
ca9036c1ad
commit
cf77c6908b
@ -44,6 +44,13 @@ export type ControlTemplate = Record<
|
|||||||
onChange: (value: string) => void;
|
onChange: (value: string) => void;
|
||||||
onToggle: (v: boolean) => void;
|
onToggle: (v: boolean) => void;
|
||||||
}
|
}
|
||||||
|
| {
|
||||||
|
type: "number";
|
||||||
|
value: number;
|
||||||
|
disabled?: boolean;
|
||||||
|
onChange: (value: number) => void;
|
||||||
|
onToggle: (v: boolean) => void;
|
||||||
|
}
|
||||||
>
|
>
|
||||||
>;
|
>;
|
||||||
|
|
||||||
@ -115,6 +122,14 @@ export function PlaygroundControl<T extends ControlTemplate>(props: {
|
|||||||
))}
|
))}
|
||||||
</PopoverContent>
|
</PopoverContent>
|
||||||
</Popover>
|
</Popover>
|
||||||
|
) : propMeta.type === "number" ? (
|
||||||
|
<Input
|
||||||
|
type="number"
|
||||||
|
value={propMeta.value}
|
||||||
|
onChange={(e) =>
|
||||||
|
propMeta.onChange(e.currentTarget.valueAsNumber)
|
||||||
|
}
|
||||||
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user