import * as React from "react"; import { UpFormControl } from "../UpForm/UpFormControl"; import { UpSelect } from "@up-group/react-controls"; interface UpEnumExtendProp { _enum: Number[]; enumDescriptions: String[]; multiple: boolean; } type enumData = { id: any; text: string }; export default class EnumField extends UpFormControl { constructor(p, c) { super(p, c); } renderField() { var options = []; for (var i = 0; i < this.schema.enum.length; i++) { if (this.schema.enum[i] !== null) { options.push({ id: this.schema.enum[i], text: this.schema.enumDescriptions[i] }); } } 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 ); } }