@prosperitainova/dumbo-react-native
Version:
Dumbo for React Native Library
40 lines (38 loc) • 1.11 kB
JavaScript
;
import React from 'react';
import { StyleSheet, View } from 'react-native';
import { styleReferenceBreaker } from '../../helpers';
/** Props for DataTable component */
import { jsx as _jsx } from "react/jsx-runtime";
/**
* DataTable component for rendering a data table.
* Children components should be DataTableRow, DataTableCell, DataTableHeader, DataTableHeaderSelected
*
* {@link https://github.com/carbon-design-system/carbon-react-native/blob/main/example/src/Views/DataTable.tsx | Example code}
*/
export class DataTable extends React.Component {
get styles() {
return StyleSheet.create({
wrapper: {
flexDirection: 'column',
width: '100%',
flex: 1,
alignContent: 'flex-start'
}
});
}
render() {
const {
componentProps,
style,
children
} = this.props;
const finalStyles = styleReferenceBreaker(this.styles.wrapper, style);
return /*#__PURE__*/_jsx(View, {
style: finalStyles,
...(componentProps || {}),
children: children
});
}
}
//# sourceMappingURL=DataTable.js.map