import React from 'react'; // import { // storiesOf // } from '@storybook/react'; import { Form, Text } from 'informed'; import { TextArea } from '@douyinfe/semi-ui'; // import { Form, asField } from '../src/index'; // import Input from '../../input/index'; // import Select from '../../select/index'; // const stories = storiesOf('informed', module); // // // stories.addDecorator(withKnobs);; // const validate = value => { // return !value || value.length < 5 // ? 'Field must be at least five characters' // : undefined; // }; // const ErrorText = asField(({ // fieldState, // fieldApi, // ...props // }) => { // const {value} = fieldState; // const {setValue, setTouched} = fieldApi; // const { // onChange, // onBlur, // initialValue, // forwardedRef, // ...rest // } = props; // return ( // // { // setValue(e.target.value); // if (onChange) { // onChange(e); // } // }} // onBlur={e => { // setTouched(); // if (onBlur) { // onBlur(e); // } // }} // /> // // ); // }); // const FromScratch = () => ( //
//
// {({formApi, formState}) => ( // // // // {JSON.stringify(formState)} // // )} //
//
// ); // stories.add('Form施工现场', () => ()); const submit = values => window.alert(`Form successfully submitted with ${JSON.stringify(values)}`); const validate = value => { if (!value) { return '不能为空'; } }; class InformDemo extends React.Component { render() { return (
{({ formState, values }) => ( <>