react-native-table-component
Advanced tools
Comparing version 1.2.1 to 1.2.2
import React, { Component } from 'react'; | ||
import { View, ViewPropTypes, Text, StyleSheet } from 'react-native'; | ||
import PropTypes from 'prop-types'; | ||
import { View, Text, StyleSheet } from 'react-native'; | ||
export class Cell extends Component { | ||
static propTypes = { | ||
style: ViewPropTypes.style, | ||
textStyle: Text.propTypes.style, | ||
borderStyle: ViewPropTypes.style | ||
style: PropTypes.object, | ||
textStyle: PropTypes.object, | ||
borderStyle: PropTypes.object | ||
}; | ||
@@ -10,0 +11,0 @@ |
import React, { Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { View, ViewPropTypes, Text, StyleSheet } from 'react-native'; | ||
import { View, Text, StyleSheet } from 'react-native'; | ||
import { Cell } from './cell'; | ||
@@ -10,4 +10,4 @@ import { sum } from '../utils'; | ||
width: PropTypes.number, | ||
style: ViewPropTypes.style, | ||
textStyle: Text.propTypes.style | ||
style: PropTypes.object, | ||
textStyle: PropTypes.object | ||
}; | ||
@@ -31,4 +31,4 @@ | ||
static propTypes = { | ||
style: ViewPropTypes.style, | ||
textStyle: Text.propTypes.style | ||
style: PropTypes.object, | ||
textStyle: PropTypes.object | ||
}; | ||
@@ -35,0 +35,0 @@ |
import React, { Component } from 'react'; | ||
import { View, ViewPropTypes, Text, StyleSheet } from 'react-native'; | ||
import PropTypes from 'prop-types'; | ||
import { View, Text, StyleSheet } from 'react-native'; | ||
import { Cell } from './cell'; | ||
@@ -8,8 +9,8 @@ import { sum } from '../utils'; | ||
static propTypes = { | ||
style: ViewPropTypes.style, | ||
textStyle: Text.propTypes.style | ||
style: PropTypes.object, | ||
textStyle: PropTypes.object | ||
}; | ||
render() { | ||
const { data, style, widthArr, height, flexArr, textStyle, ...props } = this.props; | ||
const { data, style, widthArr, height, flexArr, textStyle, cellTextStyle, ...props } = this.props; | ||
let width = widthArr ? sum(widthArr) : 0; | ||
@@ -22,3 +23,13 @@ | ||
const wth = widthArr && widthArr[i]; | ||
return <Cell key={i} data={item} width={wth} height={height} flex={flex} textStyle={textStyle} {...props} />; | ||
return ( | ||
<Cell | ||
key={i} | ||
data={item} | ||
width={wth} | ||
height={height} | ||
flex={flex} | ||
textStyle={[cellTextStyle && cellTextStyle(item), textStyle]} | ||
{...props} | ||
/> | ||
); | ||
})} | ||
@@ -32,4 +43,4 @@ </View> | ||
static propTypes = { | ||
style: ViewPropTypes.style, | ||
textStyle: Text.propTypes.style | ||
style: PropTypes.object, | ||
textStyle: PropTypes.object | ||
}; | ||
@@ -36,0 +47,0 @@ |
import React, { Component } from 'react'; | ||
import { View, ViewPropTypes } from 'react-native'; | ||
import PropTypes from 'prop-types'; | ||
import { View } from 'react-native'; | ||
export class Table extends Component { | ||
static propTypes = { | ||
style: ViewPropTypes.style, | ||
borderStyle: ViewPropTypes.style | ||
style: PropTypes.object, | ||
borderStyle: PropTypes.object | ||
}; | ||
@@ -44,3 +45,3 @@ | ||
static propTypes = { | ||
style: ViewPropTypes.style | ||
style: PropTypes.object | ||
}; | ||
@@ -47,0 +48,0 @@ |
{ | ||
"name": "react-native-table-component", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Build table for react native.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -13,2 +13,7 @@ <p align="center"> | ||
<p><span>*</span> 由于工作原因该项目不再维护,如有需要可以转让</p> | ||
<p>如果您对项目感兴趣,请通过电子邮件联系594244274@qq.com.</p> | ||
<br/><br/> | ||
为react-native设计的表格组件. | ||
@@ -15,0 +20,0 @@ |
@@ -13,2 +13,6 @@ <p align="center"> | ||
<p><span style="color: red;">*</span> The project is no longer maintained due to work reasons and can be transferred if necessary.</p> | ||
<p>If you are interested in maintaining the project, please contact the email 594244274@qq.com.</p> | ||
<br/><br/> | ||
This is a table component for react native. | ||
@@ -15,0 +19,0 @@ |
34602
236
394