@gravel-form/antd
Version:
A flexible middlewares driven json schema form with Ant Design
1 lines • 1.84 kB
Source Map (JSON)
{"version":3,"sources":["middlewares/InputMw.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG3C,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAY7C,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAYhD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAYhD,CAAC;AAEF,eAAe,OAAO,CAAC","file":"InputMw.d.ts","sourcesContent":["import * as React from 'react';\nimport get from 'lodash/get';\nimport { Input } from 'antd';\nimport { MiddlewareProps } from '../share';\nconst { TextArea, Password } = Input;\n\nexport const InputMw: React.FC<MiddlewareProps> = (props) => {\n const { next, schema, data, onChange, extraProps } = props;\n if (typeof schema === 'boolean' || schema.type !== 'string') return next(props);\n return (\n <Input\n value={data || ''}\n onChange={(e: any) => {\n onChange(e.target.value || undefined);\n }}\n {...get(extraProps, 'props')}\n />\n );\n};\n\nexport const TextAreaMw: React.FC<MiddlewareProps> = (props) => {\n const { next, schema, data, onChange, extraProps } = props;\n if (typeof schema === 'boolean' || schema.type !== 'string') return next(props);\n return (\n <TextArea\n value={data || ''}\n onChange={(e: any) => {\n onChange(e.target.value || undefined);\n }}\n {...get(extraProps, 'props')}\n />\n );\n};\n\nexport const PasswordMw: React.FC<MiddlewareProps> = (props) => {\n const { next, schema, data, onChange, extraProps } = props;\n if (typeof schema === 'boolean' || schema.type !== 'string') return next(props);\n return (\n <Password\n value={data || ''}\n onChange={(e: any) => {\n onChange(e.target.value || undefined);\n }}\n {...get(extraProps, 'props')}\n />\n );\n};\n\nexport default InputMw;\n"]}