Added logging, changed some directory structure

This commit is contained in:
2018-01-13 21:33:40 -05:00
parent f079a5f067
commit 8e72ffb917
73656 changed files with 35284 additions and 53718 deletions

View File

@@ -0,0 +1,67 @@
import * as React from 'react';
import { StandardProps } from '..';
export interface InputProps extends StandardProps<
React.HTMLAttributes<HTMLDivElement>,
InputClassKey,
'onChange' | 'onKeyUp' | 'onKeyDown' | 'defaultValue'
> {
autoComplete?: string;
autoFocus?: boolean;
inputComponent?: React.ReactNode;
defaultValue?: string | number;
disabled?: boolean;
disableUnderline?: boolean;
endAdornment?: React.ReactNode;
error?: boolean;
fullWidth?: boolean;
id?: string;
inputProps?:
| React.TextareaHTMLAttributes<HTMLTextAreaElement>
| React.InputHTMLAttributes<HTMLInputElement>;
inputRef?: React.Ref<any>;
margin?: 'dense';
multiline?: boolean;
name?: string;
placeholder?: string;
rows?: string | number;
rowsMax?: string | number;
startAdornment?: React.ReactNode;
type?: string;
value?: string | number;
onClean?: () => void;
onDirty?: () => void;
/**
* `onChange`, `onKeyUp` + `onKeyDown` are applied to the inner `InputComponent`,
* which by default is an input or textarea. Since these handlers differ from the
* ones inherited by `React.HTMLAttributes<HTMLDivElement>` we need to omit them.
*
* Note that `blur` and `focus` event handler are applied to the outter `<div>`.
* So these can just be inherited from the native `<div>`.
*/
onChange?: React.ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;
onKeyUp?: React.KeyboardEventHandler<HTMLTextAreaElement | HTMLInputElement>;
onKeyDown?: React.KeyboardEventHandler<HTMLTextAreaElement | HTMLInputElement>;
}
export type InputClassKey =
| 'root'
| 'formControl'
| 'inkbar'
| 'error'
| 'input'
| 'inputDense'
| 'disabled'
| 'focused'
| 'underline'
| 'multiline'
| 'inputDisabled'
| 'inputSingleline'
| 'inputSearch'
| 'inputMultiline'
| 'fullWidth'
;
declare const Input: React.ComponentType<InputProps>;
export default Input;

View File

