import React, { Component } from 'react'; import { courtesyS } from 'app/utils' export const TextInput = props => ( ) export const LabelDescription = props => ( ) export class NumberInput extends Component { constructor(props) { super(props) this.handleKeyDown = this.handleKeyDown.bind(this) } handleKeyDown(e) { const { min, max, step, data, name, onChange } = this.props const value = data[name] // console.log(e.keyCode) switch (e.keyCode) { case 38: // up if (e.shiftKey) { e.preventDefault() onChange({ target: { name, value: Math.min(max, parseFloat(value) + ((step || 1) * 10)) } }) } break case 40: // down if (e.shiftKey) { e.preventDefault() onChange({ target: { name, value: Math.max(min, parseFloat(value) - ((step || 1) * 10)) } }) } break } } render() { const { props } = this return ( ) } } export const ColorInput = props => ( ) export const TextArea = props => (