{"version":3,"sources":["middlewares/CheckboxMw.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAExD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC,4BAA4B,CAaxE,CAAC;AAEF,eAAe,UAAU,CAAC","file":"CheckboxMw.d.ts","sourcesContent":["import * as React from 'react';\nimport get from 'lodash/get';\nimport { Checkbox } from '@blueprintjs/core';\nimport { BlueprintFormMiddlewareProps } from '../share';\n\nexport const CheckboxMw: React.ComponentType<BlueprintFormMiddlewareProps> = (props) => {\n  const { schema, onChange, data, next, extraProps } = props;\n  if (typeof schema === 'boolean' || schema.type !== 'boolean') return next(props);\n\n  return (\n    <Checkbox\n      checked={data}\n      onChange={(e) => onChange(e.currentTarget.checked || undefined)}\n      {...get(extraProps, 'props')}\n    >\n      {schema.title}\n    </Checkbox>\n  );\n};\n\nexport default CheckboxMw;\n"]}