import PropTypes from "prop-types"; import React, { ReactElement } from "react"; import { FormSchema } from "../../interfaces/FormSchema"; import { InputTags } from "../input-tags/inputTags.component"; import { InputText } from "../input-text/inputText.component"; import { Select } from "../select/select.component"; export const defaultDisplayChoices = [ { label: "Form", value: "form" }, { label: "Wizard", value: "wizard" }, { label: "Pdf", value: "pdf" } ]; export interface FormParametersProps { onChange?: (name: string, value: any) => void; form: Partial; typeChoices?: { label: string; value: any }[]; displayChoices?: { label: string; value: any }[]; enableTags?: boolean; className?: string; } export function FormParameters({ onChange, form, enableTags = true, typeChoices = [], displayChoices = defaultDisplayChoices, className = "" }: FormParametersProps): ReactElement { const hasTypeChoices = typeChoices && typeChoices.length > 1; return (
{window.location.origin + "/" + form.path} } required={true} value={form.path} style={{ textTransform: "lowercase", width: "120px" }} onChange={onChange} />
)} {enableTags && (
)}
); } FormParameters.propTypes = { onChange: PropTypes.func, form: PropTypes.object, enableTags: PropTypes.bool, typeChoices: PropTypes.array, displayChoices: PropTypes.array, className: PropTypes.string };