mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-31 01:36:11 +00:00
Rearrange propType imports
This commit is contained in:
+1
-1
@@ -41,7 +41,7 @@
|
|||||||
"babel-core": "^6.21.0",
|
"babel-core": "^6.21.0",
|
||||||
"babel-eslint": "^7.1.1",
|
"babel-eslint": "^7.1.1",
|
||||||
"babel-loader": "^6.2.10",
|
"babel-loader": "^6.2.10",
|
||||||
"babel-plugin-transform-react-remove-prop-types": "^0.2.11",
|
"babel-plugin-transform-react-remove-prop-types": "^0.3.0",
|
||||||
"babel-preset-react-native": "^1.9.1",
|
"babel-preset-react-native": "^1.9.1",
|
||||||
"del-cli": "^0.2.1",
|
"del-cli": "^0.2.1",
|
||||||
"enzyme": "^2.4.1",
|
"enzyme": "^2.4.1",
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
import applyNativeMethods from '../../modules/applyNativeMethods';
|
import applyNativeMethods from '../../modules/applyNativeMethods';
|
||||||
import StyleSheet from '../../apis/StyleSheet';
|
import StyleSheet from '../../apis/StyleSheet';
|
||||||
import View from '../View';
|
import View from '../View';
|
||||||
|
import ViewPropTypes from '../View/ViewPropTypes';
|
||||||
import React, { Component, PropTypes } from 'react';
|
import React, { Component, PropTypes } from 'react';
|
||||||
|
|
||||||
class ActivityIndicator extends Component {
|
class ActivityIndicator extends Component {
|
||||||
static displayName = 'ActivityIndicator';
|
static displayName = 'ActivityIndicator';
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
...View.propTypes,
|
...ViewPropTypes,
|
||||||
animating: PropTypes.bool,
|
animating: PropTypes.bool,
|
||||||
color: PropTypes.string,
|
color: PropTypes.string,
|
||||||
hidesWhenStopped: PropTypes.bool,
|
hidesWhenStopped: PropTypes.bool,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import requestAnimationFrame from 'fbjs/lib/requestAnimationFrame';
|
|||||||
import StyleSheet from '../../apis/StyleSheet';
|
import StyleSheet from '../../apis/StyleSheet';
|
||||||
import StyleSheetPropType from '../../propTypes/StyleSheetPropType';
|
import StyleSheetPropType from '../../propTypes/StyleSheetPropType';
|
||||||
import View from '../View';
|
import View from '../View';
|
||||||
|
import ViewPropTypes from '../View/ViewPropTypes';
|
||||||
import React, { Component, PropTypes } from 'react';
|
import React, { Component, PropTypes } from 'react';
|
||||||
|
|
||||||
const emptyObject = {};
|
const emptyObject = {};
|
||||||
@@ -41,7 +42,7 @@ class Image extends Component {
|
|||||||
static displayName = 'Image';
|
static displayName = 'Image';
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
...View.propTypes,
|
...ViewPropTypes,
|
||||||
children: PropTypes.any,
|
children: PropTypes.any,
|
||||||
defaultSource: ImageSourcePropType,
|
defaultSource: ImageSourcePropType,
|
||||||
onError: PropTypes.func,
|
onError: PropTypes.func,
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import ListViewDataSource from './ListViewDataSource';
|
import ListViewDataSource from './ListViewDataSource';
|
||||||
import { PropTypes } from 'react';
|
import { PropTypes } from 'react';
|
||||||
import ScrollView from '../ScrollView';
|
import ScrollView, { propTypes as ScrollViewPropTypes } from '../ScrollView';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
...ScrollView.propTypes,
|
...ScrollViewPropTypes,
|
||||||
dataSource: PropTypes.instanceOf(ListViewDataSource).isRequired,
|
dataSource: PropTypes.instanceOf(ListViewDataSource).isRequired,
|
||||||
renderSeparator: PropTypes.func,
|
renderSeparator: PropTypes.func,
|
||||||
renderRow: PropTypes.func.isRequired,
|
renderRow: PropTypes.func.isRequired,
|
||||||
|
|||||||
@@ -2,13 +2,14 @@ import applyNativeMethods from '../../modules/applyNativeMethods';
|
|||||||
import ColorPropType from '../../propTypes/ColorPropType';
|
import ColorPropType from '../../propTypes/ColorPropType';
|
||||||
import StyleSheet from '../../apis/StyleSheet';
|
import StyleSheet from '../../apis/StyleSheet';
|
||||||
import View from '../View';
|
import View from '../View';
|
||||||
|
import ViewPropTypes from '../View/ViewPropTypes';
|
||||||
import React, { Component, PropTypes } from 'react';
|
import React, { Component, PropTypes } from 'react';
|
||||||
|
|
||||||
class ProgressBar extends Component {
|
class ProgressBar extends Component {
|
||||||
static displayName = 'ProgressBar';
|
static displayName = 'ProgressBar';
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
...View.propTypes,
|
...ViewPropTypes,
|
||||||
color: ColorPropType,
|
color: ColorPropType,
|
||||||
indeterminate: PropTypes.bool,
|
indeterminate: PropTypes.bool,
|
||||||
progress: PropTypes.number,
|
progress: PropTypes.number,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
import debounce from 'debounce';
|
import debounce from 'debounce';
|
||||||
import View from '../View';
|
import View from '../View';
|
||||||
|
import ViewPropTypes from '../View/ViewPropTypes';
|
||||||
import React, { Component, PropTypes } from 'react';
|
import React, { Component, PropTypes } from 'react';
|
||||||
|
|
||||||
const normalizeScrollEvent = (e) => ({
|
const normalizeScrollEvent = (e) => ({
|
||||||
@@ -44,7 +45,7 @@ const normalizeScrollEvent = (e) => ({
|
|||||||
*/
|
*/
|
||||||
export default class ScrollViewBase extends Component {
|
export default class ScrollViewBase extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
...View.propTypes,
|
...ViewPropTypes,
|
||||||
onMomentumScrollBegin: PropTypes.func,
|
onMomentumScrollBegin: PropTypes.func,
|
||||||
onMomentumScrollEnd: PropTypes.func,
|
onMomentumScrollEnd: PropTypes.func,
|
||||||
onScroll: PropTypes.func,
|
onScroll: PropTypes.func,
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import ScrollViewBase from './ScrollViewBase';
|
|||||||
import StyleSheet from '../../apis/StyleSheet';
|
import StyleSheet from '../../apis/StyleSheet';
|
||||||
import StyleSheetPropType from '../../propTypes/StyleSheetPropType';
|
import StyleSheetPropType from '../../propTypes/StyleSheetPropType';
|
||||||
import View from '../View';
|
import View from '../View';
|
||||||
|
import ViewPropTypes from '../View/ViewPropTypes';
|
||||||
import ViewStylePropTypes from '../View/ViewStylePropTypes';
|
import ViewStylePropTypes from '../View/ViewStylePropTypes';
|
||||||
import React, { Component, PropTypes } from 'react';
|
import React, { Component, PropTypes } from 'react';
|
||||||
|
|
||||||
@@ -22,7 +23,7 @@ const emptyObject = {};
|
|||||||
/* eslint-disable react/prefer-es6-class */
|
/* eslint-disable react/prefer-es6-class */
|
||||||
const ScrollView = React.createClass({
|
const ScrollView = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
...View.propTypes,
|
...ViewPropTypes,
|
||||||
contentContainerStyle: StyleSheetPropType(ViewStylePropTypes),
|
contentContainerStyle: StyleSheetPropType(ViewStylePropTypes),
|
||||||
horizontal: PropTypes.bool,
|
horizontal: PropTypes.bool,
|
||||||
keyboardDismissMode: PropTypes.oneOf([ 'none', 'interactive', 'on-drag' ]),
|
keyboardDismissMode: PropTypes.oneOf([ 'none', 'interactive', 'on-drag' ]),
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import multiplyStyleLengthValue from '../../modules/multiplyStyleLengthValue';
|
|||||||
import StyleSheet from '../../apis/StyleSheet';
|
import StyleSheet from '../../apis/StyleSheet';
|
||||||
import UIManager from '../../apis/UIManager';
|
import UIManager from '../../apis/UIManager';
|
||||||
import View from '../View';
|
import View from '../View';
|
||||||
|
import ViewPropTypes from '../View/ViewPropTypes';
|
||||||
import React, { Component, PropTypes } from 'react';
|
import React, { Component, PropTypes } from 'react';
|
||||||
|
|
||||||
const emptyObject = {};
|
const emptyObject = {};
|
||||||
@@ -15,7 +16,7 @@ class Switch extends Component {
|
|||||||
static displayName = 'Switch';
|
static displayName = 'Switch';
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
...View.propTypes,
|
...ViewPropTypes,
|
||||||
activeThumbColor: ColorPropType,
|
activeThumbColor: ColorPropType,
|
||||||
activeTrackColor: ColorPropType,
|
activeTrackColor: ColorPropType,
|
||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
|
|||||||
@@ -4,10 +4,11 @@ import NativeMethodsMixin from '../../modules/NativeMethodsMixin';
|
|||||||
import createDOMElement from '../../modules/createDOMElement';
|
import createDOMElement from '../../modules/createDOMElement';
|
||||||
import findNodeHandle from '../../modules/findNodeHandle';
|
import findNodeHandle from '../../modules/findNodeHandle';
|
||||||
import StyleSheet from '../../apis/StyleSheet';
|
import StyleSheet from '../../apis/StyleSheet';
|
||||||
import Text from '../Text';
|
import StyleSheetPropType from '../../propTypes/StyleSheetPropType';
|
||||||
|
import TextStylePropTypes from '../Text/TextStylePropTypes';
|
||||||
import TextareaAutosize from 'react-textarea-autosize';
|
import TextareaAutosize from 'react-textarea-autosize';
|
||||||
import TextInputState from './TextInputState';
|
import TextInputState from './TextInputState';
|
||||||
import View from '../View';
|
import ViewPropTypes from '../View/ViewPropTypes';
|
||||||
import { Component, PropTypes } from 'react';
|
import { Component, PropTypes } from 'react';
|
||||||
|
|
||||||
const emptyObject = {};
|
const emptyObject = {};
|
||||||
@@ -52,7 +53,7 @@ class TextInput extends Component {
|
|||||||
static displayName = 'TextInput';
|
static displayName = 'TextInput';
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
...View.propTypes,
|
...ViewPropTypes,
|
||||||
autoCapitalize: PropTypes.oneOf([ 'characters', 'none', 'sentences', 'words' ]),
|
autoCapitalize: PropTypes.oneOf([ 'characters', 'none', 'sentences', 'words' ]),
|
||||||
autoComplete: PropTypes.string,
|
autoComplete: PropTypes.string,
|
||||||
autoCorrect: PropTypes.bool,
|
autoCorrect: PropTypes.bool,
|
||||||
@@ -83,7 +84,7 @@ class TextInput extends Component {
|
|||||||
start: PropTypes.number.isRequired,
|
start: PropTypes.number.isRequired,
|
||||||
end: PropTypes.number
|
end: PropTypes.number
|
||||||
}),
|
}),
|
||||||
style: Text.propTypes.style,
|
style: StyleSheetPropType(TextStylePropTypes),
|
||||||
value: PropTypes.string
|
value: PropTypes.string
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ var ViewStylePropTypes = require('../View/ViewStylePropTypes');
|
|||||||
|
|
||||||
var ensureComponentIsNative = require('./ensureComponentIsNative');
|
var ensureComponentIsNative = require('./ensureComponentIsNative');
|
||||||
var ensurePositiveDelayProps = require('./ensurePositiveDelayProps');
|
var ensurePositiveDelayProps = require('./ensurePositiveDelayProps');
|
||||||
|
var TouchableWithoutFeedbackPropTypes = TouchableWithoutFeedback.propTypes
|
||||||
|
|
||||||
type Event = Object;
|
type Event = Object;
|
||||||
|
|
||||||
@@ -67,7 +68,7 @@ var PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
|
|||||||
|
|
||||||
var TouchableHighlight = React.createClass({
|
var TouchableHighlight = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
...TouchableWithoutFeedback.propTypes,
|
...TouchableWithoutFeedbackPropTypes,
|
||||||
/**
|
/**
|
||||||
* Determines what the opacity of the wrapped view should be when touch is
|
* Determines what the opacity of the wrapped view should be when touch is
|
||||||
* active.
|
* active.
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ var View = require('../View');
|
|||||||
|
|
||||||
var ensurePositiveDelayProps = require('./ensurePositiveDelayProps');
|
var ensurePositiveDelayProps = require('./ensurePositiveDelayProps');
|
||||||
var flattenStyle = StyleSheet.flatten
|
var flattenStyle = StyleSheet.flatten
|
||||||
|
var TouchableWithoutFeedbackPropTypes = TouchableWithoutFeedback.propTypes;
|
||||||
|
|
||||||
type Event = Object;
|
type Event = Object;
|
||||||
|
|
||||||
@@ -54,7 +55,7 @@ var TouchableOpacity = React.createClass({
|
|||||||
mixins: [TimerMixin, Touchable.Mixin, NativeMethodsMixin],
|
mixins: [TimerMixin, Touchable.Mixin, NativeMethodsMixin],
|
||||||
|
|
||||||
propTypes: {
|
propTypes: {
|
||||||
...TouchableWithoutFeedback.propTypes,
|
...TouchableWithoutFeedbackPropTypes,
|
||||||
/**
|
/**
|
||||||
* Determines what the opacity of the wrapped view should be when touch is
|
* Determines what the opacity of the wrapped view should be when touch is
|
||||||
* active.
|
* active.
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
import BaseComponentPropTypes from '../../propTypes/BaseComponentPropTypes';
|
||||||
|
import EdgeInsetsPropType from '../../propTypes/EdgeInsetsPropType';
|
||||||
|
import StyleSheetPropType from '../../propTypes/StyleSheetPropType';
|
||||||
|
import ViewStylePropTypes from './ViewStylePropTypes';
|
||||||
|
import { PropTypes } from 'react';
|
||||||
|
|
||||||
|
const ViewPropTypes = {
|
||||||
|
...BaseComponentPropTypes,
|
||||||
|
children: PropTypes.any,
|
||||||
|
collapsable: PropTypes.bool,
|
||||||
|
hitSlop: EdgeInsetsPropType,
|
||||||
|
onClick: PropTypes.func,
|
||||||
|
onClickCapture: PropTypes.func,
|
||||||
|
onLayout: PropTypes.func,
|
||||||
|
onMoveShouldSetResponder: PropTypes.func,
|
||||||
|
onMoveShouldSetResponderCapture: PropTypes.func,
|
||||||
|
onResponderGrant: PropTypes.func,
|
||||||
|
onResponderMove: PropTypes.func,
|
||||||
|
onResponderReject: PropTypes.func,
|
||||||
|
onResponderRelease: PropTypes.func,
|
||||||
|
onResponderTerminate: PropTypes.func,
|
||||||
|
onResponderTerminationRequest: PropTypes.func,
|
||||||
|
onStartShouldSetResponder: PropTypes.func,
|
||||||
|
onStartShouldSetResponderCapture: PropTypes.func,
|
||||||
|
onTouchCancel: PropTypes.func,
|
||||||
|
onTouchCancelCapture: PropTypes.func,
|
||||||
|
onTouchEnd: PropTypes.func,
|
||||||
|
onTouchEndCapture: PropTypes.func,
|
||||||
|
onTouchMove: PropTypes.func,
|
||||||
|
onTouchMoveCapture: PropTypes.func,
|
||||||
|
onTouchStart: PropTypes.func,
|
||||||
|
onTouchStartCapture: PropTypes.func,
|
||||||
|
pointerEvents: PropTypes.oneOf([ 'auto', 'box-none', 'box-only', 'none' ]),
|
||||||
|
style: StyleSheetPropType(ViewStylePropTypes)
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = ViewPropTypes;
|
||||||
@@ -2,13 +2,10 @@ import '../../modules/injectResponderEventPlugin';
|
|||||||
|
|
||||||
import applyLayout from '../../modules/applyLayout';
|
import applyLayout from '../../modules/applyLayout';
|
||||||
import applyNativeMethods from '../../modules/applyNativeMethods';
|
import applyNativeMethods from '../../modules/applyNativeMethods';
|
||||||
import BaseComponentPropTypes from '../../propTypes/BaseComponentPropTypes';
|
|
||||||
import createDOMElement from '../../modules/createDOMElement';
|
import createDOMElement from '../../modules/createDOMElement';
|
||||||
import EdgeInsetsPropType from '../../propTypes/EdgeInsetsPropType';
|
|
||||||
import normalizeNativeEvent from '../../modules/normalizeNativeEvent';
|
import normalizeNativeEvent from '../../modules/normalizeNativeEvent';
|
||||||
import StyleSheet from '../../apis/StyleSheet';
|
import StyleSheet from '../../apis/StyleSheet';
|
||||||
import StyleSheetPropType from '../../propTypes/StyleSheetPropType';
|
import ViewPropTypes from './ViewPropTypes';
|
||||||
import ViewStylePropTypes from './ViewStylePropTypes';
|
|
||||||
import { Component, PropTypes } from 'react';
|
import { Component, PropTypes } from 'react';
|
||||||
|
|
||||||
const eventHandlerNames = [
|
const eventHandlerNames = [
|
||||||
@@ -37,35 +34,7 @@ const eventHandlerNames = [
|
|||||||
class View extends Component {
|
class View extends Component {
|
||||||
static displayName = 'View';
|
static displayName = 'View';
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = ViewPropTypes;
|
||||||
...BaseComponentPropTypes,
|
|
||||||
children: PropTypes.any,
|
|
||||||
collapsable: PropTypes.bool,
|
|
||||||
hitSlop: EdgeInsetsPropType,
|
|
||||||
onClick: PropTypes.func,
|
|
||||||
onClickCapture: PropTypes.func,
|
|
||||||
onLayout: PropTypes.func,
|
|
||||||
onMoveShouldSetResponder: PropTypes.func,
|
|
||||||
onMoveShouldSetResponderCapture: PropTypes.func,
|
|
||||||
onResponderGrant: PropTypes.func,
|
|
||||||
onResponderMove: PropTypes.func,
|
|
||||||
onResponderReject: PropTypes.func,
|
|
||||||
onResponderRelease: PropTypes.func,
|
|
||||||
onResponderTerminate: PropTypes.func,
|
|
||||||
onResponderTerminationRequest: PropTypes.func,
|
|
||||||
onStartShouldSetResponder: PropTypes.func,
|
|
||||||
onStartShouldSetResponderCapture: PropTypes.func,
|
|
||||||
onTouchCancel: PropTypes.func,
|
|
||||||
onTouchCancelCapture: PropTypes.func,
|
|
||||||
onTouchEnd: PropTypes.func,
|
|
||||||
onTouchEndCapture: PropTypes.func,
|
|
||||||
onTouchMove: PropTypes.func,
|
|
||||||
onTouchMoveCapture: PropTypes.func,
|
|
||||||
onTouchStart: PropTypes.func,
|
|
||||||
onTouchStartCapture: PropTypes.func,
|
|
||||||
pointerEvents: PropTypes.oneOf([ 'auto', 'box-none', 'box-only', 'none' ]),
|
|
||||||
style: StyleSheetPropType(ViewStylePropTypes)
|
|
||||||
};
|
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
accessible: true
|
accessible: true
|
||||||
|
|||||||
@@ -895,9 +895,9 @@ babel-plugin-transform-react-jsx@^6.3.13, babel-plugin-transform-react-jsx@^6.5.
|
|||||||
babel-plugin-syntax-jsx "^6.8.0"
|
babel-plugin-syntax-jsx "^6.8.0"
|
||||||
babel-runtime "^6.0.0"
|
babel-runtime "^6.0.0"
|
||||||
|
|
||||||
babel-plugin-transform-react-remove-prop-types:
|
babel-plugin-transform-react-remove-prop-types@^0.3.0:
|
||||||
version "0.2.11"
|
version "0.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.2.11.tgz#05eb7cc4670d6506d801680576589c7abcd51b00"
|
resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.3.0.tgz#88baefdb530c95c37c6e685f591e263db9fe5585"
|
||||||
|
|
||||||
babel-plugin-transform-regenerator@6.16.1, babel-plugin-transform-regenerator@^6.16.0, babel-plugin-transform-regenerator@^6.5.0, babel-plugin-transform-regenerator@^6.6.0:
|
babel-plugin-transform-regenerator@6.16.1, babel-plugin-transform-regenerator@^6.16.0, babel-plugin-transform-regenerator@^6.5.0, babel-plugin-transform-regenerator@^6.6.0:
|
||||||
version "6.16.1"
|
version "6.16.1"
|
||||||
|
|||||||
Reference in New Issue
Block a user