@gravel-form/antd
Version:
A flexible middlewares driven json schema form with Ant Design
1 lines • 1.01 kB
Source Map (JSON)
{"version":3,"sources":["middlewares/FieldsetTemplateMw.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAI1C,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,aAAa,CAAC,eAAe,CAiBnE,CAAC;AAEF,eAAe,kBAAkB,CAAC","file":"FieldsetTemplateMw.d.ts","sourcesContent":["import * as React from 'react';\nimport { MiddlewareProps } from '../core';\nimport { Typography } from 'antd';\nconst { Text } = Typography;\n\nexport const FieldsetTemplateMw: React.ComponentType<MiddlewareProps> = (props) => {\n const { schema, next } = props;\n\n if (typeof schema === 'boolean' || !(schema.type === 'object' || schema.type === 'array')) return next(props);\n\n const title = schema.title;\n return (\n <fieldset>\n {title && <legend>{title}</legend>}\n {schema.description && (\n <div>\n <Text type=\"secondary\">{schema.description}</Text>\n </div>\n )}\n {next(props)}\n </fieldset>\n );\n};\n\nexport default FieldsetTemplateMw;\n"]}