@@ -0,0 +1,448 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
// weak
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
import { isMuiComponent } from '../utils/reactHelpers';
import Textarea from './Textarea';
// Supports determination of isControlled().
// Controlled input accepts its current value as a prop.
//
// @see https://facebook.github.io/react/docs/forms.html#controlled-components
// @param value
// @returns {boolean} true if string (including '') or number (including zero)
export function hasValue(value) {
return value !== undefined && value !== null && !(Array.isArray(value) && value.length === 0);
}
// Determine if field is dirty (a.k.a. filled).
//
// Response determines if label is presented above field or as placeholder.
//
// @param obj
// @param SSR
// @returns {boolean} False when not present or empty string.
// True when any number or string with length.
export function isDirty(obj, SSR = false) {
return obj && (hasValue(obj.value) && obj.value !== '' || SSR && hasValue(obj.defaultValue) && obj.defaultValue !== '');
}
// Determine if an Input is adorned on start.
// It's corresponding to the left with LTR.
//
// @param obj
// @returns {boolean} False when no adornments.
// True when adorned at the start.
export function isAdornedStart(obj) {
return obj.startAdornment;
}
export const styles = theme => {
const placeholder = {
color: 'currentColor',
opacity: theme.palette.type === 'light' ? 0.42 : 0.5,
transition: theme.transitions.create('opacity', {
duration: theme.transitions.duration.shorter,
easing: theme.transitions.easing.ease
})
};
const placeholderHidden = {
opacity: 0
};
const placeholderVisible = {
opacity: theme.palette.type === 'light' ? 0.42 : 0.5
};
return {
root: {
// Mimics the default input display property used by browsers for an input.
display: 'inline-flex',
alignItems: 'baseline',
position: 'relative',
fontFamily: theme.typography.fontFamily,
color: theme.palette.input.inputText,
fontSize: theme.typography.pxToRem(16)
},
formControl: {
'label + &': {
marginTop: theme.spacing.unit * 2
}
},
inkbar: {
'&:after': {
backgroundColor: theme.palette.primary[theme.palette.type === 'light' ? 'A700' : 'A200'],
left: 0,
bottom: 0,
// Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
content: '""',
height: 2,
position: 'absolute',
right: 0,
transform: 'scaleX(0)',
transition: theme.transitions.create('transform', {
duration: theme.transitions.duration.shorter,
easing: theme.transitions.easing.easeOut
}),
pointerEvents: 'none' // Transparent to the hover style.
},
'&$focused:after': {
transform: 'scaleX(1)'
}
},
error: {
'&:after': {
backgroundColor: theme.palette.error.A400,
transform: 'scaleX(1)' // error is always underlined in red
}
},
input: {
font: 'inherit',
color: 'currentColor',
// slight alteration to spec spacing to match visual spec result
padding: `${theme.spacing.unit - 1}px 0 ${theme.spacing.unit + 1}px`,
border: 0,
boxSizing: 'content-box',
verticalAlign: 'middle',
background: 'none',
margin: 0, // Reset for Safari
display: 'block',
width: '100%',
'&::-webkit-input-placeholder': placeholder,
'&::-moz-placeholder': placeholder, // Firefox 19+
'&:-ms-input-placeholder': placeholder, // IE 11
'&::-ms-input-placeholder': placeholder, // Edge
'&:focus': {
outline: 0
},
// Reset Firefox invalid required input style
'&:invalid': {
boxShadow: 'none'
},
'&::-webkit-search-decoration': {
// Remove the padding when type=search.
appearance: 'none'
},
// Show and hide the placeholder logic
'label[data-shrink=false] + $formControl &': {
'&::-webkit-input-placeholder': placeholderHidden,
'&::-moz-placeholder': placeholderHidden, // Firefox 19+
'&:-ms-input-placeholder': placeholderHidden, // IE 11
'&::-ms-input-placeholder': placeholderHidden, // Edge
'&:focus::-webkit-input-placeholder': placeholderVisible,
'&:focus::-moz-placeholder': placeholderVisible, // Firefox 19+
'&:focus:-ms-input-placeholder': placeholderVisible, // IE 11
'&:focus::-ms-input-placeholder': placeholderVisible // Edge
}
},
inputDense: {
paddingTop: theme.spacing.unit / 2
},
disabled: {
color: theme.palette.text.disabled
},
focused: {},
underline: {
'&:before': {
backgroundColor: theme.palette.input.bottomLine,
left: 0,
bottom: 0,
// Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
content: '""',
height: 1,
position: 'absolute',
right: 0,
transition: theme.transitions.create('background-color', {
duration: theme.transitions.duration.shorter,
easing: theme.transitions.easing.ease
}),
pointerEvents: 'none' // Transparent to the hover style.
},
'&:hover:not($disabled):before': {
backgroundColor: theme.palette.text.primary,
height: 2
},
'&$disabled:before': {
background: 'transparent',
backgroundImage: `linear-gradient(to right, ${theme.palette.input.bottomLine} 33%, transparent 0%)`,
backgroundPosition: 'left top',
backgroundRepeat: 'repeat-x',
backgroundSize: '5px 1px'
}
},
multiline: {
padding: `${theme.spacing.unit - 2}px 0 ${theme.spacing.unit - 1}px`
},
inputDisabled: {
opacity: 1 // Reset iOS opacity
},
inputSingleline: {
height: '1em'
},
inputSearch: {
appearance: 'textfield' // Improve type search style.
},
inputMultiline: {
resize: 'none',
padding: 0
},
fullWidth: {
width: '100%'
}
};
};
class Input extends React.Component {
constructor(...args) {
var _temp;
return _temp = super(...args), this.state = {
focused: false
}, this.input = null, this.handleFocus = event => {
this.setState({ focused: true });
if (this.props.onFocus) {
this.props.onFocus(event);
}
}, this.handleBlur = event => {
this.setState({ focused: false });
if (this.props.onBlur) {
this.props.onBlur(event);
}
}, this.handleChange = event => {
if (!this.isControlled()) {
this.checkDirty(this.input);
}
// Perform in the willUpdate
if (this.props.onChange) {
this.props.onChange(event);
}
}, this.handleRefInput = node => {
this.input = node;
if (this.props.inputRef) {
this.props.inputRef(node);
}
}, _temp;
}
componentWillMount() {
if (this.isControlled()) {
this.checkDirty(this.props);
}
}
componentDidMount() {
if (!this.isControlled()) {
this.checkDirty(this.input);
}
}
componentWillReceiveProps(nextProps) {
// The blur won't fire when the disabled state is set on a focused input.
// We need to book keep the focused state manually.
if (!this.props.disabled && nextProps.disabled) {
this.setState({
focused: false
});
}
}
componentWillUpdate(nextProps) {
if (this.isControlled(nextProps)) {
this.checkDirty(nextProps);
} // else performed in the onChange
// Book keep the focused state.
if (!this.props.disabled && nextProps.disabled) {
const { muiFormControl } = this.context;
if (muiFormControl && muiFormControl.onBlur) {
muiFormControl.onBlur();
}
}
}
// Holds the input reference
// A controlled input accepts its current value as a prop.
//
// @see https://facebook.github.io/react/docs/forms.html#controlled-components
// @returns {boolean} true if string (including '') or number (including zero)
isControlled(props = this.props) {
return hasValue(props.value);
}
checkDirty(obj) {
const { muiFormControl } = this.context;
if (isDirty(obj)) {
if (muiFormControl && muiFormControl.onDirty) {
muiFormControl.onDirty();
}
if (this.props.onDirty) {
this.props.onDirty();
}
return;
}
if (muiFormControl && muiFormControl.onClean) {
muiFormControl.onClean();
}
if (this.props.onClean) {
this.props.onClean();
}
}
render() {
const _props = this.props,
{
autoComplete,
autoFocus,
classes,
className: classNameProp,
defaultValue,
disabled: disabledProp,
disableUnderline,
endAdornment,
error: errorProp,
fullWidth,
id,
inputComponent,
inputProps: { className: inputPropsClassName } = {},
inputRef,
margin: marginProp,
multiline,
onBlur,
onFocus,
onChange,
onClean,
onDirty,
onKeyDown,
onKeyUp,
placeholder,
name,
readOnly,
rows,
rowsMax,
startAdornment,
type,
// $FlowFixMe
value
} = _props,
inputPropsProp = _objectWithoutProperties(_props.inputProps, ['className']),
other = _objectWithoutProperties(_props, ['autoComplete', 'autoFocus', 'classes', 'className', 'defaultValue', 'disabled', 'disableUnderline', 'endAdornment', 'error', 'fullWidth', 'id', 'inputComponent', 'inputProps', 'inputRef', 'margin', 'multiline', 'onBlur', 'onFocus', 'onChange', 'onClean', 'onDirty', 'onKeyDown', 'onKeyUp', 'placeholder', 'name', 'readOnly', 'rows', 'rowsMax', 'startAdornment', 'type', 'value']);
const { muiFormControl } = this.context;
let disabled = disabledProp;
let error = errorProp;
let margin = marginProp;
if (muiFormControl) {
if (typeof disabled === 'undefined') {
disabled = muiFormControl.disabled;
}
if (typeof error === 'undefined') {
error = muiFormControl.error;
}
if (typeof margin === 'undefined') {
margin = muiFormControl.margin;
}
}
const className = classNames(classes.root, {
[classes.disabled]: disabled,
[classes.error]: error,
[classes.fullWidth]: fullWidth,
[classes.focused]: this.state.focused,
[classes.formControl]: muiFormControl,
[classes.inkbar]: !disableUnderline,
[classes.multiline]: multiline,
[classes.underline]: !disableUnderline
}, classNameProp);
const inputClassName = classNames(classes.input, {
[classes.inputDisabled]: disabled,
[classes.inputSingleline]: !multiline,
[classes.inputSearch]: type === 'search',
[classes.inputMultiline]: multiline,
[classes.inputDense]: margin === 'dense'
}, inputPropsClassName);
const required = muiFormControl && muiFormControl.required === true;
let InputComponent = 'input';
let inputProps = _extends({
ref: this.handleRefInput
}, inputPropsProp);
if (inputComponent) {
InputComponent = inputComponent;
if (isMuiComponent(InputComponent, ['SelectInput'])) {
inputProps = _extends({
selectRef: this.handleRefInput
}, inputProps, {
ref: null
});
}
} else if (multiline) {
if (rows && !rowsMax) {
InputComponent = 'textarea';
} else {
inputProps = _extends({
rowsMax,
textareaRef: this.handleRefInput
}, inputProps, {
ref: null
});
InputComponent = Textarea;
}
}
return React.createElement(
'div',
_extends({ onBlur: this.handleBlur, onFocus: this.handleFocus, className: className }, other),
startAdornment,
React.createElement(InputComponent, _extends({
autoComplete: autoComplete,
autoFocus: autoFocus,
className: inputClassName,
onChange: this.handleChange,
onKeyUp: onKeyUp,
onKeyDown: onKeyDown,
disabled: disabled,
required: required ? true : undefined,
value: value,
id: id,
name: name,
defaultValue: defaultValue,
placeholder: placeholder,
type: type,
readOnly: readOnly,
rows: rows
}, inputProps)),
endAdornment
);
}
}
Input.muiName = 'Input';
Input.defaultProps = {
disableUnderline: false,
fullWidth: false,
multiline: false,
type: 'text'
};
Input.contextTypes = {
muiFormControl: PropTypes.object
};
export default withStyles(styles, { name: 'MuiInput' })(Input);

