Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 1 addition & 23 deletions src/AutoComplete/AutoComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import MenuItem from '../MenuItem';
import Divider from '../Divider';
import Popover from '../Popover/Popover';
import propTypes from '../utils/propTypes';
import warning from 'warning';
import deprecated from '../utils/deprecatedPropType';

function getStyles(props, context, state) {
const {anchorEl} = state;
Expand Down Expand Up @@ -168,10 +166,6 @@ class AutoComplete extends Component {
* Override the inline-styles of AutoComplete's TextField element.
*/
textFieldStyle: PropTypes.object,
/**
* If true, will update when focus event triggers.
*/
triggerUpdateOnFocus: deprecated(PropTypes.bool, 'Instead, use openOnFocus. It will be removed with v0.16.0.'),
};

static defaultProps = {
Expand Down Expand Up @@ -246,21 +240,6 @@ class AutoComplete extends Component {
}
};

setValue(textValue) {
warning(false, `setValue() is deprecated, use the searchText property.
It will be removed with v0.16.0.`);

this.setState({
searchText: textValue,
});
}

getValue() {
warning(false, 'getValue() is deprecated. It will be removed with v0.16.0.');

return this.state.searchText;
}

handleMouseDown = (event) => {
// Keep the TextField focused
event.preventDefault();
Expand Down Expand Up @@ -355,7 +334,7 @@ class AutoComplete extends Component {
};

handleFocus = (event) => {
if (!this.state.open && (this.props.triggerUpdateOnFocus || this.props.openOnFocus)) {
if (!this.state.open && this.props.openOnFocus) {
this.setState({
open: true,
anchorEl: ReactDOM.findDOMNode(this.refs.searchTextField),
Expand Down Expand Up @@ -400,7 +379,6 @@ class AutoComplete extends Component {
menuProps,
listStyle,
targetOrigin,
triggerUpdateOnFocus, // eslint-disable-line no-unused-vars
onNewRequest, // eslint-disable-line no-unused-vars
onUpdateInput, // eslint-disable-line no-unused-vars
openOnFocus, // eslint-disable-line no-unused-vars
Expand Down
12 changes: 2 additions & 10 deletions src/Checkbox/Checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import EnhancedSwitch from '../internal/EnhancedSwitch';
import transitions from '../styles/transitions';
import CheckboxOutline from '../svg-icons/toggle/check-box-outline-blank';
import CheckboxChecked from '../svg-icons/toggle/check-box';
import deprecated from '../utils/deprecatedPropType';

function getStyles(props, context) {
const {checkbox} = context.muiTheme;
Expand Down Expand Up @@ -104,12 +103,6 @@ class Checkbox extends Component {
* Override the inline-styles of the root element.
*/
style: PropTypes.object,
/**
* The SvgIcon to use for the unchecked state.
* This is useful to create icon toggles.
*/
unCheckedIcon: deprecated(PropTypes.element,
'Use uncheckedIcon instead. It will be removed with v0.16.0.'),
/**
* The SvgIcon to use for the unchecked state.
* This is useful to create icon toggles.
Expand Down Expand Up @@ -178,7 +171,6 @@ class Checkbox extends Component {
onCheck, // eslint-disable-line no-unused-vars
checkedIcon,
uncheckedIcon,
unCheckedIcon,
...other,
} = this.props;
const styles = getStyles(this.props, this.context);
Expand All @@ -201,8 +193,8 @@ class Checkbox extends Component {
style: checkStyles,
});

const unCheckedElement = (unCheckedIcon || uncheckedIcon) ? React.cloneElement((unCheckedIcon || uncheckedIcon), {
style: Object.assign(boxStyles, (unCheckedIcon || uncheckedIcon).props.style),
const unCheckedElement = uncheckedIcon ? React.cloneElement(uncheckedIcon, {
style: Object.assign(boxStyles, uncheckedIcon.props.style),
}) : React.createElement(CheckboxOutline, {
style: boxStyles,
});
Expand Down
3 changes: 0 additions & 3 deletions src/DatePicker/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class Calendar extends Component {
onTouchTapOk: PropTypes.func,
open: PropTypes.bool,
shouldDisableDate: PropTypes.func,
wordings: PropTypes.object,
};

static defaultProps = {
Expand Down Expand Up @@ -299,7 +298,6 @@ class Calendar extends Component {
okLabel,
onTouchTapCancel, // eslint-disable-line no-unused-vars
onTouchTapOk, // eslint-disable-line no-unused-vars
wordings,
} = this.props;

return (
Expand Down Expand Up @@ -364,7 +362,6 @@ class Calendar extends Component {
okLabel={okLabel}
onTouchTapCancel={onTouchTapCancel}
onTouchTapOk={onTouchTapOk}
wordings={wordings}
/>
}
</div>
Expand Down
7 changes: 3 additions & 4 deletions src/DatePicker/CalendarActionButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ class CalendarActionButton extends Component {
okLabel: PropTypes.node,
onTouchTapCancel: PropTypes.func,
onTouchTapOk: PropTypes.func,
wordings: PropTypes.object,
};

render() {
const {cancelLabel, okLabel, wordings} = this.props;
const {cancelLabel, okLabel} = this.props;

const styles = {
root: {
Expand All @@ -35,15 +34,15 @@ class CalendarActionButton extends Component {
return (
<div style={styles.root} >
<FlatButton
label={wordings ? wordings.cancel : cancelLabel}
label={cancelLabel}
onTouchTap={this.props.onTouchTapCancel}
primary={true}
style={styles.flatButtons}
/>
{!this.props.autoOk &&
<FlatButton
disabled={this.refs.calendar !== undefined && this.refs.calendar.isSelectedDateDisabled()}
label={wordings ? wordings.ok : okLabel}
label={okLabel}
onTouchTap={this.props.onTouchTapOk}
primary={true}
style={styles.flatButtons}
Expand Down
8 changes: 0 additions & 8 deletions src/DatePicker/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, {Component, PropTypes} from 'react';
import {dateTimeFormat, formatIso, isEqualDate} from './dateUtils';
import DatePickerDialog from './DatePickerDialog';
import TextField from '../TextField';
import deprecated from '../utils/deprecatedPropType';

class DatePicker extends Component {
static propTypes = {
Expand Down Expand Up @@ -134,11 +133,6 @@ class DatePicker extends Component {
* Sets the date for the Date Picker programmatically.
*/
value: PropTypes.object,
/**
* Wordings used inside the button of the dialog.
*/
wordings: deprecated(PropTypes.object, `Instead, use \`cancelLabel\` and \`okLabel\`.
It will be removed with v0.16.0.`),
};

static defaultProps = {
Expand Down Expand Up @@ -283,7 +277,6 @@ class DatePicker extends Component {
shouldDisableDate,
style,
textFieldStyle,
wordings,
...other,
} = this.props;

Expand Down Expand Up @@ -319,7 +312,6 @@ class DatePicker extends Component {
onDismiss={onDismiss}
ref="dialogWindow"
shouldDisableDate={shouldDisableDate}
wordings={wordings}
/>
</div>
);
Expand Down
3 changes: 0 additions & 3 deletions src/DatePicker/DatePickerDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class DatePickerDialog extends Component {
open: PropTypes.bool,
shouldDisableDate: PropTypes.func,
style: PropTypes.object,
wordings: PropTypes.object,
};

static defaultProps = {
Expand Down Expand Up @@ -120,7 +119,6 @@ class DatePickerDialog extends Component {
onShow, // eslint-disable-line no-unused-vars
shouldDisableDate,
style, // eslint-disable-line no-unused-vars
wordings,
animation,
...other,
} = this.props;
Expand Down Expand Up @@ -175,7 +173,6 @@ class DatePickerDialog extends Component {
onTouchTapOk={this.handleTouchTapOk}
okLabel={okLabel}
shouldDisableDate={shouldDisableDate}
wordings={wordings}
/>
</Container>
</div>
Expand Down
44 changes: 2 additions & 42 deletions src/List/List.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import React, {Component, PropTypes, Children, isValidElement} from 'react';
import propTypes from '../utils/propTypes';
import Subheader from '../Subheader';
import deprecated from '../utils/deprecatedPropType';
import warning from 'warning';

class List extends Component {
static propTypes = {
Expand All @@ -11,31 +8,10 @@ class List extends Component {
* be part of the list.
*/
children: PropTypes.node,
/**
* If true, the subheader will be indented by 72px.
*/
insetSubheader: deprecated(PropTypes.bool,
'Refer to the `subheader` property. It will be removed with v0.16.0.'),
/**
* Override the inline-styles of the root element.
*/
style: PropTypes.object,
/**
* The subheader string that will be displayed at the top of the list.
*/
subheader: deprecated(PropTypes.node,
'Instead, nest the `Subheader` component directly inside the `List`. It will be removed with v0.16.0.'),
/**
* Override the inline-styles of the subheader element.
*/
subheaderStyle: deprecated(PropTypes.object,
'Refer to the `subheader` property. It will be removed with v0.16.0.'),
/**
* @ignore
* ** Breaking change ** List no longer supports `zDepth`. Instead, wrap it in `Paper`
* or another component that provides zDepth.
*/
zDepth: propTypes.zDepth,
};

static contextTypes = {
Expand All @@ -45,28 +21,17 @@ class List extends Component {
render() {
const {
children,
insetSubheader = false,
style,
subheader,
subheaderStyle,
zDepth,
...other,
} = this.props;

const {prepareStyles} = this.context.muiTheme;

warning((typeof zDepth === 'undefined'), 'List no longer supports `zDepth`. Instead, wrap it in `Paper` ' +
'or another component that provides zDepth. It will be removed with v0.16.0.');

let hasSubheader = false;

if (subheader) {
const firstChild = Children.toArray(children)[0];
if (isValidElement(firstChild) && firstChild.type === Subheader) {
hasSubheader = true;
} else {
const firstChild = Children.toArray(children)[0];
if (isValidElement(firstChild) && firstChild.type === Subheader) {
hasSubheader = true;
}
}

const styles = {
Expand All @@ -79,11 +44,6 @@ class List extends Component {

return (
<div {...other} style={prepareStyles(Object.assign(styles.root, style))}>
{subheader && (
<Subheader inset={insetSubheader} style={subheaderStyle}>
{subheader}
</Subheader>
)}
{children}
</div>
);
Expand Down
20 changes: 3 additions & 17 deletions src/List/MakeSelectable.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, {Component, PropTypes} from 'react';
import {fade} from '../utils/colorManipulator';
import deprecated from '../utils/deprecatedPropType';

export const MakeSelectable = (Component) => {
return class extends Component {
Expand All @@ -9,24 +8,12 @@ export const MakeSelectable = (Component) => {
onChange: PropTypes.func,
selectedItemStyle: PropTypes.object,
value: PropTypes.any,
valueLink: deprecated(PropTypes.shape({
value: PropTypes.any,
requestChange: PropTypes.func,
}), `This property is deprecated due to his low popularity. Use the value and onChange property.
It will be removed with v0.16.0.`),
};

static contextTypes = {
muiTheme: PropTypes.object.isRequired,
};

getValueLink(props) {
return props.valueLink || {
value: props.value,
requestChange: props.onChange,
};
}

extendChild(child, styles, selectedItemStyle) {
if (child && child.type && child.type.muiName === 'ListItem') {
const selected = this.isChildSelected(child, this.props);
Expand Down Expand Up @@ -71,15 +58,14 @@ export const MakeSelectable = (Component) => {
};

isChildSelected(child, props) {
return this.getValueLink(props).value === child.props.value;
return props.value === child.props.value;
}

handleItemTouchTap = (event, item) => {
const valueLink = this.getValueLink(this.props);
const itemValue = item.props.value;

if (itemValue !== valueLink.value) {
valueLink.requestChange(event, itemValue);
if (itemValue !== this.props.value) {
this.props.onChange(event, itemValue);
}
};

Expand Down
Loading