import React from 'react'; import {FieldSimple, OperatorType} from './types'; import {ThemeProps, themeable} from '../../theme'; import InputBox from '../InputBox'; import NumberInput from '../NumberInput'; import DatePicker from '../DatePicker'; import {SelectWithRemoteOptions as Select} from '../Select'; import Switch from '../Switch'; import {localeable, LocaleProps} from '../../locale'; export interface ValueProps extends ThemeProps, LocaleProps { value: any; data?: any; onChange: (value: any) => void; field: FieldSimple; op?: OperatorType; disabled?: boolean; } export class Value extends React.Component { render() { const { classnames: cx, field, value, onChange, op, translate: __, data, disabled } = this.props; let input: JSX.Element | undefined = undefined; if (field.type === 'text') { input = ( ); } else if (field.type === 'number') { input = ( ); } else if (field.type === 'date') { input = ( ); } else if (field.type === 'time') { input = ( ); } else if (field.type === 'datetime') { input = ( ); } else if (field.type === 'select') { input = (