react-native-table-component
Advanced tools
Comparing version 1.1.7 to 1.1.8
@@ -12,5 +12,5 @@ import React, { Component } from 'react'; | ||
render() { | ||
const {data, width, height, flex, style, textStyle} = this.props; | ||
const {data, width, height, flex, style, textStyle, ...props} = this.props; | ||
const textDom = React.isValidElement(data) ? data : ( | ||
<Text style={[textStyle, styles.text]}>{data}</Text> | ||
<Text style={[textStyle, styles.text]} {...props}>{data}</Text> | ||
); | ||
@@ -17,0 +17,0 @@ let borderWidth,borderColor; |
@@ -14,3 +14,3 @@ import React, { Component } from 'react'; | ||
render() { | ||
const {data, style, width, heightArr, flex, textStyle, borderStyle} = this.props; | ||
const {data, style, width, heightArr, flex, textStyle, borderStyle, ...props} = this.props; | ||
@@ -27,3 +27,3 @@ return ( | ||
const height = heightArr && heightArr[i]; | ||
return <Cell key={i} data={item} width={width} height={height} textStyle={textStyle} borderStyle={borderStyle}/> | ||
return <Cell key={i} data={item} width={width} height={height} textStyle={textStyle} borderStyle={borderStyle} {...props}/> | ||
}) | ||
@@ -44,3 +44,3 @@ } | ||
render() { | ||
const {data, style, widthArr, heightArr, flexArr, textStyle, borderStyle} = this.props; | ||
const {data, style, widthArr, heightArr, flexArr, textStyle, borderStyle, ...props} = this.props; | ||
let widthNum = 0; | ||
@@ -63,3 +63,3 @@ if (widthArr) { | ||
const width = widthArr && widthArr[i]; | ||
return <Col key={i} data={item} width={width} heightArr={heightArr} flex={flex} style={style} textStyle={textStyle} borderStyle={borderStyle}/> | ||
return <Col key={i} data={item} width={width} heightArr={heightArr} flex={flex} style={style} textStyle={textStyle} borderStyle={borderStyle} {...props}/> | ||
}) | ||
@@ -66,0 +66,0 @@ } |
@@ -13,3 +13,3 @@ import React, { Component } from 'react'; | ||
render() { | ||
const {data, style, widthArr, height, flexArr, textStyle, borderStyle} = this.props; | ||
const {data, style, widthArr, height, flexArr, textStyle, borderStyle, ...props} = this.props; | ||
let widthNum = 0; | ||
@@ -35,3 +35,3 @@ if (widthArr) { | ||
const width = widthArr && widthArr[i]; | ||
return <Cell key={i} data={item} width={width} height={height} flex={flex} textStyle={textStyle} borderStyle={borderStyle}/> | ||
return <Cell key={i} data={item} width={width} height={height} flex={flex} textStyle={textStyle} borderStyle={borderStyle} {...props}/> | ||
}) | ||
@@ -52,3 +52,3 @@ } | ||
render() { | ||
const {data, style, widthArr, heightArr, flexArr, textStyle, borderStyle} = this.props; | ||
const {data, style, widthArr, heightArr, flexArr, textStyle, borderStyle, ...props} = this.props; | ||
let flexNum = 0, widthNum = 0; | ||
@@ -75,3 +75,3 @@ if (flexArr) { | ||
const height = heightArr && heightArr[i]; | ||
return <Row key={i} data={item} widthArr={widthArr} height={height} flexArr={flexArr} style={style} textStyle={textStyle} borderStyle={borderStyle}/> | ||
return <Row key={i} data={item} widthArr={widthArr} height={height} flexArr={flexArr} style={style} textStyle={textStyle} borderStyle={borderStyle} {...props}/> | ||
}) | ||
@@ -78,0 +78,0 @@ } |
{ | ||
"name": "react-native-table-component", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"description": "Build table for react native.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,10 +5,11 @@ # React Native Table Component | ||
This is a table component for react native. | ||
<img src="https://github.com/Gil2015/tools_file/blob/master/img/react-native-table-component/example.jpg?raw=true" width="375"/> | ||
- [Installation](#installation) | ||
- [Changelogs](#Changelogs) | ||
- [Changelogs](#changelogs) | ||
- [Examples](#examples) | ||
- [Properties](#properties) | ||
- [Notice](#Notice) | ||
- [Notice](#notice) | ||
- [License](#license) | ||
[切换到中文文档](https://github.com/Gil2015/react-native-table-component/blob/master/readme_zh.md) | ||
<br/><br/> | ||
@@ -23,2 +24,5 @@ | ||
``` | ||
<img src="https://github.com/Gil2015/tools_file/blob/master/img/react-native-table-component/example.jpg?raw=true" width="375"/> | ||
<br/><br/> | ||
@@ -352,3 +356,3 @@ | ||
| <b>heightArr</b> | Array | Height per line. | `[]` | | ||
| <b>...props</b> | any | more props | | | ||
--- | ||
@@ -364,14 +368,9 @@ | ||
+ Please set the magin value in the textStyle property to adjust the padding and do not use the padding. | ||
+ If parent element is not table element, you should add the type of borderstyle. | ||
+ If parent element is not Table component,please add the type of borderstyle. | ||
```jsx | ||
<ScrollView horizontal={true}> | ||
{/* If parent element is not table element, you should add the type of borderstyle. */} | ||
<TableWrapper borderStyle={{borderWidth: 1,borderColor: '#000',}}> | ||
<Row data={tableHead} style={styles.head} textStyle={styles.headText} widthArr={widthArr}/> | ||
{ | ||
tableData.map((data, i) => ( | ||
<Row key={i} data={data} style={[styles.list, i%2 && {backgroundColor: '#DFF5F2'}]} widthArr={widthArr} textStyle={styles.listText}/> | ||
)) | ||
} | ||
{/* If parent element is not Table component,please add the type of borderstyle. */} | ||
<TableWrapper borderStyle={{borderWidth: 2, borderColor: 'blue',}}> | ||
<Cols data={data} /> | ||
</TableWrapper> | ||
@@ -378,0 +377,0 @@ </ScrollView> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31444
8
379