コード例 #1
0
ファイル: index.js プロジェクト: fresk-nc/react-islands
        }

        if (!e.isDefaultPrevented()) {
            this.props.onChange('', this.props, { source: 'clear' });
        }
    }
}

TextInput.contextTypes = {
    theme: React.PropTypes.string,
};

TextInput.propTypes = {
    theme: React.PropTypes.string,
    id: React.PropTypes.string,
    size: React.PropTypes.oneOf(['s', 'm', 'l', 'xl']),
    className: React.PropTypes.string,
    type: React.PropTypes.string,
    name: React.PropTypes.string,
    value: React.PropTypes.string,
    placeholder: React.PropTypes.string,
    autocomplete: React.PropTypes.string,
    disabled: React.PropTypes.bool,
    hasClear: React.PropTypes.bool,
    onChange: React.PropTypes.func,
    onClick: React.PropTypes.func,
    onClearClick: React.PropTypes.func,
    onKeyDown: React.PropTypes.func,
    onKeyUp: React.PropTypes.func,
    onKeyPress: React.PropTypes.func,
};
コード例 #2
0
   *  positioning is always just relative to the parent.
   *
   *  If you want to position a child using specific numbers of logical
   *  pixels relative to its parent, set the child to have `absolute`
   *  position.
   *
   *  If you want to position a child relative to something
   *  that is not its parent, just don't use styles for that. Use the
   *  component tree.
   *
   *  See https://github.com/facebook/yoga
   *  for more details on how `position` differs between React Native
   *  and CSS.
   */
  position: ReactPropTypes.oneOf([
    'absolute',
    'relative'
  ]),

  /** `flexDirection` controls which directions children of a container go.
   *  `row` goes left to right, `column` goes top to bottom, and you may
   *  be able to guess what the other two do. It works like `flex-direction`
   *  in CSS, except the default is `column`.
   *  See https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction
   *  for more details.
   */
  flexDirection: ReactPropTypes.oneOf([
    'row',
    'row-reverse',
    'column',
    'column-reverse'
  ]),
コード例 #3
0
ファイル: MapView.js プロジェクト: igongora/react-native
    /**
     * If `false` the user won't be able to change the map region being displayed.
     * Default value is `true`.
     */
    scrollEnabled: React.PropTypes.bool,

    /**
     * The map type to be displayed.
     *
     * - standard: standard road map (default)
     * - satellite: satellite view
     * - hybrid: satellite view with roads and points of interest overlayed
     */
    mapType: React.PropTypes.oneOf([
      'standard',
      'satellite',
      'hybrid',
    ]),

    /**
     * The region to be displayed by the map.
     *
     * The region is defined by the center coordinates and the span of
     * coordinates to display.
     */
    region: React.PropTypes.shape({
      /**
       * Coordinates for the center of the map.
       */
      latitude: React.PropTypes.number.isRequired,
      longitude: React.PropTypes.number.isRequired,
コード例 #4
0
ファイル: Chart.js プロジェクト: eriksape/react-native-chart
height:_this2.state.containerHeight,
minVerticalBound:_this2.state.bounds.min,
maxVerticalBound:_this2.state.bounds.max,__source:{fileName:_jsxFileName,lineNumber:203}}))));}()));}}]);return Chart;}(_react.Component);Chart.defaultProps={data:[],animated:true,animationDuration:300,axisColor:C.BLACK,axisLabelColor:C.BLACK,axisLineWidth:1,axisTitleColor:C.GREY,axisTitleFontSize:16,chartFontSize:14,dataPointRadius:3,gridColor:C.BLACK,gridLineWidth:0.5,hideHorizontalGridLines:false,hideVerticalGridLines:false,horizontalScale:1,labelFontSize:10,lineWidth:1,showAxis:true,showDataPoint:false,showGrid:true,showXAxisLabels:true,showYAxisLabels:true,tightBounds:false,verticalGridStep:4,xAxisHeight:20,yAxisWidth:30};exports.default=Chart;









