forked from aksonov/react-native-tableview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
37 lines (37 loc) · 6.48 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{
"name": "react-native-tableview",
"version": "1.5.0",
"description": "Native iOS TableView wrapper for React Native",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/aksonov/react-native-tableview.git"
},
"keywords": [
"react-native",
"react-component",
"UITableView",
"tableview",
"iOS"
],
"author": {
"name": "Pavlo Aksonov",
"email": "akso.nov@gmail.com",
"url": "http://aksonov.com"
},
"license": "ISC",
"bugs": {
"url": "https://github.com/aksonov/react-native-tableview/issues"
},
"homepage": "https://github.com/aksonov/react-native-tableview#readme",
"dependencies": {},
"readme": "# react-native-tableview\nNative iOS UITableView for React Native with JSON support.\n\n## Why I need to use it?\n- To display long lists of data (like country list) - built-in list view has performance issues for long lists\n- To use built-in accessory types (checkmark or disclosure indicator)\n- Automatic scroll to initial selected value during component initialization\n- Automatic item selection with \"checkmark\" with old item de-selection (optionally), see demo, useful to select country/state/etc.\n- Native JSON support for datasource. If you need to display large dataset, generated Javascript will became very large and impact js loading time. To solve this problem the component could read JSON directly from app bundle without JS!\n- Filter JSON datasources using NSPredicate syntax. For example you could select states for given country only (check demo)\n\n## Supports UITableView styles\n- UITableViewStylePlain (TableView.Consts.Style.Plain)\n- UITableViewStyleGrouped (TableView.Consts.Style.Grouped)\n\n## Supports UITableViewCell styles\n- UITableViewCellStyleDefault (TableView.Consts.CellStyle.Default)\n- UITableViewCellStyleValue1 (TableView.Consts.CellStyle.Value1)\n- UITableViewCellStyleValue2 (TableView.Consts.CellStyle.Value2)\n- UITableViewCellStyleSubtitle (TableView.Consts.CellStyle.Subtitle)\n\n## Supports accessory types\n- UITableViewCellAccessoryDisclosureIndicator (\"arrow\" attribute for TableView.Item or TableView.Section)\n- UITableViewCellAccessoryCheckmark (\"selected\" attribute for TableView.Item)\n\n## Example 1\n![demo](https://cloud.githubusercontent.com/assets/1321329/9329083/cc77b4e0-45ae-11e5-9919-34f12e6d407c.gif)\n\n```\n'use strict';\n\nvar React = require('react-native');\nvar { AppRegistry } = React;\nvar TableView = require('react-native-tableview');\nvar Section = TableView.Section;\nvar Item = TableView.Item;\n\nclass TableViewExample extends React.Component {\n render(){\n return (\n <TableView style={{flex:1}}\n tableViewStyle={TableView.Consts.Style.Grouped}\n tableViewCellStyle={TableView.Consts.CellStyle.Subtitle}\n onPress={(event) => console.log(event)}>\n <Section label=\"Section 1\" arrow={true}>\n <Item value=\"1\" detail=\"Detail1\" >Item 1</Item>\n <Item value=\"2\">Item 2</Item>\n <Item>Item 3</Item>\n <Item>Item 4</Item>\n <Item>Item 5</Item>\n <Item>Item 6</Item>\n <Item>Item 7</Item>\n <Item>Item 8</Item>\n <Item>Item 9</Item>\n <Item>Item 10</Item>\n <Item>Item 11</Item>\n <Item>Item 12</Item>\n <Item>Item 13</Item>\n <Item>Item 14</Item>\n <Item>Item 15</Item>\n <Item>Item 16</Item>\n <Item>Item 17</Item>\n <Item>Item 18</Item>\n <Item>Item 19</Item>\n <Item>Item 20</Item>\n <Item>Item 21</Item>\n <Item>Item 22</Item>\n <Item>Item 23</Item>\n <Item>Item 24</Item>\n <Item>Item 25</Item>\n <Item>Item 26</Item>\n <Item>Item 27</Item>\n <Item>Item 28</Item>\n <Item>Item 29</Item>\n <Item>Item 30</Item>\n </Section>\n <Section label=\"Section 2\" arrow={false}>\n <Item selected={true}>Item 1</Item>\n <Item>Item 2</Item>\n <Item>Item 3</Item>\n </Section>\n </TableView>\n );\n }\n}\n\nAppRegistry.registerComponent('TableViewExample', () => TableViewExample);\n```\n## Example 2 (JSON source support), reads country list JSON from app bundle and display UITableView with selected value checkmarked\n![demo2](https://cloud.githubusercontent.com/assets/1321329/9335801/7a4d42ca-45d6-11e5-860c-969db80413ca.gif)\n\n```\n render(){\n return (\n <TableView selectedValue=\"ES\" style={{flex:1}} json=\"countries\"\n tableViewCellStyle={TableView.Consts.CellStyle.Subtitle}\n onPress={(event) => console.log(event)}/>\n );\n }\n```\n\n### Example 3 (JSON filter and optional items at the beginning)\n```\n // list spanish provinces and add 'All states' item at the beginning\n render(){\n var country = \"ES\";\n return (\n <TableView selectedValue=\"\" style={{flex:1}} json=\"states\" filter={`country=='${country}'`}\n tableViewCellStyle={TableView.Consts.CellStyle.Subtitle}\n onPress={(event) => console.log(event)}>\n <Item value=\"\">All states</Item>\n </TableView>\n );\n }\n```\n\n## Getting started\n1. `npm install react-native-tableview --save`\n2. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`\n3. add `./node_modules/react-native-tableview/RCTTableView.xcodeproj`\n4. In the XCode project navigator, select your project, select the `Build Phases` tab and in the `Link Binary With Libraries` section add **libRCTTableView.a**\n5. (optional) If you will use JSON file, add it to iOS application bundle\n6. `var TableView = require('react-native-tableview')`\n",
"readmeFilename": "README.md",
"gitHead": "bc76edf6b3181bea02f1e78c3c21a8cf9b2aacfe",
"_id": "react-native-tableview@1.4.1",
"_shasum": "1ea38fe72abd2cf346b950dfa2fc394d05ba3457",
"_from": "react-native-tableview@>=1.4.1 <2.0.0"
}