@gravel-form/antd
Version:
A flexible middlewares driven json schema form with Ant Design
1 lines • 1.03 kB
Source Map (JSON)
{"version":3,"sources":["middlewares/GridMw.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,eAAe,CAStD,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,eAAe,CAKtD,CAAC","file":"GridMw.d.ts","sourcesContent":["import * as React from 'react';\nimport { Row, Col } from 'antd';\nimport get from 'lodash/get';\nimport { MiddlewareProps } from '../share';\n\nexport const ColMw: React.ComponentType<MiddlewareProps> = (props) => {\n const { extraProps, parent, next } = props;\n if (!parent) return next(props);\n\n return (\n <Col span=\"24\" {...get(extraProps, 'col')}>\n {next(props)}\n </Col>\n );\n};\n\nexport const RowMw: React.ComponentType<MiddlewareProps> = (props) => {\n const { schema, extraProps, next } = props;\n if (typeof schema === 'object' && (schema.type === 'object' || schema.type === 'array'))\n return <Row {...get(extraProps, 'row')}>{next(props)}</Row>;\n return next(props);\n};\n"]}