Chart.propTypes={
// Shared properties between most types
data:_react.PropTypes.arrayOf(_react.PropTypes.array).isRequired,
type:_react.PropTypes.oneOf(['line','bar','pie']).isRequired,
highlightColor:_react.PropTypes.oneOfType([_react.PropTypes.number,_react.PropTypes.string]), // TODO
highlightIndices:_react.PropTypes.arrayOf(_react.PropTypes.number), // TODO
onDataPointPress:_react.PropTypes.func,

// Bar chart props
color:_react.PropTypes.oneOfType([_react.PropTypes.number,_react.PropTypes.string]),
cornerRadius:_react.PropTypes.number,
// fillGradient: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), // TODO
widthPercent:_react.PropTypes.number,

// Line/multi-line chart props
fillColor:_react.PropTypes.oneOfType([_react.PropTypes.number,_react.PropTypes.string]),
dataPointColor:_react.PropTypes.oneOfType([_react.PropTypes.number,_react.PropTypes.string]),
dataPointFillColor:_react.PropTypes.oneOfType([_react.PropTypes.number,_react.PropTypes.string]),
dataPointRadius:_react.PropTypes.number,
コード例 #5
0
ファイル: Text.js プロジェクト: 13591139190/react-native
 *   },
 *   titleText: {
 *     fontSize: 20,
 *     fontWeight: 'bold',
 *   },
 * };
 * ```
 */

const Text = React.createClass({
  propTypes: {
    /**
     * Line Break mode. Works only with numberOfLines.
     * clip is working only for iOS
     */
    lineBreakMode: React.PropTypes.oneOf(['head', 'middle', 'tail', 'clip']),
    /**
     * Used to truncate the text with an ellipsis after computing the text
     * layout, including line wrapping, such that the total number of lines
     * does not exceed this number.
     */
    numberOfLines: React.PropTypes.number,
    /**
     * Invoked on mount and layout changes with
     *
     *   `{nativeEvent: {layout: {x, y, width, height}}}`
     */
    onLayout: React.PropTypes.func,
    /**
     * This function is called on press.
     */
コード例 #6
0
ファイル: Splits.js プロジェクト: karatechops/grommet
        [`${CLASS_ROOT}--responsive`]: responsive,
        [`${COLOR_INDEX}-${colorIndex}`]: colorIndex
      }
    );

    a11yTitle = a11yTitle || Intl.getMessage(intl, 'splits');

    return <svg version="1.1" viewBox="0 0 24 24" width="24px" height="24px" role="img" className={classes} aria-label={a11yTitle}><path fill="none" stroke="#000000" strokeWidth="2" d="M1,22 L23,22 L23,2 L1,2 L1,22 Z M8,2 L8,22 L8,2 Z M16,2 L16,22 L16,2 Z"/></svg>;
  }
};

Icon.contextTypes = {
  intl: PropTypes.object
};

Icon.defaultProps = {
  responsive: true
};

Icon.displayName = 'Splits';

Icon.icon = true;

Icon.propTypes = {
  a11yTitle: PropTypes.string,
  colorIndex: PropTypes.string,
  size: PropTypes.oneOf(['small', 'medium', 'large', 'xlarge', 'huge']),
  responsive: PropTypes.bool
};

コード例 #7
0
ファイル: ItemContent.js プロジェクト: hsojekok/scot
process.env.NODE_ENV !== "production" ? ItemContent.propTypes = {
  /** An element type to render as (string or function). */
  as: _lib.customPropTypes.as,

  /** Primary content. */
  children: _react.PropTypes.node,

  /** Additional classes. */
  className: _react.PropTypes.string,

  /** Shorthand for primary content. */
  content: _lib.customPropTypes.contentShorthand,

  /** Shorthand for ItemDescription component. */
  description: _lib.customPropTypes.itemShorthand,

  /** Shorthand for ItemExtra component. */
  extra: _lib.customPropTypes.itemShorthand,

  /** Shorthand for ItemHeader component. */
  header: _lib.customPropTypes.itemShorthand,

  /** Shorthand for ItemMeta component. */
  meta: _lib.customPropTypes.itemShorthand,

  /** Content can specify its vertical alignment. */
  verticalAlign: _react.PropTypes.oneOf(_lib.SUI.VERTICAL_ALIGNMENTS)
} : void 0;

exports.default = ItemContent;
コード例 #8
0
    return _react2.default.createElement(
      'div',
      { className: pictureChangerClassName },
      this.renderPictureChanger(),
      this.renderPictureRemover(),
      _react2.default.createElement(
        'form',
        { className: 'hide', ref: 'imageForm' },
        _react2.default.createElement('input', { onChange: this.handlePictureInputChange, ref: 'imageInput', type: 'file' })
      )
    );
  };

  return PictureChanger;
}(_react.Component);

PictureChanger.propTypes = {
  bigAvatar: _react.PropTypes.string,
  placeholder: _react.PropTypes.string.isRequired,
  name: _react.PropTypes.string.isRequired,

  small: _react.PropTypes.bool,

  fromModal: _react.PropTypes.oneOf([_ActorAppConstants.ModalTypes.PROFILE, _ActorAppConstants.ModalTypes.CREATE_GROUP, _ActorAppConstants.ModalTypes.EDIT_GROUP]).isRequired,

  onRemove: _react.PropTypes.func.isRequired,
  onChange: _react.PropTypes.func.isRequired
};
exports.default = PictureChanger;
//# sourceMappingURL=PictureChanger.react.js.map
コード例 #9
0
ファイル: Tabs.js プロジェクト: Apologise/react-bootstrap
  propTypes: {

    /**
     * Mark the Tab with a matching `eventKey` as active.
     *
     * @controllable onSelect
     */
    activeKey: React.PropTypes.any,

    /**
     * Navigation style for tabs
     *
     * If not specified, it will be treated as `'tabs'` when vertically
     * positioned and `'pills'` when horizontally positioned.
     */
    bsStyle: React.PropTypes.oneOf(['tabs', 'pills']),

    animation: React.PropTypes.bool,

    id: requiredForA11y(React.PropTypes.oneOfType([
      React.PropTypes.string,
      React.PropTypes.number
    ])),

    /**
     * Callback fired when a Tab is selected.
     *
     * ```js
     * function (
     * 	Any eventKey,
     * 	SyntheticEvent event?
コード例 #10
0
                   todos={visibleTodos}
                   onTodoClick={index =>
            dispatch(completeTodo(index))
          } />
           </div>
       )
    }
}
App.propTypes = {
    visibleTodos: PropTypes.arrayOf(PropTypes.shape({
        text: PropTypes.string.isRequired,
        completed: PropTypes.bool.isRequired
    }).isRequired).isRequired,
    visibilityFilter: PropTypes.oneOf([
        'SHOW_ALL',
        'SHOW_COMPLETED',
        'SHOW_ACTIVE'
    ]).isRequired
}

