var View = require('View');

var ensurePositiveDelayProps = require('ensurePositiveDelayProps');
var warning = require('fbjs/lib/warning');

var PRESS_RETENTION_OFFSET = { top: 20, left: 20, right: 20, bottom: 30 };

var TouchableWithoutFeedback = React.createClass({
  displayName: 'TouchableWithoutFeedback',

  mixins: [TimerMixin, Touchable.Mixin],

  propTypes: {
    accessible: React.PropTypes.bool,
    accessibilityComponentType: React.PropTypes.oneOf(View.AccessibilityComponentType),
    accessibilityTraits: React.PropTypes.oneOfType([React.PropTypes.oneOf(View.AccessibilityTraits), React.PropTypes.arrayOf(React.PropTypes.oneOf(View.AccessibilityTraits))]),

    disabled: React.PropTypes.bool,

    onPress: React.PropTypes.func,
    onPressIn: React.PropTypes.func,
    onPressOut: React.PropTypes.func,

    onLayout: React.PropTypes.func,

    onLongPress: React.PropTypes.func,

    delayPressIn: React.PropTypes.number,

    delayPressOut: React.PropTypes.number,
Example #2
0
    annotations: React.PropTypes.arrayOf(React.PropTypes.shape({
      /**
       * The location of the annotation.
       */
      latitude: React.PropTypes.number.isRequired,
      longitude: React.PropTypes.number.isRequired,

      /**
       * Whether the pin drop should be animated or not
       */
      animateDrop: React.PropTypes.bool,

      /**
       * Annotation title/subtile.
       */
      title: React.PropTypes.string,
      subtitle: React.PropTypes.string,

      /**
       * Whether the Annotation has callout buttons.
       */
      hasLeftCallout: React.PropTypes.bool,
      hasRightCallout: React.PropTypes.bool,

      /**
       * Event handlers for callout buttons.
       */
      onLeftCalloutPress: React.PropTypes.func,
      onRightCalloutPress: React.PropTypes.func,

      /**
       * The pin color. This can be any valid color string, or you can use one
       * of the predefined PinColors constants. Applies to both standard pins
       * and custom pin images.
       *
       * Note that on iOS 8 and earlier, only the standard PinColor constants
       * are supported for regualr pins. For custom pin images, any tintColor
       * value is supported on all iOS versions.
       * @platform ios
       */
      tintColor: React.PropTypes.string,

      /**
       * Custom pin image. This must be a static image resource inside the app.
       * @platform ios
       */
      image: Image.propTypes.source,

      /**
       * annotation id
       */
      id: React.PropTypes.string,
    })),
Example #3
0
 titleColor: ColorPropType,
 /**
  * The title displayed under the refresh indicator.
  * @platform ios
  */
 title: React.PropTypes.string,
 /**
  * Whether the pull to refresh functionality is enabled.
  * @platform android
  */
 enabled: React.PropTypes.bool,
 /**
  * The colors (at least one) that will be used to draw the refresh indicator.
  * @platform android
  */
 colors: React.PropTypes.arrayOf(ColorPropType),
 /**
  * The background color of the refresh indicator.
  * @platform android
  */
 progressBackgroundColor: ColorPropType,
 /**
  * Size of the refresh indicator, see RefreshControl.SIZE.
  * @platform android
  */
 size: React.PropTypes.oneOf([RefreshLayoutConsts.SIZE.DEFAULT, RefreshLayoutConsts.SIZE.LARGE]),
 /**
  * Progress view top offset
  * @platform android
  */
 progressViewOffset: React.PropTypes.number,
Example #4
0
    annotations: React.PropTypes.arrayOf(React.PropTypes.shape({
      /**
       * The location of the annotation.
       */
      latitude: React.PropTypes.number.isRequired,
      longitude: React.PropTypes.number.isRequired,

      /**
       * Whether the pin drop should be animated or not
       */
      animateDrop: React.PropTypes.bool,

      /**
       * Whether the pin should be draggable or not
       */
      draggable: React.PropTypes.bool,

      /**
       * Event that fires when the annotation drag state changes.
       */
      onDragStateChange: React.PropTypes.func,

      /**
       * Event that fires when the annotation gets was tapped by the user
       * and the callout view was displayed.
       */
      onFocus: React.PropTypes.func,

      /**
       * Event that fires when another annotation or the mapview itself
       * was tapped and a previously shown annotation will be closed.
       */
      onBlur: React.PropTypes.func,

      /**
       * Annotation title and subtile.
       */
      title: React.PropTypes.string,
      subtitle: React.PropTypes.string,

      /**
       * Callout views.
       */
      leftCalloutView: React.PropTypes.element,
      rightCalloutView: React.PropTypes.element,
      detailCalloutView: React.PropTypes.element,

      /**
       * The pin color. This can be any valid color string, or you can use one
       * of the predefined PinColors constants. Applies to both standard pins
       * and custom pin images.
       *
       * Note that on iOS 8 and earlier, only the standard PinColor constants
       * are supported for regular pins. For custom pin images, any tintColor
       * value is supported on all iOS versions.
       */
      tintColor: ColorPropType,

      /**
       * Custom pin image. This must be a static image resource inside the app.
       */
      image: Image.propTypes.source,

      /**
       * Custom pin view. If set, this replaces the pin or custom pin image.
       */
      view: React.PropTypes.element,

      /**
       * annotation id
       */
      id: React.PropTypes.string,

      /**
       * Deprecated. Use the left/right/detailsCalloutView props instead.
       */
      hasLeftCallout: deprecatedPropType(
        React.PropTypes.bool,
        'Use `leftCalloutView` instead.'
      ),
      hasRightCallout: deprecatedPropType(
        React.PropTypes.bool,
        'Use `rightCalloutView` instead.'
      ),
      onLeftCalloutPress: deprecatedPropType(
        React.PropTypes.func,
        'Use `leftCalloutView` instead.'
      ),
      onRightCalloutPress: deprecatedPropType(
        React.PropTypes.func,
        'Use `rightCalloutView` instead.'
      ),
    })),
  }
  // TODO: rename `observedTopOfStack` to `presentedIndex` in `NavigatorIOS`
  return navState.observedTopOfStack;
};

var NavigatorNavigationBar = React.createClass({

  propTypes: {
    navigator: React.PropTypes.object,
    routeMapper: React.PropTypes.shape({
      Title: React.PropTypes.func.isRequired,
      LeftButton: React.PropTypes.func.isRequired,
      RightButton: React.PropTypes.func.isRequired,
    }),
    navState: React.PropTypes.shape({
      routeStack: React.PropTypes.arrayOf(React.PropTypes.object),
      idStack: React.PropTypes.arrayOf(React.PropTypes.number),
      presentedIndex: React.PropTypes.number,
    }),
    style: View.propTypes.style,
  },

  statics: {
    Styles: NavigatorNavigationBarStyles,
  },

  _getReusableProps: function(
    /*string*/componentName,
    /*number*/index
  ) /*object*/ {
    if (!this._reusableProps) {
Example #6
0
       * to be displayed.
       */
      latitudeDelta: React.PropTypes.number.isRequired,
      longitudeDelta: React.PropTypes.number.isRequired,
    }),

    /**
     * Map annotations with title/subtitle.
     */
    annotations: React.PropTypes.arrayOf(React.PropTypes.shape({
      /**
       * The location of the annotation.
       */
      latitude: React.PropTypes.number.isRequired,
      longitude: React.PropTypes.number.isRequired,

      /**
       * Annotation title/subtile.
       */
      title: React.PropTypes.string,
      subtitle: React.PropTypes.string,
    })),

    /**
     * Maximum size of area that can be displayed.
     */
    maxDelta: React.PropTypes.number,

    /**
     * Minimum size of area that can be displayed.
     */
Example #7
0
/* @flow */

import { PropTypes } from 'react';
import { Animated } from 'react-native';

export const NavigationRoutePropType = PropTypes.shape({
  title: PropTypes.string,
  key: PropTypes.string.isRequired,
});

export const NavigationStatePropType = PropTypes.shape({
  routes: PropTypes.arrayOf(NavigationRoutePropType).isRequired,
  index: PropTypes.number.isRequired,
});

export const SceneRendererPropType = {
  layout: PropTypes.shape({
    measured: PropTypes.bool.isRequired,
    height: PropTypes.number.isRequired,
    width: PropTypes.number.isRequired,
  }).isRequired,
  navigationState: NavigationStatePropType.isRequired,
  position: PropTypes.instanceOf(Animated.Value).isRequired,
  jumpToIndex: PropTypes.func.isRequired,
  getLastPosition: PropTypes.func.isRequired,
};
Example #8
0
          taskCallbacks={this.props.taskCallbacks}
          cardFormCallbacks={this.props.cardFormCallbacks}
          onDelete={this.handleListDelete}
        />
      );
    });

    return(
      <div>
        <div>
          <TagsBlock tags={this.props.tags}
            tagCallbacks={this.props.tagCallbacks}
            />
        </div>
        <div className="clearfix"></div>
        <div className="list-block">
          {lists}
          <span className={new_list_style}><ListForm listFormCallbacks={this.props.listFormCallbacks}/></span>
        </div>
      </div>
    );
  };
};

