Completely updated React, fixed #11, (hopefully)
This commit is contained in:
73
goTorrentWebUI/node_modules/material-ui/es/Input/InputLabel.js
generated
vendored
73
goTorrentWebUI/node_modules/material-ui/es/Input/InputLabel.js
generated
vendored
@@ -1,9 +1,8 @@
|
||||
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 _extends from 'babel-runtime/helpers/extends';
|
||||
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
||||
// @inheritedComponent FormLabel
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import withStyles from '../styles/withStyles';
|
||||
@@ -11,14 +10,14 @@ import { FormLabel } from '../Form';
|
||||
|
||||
export const styles = theme => ({
|
||||
root: {
|
||||
transformOrigin: `top ${theme.direction === 'ltr' ? 'left' : 'right'}`
|
||||
transformOrigin: 'top left'
|
||||
},
|
||||
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)`
|
||||
transform: `translate(0, ${theme.spacing.unit * 3}px) scale(1)`
|
||||
},
|
||||
labelDense: {
|
||||
// Compensation for the `Input.inputDense` style.
|
||||
@@ -26,7 +25,7 @@ export const styles = theme => ({
|
||||
},
|
||||
shrink: {
|
||||
transform: 'translate(0, 1.5px) scale(0.75)',
|
||||
transformOrigin: `top ${theme.direction === 'ltr' ? 'left' : 'right'}`
|
||||
transformOrigin: 'top left'
|
||||
},
|
||||
animated: {
|
||||
transition: theme.transitions.create('transform', {
|
||||
@@ -35,22 +34,22 @@ export const styles = theme => ({
|
||||
})
|
||||
},
|
||||
disabled: {
|
||||
color: theme.palette.input.disabled
|
||||
color: theme.palette.text.disabled
|
||||
}
|
||||
});
|
||||
|
||||
function InputLabel(props, context) {
|
||||
const {
|
||||
disabled,
|
||||
disableAnimation,
|
||||
children,
|
||||
classes,
|
||||
className: classNameProp,
|
||||
disableAnimation,
|
||||
disabled,
|
||||
FormControlClasses,
|
||||
shrink: shrinkProp,
|
||||
margin: marginProp
|
||||
margin: marginProp,
|
||||
shrink: shrinkProp
|
||||
} = props,
|
||||
other = _objectWithoutProperties(props, ['disabled', 'disableAnimation', 'children', 'classes', 'className', 'FormControlClasses', 'shrink', 'margin']);
|
||||
other = _objectWithoutProperties(props, ['children', 'classes', 'className', 'disableAnimation', 'disabled', 'FormControlClasses', 'margin', 'shrink']);
|
||||
|
||||
const { muiFormControl } = context;
|
||||
let shrink = shrinkProp;
|
||||
@@ -79,6 +78,54 @@ function InputLabel(props, context) {
|
||||
);
|
||||
}
|
||||
|
||||
InputLabel.propTypes = process.env.NODE_ENV !== "production" ? {
|
||||
/**
|
||||
* The contents of the `InputLabel`.
|
||||
*/
|
||||
children: PropTypes.node,
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes: PropTypes.object.isRequired,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: PropTypes.string,
|
||||
/**
|
||||
* If `true`, the transition animation is disabled.
|
||||
*/
|
||||
disableAnimation: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, apply disabled class.
|
||||
*/
|
||||
disabled: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the label will be displayed in an error state.
|
||||
*/
|
||||
error: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the input of this label is focused.
|
||||
*/
|
||||
focused: PropTypes.bool,
|
||||
/**
|
||||
* `classes` property applied to the `FormControl` element.
|
||||
*/
|
||||
FormControlClasses: PropTypes.object,
|
||||
/**
|
||||
* If `dense`, will adjust vertical spacing. This is normally obtained via context from
|
||||
* FormControl.
|
||||
*/
|
||||
margin: PropTypes.oneOf(['dense']),
|
||||
/**
|
||||
* if `true`, the label will indicate that the input is required.
|
||||
*/
|
||||
required: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the label is shrunk.
|
||||
*/
|
||||
shrink: PropTypes.bool
|
||||
} : {};
|
||||
|
||||
InputLabel.defaultProps = {
|
||||
disabled: false,
|
||||
disableAnimation: false
|
||||
|
Reference in New Issue
Block a user