function selectTodos(todos, filter) {
    switch (filter) {
        case VisibilityFilters.SHOW_ALL:
            return todos
        case VisibilityFilters.SHOW_COMPLETED:
            return todos.filter(todo => todo.completed)
        case VisibilityFilters.SHOW_ACTIVE:
            return todos.filter(todo => !todo.completed)
    }
}
コード例 #11
0
var Input = (function (_Component) {
    _inherits(Input, _Component);

    function Input() {
        _classCallCheck(this, _Input);

        _get(Object.getPrototypeOf(_Input.prototype), 'constructor', this).apply(this, arguments);
    }

    _createClass(Input, [{
        key: 'render',
        value: function render() {
            var _props = this.props;
            var children = _props.children;
            var className = _props.className;
            var id = _props.id;

            var other = _objectWithoutProperties(_props, ['children', 'className', 'id']);

            return _react2['default'].createElement('input', _extends({
                className: Input.getClasses(this.props),
                ref: _lodash2['default'].camelCase(Input.displayName),
                id: this.props.name,

                role: this.inputRole,
                'aria-required': this.ariaRequired,
                'aria-readonly': this.props.readOnly,
                'aria-checked': this.ariaChecked

            }, other, Input.getEventsBinding(this)));
        }
    }, {
        key: 'inputRole',
        get: function get() {
            return this.props.type === 'checkbox' ? 'checkbox' : 'textbox';
        }
    }, {
        key: 'ariaRequired',
        get: function get() {
            // aria-required is not supported by role="checkbox"
            // https://www.w3.org/TR/wai-aria/roles#checkbox
            return this.props.type === 'checkbox' ? null : this.props.required;
        }
    }, {
        key: 'ariaChecked',
        get: function get() {
            // aria-checked is required for role="checkbox"
            return this.props.type === 'checkbox' ? !!this.props.value : null;
        }
    }], [{
        key: 'getClasses',
        value: function getClasses(props) {
            var block = _config.prefix + '-' + Input.displayName.toLowerCase();
            var extraClasses = props.className.split(' ');

            return (0, _classnames2['default'])(_extends(_defineProperty({}, block, true), Input.getUIClasses(props), _lodash2['default'].fromPairs(_lodash2['default'].map(extraClasses, function (className) {
                return [className, true];
            }))));
        }
    }, {
        key: 'displayName',
        value: 'Input',
        enumerable: true
    }, {
        key: 'propTypes',
        value: _extends({
            'aria-required': (0, _reactProptypeConditionalRequire2['default'])(_react.PropTypes.string, function (props) {
                return !!props.required;
            }),
            'aria-readonly': (0, _reactProptypeConditionalRequire2['default'])(_react.PropTypes.string, function (props) {
                return !!props.readOnly;
            }),

            framework: _react.PropTypes.oneOf(Object.keys(_config.uiFrameworks)).isRequired,

            defaultValue: _react2['default'].PropTypes.string,
            defaultChecked: _react2['default'].PropTypes.bool,
            name: _react2['default'].PropTypes.string.isRequired,
            id: _react2['default'].PropTypes.string,
            value: _react2['default'].PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number, _react.PropTypes.bool]),
            type: _react.PropTypes.oneOf(_config.inputTypes),
            className: _react.PropTypes.string,
            required: _react.PropTypes.bool,
            readOnly: _react.PropTypes.bool,
            children: _react.PropTypes.any
        }, _lodash2['default'].fromPairs(_lodash2['default'].map(_config.inputEventNames, function (eventName) {
            return [eventName, _react.PropTypes.func];
        }))),
        enumerable: true
    }, {
        key: 'defaultProps',
        value: _extends({
            className: '',
            type: _lodash2['default'].first(_config.inputTypes),
            framework: _lodash2['default'].head(Object.keys(_config.uiFrameworks))
        }, _lodash2['default'].fromPairs(_lodash2['default'].map(_config.inputEventNames, function (eventName) {
            return [eventName, _lodash2['default'].noop];
        }))),
        enumerable: true
    }, {
        key: 'getEventsBinding',
        value: function value(context) {
            return _lodash2['default'].fromPairs(_lodash2['default'].map(_config.inputEventNames, function (eventName) {
                return [eventName, context.props[eventName].bind(context)];
            }));
        },
        enumerable: true
    }]);

    var _Input = Input;
    Input = (0, _decorators.uiFrameworkClasses)(Input) || Input;
    return Input;
})(_react.Component);
コード例 #12
0
ファイル: BoolControl.js プロジェクト: Mark-de-Haan/molgenis
var div = React.DOM.div, label = React.DOM.label;

