9617c2297673169b48ae94bfb18c1322.json
4.46 KB
{"ast":null,"code":"var _interopRequireWildcard=require(\"@babel/runtime/helpers/interopRequireWildcard\");var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=void 0;var _extends2=_interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));var _classCallCheck2=_interopRequireDefault(require(\"@babel/runtime/helpers/classCallCheck\"));var _createClass2=_interopRequireDefault(require(\"@babel/runtime/helpers/createClass\"));var _possibleConstructorReturn2=_interopRequireDefault(require(\"@babel/runtime/helpers/possibleConstructorReturn\"));var _getPrototypeOf2=_interopRequireDefault(require(\"@babel/runtime/helpers/getPrototypeOf\"));var _inherits2=_interopRequireDefault(require(\"@babel/runtime/helpers/inherits\"));var React=_interopRequireWildcard(require(\"react\"));var _StyleSheet=_interopRequireDefault(require(\"react-native-web/dist/exports/StyleSheet\"));var _View=_interopRequireDefault(require(\"react-native-web/dist/exports/View\"));var _jsxFileName=\"/Users/satya/Workspace/Callstack/react-native-paper/src/components/Card/CardActions.tsx\";var CardActions=function(_React$Component){(0,_inherits2.default)(CardActions,_React$Component);function CardActions(){(0,_classCallCheck2.default)(this,CardActions);return(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(CardActions).apply(this,arguments));}(0,_createClass2.default)(CardActions,[{key:\"render\",value:function render(){return React.createElement(_View.default,(0,_extends2.default)({},this.props,{style:[styles.container,this.props.style],__source:{fileName:_jsxFileName,lineNumber:37}}),React.Children.map(this.props.children,function(child){return React.isValidElement(child)?React.cloneElement(child,{compact:child.props.compact!==false}):child;}));}}]);return CardActions;}(React.Component);CardActions.displayName='Card.Actions';var styles=_StyleSheet.default.create({container:{flexDirection:'row',alignItems:'center',justifyContent:'flex-start',padding:8}});var _default=CardActions;exports.default=_default;","map":{"version":3,"sources":["CardActions.tsx"],"names":["CardActions","React","Component","displayName","styles","compact","child","StyleSheet","container","flexDirection","alignItems","justifyContent","padding"],"mappings":"kyBAAA,oD,uRA+BMA,GAAAA,CAAAA,W,wVAGK,CACP,MACE,CAAA,KAAA,CAAA,aAAA,CAAA,aAAA,CAAA,sBAAA,EAAA,CAAU,KAAV,KAAA,CAAA,CAAsB,KAAK,CAAE,CAACI,MAAM,CAAP,SAAA,CAAmB,KAAA,KAAA,CAAhD,KAA6B,CAA7B,CAAA,QAAA,CAAA,CAAA,QAAA,CAAA,YAAA,CAAA,UAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CACGH,KAAK,CAALA,QAAAA,CAAAA,GAAAA,CAAmB,KAAA,KAAA,CAAnBA,QAAAA,CAAwC,SAAA,KAAA,CAAK,CAAA,MAC5CA,CAAAA,KAAK,CAALA,cAAAA,CAAAA,KAAAA,EACIA,KAAK,CAALA,YAAAA,CAAAA,KAAAA,CAA0B,CACxBI,OAAO,CAAEC,KAAK,CAALA,KAAAA,CAAAA,OAAAA,GAFfL,KAC8B,CAA1BA,CADJA,CAD4C,KAAA,CAFlD,CAEKA,CADH,CADF,C,0BAJsBA,KAAK,CAACC,S,CAA1BF,CAAAA,W,CACGG,WADHH,CACiB,cADjBA,CAkBN,GAAMI,CAAAA,MAAM,CAAGG,oBAAAA,MAAAA,CAAkB,CAC/BC,SAAS,CAAE,CACTC,aAAa,CADJ,KAAA,CAETC,UAAU,CAFD,QAAA,CAGTC,cAAc,CAHL,YAAA,CAITC,OAAO,CALX,CACa,CADoB,CAAlBL,CAAf,C,aASA,W","sourcesContent":["import * as React from 'react';\nimport { StyleSheet, StyleProp, View, ViewStyle } from 'react-native';\n\ntype Props = React.ComponentProps<typeof View> & {\n /**\n * Items inside the `CardActions`.\n */\n children: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n};\n\n/**\n * A component to show a list of actions inside a Card.\n *\n * ## Usage\n * ```js\n * import * as React from 'react';\n * import { Button, Card } from 'react-native-paper';\n *\n * const MyComponent = () => (\n * <Card>\n * <Card.Actions>\n * <Button>Cancel</Button>\n * <Button>Ok</Button>\n * </Card.Actions>\n * </Card>\n * );\n *\n * export default MyComponent;\n * ```\n */\nclass CardActions extends React.Component<Props> {\n static displayName = 'Card.Actions';\n\n render() {\n return (\n <View {...this.props} style={[styles.container, this.props.style]}>\n {React.Children.map(this.props.children, child =>\n React.isValidElement(child)\n ? React.cloneElement(child, {\n compact: child.props.compact !== false,\n })\n : child\n )}\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'flex-start',\n padding: 8,\n },\n});\n\nexport default CardActions;\n"]},"metadata":{},"sourceType":"script"}