import * as React from "react"; import { UpFormControl } from "../UpForm/UpFormControl"; import { UpSelect } from "@up-group/react-controls"; export default class EntityField extends UpFormControl { constructor(p, c) { super(p, c); } onChange = (event, cleandata, error?) => { this.setState({ internalData: cleandata }, () => this.handleChangeEventGlobal(event, cleandata, error) ); }; getValue = () => { if ( this.state.internalData && this.state.internalData[this.schema.entitySource.id || "id"] === this.state.value ) { return this.state.internalData; } return this.state.value; }; renderField() { return ( ); } private get schema(): JsonSchema { return (this.props.schema.items as JsonSchema) || this.props.schema; } private get isArray() { return ( (this.props.schema.type as InternalTypeOfSchema[]).indexOf("array") !== -1 ); } }