/**
 * Input control for BOOL type with checkbox or radio buttons
 *
 * @memberOf component
 */
var BoolControl = React.createClass({
    mixins: [DeepPureRenderMixin, I18nStringsMixin],
    displayName: 'BoolControl',
    propTypes: {
        id: React.PropTypes.string,
        name: React.PropTypes.string,
        label: React.PropTypes.string,
        layout: React.PropTypes.oneOf(['horizontal', 'vertical']),
        type: React.PropTypes.oneOf(['single', 'group']),
        multiple: React.PropTypes.bool,
        required: React.PropTypes.bool,
        disabled: React.PropTypes.bool,
        readOnly: React.PropTypes.bool,
        focus: React.PropTypes.bool,
        value: React.PropTypes.oneOfType([React.PropTypes.bool, React.PropTypes.array]),
        onValueChange: React.PropTypes.func.isRequired
    },
    getDefaultProps: function () {
        return {
            type: 'single',
            layout: 'horizontal',
            required: true
        };
コード例 #13
0
ファイル: NavBarMixin.js プロジェクト: ShaunGreiner/mkapp
	from '../../theme/utils/styleMerger';

module.exports = {
  getDefaultProps(){
    return {
			onMenuButtonClick: function(){}
    };
  },
  propTypes:{
    navbarColor: React.PropTypes.string,
    textColor: React.PropTypes.string,
    showMenuButton: React.PropTypes.bool,
    menuButtonLabel: React.PropTypes.string,
    menuButtonIconElement: React.PropTypes.element,
    onMenuButtonClick: React.PropTypes.func.isRequired,
    connectionStatus: React.PropTypes.oneOf([0,1,2]),
    title: React.PropTypes.string,
    showActivity: React.PropTypes.bool
  },
  prepareStyles(){
    // base styles
    let baseStyles = this.getBaseStyles();
    // theme styles
		let themeStyles_navbar = this.getThemeStyles('navBar');
		// props styles, override theme styles
		let propsStyles_navbar = {
			bgColor: this.props.navbarColor,
			textColor: this.props.textColor
		};

		// only use backgroundColor and color from theme and props, props override theme
コード例 #14
0
    var peerInfo = _props.peerInfo;
    var small = _props.small;


    return _react2.default.createElement(
      'div',
      { className: 'call__avatar' },
      _react2.default.createElement(_AvatarItem2.default, {
        size: small ? 'large' : 'big',
        title: peerInfo.name,
        image: peerInfo.avatar,
        placeholder: peerInfo.placeholder
      }),
      this.renderAnimation()
    );
  };

  return CallAvatar;
}(_react.Component);

CallAvatar.propTypes = {
  small: _react.PropTypes.bool,
  peerInfo: _react.PropTypes.shape({
    name: _react.PropTypes.string.isRequired,
    avatar: _react.PropTypes.string,
    placeholder: _react.PropTypes.string.isRequired
  }).isRequired,
  callState: _react.PropTypes.oneOf([_ActorAppConstants.CallStates.CALLING, _ActorAppConstants.CallStates.IN_PROGRESS, _ActorAppConstants.CallStates.CONNECTING, _ActorAppConstants.CallStates.ENDED]).isRequired
};
exports.default = CallAvatar;
//# sourceMappingURL=CallAvatar.react.js.map
コード例 #15
0
ファイル: Search.js プロジェクト: ReganHe/grommet
            onClick={this._onAddDrop}
            onFocus={this._onFocusControl}
            onBlur={this._onBlurControl} />
        </div>
      );
    }
  }

}