View File

@@ -0,0 +1,18 @@
import * as React from 'react';
import { StandardProps } from '..';
export interface InputAdornmentProps extends StandardProps<{}, InputAdornmentClassKey> {
component?: React.ReactType;
disableTypography?: boolean;
position: 'start' | 'end';
}
export type InputAdornmentClassKey =
| 'root'
| 'positionStart'
| 'positionEnd'
;
declare const InputAdornment: React.ComponentType<InputAdornmentProps>;
export default InputAdornment;

View File

@@ -0,0 +1,57 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
import React from 'react';
import classNames from 'classnames';
import Typography from '../Typography';
import withStyles from '../styles/withStyles';
export const styles = theme => ({
root: {
'label + div > &': {
marginTop: -theme.spacing.unit * 2
}
},
positionStart: {
marginRight: theme.spacing.unit
},
positionEnd: {
marginLeft: theme.spacing.unit
}
});
function InputAdornment(props) {
const {
children,
component: Component,
classes,
className,
disableTypography,
position
} = props,
other = _objectWithoutProperties(props, ['children', 'component', 'classes', 'className', 'disableTypography', 'position']);
return React.createElement(
Component,
_extends({
className: classNames(classes.root, {
[classes.positionStart]: position === 'start',
[classes.positionEnd]: position === 'end'
}, className)
}, other),
typeof children === 'string' && !disableTypography ? React.createElement(
Typography,
{ color: 'secondary' },
children
) : children
);
}
InputAdornment.defaultProps = {
component: 'div',
disableTypography: false
};
export default withStyles(styles, { name: 'MuiInputAdornment' })(InputAdornment);

