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,53 @@
import * as React from 'react';
import { StandardProps, PropTypes } from '..';
import { FormControlProps, FormHelperTextProps } from '../Form';
import { InputProps, InputLabelProps } from '../Input';
import { FormControlClassKey } from '../Form/FormControl'
export interface TextFieldProps extends StandardProps<
FormControlProps,
TextFieldClassKey,
'onChange' | 'defaultValue'
> {
autoComplete?: string;
autoFocus?: boolean;
children?: React.ReactNode;
defaultValue?: string | number;
disabled?: boolean;
error?: boolean;
FormHelperTextProps?: FormHelperTextProps;
fullWidth?: boolean;
helperText?: React.ReactNode;
helperTextClassName?: string;
id?: string;
inputClassName?: string;
InputClassName?: string;
InputLabelProps?: InputLabelProps;
inputProps?: Object;
InputProps?: InputProps;
inputRef?: React.Ref<any>;
label?: React.ReactNode;
labelClassName?: string;
multiline?: boolean;
name?: string;
placeholder?: string;
required?: boolean;
rootRef?: React.Ref<any>;
rows?: string | number;
rowsMax?: string | number;
select?: boolean;
SelectProps?: Object;
type?: string;
value?: string | number;
margin?: PropTypes.Margin;
onChange?: React.ChangeEventHandler<HTMLInputElement>;
}
export type TextFieldClassKey =
| FormControlClassKey
;
declare const Input: React.ComponentType<TextFieldProps>;
export default Input;

View File

@@ -0,0 +1,114 @@
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; }
// @inheritedComponent FormControl
import React from 'react';
import warning from 'warning';
import Input, { InputLabel } from '../Input';
import FormControl from '../Form/FormControl';
import FormHelperText from '../Form/FormHelperText';
import Select from '../Select/Select';
function TextField(props) {
const {
autoComplete,
autoFocus,
children,
className,
defaultValue,
disabled,
error,
id,
inputClassName,
InputClassName,
inputProps: inputPropsProp,
InputProps,
inputRef,
label,
labelClassName,
InputLabelProps,
helperText,
helperTextClassName,
FormHelperTextProps,
fullWidth,
required,
type,
multiline,
name,
onChange,
placeholder,
rootRef,
rows,
rowsMax,
select,
SelectProps,
value
} = props,
other = _objectWithoutProperties(props, ['autoComplete', 'autoFocus', 'children', 'className', 'defaultValue', 'disabled', 'error', 'id', 'inputClassName', 'InputClassName', 'inputProps', 'InputProps', 'inputRef', 'label', 'labelClassName', 'InputLabelProps', 'helperText', 'helperTextClassName', 'FormHelperTextProps', 'fullWidth', 'required', 'type', 'multiline', 'name', 'onChange', 'placeholder', 'rootRef', 'rows', 'rowsMax', 'select', 'SelectProps', 'value']);
let inputProps = inputPropsProp;
if (inputClassName) {
inputProps = _extends({
className: inputClassName
}, inputProps);
}
warning(!select || Boolean(children), 'Material-UI: `children` must be passed when using the `TextField` component with `select`.');
const InputComponent = React.createElement(Input, _extends({
autoComplete: autoComplete,
autoFocus: autoFocus,
className: InputClassName,
defaultValue: defaultValue,
disabled: disabled,
multiline: multiline,
name: name,
rows: rows,
rowsMax: rowsMax,
type: type,
value: value,
id: id,
inputProps: inputProps,
inputRef: inputRef,
onChange: onChange,
placeholder: placeholder
}, InputProps));
return React.createElement(
FormControl,
_extends({
fullWidth: fullWidth,
className: className,
error: error,
required: required
}, other, {
ref: rootRef
}),
label && React.createElement(
InputLabel,
_extends({ htmlFor: id, className: labelClassName }, InputLabelProps),
label
),
select ? React.createElement(
Select,
_extends({ input: InputComponent }, SelectProps),
children
) : InputComponent,
helperText && React.createElement(
FormHelperText,
_extends({ className: helperTextClassName }, FormHelperTextProps),
helperText
)
);
}
TextField.defaultProps = {
required: false,
select: false
};
export default TextField;

View File

@@ -0,0 +1,2 @@
export { default } from './TextField';
export * from './TextField';

View File

@@ -0,0 +1 @@
export { default } from './TextField';