Search.propTypes = {
  defaultValue: PropTypes.string,
  dropAlign: Drop.alignPropType,
  dropColorIndex: PropTypes.string,
  fill: PropTypes.bool,
  iconAlign: React.PropTypes.oneOf(['start', 'end']),
  id: React.PropTypes.string,
  inline: PropTypes.bool,
  large: PropTypes.bool,
  onChange: PropTypes.func,
  onDOMChange: PropTypes.func,
  onSelect: PropTypes.func,
  placeHolder: PropTypes.string,
  responsive: PropTypes.bool,
  size: React.PropTypes.oneOf(['small', 'medium', 'large']),
  suggestions: PropTypes.arrayOf(
    PropTypes.oneOfType([
      PropTypes.shape({
        label: PropTypes.node,
        value: PropTypes.any
      }),
コード例 #16
0
    paddingBottom: 10,
  },
})

function DateSquare({side, date, children}) {
  return (
    <div className={`calendar__date calendar__date--${side}`}>
      <div className="calendar__date__name">{date.format('ddd')}</div>
      <div className="calendar__date__number">{date.format('D')}</div>
      {children}
    </div>
  )
}

DateSquare.propTypes = {
  side: PropTypes.oneOf(['before', 'after', 'main']).isRequired,
  date: PropTypes.object.isRequired,
  children: PropTypes.any,
}

function ShowTime({timeHTML}) {
  return (
    <div className="calendar__section calendar__section--heading calendar__section--time">
      <h3 dangerouslySetInnerHTML={timeHTML}></h3>
    </div>
  )
}

ShowTime.propTypes = {
  timeHTML: PropTypes.object.isRequired,
}
コード例 #17
0
ファイル: Chart.js プロジェクト: Welltory/react-chartjs-2
import React, {PropTypes} from 'react';
import ReactDOM from 'react-dom';
import Chart from 'chart.js';

const ChartComponent = React.createClass({

	displayName: 'ChartComponent',

	propTypes: {
		data: PropTypes.object.isRequired,
		height: PropTypes.number,
		legend: PropTypes.object,
		options: PropTypes.object,
		redraw: PropTypes.bool,
		type: PropTypes.oneOf(['doughnut', 'pie', 'line', 'bar', 'radar', 'polarArea']),
		width: PropTypes.number
	},

	getDefaultProps() {
		return {
			legend: {
				display: true,
				position: 'bottom'
			},
		  type: 'doughnut',
			height: 200,
			width: 200,
			redraw: true
		};
	},
コード例 #18
0
ファイル: SocialShare.js プロジェクト: Frankie-666/grommet
      href = `https://www.linkedin.com/shareArticle?mini=true&url=${encodedLink}&title=${encodedTitle}&summary=${encodedText}`;
    } else if (type === 'google') {
      socialIcon = <SocialGoogleIcon a11yTitle='Share on Google' />;
      href = `https://plus.google.com/share?url=${encodedLink}`;
    } else if (type === 'facebook') {
      socialIcon = <SocialFacebookIcon a11yTitle='Share on Facebook' />;
      href = `https://www.facebook.com/sharer/sharer.php?u=${encodedLink}`;
    } else if (type === 'email') {
      socialIcon = <SocialEmailIcon a11yTitle='Share on Email' />;
      href = `mailto:?subject=${encodedTitle}&body=${encodedText}%0D%0A${encodedLink}`;
      target = '_self';
    }

    return (
      <Anchor href={href} icon={socialIcon} target={target} />
    );
  }
};