View File

@@ -0,0 +1,27 @@
import * as React from 'react';
import { StandardProps } from '..';
import { FormLabelProps, FormLabelClassKey } from '../Form/FormLabel';
export interface InputLabelProps extends StandardProps<
FormLabelProps,
InputLabelClassKey
> {
disableAnimation?: boolean;
disabled?: boolean;
error?: boolean;
focused?: boolean;
required?: boolean;
shrink?: boolean;
}
export type InputLabelClassKey =
| FormLabelClassKey
| 'formControl'
| 'labelDense'
| 'shrink'
| 'animated'
;
declare const InputLabel: React.ComponentType<InputLabelProps>;
export default InputLabel;

View File

@@ -0,0 +1,91 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
import { FormLabel } from '../Form';
export const styles = theme => ({
root: {
transformOrigin: `top ${theme.direction === 'ltr' ? 'left' : 'right'}`
},
formControl: {
position: 'absolute',
left: 0,
top: 0,
// slight alteration to spec spacing to match visual spec result
transform: `translate(0, ${theme.spacing.unit * 3 - 1}px) scale(1)`
},
labelDense: {
// Compensation for the `Input.inputDense` style.
transform: `translate(0, ${theme.spacing.unit * 2.5 + 1}px) scale(1)`
},
shrink: {
transform: 'translate(0, 1.5px) scale(0.75)',
transformOrigin: `top ${theme.direction === 'ltr' ? 'left' : 'right'}`
},
animated: {
transition: theme.transitions.create('transform', {
duration: theme.transitions.duration.shorter,
easing: theme.transitions.easing.easeOut
})
},
disabled: {
color: theme.palette.input.disabled
}
});
function InputLabel(props, context) {
const {
disabled,
disableAnimation,
children,
classes,
className: classNameProp,
FormControlClasses,
shrink: shrinkProp,
margin: marginProp
} = props,
other = _objectWithoutProperties(props, ['disabled', 'disableAnimation', 'children', 'classes', 'className', 'FormControlClasses', 'shrink', 'margin']);
const { muiFormControl } = context;
let shrink = shrinkProp;
if (typeof shrink === 'undefined' && muiFormControl) {
shrink = muiFormControl.dirty || muiFormControl.focused || muiFormControl.adornedStart;
}
let margin = marginProp;
if (typeof margin === 'undefined' && muiFormControl) {
margin = muiFormControl.margin;
}
const className = classNames(classes.root, {
[classes.formControl]: muiFormControl,
[classes.animated]: !disableAnimation,
[classes.shrink]: shrink,
[classes.disabled]: disabled,
[classes.labelDense]: margin === 'dense'
}, classNameProp);
return React.createElement(
FormLabel,
_extends({ 'data-shrink': shrink, className: className, classes: FormControlClasses }, other),
children
);
}
InputLabel.defaultProps = {
disabled: false,
disableAnimation: false
};
InputLabel.contextTypes = {
muiFormControl: PropTypes.object
};
export default withStyles(styles, { name: 'MuiInputLabel' })(InputLabel);

