UNPKG

@gravel-form/antd

Version:

A flexible middlewares driven json schema form with Ant Design

1 lines 774 B
{"version":3,"sources":["middlewares/RateMw.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAM5C,CAAC;AAEF,eAAe,MAAM,CAAC","file":"RateMw.d.ts","sourcesContent":["import * as React from 'react';\nimport { Rate } from 'antd';\nimport get from 'lodash/get';\nimport { MiddlewareProps } from '../share';\n\nexport const RateMw: React.FC<MiddlewareProps> = (props) => {\n const { schema, onChange, data, next, extraProps } = props;\n\n if (typeof schema === 'boolean' || (schema.type !== 'integer' && schema.type !== 'number')) return next(props);\n\n return <Rate value={data} onChange={onChange} {...get(extraProps, 'props')} />;\n};\n\nexport default RateMw;\n"]}