SocialShare.propTypes = {
  type: PropTypes.oneOf(['email', 'facebook', 'twitter', 'linkedin', 'google']).isRequired,
  link: PropTypes.string.isRequired,
  title: PropTypes.string,
  text: PropTypes.string
};

SocialShare.defaultProps = {
  title: '',
  text: ''
};
コード例 #19
0
  /** Label for form element */
  label: React.PropTypes.string.isRequired,
  /** Name attribute for form element */
  name: React.PropTypes.string.isRequired,
  /** Form element type */
  type: React.PropTypes.string,
  /** Adds a helper or error message below the input */
  message: React.PropTypes.string,
  /** Hides the form element label */
  hideLabel: React.PropTypes.bool,
  /** Controls the border radius for creating grouped elements */
  rounded: React.PropTypes.oneOfType([
    React.PropTypes.bool,
    React.PropTypes.oneOf([
      'top',
      'right',
      'bottom',
      'left'
    ])
  ])
}

Input.defaultProps = {
  type: 'text',
  rounded: true
}

Input.contextTypes = {
  rebass: React.PropTypes.object
}

export default Input
コード例 #20
0
ファイル: Label.js プロジェクト: eriksape/stardust
  name: 'Label',
  type: META.type.element,
  props: {
    attached: ['top', 'bottom', 'top right', 'top left', 'bottom left', 'bottom right'],
    size: sui.sizes,
    color: sui.colors,
    pointing: ['bottom', 'left', 'right'],
    corner: ['left', 'right'],
    right: ['left', 'right'],
    ribbon: ['right'],
  },
}

