2017-06-29 12:54:02 -06:00
|
|
|
import * as React from "react";
|
2017-08-02 09:14:08 -06:00
|
|
|
import { AxisInputBoxProps } from "./interfaces";
|
2017-07-26 16:41:49 -06:00
|
|
|
import { Col, BlurableInput } from "../ui/index";
|
|
|
|
|
2019-12-10 12:53:20 -07:00
|
|
|
export const AxisInputBox = ({ onChange, value, axis }: AxisInputBoxProps) => {
|
2017-08-28 05:44:37 -06:00
|
|
|
return <Col xs={3}>
|
|
|
|
<BlurableInput
|
2020-01-03 13:04:45 -07:00
|
|
|
value={value ?? ""}
|
2017-08-28 05:44:37 -06:00
|
|
|
type="number"
|
2017-12-14 20:46:32 -07:00
|
|
|
allowEmpty={true}
|
|
|
|
onCommit={e => {
|
2018-07-13 14:56:01 -06:00
|
|
|
const val = parseFloat(e.currentTarget.value);
|
2017-12-14 20:46:32 -07:00
|
|
|
onChange(axis, isNaN(val) ? undefined : val);
|
|
|
|
}} />
|
2017-08-28 05:44:37 -06:00
|
|
|
</Col>;
|
2017-07-26 16:41:49 -06:00
|
|
|
};
|