Skip to content

Commit

Permalink
2.5.0 #197
Browse files Browse the repository at this point in the history
  • Loading branch information
iRoachie committed Jan 17, 2019
2 parents b76367d + 6535889 commit b8a9a68
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions RNTableView/RNTableView.m
Expand Up @@ -530,6 +530,13 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
newValue[@"target"] = self.reactTag;
newValue[@"selectedIndex"] = [NSNumber numberWithInteger:indexPath.item];
newValue[@"selectedSection"] = [NSNumber numberWithInteger:indexPath.section];

CGRect selectedCellRect = [tableView rectForRowAtIndexPath:indexPath];
selectedCellRect = CGRectOffset(selectedCellRect, -tableView.contentOffset.x, -tableView.contentOffset.y);
newValue[@"selectedOrigin"] = @{
@"x": @(selectedCellRect.origin.x),
@"y": @(selectedCellRect.origin.y)
};

/*
* if allowToggle is enabled and we tap an already selected row, then remove the selection.
Expand Down
1 change: 1 addition & 0 deletions RNTableView/RNTableViewManager.m
Expand Up @@ -47,6 +47,7 @@ - (NSArray *)customDirectEventTypes
RCT_EXPORT_VIEW_PROPERTY(additionalItems, NSArray)
RCT_EXPORT_VIEW_PROPERTY(selectedIndex, NSInteger)
RCT_EXPORT_VIEW_PROPERTY(selectedSection, NSInteger)
RCT_EXPORT_VIEW_PROPERTY(selectedOrigin, CGPoint)
RCT_EXPORT_VIEW_PROPERTY(cellHeight, float)
RCT_EXPORT_VIEW_PROPERTY(footerHeight, float)
RCT_EXPORT_VIEW_PROPERTY(headerHeight, float)
Expand Down
4 changes: 4 additions & 0 deletions example/ios/TableViewDemo.xcodeproj/project.pbxproj
Expand Up @@ -36,6 +36,7 @@
2D16E6881FA4F8E400B85C8A /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D16E6891FA4F8E400B85C8A /* libReact.a */; };
2DCD954D1E0B4F2C00145EB5 /* TableViewDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* TableViewDemoTests.m */; };
2DF0FFEE2056DD460020B375 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; };
3D208C0121F04B5000FB8812 /* states.json in Resources */ = {isa = PBXBuildFile; fileRef = 3D208BDA21F04B5000FB8812 /* states.json */; };
3D8FFBDC215DE29400E6B088 /* libRNTableView.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D8FFBDB215DE27E00E6B088 /* libRNTableView.a */; };
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; };
Expand Down Expand Up @@ -347,6 +348,7 @@
2D02E47B1E0B4A5D006451C7 /* TableViewDemo-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "TableViewDemo-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
2D02E4901E0B4A5D006451C7 /* TableViewDemo-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "TableViewDemo-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; };
3D208BDA21F04B5000FB8812 /* states.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = states.json; path = ../src/assets/states.json; sourceTree = "<group>"; };
3D8FFBD6215DE27E00E6B088 /* RNTableView.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNTableView.xcodeproj; path = "../node_modules/react-native-tableview/RNTableView.xcodeproj"; sourceTree = "<group>"; };
5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -591,6 +593,7 @@
83CBB9F61A601CBA00E9B192 = {
isa = PBXGroup;
children = (
3D208BDA21F04B5000FB8812 /* states.json */,
13B07FAE1A68108700A75B9A /* TableViewDemo */,
832341AE1AAA6A7D00B99B32 /* Libraries */,
00E356EF1AD99517003FC87E /* TableViewDemoTests */,
Expand Down Expand Up @@ -1082,6 +1085,7 @@
files = (
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
3D208C0121F04B5000FB8812 /* states.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "react-native-tableview",
"version": "2.4.1",
"version": "2.5.0",
"description": "Native iOS TableView wrapper for React Native",
"main": "src/index.js",
"types": "src/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions src/index.d.ts
Expand Up @@ -33,6 +33,7 @@ interface OnPressCallBack extends CallBack {
children: string
selectedIndex: number
selectedSection: number
selectedOrigin: PointPropType
footerLabel?: string
label?: string
}
Expand Down

0 comments on commit b8a9a68

Please sign in to comment.