Label.propTypes = {
  /** Attach to a <Segment />. */
  attached: PropTypes.oneOf(Label._meta.props.attached),

  /** Primary content of the label, same as text. */
  children: PropTypes.node,

  /** Classes to add to the label className. */
  className: PropTypes.string,

  /** Color of the label. */
  color: PropTypes.oneOf(Label._meta.props.colors),

  /** Place the label in one of the upper corners . */
  corner: PropTypes.oneOf(Label._meta.props.corner),

  /** Additional text with less emphasis. */
  detail: PropTypes.string,
コード例 #21
0
ファイル: index.js プロジェクト: udacityalumni/alumni-client
import { AvatarImage } from './styles';
const defaultAvatarUrl = 'https://github.com/RyanCCollins/cdn/blob/master/alumni-webapp/no-user.png?raw=true';

const Avatar = ({
  src,
  size,
}) => (
  <AvatarImage
    size={size}
    src={src || defaultAvatarUrl}
  />
);

Avatar.propTypes = {
  src: PropTypes.string.isRequired,
  size: PropTypes.oneOf([
    'xsmall',
    'small',
    'medium',
    'large',
    'xlarge',
  ]),
};

Avatar.defaultProps = {
  src: defaultAvatarUrl,
  size: 'small',
};

export default Avatar;
コード例 #22
0
ファイル: clock-button.js プロジェクト: sornon/mui
var React = require('react');
var StylePropable = require('../mixins/style-propable');
var EnhancedButton = require('../enhanced-button');
var Transitions = require('../styles/transitions');

var ClockButton = React.createClass({displayName: "ClockButton",

  mixins: [StylePropable],

  contextTypes: {
    muiTheme: React.PropTypes.object
  },

  propTypes: {
      position: React.PropTypes.oneOf(['left', 'right'])
  },
  
  getDefaultProps: function () {
      return {
          position: "left"  
      };
  },
  _handleTouchTap: function(){
    
    this.setState({
      selected: true
    })
    this.props.onTouchTap();
  },
  getTheme: function() {
    return this.context.muiTheme.component.timePicker;
コード例 #23
0
ファイル: StatusBar.js プロジェクト: 1039289948/react-native
 backgroundColor: ColorPropType,
 /**
  * If the status bar is translucent.
  * When translucent is set to true, the app will draw under the status bar.
  * This is useful when using a semi transparent status bar color.
  *
  * @platform android
  */
 translucent: React.PropTypes.bool,
 /**
  * Sets the color of the status bar text.
  *
  * @platform ios
  */
 barStyle: React.PropTypes.oneOf([
   'default',
   'light-content',
 ]),
 /**
  * If the network activity indicator should be visible.
  *
  * @platform ios
  */
 networkActivityIndicatorVisible: React.PropTypes.bool,
 /**
  * The transition effect when showing and hiding the status bar using the `hidden`
  * prop. Defaults to 'fade'.
  *
  * @platform ios
  */
 showHideTransition: React.PropTypes.oneOf([
   'fade',
コード例 #24
0
ファイル: Radio.js プロジェクト: ojame/teatime-components
'use strict';

const { PropTypes } = require('react');
const Radio = require('../view/Radio');
const StyleComponent = require('../mixin/StyleComponent');

module.exports = StyleComponent(
  Radio,
  (styles, { size }) => ({styles: styles[size]}),
  {
    s: require('../style/radio/radio-s.css'),
    m: require('../style/radio/radio-m.css'),
  },
  {
    size: 's',
  },
  {
    size: PropTypes.oneOf([
      's',
      'm',
    ]),
  }
);
コード例 #25
0
    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,
  },

  _nativeRef: (null: any),
  _lastNativeRefreshing: false,

  componentDidMount() {
    this._lastNativeRefreshing = this.props.refreshing;
  },

  componentDidUpdate(prevProps: {refreshing: boolean}) {
コード例 #26
0
ファイル: Pane.js プロジェクト: di3goleite/examples-electron
        const style = {
            flex: 1,
            position: 'relative',
            outline: 'none',
        };

        if (this.state.size !== undefined) {
            if (split === 'vertical') {
                style.width = this.state.size;
            } else {
                style.height = this.state.size;
                style.display = 'flex';
            }
            style.flex = 'none';
        }

        return (
            <div className={classes.join(' ')} style={style}>{this.props.children}</div>
        );
    }
}

Pane.propTypes = {
    split: PropTypes.oneOf(['vertical', 'horizontal']),
    className: PropTypes.string.isRequired,
    children: PropTypes.object.isRequired,
};

export default Pane;
コード例 #27
0
var Touchable = require('Touchable');
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,
コード例 #28
0
ファイル: index.js プロジェクト: iris-dni/iris-admin
    /**
     * Properties that should be passed to the itemsTemplate.
     */
    itemsTemplateProps: React.PropTypes.object,

    /**
     * The key of the unique property of each item (e.g. 'id', or 'email').
     */
    uniqueItemProperty: React.PropTypes.string.isRequired,

    /**
     * The used wrapper element. Depends on the environment - in a table 'tbody'
     * should be used as <div> cannot appear as a child of <table>.
     */
    wrapperElement: React.PropTypes.oneOf([ 'tbody', 'div' ]),

    /**
     * Props passed to the wrapperElement.
     */
    wrapperProps: React.PropTypes.object,
  },

  getDefaultProps: () => ({
    wrapperElement: 'div',
  }),

  render() {
    const {
      itemsTemplate: ItemsTemplate,
      itemsTemplateProps,
コード例 #29
0
   onValueChange: React.PropTypes.func,
   /**
    * If set to false, the picker will be disabled, i.e. the user will not be able to make a
    * selection.
    * @platform android
    */
   enabled: React.PropTypes.bool,
   /**
    * On Android, specifies how to display the selection items when the user taps on the picker:
    *
    *   - 'dialog': Show a modal dialog. This is the default.
    *   - 'dropdown': Shows a dropdown anchored to the picker view
    *
    * @platform android
    */
   mode: React.PropTypes.oneOf(['dialog', 'dropdown']),
   /**
    * Style to apply to each of the item labels.
    * @platform ios
    */
   itemStyle: itemStylePropType,
   /**
    * Prompt string for this picker, used on Android in dialog mode as the title of the dialog.
    * @platform android
    */
   prompt: React.PropTypes.string,
   /**
    * Used to locate this view in end-to-end tests.
    */
   testID: React.PropTypes.string,
 },
コード例 #30
0
ファイル: Meter.js プロジェクト: tkubica12/oneview-demo
Meter.displayName = 'Meter';
exports.default = Meter;


Meter.propTypes = {
  active: _react.PropTypes.bool, // when single value
  activeIndex: _react.PropTypes.number, // for series values
  a11yTitle: _react.PropTypes.string,
  colorIndex: _react.PropTypes.string,
  // deprecated in favor of activeIndex?
  important: _react.PropTypes.number,
  label: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.node]),
  // deprecated, caller can use Legend as needed
  legend: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.shape({
    align: _react.PropTypes.oneOf(['start', 'center', 'end']),
    placement: _react.PropTypes.oneOf(['right', 'bottom', 'inline']),
    total: _react.PropTypes.bool
  })]),
  max: _react.PropTypes.oneOfType([_react.PropTypes.shape({
    value: _react.PropTypes.number.isRequired,
    label: _react.PropTypes.string
  }), _react.PropTypes.number]),
  min: _react.PropTypes.oneOfType([_react.PropTypes.shape({
    value: _react.PropTypes.number.isRequired,
    label: _react.PropTypes.string
  }), _react.PropTypes.number]),
  onActive: _react.PropTypes.func,
  size: _react.PropTypes.oneOf(['small', 'medium', 'large', 'xlarge']),
  series: _react.PropTypes.arrayOf(_react.PropTypes.shape({
    label: _react.PropTypes.string,