Board.propTypes = {
  lists: PropTypes.arrayOf(PropTypes.object),
  cards: PropTypes.arrayOf(PropTypes.object),
  cardCallbacks: PropTypes.object
};
export default DragDropContext(HTML5Backend)(Board);
Example #9
0
import React, { PropTypes } from 'react';
import Todo from '../Todo';

const propTypes = {
  todos: PropTypes.arrayOf(PropTypes.shape({
    _id: PropTypes.string.isRequired,
    todo: PropTypes.string.isRequired,
  })),
};

const TodoList = ({
  todos,
}) => (
  <div>
    <If condition={todos}>
      <If condition={todos.length === 0}>
        <h1>Uh oh, no todos</h1>
        <Else />
        <ul>
        {
          todos.map((todo) => (
            <Todo
              key={todo._id}
              todo={todo}
            />
          ))
        }
        </ul>
      </If>
      <Else />
      <p>Something is wrong</p>
Example #10
0
    fetchParams: {},
    currentPage:1,
    queryKeys:[],
    emptyText: "暂无数据",
    searchBarPlaceholder: "搜索表格内容",
    processData: (data) => {return data},
    beforeFetch: (obj) => {return obj},
    onFetchError: () => {},
    addRowClassName: () => {},
    onChange: () => {},
}