View File

@@ -0,0 +1,25 @@
import * as React from 'react';
import { StandardProps } from '..';
export interface TextareaProps extends StandardProps<
React.TextareaHTMLAttributes<HTMLTextAreaElement>,
TextareaClassKey,
'rows'
> {
defaultValue?: any;
disabled?: boolean;
rows?: string | number;
rowsMax?: string | number;
textareaRef?: React.Ref<any>;
value?: string;
}
export type TextareaClassKey =
| 'root'
| 'shadow'
| 'textarea'
;
declare const Textarea: React.ComponentType<TextareaProps>;
export default Textarea;

View File

@@ -0,0 +1,185 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
import React from 'react';
import classnames from 'classnames';
import debounce from 'lodash/debounce';
import EventListener from 'react-event-listener';
import withStyles from '../styles/withStyles';
const rowsHeight = 24;
export const styles = {
root: {
position: 'relative', // because the shadow has position: 'absolute',
width: '100%'
},
textarea: {
width: '100%',
height: '100%',
resize: 'none',
font: 'inherit',
padding: 0,
cursor: 'inherit',
boxSizing: 'border-box',
lineHeight: 'inherit',
border: 'none',
outline: 'none',
background: 'transparent'
},
shadow: {
resize: 'none',
// Overflow also needed to here to remove the extra row
// added to textareas in Firefox.
overflow: 'hidden',
// Visibility needed to hide the extra text area on ipads
visibility: 'hidden',
position: 'absolute',
height: 'auto',
whiteSpace: 'pre-wrap'
}
};
/**
* @ignore - internal component.
*/
class Textarea extends React.Component {
constructor(...args) {
var _temp;
return _temp = super(...args), this.state = {
height: null
}, this.handleResize = debounce(event => {
this.syncHeightWithShadow(event);
}, 166), this.handleRefInput = node => {
this.input = node;
if (this.props.textareaRef) {
this.props.textareaRef(node);
}
}, this.handleRefSinglelineShadow = node => {
this.singlelineShadow = node;
}, this.handleRefShadow = node => {
this.shadow = node;
}, this.handleChange = event => {
this.value = event.target.value;
if (typeof this.props.value === 'undefined' && this.shadow) {
// The component is not controlled, we need to update the shallow value.
this.shadow.value = this.value;
this.syncHeightWithShadow(event);
}
if (this.props.onChange) {
this.props.onChange(event);
}
}, _temp;
}
componentWillMount() {
// <Input> expects the components it renders to respond to 'value'
// so that it can check whether they are dirty
this.value = this.props.value || this.props.defaultValue || '';
this.setState({
height: Number(this.props.rows) * rowsHeight
});
}
componentDidMount() {
this.syncHeightWithShadow(null);
}
componentWillReceiveProps(nextProps) {
if (nextProps.value !== this.props.value || Number(nextProps.rowsMax) !== Number(this.props.rowsMax)) {
this.syncHeightWithShadow(null, nextProps);
}
}
componentWillUnmount() {
this.handleResize.cancel();
}
syncHeightWithShadow(event, props = this.props) {
if (this.shadow && this.singlelineShadow) {
// The component is controlled, we need to update the shallow value.
if (typeof this.props.value !== 'undefined') {
this.shadow.value = props.value == null ? '' : String(props.value);
}
const lineHeight = this.singlelineShadow.scrollHeight;
let newHeight = this.shadow.scrollHeight;
// Guarding for jsdom, where scrollHeight isn't present.
// See https://github.com/tmpvar/jsdom/issues/1013
if (newHeight === undefined) {
return;
}
if (Number(props.rowsMax) >= Number(props.rows)) {
newHeight = Math.min(Number(props.rowsMax) * lineHeight, newHeight);
}
newHeight = Math.max(newHeight, lineHeight);
if (this.state.height !== newHeight) {
this.setState({
height: newHeight
});
}
}
}
render() {
const _props = this.props,
{
classes,
className,
defaultValue,
onChange,
rows,
rowsMax,
textareaRef,
value
} = _props,
other = _objectWithoutProperties(_props, ['classes', 'className', 'defaultValue', 'onChange', 'rows', 'rowsMax', 'textareaRef', 'value']);
return React.createElement(
'div',
{ className: classes.root, style: { height: this.state.height } },
React.createElement(EventListener, { target: 'window', onResize: this.handleResize }),
React.createElement('textarea', {
ref: this.handleRefSinglelineShadow,
className: classnames(classes.shadow, classes.textarea),
tabIndex: -1,
rows: '1',
readOnly: true,
'aria-hidden': 'true',
value: ''
}),
React.createElement('textarea', {
ref: this.handleRefShadow,
className: classnames(classes.shadow, classes.textarea),
tabIndex: -1,
rows: rows,
'aria-hidden': 'true',
readOnly: true,
defaultValue: defaultValue,
value: value
}),
React.createElement('textarea', _extends({
rows: rows,
className: classnames(classes.textarea, className),
defaultValue: defaultValue,
value: value,
onChange: this.handleChange
}, other, {
ref: this.handleRefInput
}))
);
}
}
Textarea.defaultProps = {
rows: 1
};
export default withStyles(styles, { name: 'MuiTextarea' })(Textarea);

View File

@@ -0,0 +1,7 @@
export { default } from './Input';
export * from './Input';
export { default as InputLabel } from './InputLabel';
export * from './InputLabel';
export { default as InputAdornment } from './InputAdornment';
export * from './InputAdornment';
// NOTE: Textarea is missing from exports (intentional?)

View File

@@ -0,0 +1,3 @@
export { default } from './Input';
export { default as InputAdornment } from './InputAdornment';
export { default as InputLabel } from './InputLabel';