Skip to content

Commit

Permalink
0.11.3
Browse files Browse the repository at this point in the history
  • Loading branch information
iRoachie authored May 16, 2018
2 parents 175492f + 468c49d commit ed6283a
Show file tree
Hide file tree
Showing 58 changed files with 26,550 additions and 6,191 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package.json
104 changes: 104 additions & 0 deletions Accordion.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import * as React from 'react';
import { EasingMode } from './index';

export interface AccordionProps {
/**
* An array of sections passed to the render methods
*/
sections: any[];

/**
* A function that should return a renderable representing the header
*/
renderHeader(
content: any,
index: number,
isActive: boolean,
sections: any[]
): React.ReactElement<{}>;

/**
* A function that should return a renderable representing the section title above the touchable
*/
renderSectionTitle?(
content: any,
index: number,
isActive: boolean,
sections: any[]
): React.ReactElement<{}>;

/**
* A function that should return a renderable representing the content
*/
renderContent(
content: any,
index: number,
isActive: boolean,
sections: any[]
): React.ReactElement<{}>;

/**
* An optional function that is called when currently active section is changed, index === false when collapsed
*/
onChange?(index: number): void;

/**
* Expand content from the bottom instead of the top
*
* @default false
*/
expandFromBottom?: boolean;

/**
* Set which index in the sections array is initially open. Defaults to none.
*/
initiallyActiveSection?: number;

/**
* Control which index in the sections array is currently open. Defaults to none. If false, closes all sections.
*/
activeSection?: boolean | number;

/**
* The color of the underlay that will show through when tapping on headers.
*
* @default black
*/
underlayColor?: string;

/**
* Alignment of the content when transitioning, can be top, center or bottom
*
* @default top
*/
align?: 'top' | 'center' | 'bottom';

/**
* Duration of transition in milliseconds
*
* @default 300
*/
duration?: number;

/**
* Function or function name from Easing (or tween-functions if < RN 0.8). Collapsible will try to combine Easing functions for you if you name them like tween-functions.
*
* @default easeOutCubic
*/
easing?: EasingMode | any;

/**
* Component to use for the Touchable
*
* @default TouchableHighlight
*/
touchableComponent?: React.ComponentClass;

/**
* Object of props to pass to the touchable component
*/
touchableProps?: {};
}

export default class Accordion extends React.Component<AccordionProps, any> {}

6 changes: 4 additions & 2 deletions Collapsible.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Animated, Easing } from 'react-native';
import { Animated, Easing, View } from 'react-native';
import { ViewPropTypes } from './config';

const ANIMATED_EASING_PREFIXES = ['easeInOut', 'easeOut', 'easeIn'];
Expand Down Expand Up @@ -198,7 +198,9 @@ export default class Collapsible extends Component {
style={[this.props.style, contentStyle]}
onLayout={this.state.animating ? undefined : this._handleLayoutChange}
>
{this.props.children}
<View style={{ height: measured ? contentHeight : null }}>
{this.props.children}
</View>
</Animated.View>
</Animated.View>
);
Expand Down
7 changes: 6 additions & 1 deletion Example/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"presets": ["react-native"]
"presets": ["babel-preset-expo"],
"env": {
"development": {
"plugins": ["transform-react-jsx-source"]
}
}
}
6 changes: 0 additions & 6 deletions Example/.buckconfig

This file was deleted.

54 changes: 0 additions & 54 deletions Example/.flowconfig

This file was deleted.

1 change: 0 additions & 1 deletion Example/.gitattributes

This file was deleted.

62 changes: 13 additions & 49 deletions Example/.gitignore
Original file line number Diff line number Diff line change
@@ -1,53 +1,17 @@
# OSX
#
.DS_Store
# See https://help.github.com/ignore-files/ for more about ignoring files.

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace
# expo
.expo/

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
# dependencies
/node_modules

# node.js
#
node_modules/
npm-debug.log
yarn-error.log
# misc
.env.local
.env.development.local
.env.test.local
.env.production.local

# BUCK
buck-out/
\.buckd/
*.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots
npm-debug.log*
yarn-debug.log*
yarn-error.log*
2 changes: 1 addition & 1 deletion Example/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{}
{}
9 changes: 9 additions & 0 deletions Example/App.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
import App from './App';

import renderer from 'react-test-renderer';

it('renders without crashing', () => {
const rendered = renderer.create(<App />).toJSON();
expect(rendered).toBeTruthy();
});
12 changes: 0 additions & 12 deletions Example/__tests__/index.android.js

This file was deleted.

12 changes: 0 additions & 12 deletions Example/__tests__/index.ios.js

This file was deleted.

65 changes: 0 additions & 65 deletions Example/android/app/BUCK

This file was deleted.

Loading

0 comments on commit ed6283a

Please sign in to comment.