// http://facebook.github.io/react/docs/reusable-components.html
Table.propTypes = {
    locale: React.PropTypes.string,
    jsxcolumns: React.PropTypes.arrayOf(React.PropTypes.object),
    width: React.PropTypes.oneOfType([
        React.PropTypes.string,
        React.PropTypes.number
    ]),
    height: React.PropTypes.oneOfType([
        React.PropTypes.string,
        React.PropTypes.number
    ]),
    headerHeight: React.PropTypes.number,
    pageSize: React.PropTypes.number,
    queryKeys: React.PropTypes.array,
    fetchDataOnMount: React.PropTypes.bool,
    doubleClickToEdit: React.PropTypes.bool,
    showColumnPicker: React.PropTypes.bool,
    showPager: React.PropTypes.bool,
Example #11
0
            <div className="col col-4">
              <h3>Todos</h3>
              <TaskList tasks={todo}
                onCompleteTask={(task) => this.handleCompleteTask(task)}
              />
            </div>
          </div>
        ) : 'Please log in' }
      </div>
    );
  }
}

HabiticaApp.propTypes = {
  habit: PropTypes.arrayOf(PropTypes.shape({
    type: PropTypes.string.isRequired,
    text: PropTypes.string.isRequired
  }).isRequired).isRequired,
  daily: PropTypes.arrayOf(PropTypes.shape({
    type: PropTypes.string.isRequired,
    text: PropTypes.string.isRequired
  }).isRequired).isRequired,
  todo: PropTypes.arrayOf(PropTypes.shape({
    type: PropTypes.string.isRequired,
    text: PropTypes.string.isRequired
  }).isRequired).isRequired
};


function select(state) {
  return {
    auth: state.auth,